Skip to content

Commit 523e1d3

Browse files
Remove redundant load from SumAggregator (#120383)
Trivial follow up to #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.
1 parent 027c605 commit 523e1d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/search/aggregations/metrics/SumAggregator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public void collect(int doc, long bucket) throws IOException {
8383
value = v + value;
8484
}
8585

86-
var compensations = SumAggregator.this.compensations;
87-
double delta = compensations.get(bucket);
8886
if (Double.isFinite(value)) {
87+
var compensations = SumAggregator.this.compensations;
88+
double delta = compensations.get(bucket);
8989
double correctedSum = v + delta;
9090
double updatedValue = value + correctedSum;
9191
delta = correctedSum - (updatedValue - value);

0 commit comments

Comments
 (0)