Console: Sort banlist and floodfills in true binary order, not by base64 string

This commit is contained in:
zzz
2016-12-04 15:25:38 +00:00
parent 7734d3dd65
commit 62b5b49b02
2 changed files with 6 additions and 2 deletions

View File

@ -31,9 +31,12 @@ class BanlistRenderer {
_context = context;
}
/**
* As of 0.9.29, sorts in true binary order, not base64 string
*/
private static class HashComparator implements Comparator<Hash>, Serializable {
public int compare(Hash l, Hash r) {
return l.toBase64().compareTo(r.toBase64());
return DataHelper.compareTo(l.getData(), r.getData());
}
}

View File

@ -322,11 +322,12 @@ class ProfileOrganizerRenderer {
/**
* Used for floodfill-only page
* As of 0.9.29, sorts in true binary order, not base64 string
* @since 0.9.8
*/
private static class HashComparator implements Comparator<PeerProfile>, Serializable {
public int compare(PeerProfile left, PeerProfile right) {
return left.getPeer().toBase64().compareTo(right.getPeer().toBase64());
return DataHelper.compareTo(left.getPeer().getData(), right.getPeer().getData());
}
}