format
This commit is contained in:
parent
52cf81ec58
commit
60aaa883c1
@ -44,16 +44,16 @@ impl BitBoard {
|
|||||||
self.get_by_index(get_index(row, col))
|
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")))]
|
#[const_fn(cfg(not(feature = "bitvec")))]
|
||||||
pub const fn set(&mut self, row: usize, col: usize, value: bool) {
|
pub const fn set(&mut self, row: usize, col: usize, value: bool) {
|
||||||
self.set_by_index(get_index(row, col), value);
|
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"))]
|
#[cfg(not(feature = "bitvec"))]
|
||||||
const fn set_by_index(&mut self, index: usize, value: bool) {
|
const fn set_by_index(&mut self, index: usize, value: bool) {
|
||||||
// PERF! branchless setting of bit (~+3% perf bump)
|
// PERF! branchless setting of bit (~+3% perf bump)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user