diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-07-02 22:43:58 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-07-02 22:43:58 +0200 |
commit | a079f4f2b3607ae4fcfe72dba913d6589fa35f4c (patch) | |
tree | 765e9242c894d865ad615fbdb6f30a4ea927a722 | |
parent | 127517d9c3cecbab255c2e1247bc12ccc72c914e (diff) | |
download | mkinitcpio-a079f4f2b3607ae4fcfe72dba913d6589fa35f4c.tar.gz mkinitcpio-a079f4f2b3607ae4fcfe72dba913d6589fa35f4c.tar.xz |
functions: remove cruft from in_array
the for loop is already a NOOP when the haystack is empty, so it already
falls through to the return 1.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rw-r--r-- | functions | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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 |