}
listTypeReleaseIterator(li);
} else if (o->type == REDIS_SET) {
- setIterator *si = setTypeInitIterator(o);
+ setTypeIterator *si = setTypeInitIterator(o);
robj *ele;
while((ele = setTypeNext(si)) != NULL) {
xorObjectDigest(digest,ele);
int encoding;
int ii; /* intset iterator */
dictIterator *di;
-} setIterator;
+} setTypeIterator;
/* Structure to hold hash iteration abstration. Note that iteration over
* hashes involves both fields and values. Because it is possible that
int setTypeAdd(robj *subject, robj *value);
int setTypeRemove(robj *subject, robj *value);
int setTypeIsMember(robj *subject, robj *value);
-setIterator *setTypeInitIterator(robj *subject);
-void setTypeReleaseIterator(setIterator *si);
-robj *setTypeNext(setIterator *si);
+setTypeIterator *setTypeInitIterator(robj *subject);
+void setTypeReleaseIterator(setTypeIterator *si);
+robj *setTypeNext(setTypeIterator *si);
robj *setTypeRandomElement(robj *subject);
unsigned long setTypeSize(robj *subject);
void setTypeConvert(robj *subject, int enc);
return 0;
}
-setIterator *setTypeInitIterator(robj *subject) {
- setIterator *si = zmalloc(sizeof(setIterator));
+setTypeIterator *setTypeInitIterator(robj *subject) {
+ setTypeIterator *si = zmalloc(sizeof(setIterator));
si->subject = subject;
si->encoding = subject->encoding;
if (si->encoding == REDIS_ENCODING_HT) {
return si;
}
-void setTypeReleaseIterator(setIterator *si) {
+void setTypeReleaseIterator(setTypeIterator *si) {
if (si->encoding == REDIS_ENCODING_HT)
dictReleaseIterator(si->di);
zfree(si);
/* Move to the next entry in the set. Returns the object at the current
* position, or NULL when the end is reached. This object will have its
* refcount incremented, so the caller needs to take care of this. */
-robj *setTypeNext(setIterator *si) {
+robj *setTypeNext(setTypeIterator *si) {
robj *ret = NULL;
if (si->encoding == REDIS_ENCODING_HT) {
dictEntry *de = dictNext(si->di);
* to a hashtable) is presized to hold the number of elements in the original
* set. */
void setTypeConvert(robj *subject, int enc) {
- setIterator *si;
+ setTypeIterator *si;
robj *element;
redisAssert(subject->type == REDIS_SET);
void sinterGenericCommand(redisClient *c, robj **setkeys, unsigned long setnum, robj *dstkey) {
robj **sets = zmalloc(sizeof(robj*)*setnum);
- setIterator *si;
+ setTypeIterator *si;
robj *ele, *lenobj = NULL, *dstset = NULL;
unsigned long j, cardinality = 0;
void sunionDiffGenericCommand(redisClient *c, robj **setkeys, int setnum, robj *dstkey, int op) {
robj **sets = zmalloc(sizeof(robj*)*setnum);
- setIterator *si;
+ setTypeIterator *si;
robj *ele, *dstset = NULL;
int j, cardinality = 0;