mirror of
https://github.com/TrianguloY/UrlChecker.git
synced 2024-09-19 20:02:16 +02:00
parent
3be4a1e457
commit
65ed3caf64
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user