code optimization for ConfigChangeHandler (#9923)

This commit is contained in:
ZhangShenao 2023-02-10 09:41:04 +08:00 committed by GitHub
parent 2faa5b58d0
commit 882c6edb64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,6 @@ import com.alibaba.nacos.common.spi.NacosServiceLoader;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -44,11 +43,8 @@ public class ConfigChangeHandler {
this.parserList = new LinkedList<>();
Collection<ConfigChangeParser> loader = NacosServiceLoader.load(ConfigChangeParser.class);
Iterator<ConfigChangeParser> itr = loader.iterator();
while (itr.hasNext()) {
this.parserList.add(itr.next());
}
this.parserList.addAll(loader);
this.parserList.add(new PropertiesChangeParser());
this.parserList.add(new YmlChangeParser());
}