mirror of
https://github.com/fluencelabs/redis
synced 2025-05-28 17:51:20 +00:00
removed a second copy of rewriteClientCommandVector put inside the source code for a merge error
This commit is contained in:
parent
891f9196fc
commit
3fee7e3013
@ -898,30 +898,3 @@ void rewriteClientCommandVector(redisClient *c, int argc, ...) {
|
||||
c->argc = argc;
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void rewriteClientCommandVector(redisClient *c, int argc, ...) {
|
||||
va_list ap;
|
||||
int j;
|
||||
robj **argv; /* The new argument vector */
|
||||
|
||||
argv = zmalloc(sizeof(robj*)*argc);
|
||||
va_start(ap,argc);
|
||||
for (j = 0; j < argc; j++) {
|
||||
robj *a;
|
||||
|
||||
a = va_arg(ap, robj*);
|
||||
argv[j] = a;
|
||||
incrRefCount(a);
|
||||
}
|
||||
/* We free the objects in the original vector at the end, so we are
|
||||
* sure that if the same objects are reused in the new vector the
|
||||
* refcount gets incremented before it gets decremented. */
|
||||
for (j = 0; j < c->argc; j++) decrRefCount(c->argv[j]);
|
||||
zfree(c->argv);
|
||||
/* Replace argv and argc with our new versions. */
|
||||
c->argv = argv;
|
||||
c->argc = argc;
|
||||
c->cmd = lookupCommand(c->argv[0]->ptr);
|
||||
redisAssert(c->cmd != NULL);
|
||||
va_end(ap);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user