mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
merged code from 184d74ab, 4774a53b, f483ce5f to new file structure
This commit is contained in:
parent
70a214c46d
commit
d0a4e24e32
@ -476,11 +476,10 @@ 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);
|
||||
return;
|
||||
}
|
||||
@ -516,9 +515,9 @@ 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;
|
||||
|
@ -497,9 +497,9 @@ 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;
|
||||
@ -750,11 +750,10 @@ 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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user