Skip to content

Commit 20fd1b9

Browse files
committed
improve coverage.rs code comments
1 parent 4774f74 commit 20fd1b9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

move-mutator/src/coverage.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ impl Coverage {
8989
/// Compute per-function covered spans with function names preserved.
9090
/// Returns a map from qualified function names (e.g., "vector::append") to their covered spans.
9191
/// Only functions with some covered code are included in the result.
92+
///
93+
/// Some of the logic is borrowed from the implementation of `SourceCoverageBuilder` in
94+
/// aptos-core/third_party/move/tools/move-coverage/src/source_coverage.rs
95+
/// The difference is that we map the covered code to function in belongs to
9296
fn compute_function_covered_spans(
9397
coverage_map: &CoverageMap,
9498
root_modules: Vec<(&move_binary_format::CompiledModule, &SourceMap)>,
@@ -158,7 +162,7 @@ fn compute_function_covered_spans(
158162
}
159163

160164
/// Given a list of locations, merge overlapping and abutting locations.
161-
/// Taken from aptos-core third-party/move/tools/move-coverage/src/source_coverage.rs
165+
/// Borrowed from aptos-core/third-party/move/tools/move-coverage/src/source_coverage.rs
162166
fn minimize_locations(mut locs: Vec<IrLoc>) -> Vec<IrLoc> {
163167
locs.sort();
164168
let mut result = vec![];

0 commit comments

Comments
 (0)