diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-14 17:48:52 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-14 17:48:52 +1300 |
commit | 06f5ca98018fd4ba357b0e70b1e710b682b6cdb5 (patch) | |
tree | 76bc12131c82c87852e4183969d6969d9eeabf7f /bash/bashrc.d/vis.bash | |
parent | Fix some English (diff) | |
download | dotfiles-06f5ca98018fd4ba357b0e70b1e710b682b6cdb5.tar.gz dotfiles-06f5ca98018fd4ba357b0e70b1e710b682b6cdb5.zip |
Switch to a faster method of array appending
Does away with the nasty hack around man page discovery, and still
compatible with Bash 2.05a
Diffstat (limited to 'bash/bashrc.d/vis.bash')
-rw-r--r-- | bash/bashrc.d/vis.bash | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bash/bashrc.d/vis.bash b/bash/bashrc.d/vis.bash index 02981afe..93b4098c 100644 --- a/bash/bashrc.d/vis.bash +++ b/bash/bashrc.d/vis.bash @@ -5,7 +5,7 @@ _vis() { vispath=${VISPATH:-$HOME/.local/bin} [[ -d $vispath ]] || return while IFS= read -d '' -r executable ; do - COMPREPLY=("${COMPREPLY[@]}" "$executable") + COMPREPLY[${#COMPREPLY[@]}]=$executable done < <( shopt -s dotglob nullglob declare -a files @@ -13,7 +13,7 @@ _vis() { declare -a executables for file in "${files[@]}" ; do [[ -f $file && -x $file ]] || continue - executables=("${executables[@]}" "${file##*/}") + executables[${#executables[@]}]=${file##*/} done ((${#executables[@]})) || exit 1 printf '%q\0' "${executables[@]}" |