X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/184d74abc628a1fccf66d34505a8c5505f82d21b..4774a53b:/redis.c diff --git a/redis.c b/redis.c index 30b4f6f1..6ac410d0 100644 --- a/redis.c +++ b/redis.c @@ -6409,9 +6409,9 @@ static void zremrangebyrankCommand(redisClient *c) { 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) { addReply(c,shared.czero); return;