Skip to content

Commit 82fa9e6

Browse files
FabioLuporinimloubout
authored andcommitted
compiler: Speed up FindWithin
1 parent 32c6b61 commit 82fa9e6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

devito/ir/iet/visitors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,10 @@ def visit_Node(self, o, ret=None):
11451145
if flag and self.rule(self.match, o):
11461146
found.append(o)
11471147
for i in o.children:
1148-
found, flag = self._visit(i, ret=(found, flag))
1148+
found, newflag = self._visit(i, ret=(found, flag))
1149+
if flag and not newflag:
1150+
return found, newflag
1151+
flag = newflag
11491152

11501153
if o is self.stop:
11511154
flag = False

0 commit comments

Comments
 (0)