]> git.saurik.com Git - redis.git/commitdiff
always iterate from head to tail on LINSERT
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 11 Jun 2010 10:03:15 +0000 (12:03 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 11 Jun 2010 10:03:15 +0000 (12:03 +0200)
redis.c

diff --git a/redis.c b/redis.c
index 22894ec6a438f2f0eab6a434c31212a99b42029b..f0a0cd3d52aafb89a0eca731c9b6508ecc925503 100644 (file)
--- 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);