Skip to content

Commit 799f7b4

Browse files
mdashtiPSeitz
authored andcommitted
Built SUM final result in each branch directly.
Keeps the empty-bucket coercion visible at the boundary instead of a shared binding, following the reviewer's suggested shape.
1 parent fc88d80 commit 799f7b4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/aggregation/intermediate_agg_result.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,12 @@ impl IntermediateMetricResult {
387387
.and_then(|sum| sum.none_if_no_match)
388388
.unwrap_or(false);
389389
let value = intermediate_sum.finalize();
390-
let coerced = if none_if_no_match {
391-
value
390+
if none_if_no_match {
391+
MetricResult::Sum(value.into())
392392
} else {
393-
Some(value.unwrap_or(0.0))
394-
};
395-
MetricResult::Sum(coerced.into())
393+
let value = Some(value.unwrap_or(0.0));
394+
MetricResult::Sum(value.into())
395+
}
396396
}
397397
IntermediateMetricResult::Percentiles(percentiles) => MetricResult::Percentiles(
398398
percentiles

0 commit comments

Comments
 (0)