Performance improvement.
authorBoris Kolpackov <boris@kolpackov.net>
Fri, 25 Sep 2009 15:51:11 +0000 (15:51 +0000)
committerBoris Kolpackov <boris@kolpackov.net>
Fri, 25 Sep 2009 15:51:11 +0000 (15:51 +0000)
ChangeLog
implicit.c

index 9caef15a41c454d2fa64467a034f0d294744c389..545ea53c03b31326ac69deee081c3612b1514761 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-25 Boris Kolpackov  <boris@codesynthesis.com>
+
+       * implicit.c (pattern_search): Terminate early if we haven't
+       found any rules to try (performance improvement).
+
 2009-09-25 Boris Kolpackov  <boris@codesynthesis.com>
 
        * implicit.c (pattern_search): Merge three parallel arrays,
index 6db4d0ed51957f4f73bf3fbb3b65c1a508b956e2..c3e35f7e08842cf5a2723706d6794d80a88004ba 100644 (file)
@@ -390,6 +390,10 @@ pattern_search (struct file *file, int archive,
         }
     }
 
+  /* Bail out early if we haven't found any rules. */
+  if (nrules == 0)
+    goto done;
+
   /* If we have found a matching rule that won't match all filenames,
      retroactively reject any non-"terminal" rules that do always match.  */
   if (specific_rule_matched)