From 27346a9f437071ffde58af884ecf55fdec56a123 Mon Sep 17 00:00:00 2001 From: zongtanghu Date: Fri, 8 May 2020 18:09:11 +0800 Subject: [PATCH] [#2761]ProtocolManager class's getCpProtocol()/getApProtocol() method' codes can be optimized. --- .../alibaba/nacos/core/distributed/ProtocolManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/alibaba/nacos/core/distributed/ProtocolManager.java b/core/src/main/java/com/alibaba/nacos/core/distributed/ProtocolManager.java index e749054a2..9274e81d7 100644 --- a/core/src/main/java/com/alibaba/nacos/core/distributed/ProtocolManager.java +++ b/core/src/main/java/com/alibaba/nacos/core/distributed/ProtocolManager.java @@ -75,8 +75,8 @@ public class ProtocolManager synchronized (this) { if (!cpInit) { initCPProtocol(); - } - cpInit = true; + cpInit = true; + } } return cpProtocol; } @@ -85,8 +85,8 @@ public class ProtocolManager synchronized (this) { if (!apInit) { initAPProtocol(); - } - apInit = true; + apInit = true; + } } return apProtocol; }