Skip to content

Commit

Permalink
Sort Unbound First
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Dec 27, 2024
1 parent ab98f58 commit d60f819
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ private static Comparator<InfoWrapper> compDefault(InfoWrapper selected) {

if (b.getFrequency() == selected.getFrequency()) return 1;
}
if (a.getFrequency() != b.getFrequency()) return b.getFrequency() - a.getFrequency();
if (a.getFrequency() != b.getFrequency()) {
// Unbound first
if (a.getFrequency() == 0) return -1;
if (b.getFrequency() == 0) return 1;

return b.getFrequency() - a.getFrequency();
}

return compareTypeThenDist(a, b);
};
Expand Down

0 comments on commit d60f819

Please sign in to comment.