-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(_comp_count_args): skip reinitializing cword and words
In most of the contexts calling `_comp_count_args` in the current codebase, `cword` and `words` are already initialized with the same set of exclude chars (-n chars) by _comp_initialize, so there seems to be no need to again reassemble `cword` and `words`. This patch removes the redundant initialization of `cword` and `words`. * When `_comp_initialize` is called without `-s` or `-n chars` and `_comp_count_args` is called with an empty $1, they are compatible so `cword` and `words` outside can be directly used. * `7z` and `nslookup` specify the same set of exclude chars as `_comp_initialize`, so existing `cword` and `words` are compatible. Nevertheless, we need to reinitialize `cword` and `words` when the specified exclude chars are different from those specified to _comp_initialize. * The `ssh` completion calls `_comp_count_args` with excluding `=` while it calls `_comp_initialize` with `-n :`. * The `chown` completion calls `_comp_count_args` with excluding `:` while it calls `_comp_initialize` with `-sn :`. * The `nc` completions calls `_comp_count_args` without exclude chars while it calls `_comp_initialize` with `-n :`. * The completions for `chmod`, `cryptsetup`, `hcitool`, `mkinitrd`, `patch`, `quota`, and `zopflipng` does not specify exclude chars to `_comp_count_args` while they specify `-s` to `_comp_initialize`. It is not clear whether these discrepancies are intended ones are not, but this patch tries to keep the current behavior by explicitly specifying the original exclude chars.
- Loading branch information
1 parent
ad4472f
commit 29398ef
Showing
12 changed files
with
40 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters