From 0f1d0abcc189b6c171424b179ee5636c6d9a9f8b Mon Sep 17 00:00:00 2001 From: Brian Huang Date: Sun, 7 Jun 2020 19:55:21 +0800 Subject: [PATCH] hi.here 'addAll()' call can be replaced with parametrized constructor call,performance will be better --- .../healthcheck/extend/HealthCheckExtendProvider.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/extend/HealthCheckExtendProvider.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/extend/HealthCheckExtendProvider.java index fe6407368..ef4b0f515 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/extend/HealthCheckExtendProvider.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/extend/HealthCheckExtendProvider.java @@ -60,10 +60,8 @@ public class HealthCheckExtendProvider implements BeanFactoryAware { for(HealthCheckType type : HealthCheckType.values()){ origin.add(type.name()); } - Set processorType = new HashSet<>(); - Set healthCheckerType = new HashSet<>(); - processorType.addAll(origin); - healthCheckerType.addAll(origin); + Set processorType = new HashSet<>(origin); + Set healthCheckerType = new HashSet<>(origin); while(processorIt.hasNext()){ HealthCheckProcessor processor = processorIt.next();