perf: Merge .clone() calls

This seems like something rustc would be able to figure out, but
apparently not.

Saves 0.6K.
This commit is contained in:
Jan Verbeek 2022-01-31 01:43:13 +01:00
parent 6411e2ede6
commit 4420fd25c8

View file

@ -63,13 +63,14 @@ impl ArgMatcher {
// --global-arg where the value is `other`, however the occurs will be 0. // --global-arg where the value is `other`, however the occurs will be 0.
let to_update = if let Some(parent_ma) = vals_map.get(global_arg) { let to_update = if let Some(parent_ma) = vals_map.get(global_arg) {
if parent_ma.occurs > 0 && ma.occurs == 0 { if parent_ma.occurs > 0 && ma.occurs == 0 {
parent_ma.clone() parent_ma
} else { } else {
ma.clone() ma
} }
} else { } else {
ma.clone() ma
}; }
.clone();
vals_map.insert(global_arg.clone(), to_update); vals_map.insert(global_arg.clone(), to_update);
} }
} }