Skip to content

Commit

Permalink
Remove unnecessary cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
jaisnan committed Jul 25, 2023
1 parent 52bd8cb commit 59e9181
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions kani-driver/src/cbmc_property_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,18 +458,15 @@ pub fn format_result_coverage(properties: &[Property]) -> String {
let mut formatted_output = String::new();
formatted_output.push_str("\nCoverage Results:\n");

let coverage_checks: Vec<Property> = properties
let mut coverage_checks: Vec<&Property> = properties
.iter()
.filter(|&x| {
x.property_class() == "coverage"
&& !contains_library_path(x.source_location.file.as_ref().unwrap())
})
.cloned()
.collect();

let mut sorted_checks: Vec<&Property> = coverage_checks.iter().collect();

sorted_checks.sort_by_key(|check| (&check.source_location.file, &check.source_location.line));
coverage_checks.sort_by_key(|check| (&check.source_location.file, &check.source_location.line));

let mut files: HashMap<String, Vec<(usize, CheckStatus)>> = HashMap::new();
for check in coverage_checks {
Expand Down

0 comments on commit 59e9181

Please sign in to comment.