Handle empty context

master
Salvo 'LtWorf' Tomaselli 2020-08-26 17:15:51 +07:00
parent 0af82fb225
commit 1181042ee0
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
1 changed files with 2 additions and 2 deletions

@ -137,7 +137,7 @@ def general_optimize(expression):
return optimize_all(expression, None, specific=False, general=True)
def recursive_scan(function, node, rels) -> Tuple[Node, int]:
def recursive_scan(function, node: Node, rels: Optional[Dict[str, Any]]) -> Tuple[Node, int]:
'''Does a recursive optimization on the tree.
This function will recursively execute the function given
@ -151,7 +151,7 @@ def recursive_scan(function, node, rels) -> Tuple[Node, int]:
returned value.'''
args = []
if rels:
if rels is not None:
args.append(rels)
changes = 0