mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-07-07 17:50:42 +00:00
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.
This commit is contained in:
@@ -387,12 +387,12 @@ impl IntermediateMetricResult {
|
||||
.and_then(|sum| sum.none_if_no_match)
|
||||
.unwrap_or(false);
|
||||
let value = intermediate_sum.finalize();
|
||||
let coerced = if none_if_no_match {
|
||||
value
|
||||
if none_if_no_match {
|
||||
MetricResult::Sum(value.into())
|
||||
} else {
|
||||
Some(value.unwrap_or(0.0))
|
||||
};
|
||||
MetricResult::Sum(coerced.into())
|
||||
let value = Some(value.unwrap_or(0.0));
|
||||
MetricResult::Sum(value.into())
|
||||
}
|
||||
}
|
||||
IntermediateMetricResult::Percentiles(percentiles) => MetricResult::Percentiles(
|
||||
percentiles
|
||||
|
||||
Reference in New Issue
Block a user