]> git.ipfire.org Git - people/ms/network.git/commitdiff
util: Reuse listmatch for isoneof.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Jun 2012 20:35:50 +0000 (20:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Jun 2012 20:35:50 +0000 (20:35 +0000)
functions.util

index da2d036d34eff3d1234840faf8d2d851ce8d8e25..88b6c0cb84947b566a6d981718cbc9185879ba17 100644 (file)
@@ -56,8 +56,6 @@ function listmatch() {
        local match=${1}
        shift
 
-       assert isset match
-
        local i
        for i in $@; do
                [ "${match}" = "${i}" ] && return ${EXIT_OK}
@@ -169,11 +167,7 @@ function isoneof() {
        local var=${!1}
        shift
 
-       for i in $@; do
-               [ "${var}" = "${i}" ] && return ${EXIT_OK}
-       done
-
-       return ${EXIT_ERROR}
+       listmatch "${var}" "$@"
 }
 
 function isbool() {