streamIteratorRemoveEntry(): set back lp only if pointer changed.
Most of the times the pointer will remain the same since integers of similar size don't take more space in listpacks. Related to #5210.
This commit is contained in:
parent
ba1d382d42
commit
74f1b91282
@ -726,7 +726,8 @@ void streamIteratorRemoveEntry(streamIterator *si, streamID *current) {
|
||||
lp = lpReplaceInteger(lp,&p,aux+1);
|
||||
|
||||
/* Update the listpack with the new pointer. */
|
||||
raxInsert(si->stream->rax,si->ri.key,si->ri.key_len,lp,NULL);
|
||||
if (si->lp != lp)
|
||||
raxInsert(si->stream->rax,si->ri.key,si->ri.key_len,lp,NULL);
|
||||
}
|
||||
|
||||
/* Update the number of entries counter. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user