You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/11/13 04:17:50 UTC

svn commit: r1034634 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/DecoratedKey.java

Author: jbellis
Date: Sat Nov 13 03:17:49 2010
New Revision: 1034634

URL: http://svn.apache.org/viewvc?rev=1034634&view=rev
Log:
revert r1033806

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/DecoratedKey.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/DecoratedKey.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/DecoratedKey.java?rev=1034634&r1=1034633&r2=1034634&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/DecoratedKey.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/DecoratedKey.java Sat Nov 13 03:17:49 2010
@@ -61,7 +61,7 @@ public class DecoratedKey<T extends Toke
     @Override
     public int hashCode()
     {
-        return token.hashCode() + (key == null ? 0 : key.hashCode());
+        return token.hashCode();
     }
 
     @Override
@@ -75,40 +75,12 @@ public class DecoratedKey<T extends Toke
             return false;
 
         DecoratedKey other = (DecoratedKey) obj;
-
-        if (token.equals(other.token))
-        {
-            if (key == null && other.key == null)
-                return true;
-
-            if (key == null || other.key == null)
-                return false;
-
-            return key.equals(other.key);
-        }
-
-        return false;
+        return token.equals(other.token);
     }
 
     public int compareTo(DecoratedKey other)
     {
-        int cmp = token.compareTo(other.token);
-
-        if (cmp == 0)
-        {
-            if (key == null && other.key == null)
-                return 0;
-
-            if (key == null)
-                return 1;
-
-            if (other.key == null)
-                return -1;
-
-            return key.compareTo(other.key);
-        }
-
-        return cmp;
+        return token.compareTo(other.token);
     }
 
     public boolean isEmpty()