mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
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:
parent
6411e2ede6
commit
4420fd25c8
1 changed files with 5 additions and 4 deletions
|
@ -63,13 +63,14 @@ impl ArgMatcher {
|
|||
// --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) {
|
||||
if parent_ma.occurs > 0 && ma.occurs == 0 {
|
||||
parent_ma.clone()
|
||||
parent_ma
|
||||
} else {
|
||||
ma.clone()
|
||||
ma
|
||||
}
|
||||
} else {
|
||||
ma.clone()
|
||||
};
|
||||
ma
|
||||
}
|
||||
.clone();
|
||||
vals_map.insert(global_arg.clone(), to_update);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue