Skip to content

Commit a244587

Browse files
akinomyogascop
authored andcommitted
perf(mutt): return earlier on empty cur
1 parent 5330fbe commit a244587

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

completions/mutt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ _comp_cmd_mutt__aliases()
9999
# @param $1 (cur) Current word to complete
100100
_comp_cmd_mutt__query()
101101
{
102-
local cur=$1 querycmd muttcmd=${words[0]}
102+
local cur=$1
103+
[[ $cur ]] || return 0
104+
local querycmd muttcmd=${words[0]}
103105
local -a queryresults
104106

105107
querycmd="$("$muttcmd" -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'"$cur"'|')"
106-
if [[ $cur && $querycmd ]]; then
108+
if [[ $querycmd ]]; then
107109
local REPLY
108110
_comp_expand_tilde "$querycmd"
109111
querycmd=$REPLY

0 commit comments

Comments
 (0)