1
0
mirror of https://github.com/git/git.git synced 2024-09-28 15:01:31 +02:00

completion: small optimization

No need to calculate a new $c with a space if we are not going to do
anything it with it.

There should be no functional changes, except that a word "foo " with no
suffixes can't be matched. But $cur cannot have a space at the end
anyway. So it's safe.

Based on the code from SZEDER Gábor.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Felipe Contreras 2013-04-10 01:57:57 -05:00 committed by Junio C Hamano
parent b4cfbc969c
commit ddc996d767

@ -210,11 +210,11 @@ __gitcomp ()
local c i=0 IFS=$' \t\n'
for c in $1; do
c="$c${4-}"
case $c in
--*=*|*.) ;;
*) c="$c " ;;
esac
if [[ $c == "$cur_"* ]]; then
case $c in
--*=*|*.) ;;
*) c="$c " ;;
esac
COMPREPLY[i++]="${2-}$c"
fi
done