This commit is contained in:
Ethan Knights 2023-07-17 21:37:36 -05:00 committed by GitHub
commit 465b1a937a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,16 +21,12 @@ object IntersectionValueCalculator {
x.remaining() >> 3 // divide 8 x.remaining() >> 3 // divide 8
} }
/**
*
*/
def apply(x: ByteBuffer, y: ByteBuffer, intersectionIdLimit: Int): WorkerIntersectionValue = { def apply(x: ByteBuffer, y: ByteBuffer, intersectionIdLimit: Int): WorkerIntersectionValue = {
val xSize = computeArraySize(x) val xSize = computeArraySize(x)
val ySize = computeArraySize(y) val ySize = computeArraySize(y)
val largerArray = if (xSize > ySize) x else y val (largerArray, smallerArray) = if (xSize > ySize) (x, y) else (y, x)
val smallerArray = if (xSize > ySize) y else x
if (intersectionIdLimit == 0) { if (intersectionIdLimit == 0) {
val result = computeIntersectionUsingBinarySearchOnLargerByteBuffer(smallerArray, largerArray) val result = computeIntersectionUsingBinarySearchOnLargerByteBuffer(smallerArray, largerArray)