From 18516c50897e1be65c83ccc3f60284b0bc67526f Mon Sep 17 00:00:00 2001 From: "Kurt J. Bosch" Date: Fri, 24 Jun 2011 11:00:09 +0200 Subject: Simplify in_array function --- functions | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/functions b/functions index a29eb7f..4e184f6 100644 --- a/functions +++ b/functions @@ -165,12 +165,10 @@ status() { # usage : in_array( $needle, $haystack ) # return : 0 - found # 1 - not found -# Copied from makepkg in_array() { - [[ $2 ]] || return 1 local needle=$1; shift local item - for item in "$@"; do + for item; do [[ ${item#@} = $needle ]] && return 0 done return 1 # Not Found -- cgit v1.2.3