cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1034634 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/DecoratedKey.java
Date Sat, 13 Nov 2010 03:17:50 GMT
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()



Mime
View raw message