mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 15:21:03 +00:00
Update rdb.c to properly work with new memory strategy for sorted sets
This commit is contained in:
parent
50a9fad5d5
commit
56e52b69fe
@ -730,13 +730,14 @@ robj *rdbLoadObject(int type, FILE *fp) {
|
|||||||
/* Load every single element of the list/set */
|
/* Load every single element of the list/set */
|
||||||
while(zsetlen--) {
|
while(zsetlen--) {
|
||||||
robj *ele;
|
robj *ele;
|
||||||
double *score = zmalloc(sizeof(double));
|
double score;
|
||||||
|
zskiplistNode *znode;
|
||||||
|
|
||||||
if ((ele = rdbLoadEncodedStringObject(fp)) == NULL) return NULL;
|
if ((ele = rdbLoadEncodedStringObject(fp)) == NULL) return NULL;
|
||||||
ele = tryObjectEncoding(ele);
|
ele = tryObjectEncoding(ele);
|
||||||
if (rdbLoadDoubleValue(fp,score) == -1) return NULL;
|
if (rdbLoadDoubleValue(fp,&score) == -1) return NULL;
|
||||||
dictAdd(zs->dict,ele,score);
|
znode = zslInsert(zs->zsl,score,ele);
|
||||||
zslInsert(zs->zsl,*score,ele);
|
dictAdd(zs->dict,ele,&znode->score);
|
||||||
incrRefCount(ele); /* added to skiplist */
|
incrRefCount(ele); /* added to skiplist */
|
||||||
}
|
}
|
||||||
} else if (type == REDIS_HASH) {
|
} else if (type == REDIS_HASH) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user