From b1fcbeafc35701367cb84c4efce3b46426343cb1 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 18 Nov 2012 08:29:17 +0000 Subject: test-flags-PROG: use arrays to simplify code a bit --- eclass/flag-o-matic.eclass | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'eclass') diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass index f5f7720674d8..5e6af23468fc 100644 --- a/eclass/flag-o-matic.eclass +++ b/eclass/flag-o-matic.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.182 2012/11/18 08:27:00 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.183 2012/11/18 08:29:17 vapier Exp $ # @ECLASS: flag-o-matic.eclass # @MAINTAINER: @@ -422,21 +422,21 @@ test-flag-FC() { test-flag-PROG "FC" f95 "$1"; } test-flags-PROG() { local comp=$1 - local flags + local flags=() local x shift [[ -z ${comp} ]] && return 1 - for x in "$@" ; do - test-flag-${comp} "${x}" && flags="${flags}${flags:+ }${x}" + for x ; do + test-flag-${comp} "${x}" && flags+=( "${x}" ) done - echo "${flags}" + echo "${flags[*]}" # Just bail if we dont have any flags - [[ -n ${flags} ]] + [[ ${#flags[@]} -gt 0 ]] } # @FUNCTION: test-flags-CC -- cgit v1.2.3-65-gdbad