From 4c5b06c5bb8df81e5f4affb0eeda00ce1028782b Mon Sep 17 00:00:00 2001 From: nkorange Date: Fri, 29 Mar 2019 19:29:42 +0800 Subject: [PATCH] Optimize code --- .../alibaba/nacos/client/naming/NacosNamingService.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java b/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java index 262fb5801..271a44f4e 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java @@ -104,14 +104,11 @@ public class NacosNamingService implements NamingService { private int initClientBeatThreadCount(Properties properties) { if (properties == null) { - return UtilAndComs.DEFAULT_CLIENT_BEAT_THREAD_COUNT; } - int clientBeatThreadCount = NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_CLIENT_BEAT_THREAD_COUNT), + return NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_CLIENT_BEAT_THREAD_COUNT), UtilAndComs.DEFAULT_CLIENT_BEAT_THREAD_COUNT); - - return clientBeatThreadCount; } private int initPollingThreadCount(Properties properties) { @@ -120,10 +117,8 @@ public class NacosNamingService implements NamingService { return UtilAndComs.DEFAULT_POLLING_THREAD_COUNT; } - int pollingThreadCount = NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_POLLING_THREAD_COUNT), + return NumberUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_POLLING_THREAD_COUNT), UtilAndComs.DEFAULT_POLLING_THREAD_COUNT); - - return pollingThreadCount; } private boolean isLoadCacheAtStart(Properties properties) {