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
a3004773
"vscode:/vscode.git/clone" did not exist on "c4cbffa3a1b7f83fd27359961b4d9e287847c4b6"
Commit
a3004773
authored
Dec 09, 2010
by
Pieter Noordhuis
Browse files
Undo rename of function names where something went wrong
parent
c2f816b4
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_zset.c
View file @
a3004773
...
@@ -263,7 +263,7 @@ zskiplistNode *zslFirstWithScore(zskiplist *zsl, double score) {
...
@@ -263,7 +263,7 @@ zskiplistNode *zslFirstWithScore(zskiplist *zsl, double score) {
* Returns 0 when the element cannot be found, rank otherwise.
* Returns 0 when the element cannot be found, rank otherwise.
* Note that the rank is 1-based due to the span of zsl->header to the
* Note that the rank is 1-based due to the span of zsl->header to the
* first element. */
* first element. */
unsigned
long
zsl
istType
GetRank
(
zskiplist
*
zsl
,
double
score
,
robj
*
o
)
{
unsigned
long
zslGetRank
(
zskiplist
*
zsl
,
double
score
,
robj
*
o
)
{
zskiplistNode
*
x
;
zskiplistNode
*
x
;
unsigned
long
rank
=
0
;
unsigned
long
rank
=
0
;
int
i
;
int
i
;
...
@@ -287,7 +287,7 @@ unsigned long zslistTypeGetRank(zskiplist *zsl, double score, robj *o) {
...
@@ -287,7 +287,7 @@ unsigned long zslistTypeGetRank(zskiplist *zsl, double score, robj *o) {
}
}
/* Finds an element by its rank. The rank argument needs to be 1-based. */
/* Finds an element by its rank. The rank argument needs to be 1-based. */
zskiplistNode
*
zsl
istType
GetElementByRank
(
zskiplist
*
zsl
,
unsigned
long
rank
)
{
zskiplistNode
*
zslGetElementByRank
(
zskiplist
*
zsl
,
unsigned
long
rank
)
{
zskiplistNode
*
x
;
zskiplistNode
*
x
;
unsigned
long
traversed
=
0
;
unsigned
long
traversed
=
0
;
int
i
;
int
i
;
...
@@ -810,10 +810,10 @@ void zrangeGenericCommand(redisClient *c, int reverse) {
...
@@ -810,10 +810,10 @@ void zrangeGenericCommand(redisClient *c, int reverse) {
/* check if starting point is trivial, before searching
/* check if starting point is trivial, before searching
* the element in log(N) time */
* the element in log(N) time */
if
(
reverse
)
{
if
(
reverse
)
{
ln
=
start
==
0
?
zsl
->
tail
:
zsl
istType
GetElementByRank
(
zsl
,
llen
-
start
);
ln
=
start
==
0
?
zsl
->
tail
:
zslGetElementByRank
(
zsl
,
llen
-
start
);
}
else
{
}
else
{
ln
=
start
==
0
?
ln
=
start
==
0
?
zsl
->
header
->
level
[
0
].
forward
:
zsl
istType
GetElementByRank
(
zsl
,
start
+
1
);
zsl
->
header
->
level
[
0
].
forward
:
zslGetElementByRank
(
zsl
,
start
+
1
);
}
}
/* Return the result in form of a multi-bulk reply */
/* Return the result in form of a multi-bulk reply */
...
@@ -1039,7 +1039,7 @@ void zrankGenericCommand(redisClient *c, int reverse) {
...
@@ -1039,7 +1039,7 @@ void zrankGenericCommand(redisClient *c, int reverse) {
}
}
score
=
dictGetEntryVal
(
de
);
score
=
dictGetEntryVal
(
de
);
rank
=
zsl
istType
GetRank
(
zsl
,
*
score
,
c
->
argv
[
2
]);
rank
=
zslGetRank
(
zsl
,
*
score
,
c
->
argv
[
2
]);
if
(
rank
)
{
if
(
rank
)
{
if
(
reverse
)
{
if
(
reverse
)
{
addReplyLongLong
(
c
,
zsl
->
length
-
rank
);
addReplyLongLong
(
c
,
zsl
->
length
-
rank
);
...
...
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