[arch-projects] [initscripts] [PATCH 13/13] Simplify in_array function
Kurt J. Bosch
kjb-temp-2009 at alpenjodel.de
Fri Jun 24 05:15:03 EDT 2011
---
functions | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/functions b/functions
index 06828c3..aafc686 100644
--- a/functions
+++ b/functions
@@ -157,12 +157,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
--
1.7.1
More information about the arch-projects
mailing list