address review: store running-total entries only for items with a number

This commit is contained in:
Dylan M. Taylor
2026-11-04 02:38:40 +00:00
parent 0355c88a8c
commit 0dab91a2fb
+3 -1
View File
@@ -368,7 +368,9 @@ fn running_total(raw: Value, lookup: &ValueLookup<'_>, context: &ShowContext<'_>
let mut path = Vec::with_capacity(rest.len() + 1);
path.push(*item);
path.extend_from_slice(rest);
total += number(&lookup.get(&path, context.col_path, context.value_index)).unwrap_or(0.0);
// An item with no number here adds nothing and is not stored (the shown cell always has one).
let Some(value) = number(&lookup.get(&path, context.col_path, context.value_index)) else { continue };
total += value;
by_item.entry(*item).or_insert(total);
}
(by_item, total)