const nits

This commit is contained in:
2025-02-19 00:19:44 -05:00
parent 2ef316ab52
commit 876d829e5e
3 changed files with 12 additions and 9 deletions

View File

@@ -63,6 +63,8 @@ impl BitBoard {
self.0 &= !(1 << index)
}
// PERF! was going to optimize setting multiple indexes,
// seems rust does this for us: https://godbolt.org/z/ddj3dMxsP
#[cfg(not(feature = "bitvec"))]
const fn set_bit(&mut self, index: usize) {
self.0 |= 1 << index
@@ -84,7 +86,7 @@ impl BitBoard {
// works on both `bitvec` and native (const on native)
#[const_fn(cfg(not(feature = "bitvec")))]
pub fn count(&self) -> usize {
pub const fn count(&self) -> usize {
self.0.count_ones() as usize
}
}