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
9fe7cd8f14
commit
c7c3b23787
@ -726,7 +726,8 @@ void streamIteratorRemoveEntry(streamIterator *si, streamID *current) {
|
|||||||
lp = lpReplaceInteger(lp,&p,aux+1);
|
lp = lpReplaceInteger(lp,&p,aux+1);
|
||||||
|
|
||||||
/* Update the listpack with the new pointer. */
|
/* 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. */
|
/* Update the number of entries counter. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user