Make day 08 ready for big boi input

20MB input still runs in 0.7ms :umu:
This commit is contained in:
kageru 2020-12-08 15:03:09 +01:00
parent 27ff0996cb
commit 4d2cc20f0e
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

View File

@ -61,7 +61,7 @@ fn part2(commands: &Vec<Command>, seen: &mut Vec<bool>, mut index: i32, mut acc:
seen[index as usize] = true;
match commands[index as usize] {
Command::NOP(x) => {
if !changed {
if !changed && index > -x {
if let Some(n) = part2(commands, seen, index + x, acc, true) {
return Some(n);
}