From: Michael Tremer Date: Sat, 23 Jun 2012 20:35:50 +0000 (+0000) Subject: util: Reuse listmatch for isoneof. X-Git-Tag: 004~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c09759fa148ef94da39e49a0b66c26cd56ba11d;p=network.git util: Reuse listmatch for isoneof. --- diff --git a/functions.util b/functions.util index da2d036d..88b6c0cb 100644 --- a/functions.util +++ b/functions.util @@ -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() {