Commit 7f9b9512 authored by Dvir Volk's avatar Dvir Volk
Browse files

fixed stop condition in RM_ZsetRangeNext and RM_ZsetRangePrev

parent b53e73e1
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment