1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-06-02 06:20:52 +00:00

Use { ..; } instead of (..) to avoid subshell overhead.

ShellCheck SC2235: https://github.com/koalaman/shellcheck/wiki/SC2235
This commit is contained in:
William Melody 2019-11-04 17:01:16 -08:00
parent 6b72e51651
commit 060306f28b

4
hosts
View File

@ -271,11 +271,11 @@ _load_commands() {
# Add the function name to the $_DEFINED_COMMANDS array unless it starts
# with an underscore or is one of the desc(), debug(), or die() functions,
# since these are treated as having 'private' visibility.
if ! ( [[ "${_function_name}" =~ ^_(.*) ]] || \
if ! { [[ "${_function_name}" =~ ^_(.*) ]] || \
[[ "${_function_name}" == "desc" ]] || \
[[ "${_function_name}" == "debug" ]] || \
[[ "${_function_name}" == "die" ]]
)
}
then
_DEFINED_COMMANDS+=("${_function_name}")
fi