mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
parent
79b44d0460
commit
a62fd05d53
1 changed files with 2 additions and 0 deletions
|
@ -126,6 +126,8 @@ impl MKeyMap {
|
||||||
/// We need a lazy build here since some we may change args after creating
|
/// We need a lazy build here since some we may change args after creating
|
||||||
/// the map, you can checkout who uses `args_mut`.
|
/// the map, you can checkout who uses `args_mut`.
|
||||||
pub(crate) fn _build(&mut self) {
|
pub(crate) fn _build(&mut self) {
|
||||||
|
// There will be at least as many keys as args, so that is a good starting point
|
||||||
|
self.keys.reserve(self.args.len());
|
||||||
for (i, arg) in self.args.iter().enumerate() {
|
for (i, arg) in self.args.iter().enumerate() {
|
||||||
append_keys(&mut self.keys, arg, i);
|
append_keys(&mut self.keys, arg, i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue