fix debug assert statement
This commit is contained in:
parent
2d55809d9a
commit
20c43f3717
@ -32,7 +32,11 @@ impl<T> PosMap<T> {
|
|||||||
pub fn get(&self, row: usize, col: usize) -> &T {
|
pub fn get(&self, row: usize, col: usize) -> &T {
|
||||||
let index = row * BOARD_SIZE + col;
|
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) }
|
unsafe { self.0.get_unchecked(index) }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user