Skip to content

Commit

Permalink
Save a call to prepareRounding if roundingIdx is unchanged.
Browse files Browse the repository at this point in the history
Signed-off-by: Finn Carroll <carrofin@amazon.com>
  • Loading branch information
finnegancarroll committed Jan 16, 2025
1 parent 2cd9e8e commit d107362
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ protected Rounding getRounding(final long low, final long high) {

// Ensure preparedRounding never shrinks
roundingIdx = Math.max(prevRoundingIdx, roundingIdx);
preparedRounding = prepareRounding(roundingIdx);
if (roundingIdx != prevRoundingIdx) {
preparedRounding = prepareRounding(roundingIdx);
}

return roundingInfos[roundingIdx].rounding;
}

Expand Down

0 comments on commit d107362

Please sign in to comment.