CMin: don't add to map if it's the initial value (uninteresting) (#1078)

This commit is contained in:
Addison Crump 2023-02-16 17:28:49 +01:00 committed by GitHub
parent 8bffd28b4c
commit f454d17482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,6 +142,7 @@ where
// Store coverage, mapping coverage map indices to hit counts (if present) and the // Store coverage, mapping coverage map indices to hit counts (if present) and the
// associated seeds for the map indices with those hit counts. // associated seeds for the map indices with those hit counts.
for (i, e) in obs.as_iter().copied().enumerate() { for (i, e) in obs.as_iter().copied().enumerate() {
if e != obs.initial() {
cov_map cov_map
.entry(i) .entry(i)
.or_insert_with(HashMap::new) .or_insert_with(HashMap::new)
@ -149,6 +150,7 @@ where
.or_insert_with(HashSet::new) .or_insert_with(HashSet::new)
.insert(seed_expr.clone()); .insert(seed_expr.clone());
} }
}
// Keep track of that seed's index and weight // Keep track of that seed's index and weight
seed_exprs.insert(seed_expr, (idx, weight)); seed_exprs.insert(seed_expr, (idx, weight));