summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuYunlong <xzsyeb@126.com>2020-07-20 18:14:27 +0800
committerGitHub <noreply@github.com>2020-07-20 13:14:27 +0300
commit86fed3fe093cfa5342b1965b89adb4ac987890ba (patch)
treeeb26b31308ef85cf57c48fde228440b9b1960ebc
parent2f4e9c3f9f38e196fe4a03232c97782cbf8b3702 (diff)
downloadredis-86fed3fe093cfa5342b1965b89adb4ac987890ba.tar.gz
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.
-rw-r--r--src/t_stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index d2c5b45a3..19b20ee56 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -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. */