This commit is contained in:
Simon Gardling 2025-02-22 19:51:03 -05:00
parent 52cf81ec58
commit 60aaa883c1
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -44,16 +44,16 @@ impl BitBoard {
self.get_by_index(get_index(row, col))
}
#[cfg(not(feature = "bitvec"))]
const fn get_by_index(&self, index: usize) -> bool {
((self.0 >> index) & 0b1) != 0b0
}
#[const_fn(cfg(not(feature = "bitvec")))]
pub const fn set(&mut self, row: usize, col: usize, value: bool) {
self.set_by_index(get_index(row, col), value);
}
#[cfg(not(feature = "bitvec"))]
const fn get_by_index(&self, index: usize) -> bool {
((self.0 >> index) & 0b1) != 0b0
}
#[cfg(not(feature = "bitvec"))]
const fn set_by_index(&mut self, index: usize, value: bool) {
// PERF! branchless setting of bit (~+3% perf bump)