]> Savannah Git Hosting - gnulib.git/commitdiff
dfa: minor simplification with emptyset
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Jan 2017 09:27:44 +0000 (01:27 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 10 Jan 2017 10:13:13 +0000 (02:13 -0800)
* lib/dfa.c (build_state): Simplify by using emptyset.

ChangeLog
lib/dfa.c

index e0b73b50be1d99453467f4506da2bf89293ef9fe..8fda2938dbcbdb92c8a4a7ce2073258f2e6f876a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-10  Paul Eggert  <eggert@cs.ucla.edu>
+
+       dfa: minor simplification with emptyset
+       * lib/dfa.c (build_state): Simplify by using emptyset.
+
 2017-01-09  Paul Eggert  <eggert@cs.ucla.edu>
 
        dfa: shrink constraints from 4 bits to 3
index 28678c2327331323d171badb71331de1688ec38c..5df27eae09d3008e5898031ef773309a5d990c85 100644 (file)
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -2760,10 +2760,7 @@ build_state (state_num s, struct dfa *d, unsigned char uc)
               matches.w[j] &= d->syntax.letters.w[j] | d->syntax.newline.w[j];
 
           /* If there are no characters left, there's no point in going on.  */
-          size_t j;
-          for (j = 0; j < CHARCLASS_WORDS && !matches.w[j]; j++)
-            continue;
-          if (j == CHARCLASS_WORDS)
+          if (emptyset (&matches))
             continue;
 
           /* If we have reset the bit that made us declare "matched", reset