Skip to content

Commit

Permalink
FISH-10146: Apply suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Viii3 committed Dec 3, 2024
1 parent 6c283fa commit 375b756
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
Expand Down Expand Up @@ -141,13 +142,11 @@ final List<String> getDGServerNames() {
return Collections.emptyList();
}

Set<String> deploymentGroupNeighbours = new HashSet<>();
deploymentGroups.forEach(groupData -> {
if (groupData.dgServerRefs.contains(instanceName)) {
deploymentGroupNeighbours.addAll(groupData.dgServerRefs);
}
});
return new ArrayList<>(deploymentGroupNeighbours);
return deploymentGroups
.stream()
.filter(groupData -> groupData.dgServerRefs.contains(instanceName))
.flatMap(groupData -> groupData.dgServerRefs.stream())
.collect(Collectors.toList());
}

public Map<String, String> getMapServerConfig() {
Expand Down

0 comments on commit 375b756

Please sign in to comment.