10
0
mirror of https://gitlab.com/scemama/irpf90.git synced 2024-11-09 07:33:43 +01:00

Slight acceleration

This commit is contained in:
Anthony Scemama 2009-09-17 11:56:04 +02:00
parent cb52b89616
commit b4273ba620

View File

@ -11,10 +11,14 @@ import error
def find_variables_in_line(line):
assert isinstance(line,Line)
result = []
buffer = regexps.re_string.sub('',line.text)
sub_done = False
buffer = line.text.lower()
for v in variables.keys():
var = variables[v]
if var.name in buffer.lower():
if var.name in buffer:
if not sub_done:
buffer = regexps.re_string.sub('',buffer)
sub_done = True
if var.regexp.search(buffer) is not None:
result.append(var.same_as)
return result