projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bd8db0a
)
fix LREM to remove *all* occurances when a zero argument is given
author
Pieter Noordhuis
<pcnoordhuis@gmail.com>
Sun, 30 May 2010 01:14:38 +0000
(
03:14
+0200)
committer
Pieter Noordhuis
<pcnoordhuis@gmail.com>
Sun, 30 May 2010 01:25:14 +0000
(
03:25
+0200)
redis.c
patch
|
blob
|
blame
|
history
diff --git
a/redis.c
b/redis.c
index 1ae32797186e3b4319c85c552be19349d56a1505..2a4882834f8306cb66a8b014e5d9abc6bc1da6ee 100644
(file)
--- a/
redis.c
+++ b/
redis.c
@@
-5196,12
+5196,12
@@
static void lremCommand(redisClient *c) {
li = lInitIterator(subject,0);
}
li = lInitIterator(subject,0);
}
- while (
toremove &&
lIsEntry(li)) {
+ while (lIsEntry(li)) {
if (lEqualTo(li,obj)) {
lDelete(li,direction);
server.dirty++;
if (lEqualTo(li,obj)) {
lDelete(li,direction);
server.dirty++;
- toremove--;
removed++;
removed++;
+ if (toremove && removed == toremove) break;
} else {
lMove(li,direction);
}
} else {
lMove(li,direction);
}