The compiler has two separate steps that add variable declarations for each tracking node:
https://github.com/YarnSpinnerTool/YarnSpinner-Rust/blob/main/crates/compiler/src/compiler/run_compilation.rs#L20-L21
&create_declarations_for_tracking_nodes,
&add_tracking_declarations,
The code for both steps is almost identical, with one cloning an iterator, and the other collecting into a Vec and cloning that.
Rather than add the declarations twice, one of these compilation steps should be deleted.
The compiler has two separate steps that add variable declarations for each tracking node:
https://github.com/YarnSpinnerTool/YarnSpinner-Rust/blob/main/crates/compiler/src/compiler/run_compilation.rs#L20-L21
The code for both steps is almost identical, with one cloning an iterator, and the other collecting into a
Vecand cloning that.Rather than add the declarations twice, one of these compilation steps should be deleted.