mirror of
https://github.com/fluencelabs/redis
synced 2025-06-18 19:51:22 +00:00
use the new rewriteClientCommandVector() function for SPOP -> SREM replication translation as well.
This commit is contained in:
25
src/t_list.c
25
src/t_list.c
@ -624,31 +624,6 @@ void lremCommand(redisClient *c) {
|
||||
if (removed) touchWatchedKey(c->db,c->argv[1]);
|
||||
}
|
||||
|
||||
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;
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
/* This is the semantic of this command:
|
||||
* RPOPLPUSH srclist dstlist:
|
||||
* IF LLEN(srclist) > 0
|
||||
|
Reference in New Issue
Block a user