Skip to content

Commit

Permalink
Remove redundant load from SumAggregator (elastic#120383)
Browse files Browse the repository at this point in the history
Trivial follow up to elastic#120241, no need for a redundant load though the not-load path is probably very cold anyway,
but still better to give the compiler all the inputs it can get.
  • Loading branch information
original-brownbear authored Jan 17, 2025
1 parent 027c605 commit 523e1d3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public void collect(int doc, long bucket) throws IOException {
value = v + value;
}

var compensations = SumAggregator.this.compensations;
double delta = compensations.get(bucket);
if (Double.isFinite(value)) {
var compensations = SumAggregator.this.compensations;
double delta = compensations.get(bucket);
double correctedSum = v + delta;
double updatedValue = value + correctedSum;
delta = correctedSum - (updatedValue - value);
Expand Down

0 comments on commit 523e1d3

Please sign in to comment.