posmap change
This commit is contained in:
parent
3eb5b71b7b
commit
fa7ad34dcb
@ -25,22 +25,10 @@ impl<T: Default> PosMap<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get(&self, coords: CoordPair) -> &T {
|
pub fn get(&self, coords: CoordPair) -> &T {
|
||||||
debug_assert!(
|
&self.0[coords.0 as usize]
|
||||||
Board::BOARD_AREA + 1 >= coords.0,
|
|
||||||
"index out of range, was: {:?}",
|
|
||||||
coords
|
|
||||||
);
|
|
||||||
|
|
||||||
unsafe { self.0.get_unchecked(coords.0 as usize) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set(&mut self, coords: CoordPair, value: T) {
|
pub fn set(&mut self, coords: CoordPair, value: T) {
|
||||||
debug_assert!(
|
|
||||||
Board::BOARD_AREA + 1 >= coords.0,
|
|
||||||
"index out of range, was: {:?}",
|
|
||||||
coords
|
|
||||||
);
|
|
||||||
|
|
||||||
self.0[coords.0 as usize] = value;
|
self.0[coords.0 as usize] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user