From 4ebbe0f63a5266c3ceba0bb7a9cebf96a5b9a4c0 Mon Sep 17 00:00:00 2001 From: Daniel McGregor Date: Fri, 1 Nov 2024 11:45:55 +0800 Subject: [PATCH] refactor: ensure consistent ordering of log output when removing unused variables --- src/puya/ir/optimize/dead_code_elimination.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/puya/ir/optimize/dead_code_elimination.py b/src/puya/ir/optimize/dead_code_elimination.py index 2bec52a303..088fd057f3 100644 --- a/src/puya/ir/optimize/dead_code_elimination.py +++ b/src/puya/ir/optimize/dead_code_elimination.py @@ -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