Skip to content

Commit

Permalink
refactor: ensure consistent ordering of log output when removing unus…
Browse files Browse the repository at this point in the history
…ed variables
  • Loading branch information
daniel-makerx committed Nov 6, 2024
1 parent e53fd59 commit 4ebbe0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/puya/ir/optimize/dead_code_elimination.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def remove_unused_variables(_context: CompileContext, subroutine: models.Subrout
isinstance(ass.source, models.Intrinsic)
and ass.source.op.code in SIDE_EFFECT_FREE_AVM_OPS
):
for reg in registers:
for reg in sorted(registers, key=lambda r: r.local_id):
logger.debug(f"Removing unused variable {reg.local_id}")
block.ops.remove(ass)
modified += 1
Expand Down

0 comments on commit 4ebbe0f

Please sign in to comment.