Refactor the sorting of competitors
This commit is contained in:
parent
7e46399a4a
commit
bca09ae2d1
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue