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 Nov 29, 2024
1 parent 4da308d commit 86d290c
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 86d290c

Please sign in to comment.