10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-12-21 11:53:32 +01:00

Optimization => Faster by 20%

Version:1.1.30
This commit is contained in:
Anthony Scemama 2009-09-29 15:01:34 +02:00
parent dfe5442c46
commit bcc3b5838b
2 changed files with 7 additions and 6 deletions

View File

@ -33,19 +33,20 @@ from subroutines import subroutines
import regexps import regexps
import error import error
vtuple = map(lambda v: (v, variables[v], variables[v].same_as, variables[v].regexp), variables.keys())
def find_variables_in_line(line): def find_variables_in_line(line):
assert isinstance(line,Line) assert isinstance(line,Line)
result = [] result = []
sub_done = False sub_done = False
buffer = line.text.lower() buffer = line.text.lower()
for v in variables.keys(): for v,var,same_as,regexp in vtuple:
var = variables[v] if v in buffer:
if var.name in buffer:
if not sub_done: if not sub_done:
buffer = regexps.re_string.sub('',buffer) buffer = regexps.re_string.sub('',buffer)
sub_done = True sub_done = True
if var.regexp.search(buffer) is not None: if regexp.search(buffer) is not None:
result.append(var.same_as) result.append(same_as)
return result return result
def find_subroutine_in_line(line): def find_subroutine_in_line(line):

View File

@ -1 +1 @@
version = "1.1.29" version = "1.1.30"