Subject: [PATCH] dfa: more simplification of dfaexec_main

From: Norihiro Tanaka <[email-masked]>
Date: Sat, 13 Dec 2014 10:26:03 +0900

I simplified dfaexec_main in bug#19252, but it was not enough.  This
change additionally simplifies it.  The change induces no semantic change.
From 0253cb531086ee3d3aceccb9f5a6ae7b3cc4dbdf Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <[email-masked]>
Date: Sat, 13 Dec 2014 10:10:13 +0900
Subject: [PATCH] dfa: more simplification of dfaexec_main

* src/dfa.c (dfaexec_main): Failure at an acceptable position and demand
to build state is unlikely.  So go next loop without checking them after
a newline.  This commit induces no semantic change.
---
 src/dfa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index 806cb04..2da21f6 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3474,8 +3474,7 @@ dfaexec_main (struct dfa *d, char const *begin, char *end,
 
           s = allow_nl ? d->newlines[s1] : 0;
         }
-
-      if (d->fails[s])
+      else if (d->fails[s])
         {
           if (d->success[s] & sbit[*p])
             {
@@ -3492,8 +3491,7 @@ dfaexec_main (struct dfa *d, char const *begin, char *end,
         }
       else
         {
-          if (!d->trans[s])
-            build_state (s, d);
+          build_state (s, d);
           trans = d->trans;
         }
     }
-- 
2.2.0