diff --git a/src/repr/bitboard.rs b/src/repr/bitboard.rs index 4ca70ca..7436e0b 100644 --- a/src/repr/bitboard.rs +++ b/src/repr/bitboard.rs @@ -1,6 +1,6 @@ use super::{ board::Board, - coords::{CoordAxis, CoordPair}, + coords::{CoordPair, CoordPairInner}, }; use const_fn::const_fn; use static_assertions::const_assert; @@ -53,24 +53,24 @@ impl BitBoard { } #[cfg(not(feature = "bitvec"))] - const fn get_by_index(&self, index: CoordAxis) -> bool { + const fn get_by_index(&self, index: CoordPairInner) -> bool { ((self.0 >> index) & 0b1) != 0b0 } #[cfg(not(feature = "bitvec"))] - const fn set_by_index(&mut self, index: CoordAxis, value: bool) { + const fn set_by_index(&mut self, index: CoordPairInner, value: bool) { // PERF! branchless setting of bit (~+3% perf bump) self.0 &= !(0b1 << index); // clear bit self.0 |= (value as BitBoardInner) << index; // set bit (if needed) } #[cfg(feature = "bitvec")] - pub fn get_by_index(&self, index: CoordAxis) -> bool { + pub fn get_by_index(&self, index: CoordPairInner) -> bool { self.0[index as usize] } #[cfg(feature = "bitvec")] - pub fn set_by_index(&mut self, index: CoordAxis, value: bool) { + pub fn set_by_index(&mut self, index: CoordPairInner, value: bool) { self.0.set(index as usize, value); }