Skip to content

Commit 6e4b192

Browse files
committed
Remove an unused method from ByteArrayMethods.
1 parent de5e001 commit 6e4b192

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

unsafe/src/main/java/org/apache/spark/unsafe/array/ByteArrayMethods.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,6 @@ public static int roundNumberOfBytesToNearestWord(int numBytes) {
3434
}
3535
}
3636

37-
/**
38-
* Optimized equality check for equal-length byte arrays.
39-
* @return true if the arrays are equal, false otherwise
40-
*/
41-
public static boolean arrayEquals(
42-
Object leftBaseObject,
43-
long leftBaseOffset,
44-
Object rightBaseObject,
45-
long rightBaseOffset,
46-
long arrayLengthInBytes) {
47-
// TODO: this can be optimized by comparing words and falling back to individual byte
48-
// comparison only at the end of the array (Guava's UnsignedBytes has an implementation of this)
49-
for (int i = 0; i < arrayLengthInBytes; i++) {
50-
final byte left =
51-
PlatformDependent.UNSAFE.getByte(leftBaseObject, leftBaseOffset + i);
52-
final byte right =
53-
PlatformDependent.UNSAFE.getByte(rightBaseObject, rightBaseOffset + i);
54-
if (left != right) return false;
55-
}
56-
return true;
57-
}
58-
5937
/**
6038
* Optimized byte array equality check for 8-byte-word-aligned byte arrays.
6139
* @return true if the arrays are equal, false otherwise

0 commit comments

Comments
 (0)