From f04530eb618a3f7e7ee1dd15f0b2907fc28bed98 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 5 Aug 2010 21:12:11 +1000 Subject: makepkg: remove unnecessary variable presence check It is unnecessary to check for a variables existence before looping over it. Extracted from patch supplied by Andres P Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index a28cfa75..7e6a194a 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1285,14 +1285,12 @@ check_sanity() { done fi - if [[ -n "${PKGLIST[@]}" ]]; then - for pkg in ${PKGLIST[@]}; do - if ! in_array $pkg ${pkgname[@]}; then - error "$(gettext "requested package %s is not provided in %s")" "$pkg" "$BUILDFILE" - return 1 - fi - done - fi + for pkg in ${PKGLIST[@]}; do + if ! in_array $pkg ${pkgname[@]}; then + error "$(gettext "requested package %s is not provided in %s")" "$pkg" "$BUILDFILE" + return 1 + fi + done return 0 } -- cgit v1.2.3-70-g09d2