From 420b86f2db1d7b05c31ffb0b94fda05c8eef3fd4 Mon Sep 17 00:00:00 2001 From: mdb Date: Tue, 12 Sep 2006 23:24:03 +0000 Subject: [PATCH] Type safety is a goodness. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1902 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/IntTuple.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/java/com/samskivert/util/IntTuple.java b/src/java/com/samskivert/util/IntTuple.java index 2df9a0b2..3722169e 100644 --- a/src/java/com/samskivert/util/IntTuple.java +++ b/src/java/com/samskivert/util/IntTuple.java @@ -24,7 +24,7 @@ package com.samskivert.util; * A simple object that holds a reference to two ints. */ public class IntTuple - implements Comparable + implements Comparable { /** The left int. */ public int left; @@ -53,14 +53,9 @@ public class IntTuple } // documentation inherited from interface - public int compareTo (Object o) + public int compareTo (IntTuple ot) { - if (o instanceof IntTuple) { - IntTuple ot = (IntTuple)o; - return (left == ot.left) ? (right - ot.right) : (left - ot.left); - } else { - return hashCode() - o.hashCode(); - } + return (left == ot.left) ? (right - ot.right) : (left - ot.left); } /**