From c751d8a686aa298d591ccf18adf5d1cc19808a4c Mon Sep 17 00:00:00 2001 From: Mixficsol <838844609@qq.com> Date: Mon, 6 Jun 2022 13:17:18 +0800 Subject: [PATCH] Update cluster.c (#10773) On line 4068, redis has a logical nodeIsSlave(myself) on the outer if layer, which you can delete without having to repeat the decision --- src/cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 5f3c75e09..d328ede2f 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -4077,7 +4077,7 @@ void clusterCron(void) { orphaned_masters++; } if (okslaves > max_slaves) max_slaves = okslaves; - if (nodeIsSlave(myself) && myself->slaveof == node) + if (myself->slaveof == node) this_slaves = okslaves; }