bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/4] gnulib-tool: abort loops early where possible.


From: Ralf Wildenhues
Subject: [PATCH 3/4] gnulib-tool: abort loops early where possible.
Date: Sun, 28 Dec 2008 11:19:38 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

* gnulib-tool (func_modules_add_dummy, func_import): Abort
loops early if we already know the answer.
---
 gnulib-tool |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/gnulib-tool b/gnulib-tool
index c172d6c..af0726e 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -1726,7 +1726,7 @@ ba
         # Ignore .h files since they are not compiled.
         case "$file" in
           *.h) ;;
-          *) have_lib_SOURCES=yes ;;
+          *) have_lib_SOURCES=yes; break 2 ;;
         esac
       done
     fi
@@ -2664,15 +2664,11 @@ func_import ()
     if test -n "$module"; then
       func_get_filelist $module
       all_files=$module_files
-      lib_files=`for f in $all_files; do \
-                   case $f in \
-                     lib/*) echo $f ;; \
-                   esac; \
-                 done | sed -e 's,^lib/,,'`
-      if test -n "$lib_files"; then
-        use_libtests=true
-        break
-      fi
+      for f in $all_files; do
+        case $f in
+          lib/*) use_libtests=true; break 2;;
+        esac
+      done
     fi
   done
 
-- 
1.6.1.rc3.96.g159c88





reply via email to

[Prev in Thread] Current Thread [Next in Thread]