From e46939b5def8927ed66aa5655492fd70db713451 Mon Sep 17 00:00:00 2001
From: Ian Luo <ian.luo@gmail.com>
Date: Thu, 13 Aug 2020 13:24:57 +0800
Subject: [PATCH] code polish for else branch

---
 cluster/router/chain/chain.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cluster/router/chain/chain.go b/cluster/router/chain/chain.go
index 1c7d48aef..0ab2c781f 100644
--- a/cluster/router/chain/chain.go
+++ b/cluster/router/chain/chain.go
@@ -249,10 +249,10 @@ func poolRouter(p router.Poolable, origin *InvokerCache, invokers []protocol.Inv
 	if isCacheMiss(origin, name) || p.ShouldPool() || isInvokersChanged(origin.invokers, invokers) {
 		logger.Debugf("build address cache for router %q", name)
 		return p.Pool(invokers)
-	} else {
-		logger.Debugf("reuse existing address cache for router %q", name)
-		return origin.pools[name], origin.metadatas[name]
 	}
+
+	logger.Debugf("reuse existing address cache for router %q", name)
+	return origin.pools[name], origin.metadatas[name]
 }
 
 // isCacheMiss checks if the corresponding cache entry for a poolable router has already existed.
-- 
GitLab