From fe39ffc076712fc8cd55c96fc5cb0eee2efe4847 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sat, 20 Jul 2019 10:57:12 -0400 Subject: [PATCH] Remove unnecessary type casts. --- .../java/org/apache/commons/codec/digest/MurmurHash2.java | 2 +- .../java/org/apache/commons/codec/digest/MurmurHash3.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java b/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java index 45c8b619cf..c585d39918 100644 --- a/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java +++ b/src/main/java/org/apache/commons/codec/digest/MurmurHash2.java @@ -166,7 +166,7 @@ public static long hash64(final byte[] data, final int length, final int seed) { case 2: h ^= (long) (data[(length & ~7) + 1] & 0xff) << 8; case 1: - h ^= (long) (data[length & ~7] & 0xff); + h ^= data[length & ~7] & 0xff; h *= m; } diff --git a/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java b/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java index 7c543adcd0..df46433d09 100644 --- a/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java +++ b/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java @@ -461,7 +461,7 @@ public static long[] hash128(final byte[] data, final int offset, final int leng case 10: k2 ^= (long) (data[offset + tailStart + 9] & 0xff) << 8; case 9: - k2 ^= (long) (data[offset + tailStart + 8] & 0xff); + k2 ^= data[offset + tailStart + 8] & 0xff; k2 *= C2; k2 = Long.rotateLeft(k2, R3); k2 *= C1; @@ -482,7 +482,7 @@ public static long[] hash128(final byte[] data, final int offset, final int leng case 2: k1 ^= (long) (data[offset + tailStart + 1] & 0xff) << 8; case 1: - k1 ^= (long) (data[offset + tailStart] & 0xff); + k1 ^= data[offset + tailStart] & 0xff; k1 *= C1; k1 = Long.rotateLeft(k1, R1); k1 *= C2;