Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
56e52b69
Commit
56e52b69
authored
Sep 22, 2010
by
Pieter Noordhuis
Browse files
Update rdb.c to properly work with new memory strategy for sorted sets
parent
50a9fad5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
56e52b69
...
@@ -730,13 +730,14 @@ robj *rdbLoadObject(int type, FILE *fp) {
...
@@ -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
,
el
e
);
dictAdd
(
zs
->
dict
,
ele
,
&
znode
->
scor
e
);
incrRefCount
(
ele
);
/* added to skiplist */
incrRefCount
(
ele
);
/* added to skiplist */
}
}
}
else
if
(
type
==
REDIS_HASH
)
{
}
else
if
(
type
==
REDIS_HASH
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment