Skip to content

Commit 4ca0ef6

Browse files
committed
Use UNSAFE.getLong() to speed up BitSetMethods#anySet()
1 parent 3e9b691 commit 4ca0ef6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static boolean anySet(Object baseObject, long baseOffset, long bitSetWidt
7878
return true;
7979
}
8080
}
81-
for (long i = SIZE_OF_LONG * widthInLong; i <= bitSetWidthInBytes; i++) {
81+
for (long i = SIZE_OF_LONG * widthInLong; i < bitSetWidthInBytes; i++) {
8282
if (PlatformDependent.UNSAFE.getByte(baseObject, baseOffset + i) != 0) {
8383
return true;
8484
}

0 commit comments

Comments
 (0)