Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5ad2a94a
Commit
5ad2a94a
authored
Dec 16, 2016
by
Salvatore Sanfilippo
Committed by
GitHub
Dec 16, 2016
Browse files
Merge pull request #3686 from dvirsky/fix_lowlevel_zrange
fixed stop condition in RM_ZsetRangeNext and RM_ZsetRangePrev
parents
d634c362
7f9b9512
Changes
1
Show whitespace changes
Inline
Side-by-side
src/module.c
View file @
5ad2a94a
...
@@ -1858,12 +1858,12 @@ int RM_ZsetRangeNext(RedisModuleKey *key) {
...
@@ -1858,12 +1858,12 @@ int RM_ZsetRangeNext(RedisModuleKey *key) {
}
else
{
}
else
{
/* Are we still within the range? */
/* Are we still within the range? */
if
(
key
->
ztype
==
REDISMODULE_ZSET_RANGE_SCORE
&&
if
(
key
->
ztype
==
REDISMODULE_ZSET_RANGE_SCORE
&&
!
zslValueLteMax
(
l
n
->
score
,
&
key
->
zrs
))
!
zslValueLteMax
(
n
ext
->
score
,
&
key
->
zrs
))
{
{
key
->
zer
=
1
;
key
->
zer
=
1
;
return
0
;
return
0
;
}
else
if
(
key
->
ztype
==
REDISMODULE_ZSET_RANGE_LEX
)
{
}
else
if
(
key
->
ztype
==
REDISMODULE_ZSET_RANGE_LEX
)
{
if
(
!
zslLexValueLteMax
(
l
n
->
ele
,
&
key
->
zlrs
))
{
if
(
!
zslLexValueLteMax
(
n
ext
->
ele
,
&
key
->
zlrs
))
{
key
->
zer
=
1
;
key
->
zer
=
1
;
return
0
;
return
0
;
}
}
...
@@ -1921,7 +1921,7 @@ int RM_ZsetRangePrev(RedisModuleKey *key) {
...
@@ -1921,7 +1921,7 @@ int RM_ZsetRangePrev(RedisModuleKey *key) {
}
else
{
}
else
{
/* Are we still within the range? */
/* Are we still within the range? */
if
(
key
->
ztype
==
REDISMODULE_ZSET_RANGE_SCORE
&&
if
(
key
->
ztype
==
REDISMODULE_ZSET_RANGE_SCORE
&&
!
zslValueGteMin
(
ln
->
score
,
&
key
->
zrs
))
!
zslValueGteMin
(
prev
->
score
,
&
key
->
zrs
))
{
{
key
->
zer
=
1
;
key
->
zer
=
1
;
return
0
;
return
0
;
...
...
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