mirror of
https://github.com/fluencelabs/redis
synced 2025-06-21 13:01:32 +00:00
Merge remote branch 'pietern/zfixes-2.0.0' into 2.0.0
This commit is contained in:
17
redis.c
17
redis.c
@ -4903,9 +4903,9 @@ static void lrangeCommand(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) {
|
||||
/* Out of range start or start > end result in empty list */
|
||||
addReply(c,shared.emptymultibulk);
|
||||
@ -4942,9 +4942,9 @@ static void ltrimCommand(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) {
|
||||
/* Out of range start or start > end result in empty list */
|
||||
ltrim = llen;
|
||||
@ -5909,9 +5909,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;
|
||||
@ -6159,11 +6159,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user