0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00

Revert "fix sorting order"

This reverts commit c6b7bc8011.
This commit is contained in:
TrianguloY 2022-08-24 19:51:23 +02:00
parent 3be4a1e457
commit 65ed3caf64

View File

@ -38,7 +38,7 @@ public class LastOpened {
List<String> priority = getPriority(url).get();
// sort list based on priority
Collections.sort(packs, (p1, p2) -> Integer.compare(priority.indexOf(p2), priority.indexOf(p1)));
Collections.sort(packs, (p1, p2) -> Integer.compare(priority.indexOf(p1), priority.indexOf(p2)));
}
/**
@ -71,7 +71,7 @@ public class LastOpened {
// update
int i = priority.indexOf(pack);
if (i >= 0 && i + 1 < priority.size()) {
if (i >= 0 && i < priority.size()) {
// already present and not most prioritized, shift up
Collections.swap(priority, i, i + 1);
} else if (i == -1) {