mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
always iterate from head to tail on LINSERT
This commit is contained in:
parent
279d7e67cf
commit
1240552da9
4
redis.c
4
redis.c
@ -5218,11 +5218,7 @@ static void pushxGenericCommand(redisClient *c, int where, robj *old_obj, robj *
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (old_obj != NULL) {
|
if (old_obj != NULL) {
|
||||||
if (where == REDIS_TAIL) {
|
|
||||||
iter = listTypeInitIterator(subject,0,REDIS_TAIL);
|
iter = listTypeInitIterator(subject,0,REDIS_TAIL);
|
||||||
} else {
|
|
||||||
iter = listTypeInitIterator(subject,-1,REDIS_HEAD);
|
|
||||||
}
|
|
||||||
while (listTypeNext(iter,&entry)) {
|
while (listTypeNext(iter,&entry)) {
|
||||||
if (listTypeEqual(&entry,old_obj)) {
|
if (listTypeEqual(&entry,old_obj)) {
|
||||||
listTypeInsert(subject,&entry,new_obj,where);
|
listTypeInsert(subject,&entry,new_obj,where);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user