Author: Carl Friedrich Bolz <cfb...@gmx.de>
Branch: 
Changeset: r80489:0cf2468ac04a
Date: 2015-10-30 16:46 +0100
http://bitbucket.org/pypy/pypy/changeset/0cf2468ac04a/

Log:    don't slice the input string every time for non-greedy automata

diff --git a/pypy/interpreter/pyparser/automata.py 
b/pypy/interpreter/pyparser/automata.py
--- a/pypy/interpreter/pyparser/automata.py
+++ b/pypy/interpreter/pyparser/automata.py
@@ -66,7 +66,8 @@
     def recognize (self, inVec, pos = 0):
         crntState = self.start
         i = pos
-        for item in inVec[pos:]:
+        for i in range(pos, len(inVec)):
+            item = inVec[i]
             # arcMap, accept = self.states[crntState]
             arcMap = self.states[crntState]
             accept = self.accepts[crntState]
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to