RDB hashes loading fixed removing the assertion that failed every time an HT-encoded hash was loaded.

This commit is contained in:
antirez 2012-03-13 09:49:11 +01:00
parent 79642420b0
commit c3c856228d

View File

@ -844,9 +844,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
hashTypeConvert(o, REDIS_ENCODING_HT); hashTypeConvert(o, REDIS_ENCODING_HT);
/* Load every field and value into the ziplist */ /* 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; robj *field, *value;
len--;
/* Load raw strings */ /* Load raw strings */
field = rdbLoadStringObject(rdb); field = rdbLoadStringObject(rdb);
if (field == NULL) return NULL; if (field == NULL) return NULL;
@ -869,9 +870,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
} }
/* Load remaining fields and values into the hash table */ /* 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; robj *field, *value;
len--;
/* Load encoded strings */ /* Load encoded strings */
field = rdbLoadEncodedStringObject(rdb); field = rdbLoadEncodedStringObject(rdb);
if (field == NULL) return NULL; if (field == NULL) return NULL;