mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
Cleanup - Collections.sort -> list.sort
This commit is contained in:
@@ -254,7 +254,7 @@ public final class LDAModelGenetrator {
|
||||
}
|
||||
Comparator<Archetype> archetypeComparator = (o1, o2) -> o2.getDeckCount().compareTo(o1.getDeckCount());
|
||||
|
||||
Collections.sort(unfilteredTopics,archetypeComparator);
|
||||
unfilteredTopics.sort(archetypeComparator);
|
||||
return unfilteredTopics;
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ public final class LDAModelGenetrator {
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <K, V> Map<K, V> sortByValue(Map<K, V> map) {
|
||||
List<Map.Entry<K, V>> list = new LinkedList<>(map.entrySet());
|
||||
Collections.sort(list, (Comparator<Object>) (o1, o2) -> ((Comparable<V>) ((Map.Entry<K, V>) (o2)).getValue()).compareTo(((Map.Entry<K, V>) (o1)).getValue()));
|
||||
list.sort((Comparator<Object>) (o1, o2) -> ((Comparable<V>) ((Map.Entry<K, V>) (o2)).getValue()).compareTo(((Map.Entry<K, V>) (o1)).getValue()));
|
||||
|
||||
Map<K, V> result = new LinkedHashMap<>();
|
||||
for (Map.Entry<K, V> entry : list) {
|
||||
|
||||
Reference in New Issue
Block a user