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:
1 parent
6d791dbe29
commit
158c3f99f0
30 files changed
+36
-36
No files matched your search
+2
-2
@@ -13,12 +13,12 @@ if [[ -z "${DISPLAY}" && $(id -u) -ge 1000 ]] ; then
|
||||
3) VT=vt3 ;;
|
||||
esac
|
||||
|
||||
if ( command -v ck-launch-session &> /dev/null )
|
||||
if command -v ck-launch-session &> /dev/null
|
||||
then
|
||||
EXEC="exec ck-launch-session"
|
||||
fi
|
||||
|
||||
if ( command -v startx &> /dev/null )
|
||||
if command -v startx &> /dev/null
|
||||
then
|
||||
${EXEC} startx 1> ~/.log/xsession-errors 2>&1 -- "${VT}"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user