From 060306f28b40404368de1e1fc59bb24f06357164 Mon Sep 17 00:00:00 2001 From: William Melody Date: Mon, 4 Nov 2019 17:01:16 -0800 Subject: [PATCH] Use { ..; } instead of (..) to avoid subshell overhead. ShellCheck SC2235: https://github.com/koalaman/shellcheck/wiki/SC2235 --- hosts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts b/hosts index 259d8c0..dac89f2 100755 --- a/hosts +++ b/hosts @@ -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