Add .snap.new files to gitignore
This commit is contained in:
@@ -51,7 +51,7 @@ pub fn remove_redundant_jumps<'a>(
|
||||
) -> (Vec<InstructionNode<'a>>, bool) {
|
||||
let mut output = Vec::with_capacity(input.len());
|
||||
let mut changed = false;
|
||||
|
||||
|
||||
for (i, node) in input.iter().enumerate() {
|
||||
// Check if this is a jump to the next line number
|
||||
if let Instruction::Jump(Operand::Number(target)) = &node.instruction {
|
||||
@@ -64,7 +64,7 @@ pub fn remove_redundant_jumps<'a>(
|
||||
}
|
||||
output.push(node.clone());
|
||||
}
|
||||
|
||||
|
||||
(output, changed)
|
||||
}
|
||||
|
||||
|
||||
@@ -92,9 +92,9 @@ pub fn optimize<'a>(instructions: Instructions<'a>) -> Instructions<'a> {
|
||||
|
||||
// Final Pass: Resolve Labels to Line Numbers
|
||||
let mut instructions = resolve_labels(instructions);
|
||||
|
||||
|
||||
// Post-resolution Pass: Remove redundant jumps (must run after label resolution)
|
||||
let (instructions, _) = remove_redundant_jumps(instructions);
|
||||
|
||||
|
||||
Instructions::new(instructions)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user