]> git.saurik.com Git - redis.git/blobdiff - src/t_list.c
lpush arguments vector rewrite modified for more speed and to memory leak removal.
[redis.git] / src / t_list.c
index 636c556c23721b4c61446467d3496283be96b40e..d6e28b7e5c23b8f187cffb8b66d02932a43100a2 100644 (file)
@@ -296,8 +296,8 @@ void pushGenericCommand(redisClient *c, int where) {
      * be propagated). */
     if (waiting && pushed) {
         /* CMD KEY a b C D E */
-        for (j = 2; j < pushed+2; j++)
-            rewriteClientCommandArgument(c,j,c->argv[j+waiting]);
+        for (j = 0; j < waiting; j++) decrRefCount(c->argv[j+2]);
+        memmove(c->argv+2,c->argv+2+waiting,sizeof(robj*)*pushed);
         c->argc -= waiting;
     }
 }