perf: remove unnecessary subshells in command -v checks

Replace 'if (command -v x &>/dev/null); then' with
'if command -v x &>/dev/null; then' across completion.d, rc.d and
profile.d. Parentheses forced a subshell fork for every 'if' check,
which is unnecessary overhead since command -v runs fine in the
current shell.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Xavier LogeraisandCopilot committed 2026-09-28 18:17:13 +02:00
1 parent 6d791dbe29
commit 158c3f99f0
30 files changed
+36 -36

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
if (asdf which direnv &>/dev/null); then
if asdf which direnv &>/dev/null; then
# Hook direnv into your shell.
eval "$(asdf exec direnv hook bash)"
@@ -7,7 +7,7 @@ if (asdf which direnv &>/dev/null); then
return
elif (command -v direnv &>/dev/null); then
elif command -v direnv &>/dev/null; then
# Hook direnv into your shell.
eval "$(direnv hook bash)"