File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
unsafe/src/main/java/org/apache/spark/unsafe/array Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments