From: Pieter Noordhuis Date: Fri, 11 Jun 2010 17:22:27 +0000 (+0200) Subject: intset housekeeping X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/e24d93762f8945de0ee03f23b15d686cfa08bb58?hp=35cabcb50557eae1433a68c7730ad8aff478b68a intset housekeeping --- diff --git a/intset.c b/intset.c index f1bbcde3..1ee8263c 100644 --- a/intset.c +++ b/intset.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "intset.h" #include "zmalloc.h" @@ -152,7 +151,7 @@ intset *intsetAdd(intset *is, int64_t value, uint8_t *success) { } /* Delete integer from intset */ -intset *intsetDelete(intset *is, int64_t value, uint8_t *success) { +intset *intsetRemove(intset *is, int64_t value, uint8_t *success) { uint8_t valenc = INTSET_VALUE_ENCODING(value); uint32_t pos; if (success) *success = 0; @@ -370,7 +369,7 @@ int main(int argc, char **argv) { assert(intsetFind(is,v1)); v2 = rand() % 0xfff; - is = intsetDelete(is,v2,NULL); + is = intsetRemove(is,v2,NULL); assert(!intsetFind(is,v2)); } checkConsistency(is); diff --git a/intset.h b/intset.h index 9d91710a..b90c44e0 100644 --- a/intset.h +++ b/intset.h @@ -1,5 +1,6 @@ #ifndef __INTSET_H #define __INTSET_H +#include typedef struct intset { uint32_t encoding; @@ -9,7 +10,7 @@ typedef struct intset { intset *intsetNew(void); intset *intsetAdd(intset *is, int64_t value, uint8_t *success); -intset *intsetDelete(intset *is, int64_t value, uint8_t *success); +intset *intsetRemove(intset *is, int64_t value, uint8_t *success); uint8_t intsetFind(intset *is, int64_t value); int64_t intsetRandom(intset *is);