[pypy-svn] r44562 - pypy/dist/pypy/rlib/parsing
cfbolz at codespeak.net
cfbolz at codespeak.net
Wed Jun 27 16:24:57 CEST 2007
Author: cfbolz
Date: Wed Jun 27 16:24:56 2007
New Revision: 44562
Modified:
pypy/dist/pypy/rlib/parsing/deterministic.py
Log:
reorder the if conditions in the code that is generated for state transitions
to give the if-to-switch optimization more opportunities.
Modified: pypy/dist/pypy/rlib/parsing/deterministic.py
==============================================================================
--- pypy/dist/pypy/rlib/parsing/deterministic.py (original)
+++ pypy/dist/pypy/rlib/parsing/deterministic.py Wed Jun 27 16:24:56 2007
@@ -17,7 +17,9 @@
result.append(1)
real_result = []
for i in range(len(result) // 2):
- real_result.append((result[i * 2], result[i * 2 + 1]))
+ real_result.append((result[i * 2 + 1], result[i * 2]))
+ real_result.sort()
+ real_result = zip(*zip(*real_result)[::-1])
return real_result
class LexerError(Exception):
More information about the Pypy-commit
mailing list