bug-grep
[Top][All Lists]
Advanced

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

bug#17156: [PATCH 3/5] grep: avoid to re-build a state built previously.


From: Paolo Bonzini
Subject: bug#17156: [PATCH 3/5] grep: avoid to re-build a state built previously.
Date: Tue, 1 Apr 2014 11:18:44 +0200

From: Norihiro Tanaka <address@hidden>

* src/dfa.c (dfaexec): avoid to re-build a state built previously.
---
 src/dfa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/dfa.c b/src/dfa.c
index a7f0056..c06c922 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3533,7 +3533,8 @@ dfaexec (struct dfa *d, char const *begin, char *end,
 
       if (s >= 0)
         {
-          build_state (s, d);
+          if (!d->trans[s])
+            build_state (s, d);
           trans = d->trans;
           continue;
         }
-- 
1.9.0







reply via email to

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