Avoid raxInsert() for raxSetData() instead

This commit is contained in:
Slavomir Kaslev 2025-09-13 00:23:55 +03:00
parent 50f3cde381
commit 84af8e8152
1 changed files with 3 additions and 3 deletions

View File

@ -539,7 +539,7 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_
/* Shrink extra pre-allocated memory */
lp = lpShrinkToFit(lp);
if (ri.data != lp)
raxInsert(s->rax,ri.key,ri.key_len,lp,NULL);
raxSetData(ri.node, lp);
lp = NULL;
}
}
@ -888,8 +888,8 @@ int64_t streamTrim(stream *s, streamAddTrimArgs *args) {
/* TODO: perform a garbage collection. */
}
/* Update the listpack with the new pointer. */
raxInsert(s->rax,ri.key,ri.key_len,lp,NULL);
/* Update the node with the new pointer. */
raxSetData(ri.node,lp);
/* If the node is eligible for removal but we couldn't remove it due to delete strategy
* constraints (we need to check each entry individually), continue to the next node