mirror of
https://github.com/fluencelabs/redis
synced 2025-04-03 16:21:03 +00:00
Rename iterator to setTypeIterator for consistency
This commit is contained in:
parent
029e5577ff
commit
cb72d0f155
@ -119,7 +119,7 @@ void computeDatasetDigest(unsigned char *final) {
|
|||||||
}
|
}
|
||||||
listTypeReleaseIterator(li);
|
listTypeReleaseIterator(li);
|
||||||
} else if (o->type == REDIS_SET) {
|
} else if (o->type == REDIS_SET) {
|
||||||
setIterator *si = setTypeInitIterator(o);
|
setTypeIterator *si = setTypeInitIterator(o);
|
||||||
robj *ele;
|
robj *ele;
|
||||||
while((ele = setTypeNext(si)) != NULL) {
|
while((ele = setTypeNext(si)) != NULL) {
|
||||||
xorObjectDigest(digest,ele);
|
xorObjectDigest(digest,ele);
|
||||||
|
@ -545,7 +545,7 @@ typedef struct {
|
|||||||
int encoding;
|
int encoding;
|
||||||
int ii; /* intset iterator */
|
int ii; /* intset iterator */
|
||||||
dictIterator *di;
|
dictIterator *di;
|
||||||
} setIterator;
|
} setTypeIterator;
|
||||||
|
|
||||||
/* Structure to hold hash iteration abstration. Note that iteration over
|
/* Structure to hold hash iteration abstration. Note that iteration over
|
||||||
* hashes involves both fields and values. Because it is possible that
|
* hashes involves both fields and values. Because it is possible that
|
||||||
@ -734,9 +734,9 @@ robj *setTypeCreate(robj *value);
|
|||||||
int setTypeAdd(robj *subject, robj *value);
|
int setTypeAdd(robj *subject, robj *value);
|
||||||
int setTypeRemove(robj *subject, robj *value);
|
int setTypeRemove(robj *subject, robj *value);
|
||||||
int setTypeIsMember(robj *subject, robj *value);
|
int setTypeIsMember(robj *subject, robj *value);
|
||||||
setIterator *setTypeInitIterator(robj *subject);
|
setTypeIterator *setTypeInitIterator(robj *subject);
|
||||||
void setTypeReleaseIterator(setIterator *si);
|
void setTypeReleaseIterator(setTypeIterator *si);
|
||||||
robj *setTypeNext(setIterator *si);
|
robj *setTypeNext(setTypeIterator *si);
|
||||||
robj *setTypeRandomElement(robj *subject);
|
robj *setTypeRandomElement(robj *subject);
|
||||||
unsigned long setTypeSize(robj *subject);
|
unsigned long setTypeSize(robj *subject);
|
||||||
void setTypeConvert(robj *subject, int enc);
|
void setTypeConvert(robj *subject, int enc);
|
||||||
|
@ -220,7 +220,7 @@ void sortCommand(redisClient *c) {
|
|||||||
}
|
}
|
||||||
listTypeReleaseIterator(li);
|
listTypeReleaseIterator(li);
|
||||||
} else if (sortval->type == REDIS_SET) {
|
} else if (sortval->type == REDIS_SET) {
|
||||||
setIterator *si = setTypeInitIterator(sortval);
|
setTypeIterator *si = setTypeInitIterator(sortval);
|
||||||
robj *ele;
|
robj *ele;
|
||||||
while((ele = setTypeNext(si)) != NULL) {
|
while((ele = setTypeNext(si)) != NULL) {
|
||||||
vector[j].obj = ele;
|
vector[j].obj = ele;
|
||||||
|
14
src/t_set.c
14
src/t_set.c
@ -80,8 +80,8 @@ int setTypeIsMember(robj *subject, robj *value) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIterator *setTypeInitIterator(robj *subject) {
|
setTypeIterator *setTypeInitIterator(robj *subject) {
|
||||||
setIterator *si = zmalloc(sizeof(setIterator));
|
setTypeIterator *si = zmalloc(sizeof(setIterator));
|
||||||
si->subject = subject;
|
si->subject = subject;
|
||||||
si->encoding = subject->encoding;
|
si->encoding = subject->encoding;
|
||||||
if (si->encoding == REDIS_ENCODING_HT) {
|
if (si->encoding == REDIS_ENCODING_HT) {
|
||||||
@ -94,7 +94,7 @@ setIterator *setTypeInitIterator(robj *subject) {
|
|||||||
return si;
|
return si;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTypeReleaseIterator(setIterator *si) {
|
void setTypeReleaseIterator(setTypeIterator *si) {
|
||||||
if (si->encoding == REDIS_ENCODING_HT)
|
if (si->encoding == REDIS_ENCODING_HT)
|
||||||
dictReleaseIterator(si->di);
|
dictReleaseIterator(si->di);
|
||||||
zfree(si);
|
zfree(si);
|
||||||
@ -103,7 +103,7 @@ void setTypeReleaseIterator(setIterator *si) {
|
|||||||
/* Move to the next entry in the set. Returns the object at the current
|
/* 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
|
* position, or NULL when the end is reached. This object will have its
|
||||||
* refcount incremented, so the caller needs to take care of this. */
|
* refcount incremented, so the caller needs to take care of this. */
|
||||||
robj *setTypeNext(setIterator *si) {
|
robj *setTypeNext(setTypeIterator *si) {
|
||||||
robj *ret = NULL;
|
robj *ret = NULL;
|
||||||
if (si->encoding == REDIS_ENCODING_HT) {
|
if (si->encoding == REDIS_ENCODING_HT) {
|
||||||
dictEntry *de = dictNext(si->di);
|
dictEntry *de = dictNext(si->di);
|
||||||
@ -151,7 +151,7 @@ unsigned long setTypeSize(robj *subject) {
|
|||||||
* to a hashtable) is presized to hold the number of elements in the original
|
* to a hashtable) is presized to hold the number of elements in the original
|
||||||
* set. */
|
* set. */
|
||||||
void setTypeConvert(robj *subject, int enc) {
|
void setTypeConvert(robj *subject, int enc) {
|
||||||
setIterator *si;
|
setTypeIterator *si;
|
||||||
robj *element;
|
robj *element;
|
||||||
redisAssert(subject->type == REDIS_SET);
|
redisAssert(subject->type == REDIS_SET);
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ int qsortCompareSetsByCardinality(const void *s1, const void *s2) {
|
|||||||
|
|
||||||
void sinterGenericCommand(redisClient *c, robj **setkeys, unsigned long setnum, robj *dstkey) {
|
void sinterGenericCommand(redisClient *c, robj **setkeys, unsigned long setnum, robj *dstkey) {
|
||||||
robj **sets = zmalloc(sizeof(robj*)*setnum);
|
robj **sets = zmalloc(sizeof(robj*)*setnum);
|
||||||
setIterator *si;
|
setTypeIterator *si;
|
||||||
robj *ele, *lenobj = NULL, *dstset = NULL;
|
robj *ele, *lenobj = NULL, *dstset = NULL;
|
||||||
unsigned long j, cardinality = 0;
|
unsigned long j, cardinality = 0;
|
||||||
|
|
||||||
@ -419,7 +419,7 @@ void sinterstoreCommand(redisClient *c) {
|
|||||||
|
|
||||||
void sunionDiffGenericCommand(redisClient *c, robj **setkeys, int setnum, robj *dstkey, int op) {
|
void sunionDiffGenericCommand(redisClient *c, robj **setkeys, int setnum, robj *dstkey, int op) {
|
||||||
robj **sets = zmalloc(sizeof(robj*)*setnum);
|
robj **sets = zmalloc(sizeof(robj*)*setnum);
|
||||||
setIterator *si;
|
setTypeIterator *si;
|
||||||
robj *ele, *dstset = NULL;
|
robj *ele, *dstset = NULL;
|
||||||
int j, cardinality = 0;
|
int j, cardinality = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user