Refactor the sorting of competitors

This commit is contained in:
Manuel Thalmann 2022-10-04 21:25:54 +02:00
parent 7e46399a4a
commit bca09ae2d1

View file

@ -48,7 +48,17 @@ public class Competitor implements Comparable<Competitor> {
@Override
public int compareTo(Competitor o) {
return Long.compare(parseTime(getTime()), parseTime(o.getTime()));
int result = rank - o.rank;
if (result == 0) {
result = Long.compare(parseTime(getTime()), parseTime(o.getTime()));
if (result == 0) {
result = getName().compareTo(o.getName());
}
}
return result;
}
@Override