fix debug assert statement

This commit is contained in:
Simon Gardling 2025-02-20 11:18:14 -05:00
parent 2d55809d9a
commit 20c43f3717
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -32,7 +32,11 @@ impl<T> PosMap<T> {
pub fn get(&self, row: usize, col: usize) -> &T {
let index = row * BOARD_SIZE + col;
debug_assert!(index > BOARD_AREA + 1, "index out of range");
debug_assert!(
BOARD_AREA + 1 >= index,
"index out of range, was: {}",
index
);
unsafe { self.0.get_unchecked(index) }
}