From 7f9b9512b877af96ded1c9758c23c075bab36f8d Mon Sep 17 00:00:00 2001 From: Dvir Volk Date: Thu, 15 Dec 2016 00:07:20 +0200 Subject: [PATCH] fixed stop condition in RM_ZsetRangeNext and RM_ZsetRangePrev --- src/module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/module.c b/src/module.c index 5f85bf31..a5b3d52a 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;