inline toggle_box to eliminate bounds checking

This commit is contained in:
mos 2024-10-25 10:09:19 +02:00
parent 816a3cbc3a
commit b7d7b27566
1 changed files with 1 additions and 0 deletions

View File

@ -193,6 +193,7 @@ impl State {
State { lvl } State { lvl }
} }
#[inline(always)]
fn toggle_box(&mut self, pos: &Pos) { fn toggle_box(&mut self, pos: &Pos) {
self.lvl[*pos] = if self.lvl[*pos] == Cell::Goal(true) { self.lvl[*pos] = if self.lvl[*pos] == Cell::Goal(true) {
Cell::Goal(false) Cell::Goal(false)