mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 16:51:22 +00:00
Test for ranges where min > max
This commit is contained in:
@ -196,6 +196,10 @@ static int zslValueInRange(double value, zrangespec *spec) {
|
||||
int zslIsInRange(zskiplist *zsl, zrangespec *range) {
|
||||
zskiplistNode *x;
|
||||
|
||||
/* Test for ranges that will always be empty. */
|
||||
if (range->min > range->max ||
|
||||
(range->min == range->max && (range->minex || range->maxex)))
|
||||
return 0;
|
||||
x = zsl->tail;
|
||||
if (x == NULL || !zslValueInMinRange(x->score,range))
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user