From 9a2a75593105ff28cd6d0d00b7ff3f1083fee293 Mon Sep 17 00:00:00 2001 From: "ray.j.greenwell" Date: Sat, 5 Dec 2009 00:00:18 +0000 Subject: [PATCH] Look ma, less code. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2665 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/util/ComparableArrayList.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/java/com/samskivert/util/ComparableArrayList.java b/src/java/com/samskivert/util/ComparableArrayList.java index 9fdd5a2f..d2f77dc9 100644 --- a/src/java/com/samskivert/util/ComparableArrayList.java +++ b/src/java/com/samskivert/util/ComparableArrayList.java @@ -74,18 +74,7 @@ public class ComparableArrayList> return insertSorted(value, _comp); } - protected transient Comparator _comp = new Comparator() { - public int compare (T o1, T o2) { - if (o1 == o2) { // catches null == null - return 0; - } else if (o1 == null) { - return 1; - } else if (o2 == null) { - return -1; - } - return o1.compareTo(o2); // null-free - } - }; + protected transient Comparator _comp = Comparators.comparable(); /** Change this if the fields or inheritance hierarchy ever changes * (which is extremely unlikely). We override this because I'm tired