cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1026211 - /cassandra/trunk/src/java/org/apache/cassandra/utils/MurmurHash.java
Date Fri, 22 Oct 2010 05:03:27 GMT
Author: jbellis
Date: Fri Oct 22 05:03:27 2010
New Revision: 1026211

URL: http://svn.apache.org/viewvc?rev=1026211&view=rev
Log:
fix MurmurHash regression caused by a surfeit (paucity?) of cleverness.  patch by jbellis

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/utils/MurmurHash.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/MurmurHash.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/MurmurHash.java?rev=1026211&r1=1026210&r2=1026211&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/MurmurHash.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/MurmurHash.java Fri Oct 22 05:03:27
2010
@@ -36,15 +36,15 @@ public class MurmurHash {  
 
     int len_4 = length >> 2;
 
-    for (int i = offset; i < offset + len_4; i++) {
+    for (int i = 0; i < len_4; i++) {
       int i_4 = i << 2;
-      int k = data[i_4 + 3];
+      int k = data[offset + i_4 + 3];
       k = k << 8;
-      k = k | (data[i_4 + 2] & 0xff);
+      k = k | (data[offset + i_4 + 2] & 0xff);
       k = k << 8;
-      k = k | (data[i_4 + 1] & 0xff);
+      k = k | (data[offset + i_4 + 1] & 0xff);
       k = k << 8;
-      k = k | (data[i_4 + 0] & 0xff);
+      k = k | (data[offset + i_4 + 0] & 0xff);
       k *= m;
       k ^= k >>> r;
       k *= m;



Mime
View raw message