COW friendly versions of SPOP and SRANDMEMBER commands, with some change to the set encoding-agnostic API.

This commit is contained in:
antirez
2010-12-09 10:21:02 +01:00
parent d51ebef509
commit a5be65f71c
4 changed files with 45 additions and 34 deletions

View File

@ -10,7 +10,7 @@ typedef struct intset {
intset *intsetNew(void);
intset *intsetAdd(intset *is, int64_t value, uint8_t *success);
intset *intsetRemove(intset *is, int64_t value, uint8_t *success);
intset *intsetRemove(intset *is, int64_t value, int *success);
uint8_t intsetFind(intset *is, int64_t value);
int64_t intsetRandom(intset *is);
uint8_t intsetGet(intset *is, uint32_t pos, int64_t *value);