summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
Diffstat (limited to 'functions')
-rw-r--r--functions5
1 files changed, 2 insertions, 3 deletions
diff --git a/functions b/functions
index ac7da7e..ffb00ec 100644
--- a/functions
+++ b/functions
@@ -46,9 +46,8 @@ in_array() {
# $1: needle
# ${@:2}: haystack
- local needle=$1; shift
- [[ -z $1 ]] && return 1 # Not Found
- local item
+ local item= needle=$1; shift
+
for item in "$@"; do
[[ $item = $needle ]] && return 0 # Found
done