From: antirez Date: Wed, 29 Feb 2012 12:38:30 +0000 (+0100) Subject: lpush arguments vector rewrite modified for more speed and to memory leak removal. X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/cd8bdea31bdd682c811276a56515b65268f42958?ds=sidebyside lpush arguments vector rewrite modified for more speed and to memory leak removal. --- diff --git a/src/t_list.c b/src/t_list.c index 636c556c..d6e28b7e 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -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; } }