Handle empty context

This commit is contained in:
Salvo 'LtWorf' Tomaselli 2020-08-26 17:15:51 +02:00
parent 0af82fb225
commit 1181042ee0
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF

View File

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