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:
WuYunlong 2020-07-20 18:14:27 +08:00 committed by GitHub
parent 2f4e9c3f9f
commit 86fed3fe09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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. */