From: David ‘Bombe’ Roden Date: Fri, 5 Nov 2010 22:42:17 +0000 (+0100) Subject: Use Sone comparator. X-Git-Tag: 0.2-RC1~5 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b9819e9ca619c85939a6805efbc2b290d6aadc45;p=Sone.git Use Sone comparator. --- diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index fd69832..145dca4 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -291,17 +291,7 @@ public class Sone { */ public List getFriends() { List friends = new ArrayList(friendSones); - Collections.sort(friends, new Comparator() { - - @Override - public int compare(Sone leftSone, Sone rightSone) { - int diff = SoneAccessor.getNiceName(leftSone).compareToIgnoreCase(SoneAccessor.getNiceName(rightSone)); - if (diff != 0) { - return diff; - } - return (int) Math.max(Integer.MIN_VALUE, Math.min(Integer.MAX_VALUE, rightSone.getTime() - leftSone.getTime())); - } - }); + Collections.sort(friends, NICE_NAME_COMPARATOR); return friends; }