Commit 1240552d authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

always iterate from head to tail on LINSERT

parent 279d7e67
......@@ -5218,11 +5218,7 @@ static void pushxGenericCommand(redisClient *c, int where, robj *old_obj, robj *
}
if (old_obj != NULL) {
if (where == REDIS_TAIL) {
iter = listTypeInitIterator(subject,0,REDIS_TAIL);
} else {
iter = listTypeInitIterator(subject,-1,REDIS_HEAD);
}
iter = listTypeInitIterator(subject,0,REDIS_TAIL);
while (listTypeNext(iter,&entry)) {
if (listTypeEqual(&entry,old_obj)) {
listTypeInsert(subject,&entry,new_obj,where);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment