summaryrefslogtreecommitdiff
path: root/src/core/libs
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-04-04 15:04:01 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2010-04-04 15:04:01 +0200
commit7376a9ecd3c24d5a2b1aa44fa4710197759e99d8 (patch)
tree9c83852a17a33c874b846f89262e5e1ab7200f94 /src/core/libs
parent252473eb0bfd1aee56709512f42cc8dcd281a311 (diff)
simplify check_is_in function
Diffstat (limited to 'src/core/libs')
-rw-r--r--src/core/libs/lib-misc.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index 7129f58..113555f 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -80,14 +80,12 @@ wait_for ()
check_is_in ()
{
[ -z "$1" ] && die_error "check_is_in needs a non-empty needle as \$1 and a haystack as \$2!(got: check_is_in '$1' '$2'" # haystack can be empty though
- NEEDLE=$1
- HAYSTACK=$2
- local pattern="$NEEDLE" element
+ local needle="$1" element
shift
for element
do
- [[ $element = $pattern ]] && return 0
+ [[ $element = $needle ]] && return 0
done
return 1
}