fix LREM to remove *all* occurances when a zero argument is given

This commit is contained in:
Pieter Noordhuis 2010-05-30 03:14:38 +02:00
parent bd8db0ada8
commit 3fbf9001ce

View File

@ -5196,12 +5196,12 @@ static void lremCommand(redisClient *c) {
li = lInitIterator(subject,0);
}
while (toremove && lIsEntry(li)) {
while (lIsEntry(li)) {
if (lEqualTo(li,obj)) {
lDelete(li,direction);
server.dirty++;
toremove--;
removed++;
if (toremove && removed == toremove) break;
} else {
lMove(li,direction);
}