diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2016-12-16 09:20:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-16 09:20:47 +0100 |
commit | 5ad2a94a1696fd7a87070836fdb081c4027730f5 (patch) | |
tree | 122e34dd474dd5d50ad2510c0190a621741f5d44 | |
parent | d634c36253125e7f07bb161d76a89e3649213d6a (diff) | |
parent | 7f9b9512b877af96ded1c9758c23c075bab36f8d (diff) | |
download | redis-5ad2a94a1696fd7a87070836fdb081c4027730f5.tar.gz |
Merge pull request #3686 from dvirsky/fix_lowlevel_zrange
fixed stop condition in RM_ZsetRangeNext and RM_ZsetRangePrev
-rw-r--r-- | src/module.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/module.c b/src/module.c index 5f85bf311..a5b3d52ae 100644 --- a/src/module.c +++ b/src/module.c @@ -1858,12 +1858,12 @@ int RM_ZsetRangeNext(RedisModuleKey *key) { } else { /* Are we still within the range? */ if (key->ztype == REDISMODULE_ZSET_RANGE_SCORE && - !zslValueLteMax(ln->score,&key->zrs)) + !zslValueLteMax(next->score,&key->zrs)) { key->zer = 1; return 0; } else if (key->ztype == REDISMODULE_ZSET_RANGE_LEX) { - if (!zslLexValueLteMax(ln->ele,&key->zlrs)) { + if (!zslLexValueLteMax(next->ele,&key->zlrs)) { key->zer = 1; return 0; } @@ -1921,7 +1921,7 @@ int RM_ZsetRangePrev(RedisModuleKey *key) { } else { /* Are we still within the range? */ if (key->ztype == REDISMODULE_ZSET_RANGE_SCORE && - !zslValueGteMin(ln->score,&key->zrs)) + !zslValueGteMin(prev->score,&key->zrs)) { key->zer = 1; return 0; |