Skip to content

Commit

Permalink
refactor(traverse): use for/else
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohdan committed Jul 12, 2023
1 parent 8c87aaa commit 547e991
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions remarshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,11 @@ def traverse(
]
)
else:
matched = False
for t, callback in instance_callbacks:
if isinstance(col, t):
matched = True
res = callback(col)
break

if not matched:
else:
res = default_callback(col)

return res
Expand Down

0 comments on commit 547e991

Please sign in to comment.