Skip to content

Commit

Permalink
modified HeapQuickSelectSketch::getHashTableThreshold(..)
Browse files Browse the repository at this point in the history
And DirectQuickSelectSketchR::getOffHeapHashTableThreshold(..)
to eliminate the unnecessary Math.floor(..) function.
  • Loading branch information
leerho committed May 15, 2024
1 parent ca32da7 commit f979b37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ protected static final int getOffHeapHashTableThreshold(final int lgNomLongs, fi
//SpotBugs may complain (DB_DUPLICATE_BRANCHES) if DQS_RESIZE_THRESHOLD == REBUILD_THRESHOLD,
//but this allows us to tune these constants for different sketches.
final double fraction = (lgArrLongs <= lgNomLongs) ? DQS_RESIZE_THRESHOLD : ThetaUtil.REBUILD_THRESHOLD;
return (int) Math.floor(fraction * (1 << lgArrLongs));
return (int) (fraction * (1 << lgArrLongs));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private final void quickSelectAndRebuild() {
*/
private static final int getHashTableThreshold(final int lgNomLongs, final int lgArrLongs) {
final double fraction = (lgArrLongs <= lgNomLongs) ? ThetaUtil.RESIZE_THRESHOLD : ThetaUtil.REBUILD_THRESHOLD;
return (int) Math.floor(fraction * (1 << lgArrLongs));
return (int) (fraction * (1 << lgArrLongs));
}

}

0 comments on commit f979b37

Please sign in to comment.