coverage: Don't store function_source_hash in BcbCounter::Counter

This shows one small benefit of separating `BcbCounter` from `CoverageKind`.
The function source hash will be the same for all counters within a function,
so instead of passing it through `CoverageCounters` and storing it in every
counter, we can just supply it during the final conversion to `CoverageKind`.
This commit is contained in:
Zalathar
2023-08-14 12:16:29 +10:00
parent fbab055e77
commit 72f4c78dc6
3 changed files with 9 additions and 12 deletions

View File

@@ -674,7 +674,7 @@ fn test_make_bcb_counters() {
));
}
}
let mut coverage_counters = counters::CoverageCounters::new(0, &basic_coverage_blocks);
let mut coverage_counters = counters::CoverageCounters::new(&basic_coverage_blocks);
coverage_counters
.make_bcb_counters(&mut basic_coverage_blocks, &coverage_spans)
.expect("should be Ok");