Optimize code

This commit is contained in:
nkorange 2019-03-29 19:29:42 +08:00
parent 37b9004569
commit 4c5b06c5bb

View File

@ -104,14 +104,11 @@ public class NacosNamingService implements NamingService {
private int initClientBeatThreadCount(Properties properties) { private int initClientBeatThreadCount(Properties properties) {
if (properties == null) { if (properties == null) {
return UtilAndComs.DEFAULT_CLIENT_BEAT_THREAD_COUNT; 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); UtilAndComs.DEFAULT_CLIENT_BEAT_THREAD_COUNT);
return clientBeatThreadCount;
} }
private int initPollingThreadCount(Properties properties) { private int initPollingThreadCount(Properties properties) {
@ -120,10 +117,8 @@ public class NacosNamingService implements NamingService {
return UtilAndComs.DEFAULT_POLLING_THREAD_COUNT; 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); UtilAndComs.DEFAULT_POLLING_THREAD_COUNT);
return pollingThreadCount;
} }
private boolean isLoadCacheAtStart(Properties properties) { private boolean isLoadCacheAtStart(Properties properties) {