cleanup: use bulk operation instead of iteration
This commit is contained in:
@@ -51,9 +51,7 @@ public final class UseOwlOfMinervaHandler extends AbstractMaplePacketHandler {
|
||||
Comparator<Pair<Integer, Integer>> comparator = (p1, p2) -> p2.getRight().compareTo(p1.getRight());
|
||||
|
||||
PriorityQueue<Pair<Integer, Integer>> queue = new PriorityQueue<>(Math.max(1, owlSearched.size()), comparator);
|
||||
for(Pair<Integer, Integer> p : owlSearched) {
|
||||
queue.add(p);
|
||||
}
|
||||
queue.addAll(owlSearched);
|
||||
|
||||
owlLeaderboards = new LinkedList<>();
|
||||
for(int i = 0; i < Math.min(owlSearched.size(), 10); i++) {
|
||||
|
||||
Reference in New Issue
Block a user