From 1240552da92c7a1aa490cea6f6a66d1265c587e2 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 11 Jun 2010 12:03:15 +0200 Subject: [PATCH] always iterate from head to tail on LINSERT --- redis.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/redis.c b/redis.c index 22894ec6..f0a0cd3d 100644 --- a/redis.c +++ b/redis.c @@ -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); -- 2.47.2