mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
always iterate from head to tail on LINSERT
This commit is contained in:
parent
279d7e67cf
commit
1240552da9
6
redis.c
6
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user