1
0
Fork 0

wip: introduce MoveSet

This commit is contained in:
Paul-Nicolas Madelaine 2025-12-17 23:03:20 +01:00
parent 42ccddc12b
commit a8b7b9ca63
2 changed files with 245 additions and 209 deletions

View file

@ -120,11 +120,8 @@ impl<'l> Move<'l> {
self.to
}
#[inline]
fn extend<I>(&mut self, iter: I) -> ControlFlow<Infallible>
where
I: Iterator<Item = RawMove> + ExactSizeIterator,
{
iter.for_each(|raw| {
fn extend(&mut self, s: MoveSet) -> ControlFlow<Infallible> {
s.for_each(|raw| {
debug_assert!(raw.role() as u8 == ROLE);
debug_assert!(self.to.contains(raw.to()));
self.candidates.insert(raw.from);
@ -236,11 +233,8 @@ impl<'l> MoveGen<Infallible> for Moves<'l> {
ControlFlow::Continue(())
}
#[inline]
fn extend<I>(&mut self, iter: I) -> ControlFlow<Infallible>
where
I: Iterator<Item = RawMove> + ExactSizeIterator,
{
iter.for_each(|raw| unsafe { self.array.push_unchecked(raw) });
fn extend(&mut self, s: MoveSet) -> ControlFlow<Infallible> {
s.for_each(|raw| unsafe { self.array.push_unchecked(raw) });
ControlFlow::Continue(())
}
}