From 3c09759fa148ef94da39e49a0b66c26cd56ba11d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 23 Jun 2012 20:35:50 +0000 Subject: [PATCH] util: Reuse listmatch for isoneof. --- functions.util | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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() { -- 2.47.3