Compare commits

...

2 Commits

Author SHA1 Message Date
Ethan Knights
daebb8120e
Merge 10604e10f3 into fb54d8b549 2023-05-22 17:36:27 -05:00
ethanknights
10604e10f3 enhance: skip redundant arraySize comparison 2023-04-06 17:33:08 +01:00

View File

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