marcjal / pyemu

Automatically exported from code.google.com/p/pyemu
0 stars 0 forks source link

Patch for /trunk/PyEmu.py #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I might be misinterpreting, but it appears as if this regular expression is 
malformed.

Additionally, you are re.compile-ing each expression every time it's evaluated 
-- and it evaluates (and thus *compiles*) all of them until one is matched 
(!!!!).  

It would be a good idea to move the compiled statements (results of re.compile) 
to a property/member, so that it is only compiled once.

Eg;

exprExX = re.compile(..., re.IGNORECASE)
...
if exprExX.match(register): # eax/ebx/ecx/edx
   # ...

Original issue reported on code.google.com by zachrig...@gmail.com on 15 Sep 2011 at 3:33

Attachments: