From 86fed3fe093cfa5342b1965b89adb4ac987890ba Mon Sep 17 00:00:00 2001
From: WuYunlong <xzsyeb@126.com>
Date: Mon, 20 Jul 2020 18:14:27 +0800
Subject: [PATCH] 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.
---
 src/t_stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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