X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/e2641e09cc0daf44f63f654230f72d22acf3a9af..23c64fe50ddbc01f825ebe64f1a8b5f14c584327:/src/debug.c?ds=sidebyside diff --git a/src/debug.c b/src/debug.c index 10b620d6..76d18b21 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,6 +1,8 @@ #include "redis.h" #include "sha1.h" /* SHA1 is used for DEBUG DIGEST */ +#include + /* ================================= Debugging ============================== */ /* Compute the sha1 of string at 's' with 'len' bytes long. @@ -117,16 +119,13 @@ void computeDatasetDigest(unsigned char *final) { } listTypeReleaseIterator(li); } else if (o->type == REDIS_SET) { - dict *set = o->ptr; - dictIterator *di = dictGetIterator(set); - dictEntry *de; - - while((de = dictNext(di)) != NULL) { - robj *eleobj = dictGetEntryKey(de); - - xorObjectDigest(digest,eleobj); + setTypeIterator *si = setTypeInitIterator(o); + robj *ele; + while((ele = setTypeNext(si)) != NULL) { + xorObjectDigest(digest,ele); + decrRefCount(ele); } - dictReleaseIterator(di); + setTypeReleaseIterator(si); } else if (o->type == REDIS_ZSET) { zset *zs = o->ptr; dictIterator *di = dictGetIterator(zs->dict);