Skip to content

Commit

Permalink
Fixing inmutable list
Browse files Browse the repository at this point in the history
  • Loading branch information
softwaremagico committed May 10, 2024
1 parent 5524d0e commit aa9a318
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,10 @@ public List<ScoreOfCompetitor> getCompetitorsGlobalScoreRanking(Collection<Parti
final List<Duel> unties = duelProvider.getUnties(competitors).stream().filter(duel ->
from == null || duel.getCreatedAt().isAfter(from)).toList();

final Set<Participant> participantsInFights = fights.stream().flatMap(fight -> fight.getTeam1().getMembers().stream()).collect(Collectors.toSet());
final Set<Participant> participantsInFights = fights.stream().flatMap(fight ->
fight.getTeam1().getMembers().stream()).collect(Collectors.toSet());
participantsInFights.addAll(fights.stream().flatMap(fight -> fight.getTeam2().getMembers().stream()).collect(Collectors.toSet()));
competitors.retainAll(participantsInFights);
competitors.retainAll(new HashSet<>(participantsInFights));
for (final Participant competitor : competitors) {
scores.add(new ScoreOfCompetitor(competitor, fights, unties, false));
}
Expand Down

0 comments on commit aa9a318

Please sign in to comment.