summaryrefslogtreecommitdiff
path: root/functions/aliases.sh
diff options
context:
space:
mode:
authorjnqnfe <jnqnfe@gmail.com>2015-01-06 03:36:55 +0000
committerLuca Boccassi <bluca@debian.org>2020-03-05 22:07:50 +0000
commitc1dcc4dd898c2d6f214dcc7ea23de73ab37cef7b (patch)
tree9e4668f3bbe6dd646d51c90b0c94cc2a0c3c685a /functions/aliases.sh
parent0869a890ae461c01a3c29a81f972605abbd23b9e (diff)
downloadvyos-live-build-c1dcc4dd898c2d6f214dcc7ea23de73ab37cef7b.tar.gz
vyos-live-build-c1dcc4dd898c2d6f214dcc7ea23de73ab37cef7b.zip
aliases: simplify excessively complex In_list function
This function is never used to find multiple needles at one time. Gbp-Dch: Short Closes: #952915
Diffstat (limited to 'functions/aliases.sh')
-rwxr-xr-xfunctions/aliases.sh13
1 files changed, 5 insertions, 8 deletions
diff --git a/functions/aliases.sh b/functions/aliases.sh
index 3df028f61..7ec1cd3f2 100755
--- a/functions/aliases.sh
+++ b/functions/aliases.sh
@@ -15,18 +15,15 @@ Find_files ()
In_list ()
{
- NEEDLES="${1}"
+ local NEEDLE="${1}"
shift
for ITEM in ${@}
do
- for NEEDLE in ${NEEDLES}
- do
- if [ "${NEEDLE}" = "${ITEM}" ]
- then
- return 0
- fi
- done
+ if [ "${NEEDLE}" = "${ITEM}" ]
+ then
+ return 0
+ fi
done
return 1