From: antirez Date: Tue, 13 Mar 2012 08:49:11 +0000 (+0100) Subject: RDB hashes loading fixed removing the assertion that failed every time an HT-encoded... X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/ee61a4b99ee56203edb746c666fa89f88c2d0afa?hp=dfc25454701638d39bc75fbc3f9c55619b503bd0 RDB hashes loading fixed removing the assertion that failed every time an HT-encoded hash was loaded. --- diff --git a/src/rdb.c b/src/rdb.c index 518fef02..4a56659d 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -844,9 +844,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) { hashTypeConvert(o, REDIS_ENCODING_HT); /* Load every field and value into the ziplist */ - while (o->encoding == REDIS_ENCODING_ZIPLIST && len-- > 0) { + while (o->encoding == REDIS_ENCODING_ZIPLIST && len > 0) { robj *field, *value; + len--; /* Load raw strings */ field = rdbLoadStringObject(rdb); if (field == NULL) return NULL; @@ -869,9 +870,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) { } /* Load remaining fields and values into the hash table */ - while (o->encoding == REDIS_ENCODING_HT && len-- > 0) { + while (o->encoding == REDIS_ENCODING_HT && len > 0) { robj *field, *value; + len--; /* Load encoded strings */ field = rdbLoadEncodedStringObject(rdb); if (field == NULL) return NULL;