Skip to content

Commit

Permalink
fix: Fix TerritoryModel#getTerritoryProfileFromShortName not having a…
Browse files Browse the repository at this point in the history
… stable order (#2442)
  • Loading branch information
kristofbolyai committed May 5, 2024
1 parent b0437cb commit adfcf50
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.wynntils.services.map.type.TerritoryDefenseFilterType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -79,7 +80,7 @@ public TerritoryProfile getTerritoryProfileFromShortName(
.filter(profile -> excludedTerritories.stream()
.noneMatch(ex -> ex.getName().equals(profile.getName())))
.filter(profile -> profile.getName().startsWith(shortName))
.findFirst()
.min(Comparator.comparing(TerritoryProfile::getName))
.orElse(null);
}

Expand Down

0 comments on commit adfcf50

Please sign in to comment.