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;
r zrem zset g
# inclusive
+ assert_equal {} [r zrangebyscore zset 4 2]
assert_equal {} [r zrangebyscore zset 6 +inf]
assert_equal {} [r zrangebyscore zset -inf -6]
assert_equal {} [r zrevrangebyscore zset +inf 6]
assert_equal {} [r zrevrangebyscore zset -6 -inf]
# exclusive
+ assert_equal {} [r zrangebyscore zset (4 (2]
+ assert_equal {} [r zrangebyscore zset 2 (2]
+ assert_equal {} [r zrangebyscore zset (2 2]
assert_equal {} [r zrangebyscore zset (6 (+inf]
assert_equal {} [r zrangebyscore zset (-inf (-6]
assert_equal {} [r zrevrangebyscore zset (+inf (6]