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
8218db3d
Commit
8218db3d
authored
Mar 08, 2011
by
Pieter Noordhuis
Browse files
Little less obfuscation
parent
0b10e104
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
8218db3d
...
...
@@ -524,7 +524,6 @@ int zzlInsert(robj *zobj, robj *ele, double score) {
unsigned
char
*
zl
=
zobj
->
ptr
;
unsigned
char
*
eptr
=
ziplistIndex
(
zl
,
0
),
*
sptr
;
double
s
;
int
insert
=
0
;
ele
=
getDecodedObject
(
ele
);
while
(
eptr
!=
NULL
)
{
...
...
@@ -536,16 +535,14 @@ int zzlInsert(robj *zobj, robj *ele, double score) {
/* First element with score larger than score for element to be
* inserted. This means we should take its spot in the list to
* maintain ordering. */
insert
=
1
;
}
else
if
(
s
==
score
)
{
/* Ensure lexicographical ordering for elements. */
if
(
zzlCompareElements
(
eptr
,
ele
->
ptr
,
sdslen
(
ele
->
ptr
))
<
0
)
insert
=
1
;
}
if
(
insert
)
{
zzlInsertAt
(
zobj
,
ele
,
score
,
eptr
);
break
;
}
else
if
(
s
==
score
)
{
/* Ensure lexicographical ordering for elements. */
if
(
zzlCompareElements
(
eptr
,
ele
->
ptr
,
sdslen
(
ele
->
ptr
))
<
0
)
{
zzlInsertAt
(
zobj
,
ele
,
score
,
eptr
);
break
;
}
}
/* Move to next element. */
...
...
@@ -553,8 +550,8 @@ int zzlInsert(robj *zobj, robj *ele, double score) {
}
/* Push on tail of list when it was not yet inserted. */
if
(
!
insert
)
zzlInsertAt
(
zobj
,
ele
,
score
,
eptr
);
if
(
eptr
==
NULL
)
zzlInsertAt
(
zobj
,
ele
,
score
,
NULL
);
decrRefCount
(
ele
);
return
REDIS_OK
;
...
...
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