diff --git a/src/board.rs b/src/board.rs index 985f284..723cf1c 100644 --- a/src/board.rs +++ b/src/board.rs @@ -32,10 +32,7 @@ impl PosMap { pub fn get(&self, row: usize, col: usize) -> &T { let index = row * BOARD_SIZE + col; - #[cfg(debug_assertions)] - if index > BOARD_AREA + 1 { - panic!("index is out of range"); - } + debug_assert!(index > BOARD_AREA + 1, "index out of range"); unsafe { self.0.get_unchecked(index) } }