From 67e6c4bdcaa0a1e2357344c9a0850f7bc771bcc9 Mon Sep 17 00:00:00 2001 From: Cruz Julian Bishop Date: Tue, 21 Aug 2012 09:27:14 +1000 Subject: [PATCH] Optimize UniqueName.compareTo(other) slightly Replaces a manual check of IDs with one built in to Java At least it makes the code smaller! Signed-off-by: Cruz Julian Bishop --- common/src/main/java/io/netty/util/UniqueName.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/common/src/main/java/io/netty/util/UniqueName.java b/common/src/main/java/io/netty/util/UniqueName.java index 525bb7bfe6..5b60e331a4 100644 --- a/common/src/main/java/io/netty/util/UniqueName.java +++ b/common/src/main/java/io/netty/util/UniqueName.java @@ -103,13 +103,7 @@ public class UniqueName implements Comparable { return returnCode; } - if (id < other.id) { - return -1; - } else if (id > other.id) { - return 1; - } else { - return 0; - } + return ((Integer) id).compareTo((Integer) other.id); } @Override