remove extra call to propegate_from_dry

This commit is contained in:
Simon Gardling 2025-02-12 10:28:55 -05:00
parent 01ae7be70d
commit 9a114e2cb9
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -115,8 +115,9 @@ impl FutureMoves {
) -> impl Iterator<Item = usize> {
let start_idx = self.arena.len();
self.arena.extend(
board
.possible_moves(color)
// use [`Board::all_positions`] here instead of [`Board::possible_moves`]
// because we use [`Board::what_if`] later and we want to reduce calls to [`Board::propegate_from_dry`]
Board::all_positions()
.flat_map(|(i, j)| board.what_if(i, j, color).map(|x| (i, j, x)))
.map(|(i, j, (new_board, captured))| Move {
i,