cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject cassandra git commit: Improve MD5Digest.hashCode()
Date Tue, 03 Mar 2015 08:42:39 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk f257b669d -> 7310c054f


Improve MD5Digest.hashCode()

Patch by Robert Stupp; Reviewed by Aleksey Yeschenko for CASSANDRA-8847


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7310c054
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7310c054
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7310c054

Branch: refs/heads/trunk
Commit: 7310c054f29e80a124a105320a165e465e3bd124
Parents: f257b66
Author: Robert Stupp <snazy@snazy.de>
Authored: Tue Mar 3 09:39:44 2015 +0100
Committer: Robert Stupp <snazy@snazy.de>
Committed: Tue Mar 3 09:39:44 2015 +0100

----------------------------------------------------------------------
 src/java/org/apache/cassandra/utils/MD5Digest.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7310c054/src/java/org/apache/cassandra/utils/MD5Digest.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/MD5Digest.java b/src/java/org/apache/cassandra/utils/MD5Digest.java
index 59c1aba..3f46458 100644
--- a/src/java/org/apache/cassandra/utils/MD5Digest.java
+++ b/src/java/org/apache/cassandra/utils/MD5Digest.java
@@ -30,10 +30,12 @@ import java.util.Arrays;
 public class MD5Digest
 {
     public final byte[] bytes;
+    private final int hashCode;
 
     private MD5Digest(byte[] bytes)
     {
         this.bytes = bytes;
+        hashCode = Arrays.hashCode(bytes);
     }
 
     public static MD5Digest wrap(byte[] digest)
@@ -54,7 +56,7 @@ public class MD5Digest
     @Override
     public final int hashCode()
     {
-        return Arrays.hashCode(bytes);
+        return hashCode;
     }
 
     @Override


Mime
View raw message