mirror of https://github.com/redis/redis.git
Avoid raxInsert() for raxSetData() instead
This commit is contained in:
parent
50f3cde381
commit
84af8e8152
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue