X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/d5096a28d79bc8e0c015816d1b359a4d197cb3bb..184d74ab:/redis.c diff --git a/redis.c b/redis.c index f6a765da..30b4f6f1 100644 --- a/redis.c +++ b/redis.c @@ -6662,11 +6662,10 @@ static void zrangeGenericCommand(redisClient *c, int reverse) { if (start < 0) start = llen+start; if (end < 0) end = llen+end; if (start < 0) start = 0; - if (end < 0) end = 0; - /* indexes sanity checks */ + /* Invariant: start >= 0, so this test will be true when end < 0. + * The range is empty when start > end or start >= length. */ if (start > end || start >= llen) { - /* Out of range start or start > end result in empty list */ addReply(c,shared.emptymultibulk); return; }