v0.7.2b: adjusted rankings comparator to account for equal scores

This commit is contained in:
Evan Debenham 2019-04-04 22:55:27 -04:00
parent 2bd197a5b3
commit c6e96b9b8e

View File

@ -320,7 +320,12 @@ public enum Rankings {
private static final Comparator<Record> scoreComparator = new Comparator<Rankings.Record>() { private static final Comparator<Record> scoreComparator = new Comparator<Rankings.Record>() {
@Override @Override
public int compare( Record lhs, Record rhs ) { public int compare( Record lhs, Record rhs ) {
return (int)Math.signum( rhs.score - lhs.score ); int result = (int)Math.signum( rhs.score - lhs.score );
if (result == 0) {
return (int)Math.signum( rhs.gameID.hashCode() - lhs.gameID.hashCode());
} else{
return result;
}
} }
}; };
} }