Refactor streamAppendItem() by deleting redundancy condition. (#7487)
It will never happen that "lp != NULL && lp_bytes >= server.stream_node_max_bytes". Assume that "lp != NULL && lp_bytes >= server.stream_node_max_bytes", we got the following conditions: a. lp != NULL b. lp_bytes >= server.stream_node_max_bytes If server.stream_node_max_bytes is 0, given condition a, condition b is always satisfied If server.stream_node_max_bytes is not 0, given condition a and condition b, the codes just a few lines above set lp to NULL, a controdiction with condition a So that condition b is recundant. We could delete it safely.
This commit is contained in:
parent
2f4e9c3f9f
commit
86fed3fe09
@ -281,7 +281,7 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_
|
||||
}
|
||||
|
||||
int flags = STREAM_ITEM_FLAG_NONE;
|
||||
if (lp == NULL || lp_bytes >= server.stream_node_max_bytes) {
|
||||
if (lp == NULL) {
|
||||
master_id = id;
|
||||
streamEncodeID(rax_key,&id);
|
||||
/* Create the listpack having the master entry ID and fields. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user