Commit c3c85622 authored by antirez's avatar antirez
Browse files

RDB hashes loading fixed removing the assertion that failed every time an...

RDB hashes loading fixed removing the assertion that failed every time an HT-encoded hash was loaded.
parent 79642420
...@@ -844,9 +844,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) { ...@@ -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) { ...@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment