diff options
author | Ben Klein <robobenklein@gmail.com> | 2018-07-12 21:34:56 +0300 |
---|---|---|
committer | Ben Klein <robobenklein@gmail.com> | 2018-07-12 22:37:33 +0300 |
commit | 45b0d68ec435a89ccc13193149a5bc306d449d04 (patch) | |
tree | 574929d441b8fa856a10caaa1af1f998ed4bf4a9 /functions | |
parent | 002f7b81a14def4ce7f1d5ea100825f0b8ebc464 (diff) |
Replace `typeset` check with shellvar flag
More performance without changing functionality.
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/utilities.zsh | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh index 69fd2ec8..127007fb 100755 --- a/functions/utilities.zsh +++ b/functions/utilities.zsh @@ -9,9 +9,7 @@ # Exits with 0 if a variable has been previously defined (even if empty) # Takes the name of a variable that should be checked. function defined() { - local varname="$1" - - typeset -p "$varname" > /dev/null 2>&1 + [[ ! -z "${(tP)1}" ]] } # Given the name of a variable and a default value, sets the variable |