Skip to content

Commit

Permalink
Set visited as None
Browse files Browse the repository at this point in the history
  • Loading branch information
Ig-dolci committed Nov 28, 2024
1 parent 3359367 commit c66d385
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions firedrake/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ def update_tensor(assembled_base_form, tensor):
raise NotImplementedError("Cannot update tensor of type %s" % type(tensor))

@staticmethod
def base_form_postorder_traversal(expr, visitor, visited={}):
def base_form_postorder_traversal(expr, visitor, visited=None):
visited = visited if visited is not None else {}
if expr in visited:
return visited[expr]

Expand All @@ -605,7 +606,8 @@ def base_form_postorder_traversal(expr, visitor, visited={}):
return visited[expr]

@staticmethod
def base_form_preorder_traversal(expr, visitor, visited={}):
def base_form_preorder_traversal(expr, visitor, visited=None):
visited = visited if visited is not None else {}
if expr in visited:
return visited[expr]

Expand Down

0 comments on commit c66d385

Please sign in to comment.