Skip to content

Commit 583d682

Browse files
committed
feat(impact): reuse function for unit id, less clone
1 parent 463ce0b commit 583d682

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/action/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ impl UnitTrace {
7979
}
8080

8181
pub fn squash_with_target_unit_traces(&mut self) {
82-
for unit_ids in self.with_target_unit_trace.unit_ids_applied_by_key.values() {
82+
let unit_ids = std::mem::take(&mut self.with_target_unit_trace);
83+
84+
for (_, unit_ids) in unit_ids.unit_ids_applied_by_key {
8385
for unit_id in unit_ids {
84-
self.unit_ids_applied.insert(unit_id.clone());
85-
self.unit_ids_seen.insert(unit_id.clone());
86+
self.add_unit_id(unit_id)
8687
}
8788
}
8889

0 commit comments

Comments
 (0)