[Improvement][Service] The method refreshMasterList was executed one more time in function putAll.
DaqianLiao opened this issue · comments
DaqianLiao commented
Search before asking
- I had searched in the issues and found no similar feature requirement.
Description
In the MasterPriorityQueue class, the refreshMasterList method is executed each time when a Server is added by put method. Therefore, there is no need to execute the refreshMasterList method again after iterating through the putAll method.
public void put(Server serverInfo) {
this.queue.put(serverInfo);
refreshMasterList();
}
public void putAll(Collection serverList) {
for (Server server : serverList) {
this.queue.put(server);
}
refreshMasterList(); // should remove
}
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct