Commit c7c3b237 authored by antirez's avatar antirez
Browse files

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.
parent 9fe7cd8f
...@@ -726,7 +726,8 @@ void streamIteratorRemoveEntry(streamIterator *si, streamID *current) { ...@@ -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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment