Use unchecked conversion in 'BitboardIterator
This commit is contained in:
parent
eefa707c07
commit
024a41fa18
1 changed files with 2 additions and 1 deletions
|
|
@ -11,7 +11,8 @@ impl Iterator for BitboardIterator {
|
||||||
} else {
|
} else {
|
||||||
let lsb = self.0.trailing_zeros() as usize;
|
let lsb = self.0.trailing_zeros() as usize;
|
||||||
self.0 ^= 1 << lsb;
|
self.0 ^= 1 << lsb;
|
||||||
Some(crate::board::Square::from_index(lsb))
|
// SAFETY: we know the value is in-bounds
|
||||||
|
Some(unsafe { crate::board::Square::from_index_unchecked(lsb) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue