Skip to content

Commit 6cb94ed

Browse files
committed
use MemoryBlock in hashBytesByIntBlock according to kiszk's comment
1 parent 91adce5 commit 6cb94ed

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,10 @@ public static int hashUnsafeBytes2Block(MemoryBlock base, int seed) {
117117
}
118118

119119
private static int hashBytesByIntBlock(MemoryBlock base, int lengthInBytes, int seed) {
120-
Object o = base.getBaseObject();
121-
long offset = base.getBaseOffset();
122120
assert (lengthInBytes % 4 == 0);
123121
int h1 = seed;
124122
for (int i = 0; i < lengthInBytes; i += 4) {
125-
int halfWord = Platform.getInt(o, offset + i);
123+
int halfWord = base.getInt(i);
126124
int k1 = mixK1(halfWord);
127125
h1 = mixH1(h1, k1);
128126
}

0 commit comments

Comments
 (0)