summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2021-12-23 10:26:17 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2021-12-23 10:26:17 +0000
commite676d1be982afe783fa4d2a7690f914658f5baf8 (patch)
treef790eb98da2b261502b8c84c1824c10367f0b654
parent0ec2e7e06ab99366f92bea5c20805ba2dd521834 (diff)
downloadaoc-e676d1be982afe783fa4d2a7690f914658f5baf8.tar.bz2
2021: Day 23 - knock 30ms off by making state checks debug-only
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r--2021/src/bin/2021day23.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/2021/src/bin/2021day23.rs b/2021/src/bin/2021day23.rs
index f34b540..19f7109 100644
--- a/2021/src/bin/2021day23.rs
+++ b/2021/src/bin/2021day23.rs
@@ -131,7 +131,7 @@ impl AmbiCave {
let mut newstate = *self;
newstate.caves[cave][pos] = 0;
newstate.hallway[hidx] = ambipod;
- assert!(newstate.state_ok());
+ debug_assert!(newstate.state_ok());
ret.push((newstate, cost));
}
}
@@ -169,7 +169,7 @@ impl AmbiCave {
newstate.hallway[hidx] = 0;
newstate.caves[cave][pos] = ambipod;
let cost = (base_cost + 3 - pos) * Self::ambi_cost(ambipod);
- assert!(newstate.state_ok());
+ debug_assert!(newstate.state_ok());
ret.push((newstate, cost));
}
@@ -197,7 +197,7 @@ impl AmbiCave {
self.caves[2][2] = 2;
self.caves[3][1] = 3;
self.caves[3][2] = 1;
- assert!(self.state_ok());
+ debug_assert!(self.state_ok());
}
}