remove extra call to propegate_from_dry
This commit is contained in:
parent
01ae7be70d
commit
9a114e2cb9
@ -115,8 +115,9 @@ impl FutureMoves {
|
|||||||
) -> impl Iterator<Item = usize> {
|
) -> impl Iterator<Item = usize> {
|
||||||
let start_idx = self.arena.len();
|
let start_idx = self.arena.len();
|
||||||
self.arena.extend(
|
self.arena.extend(
|
||||||
board
|
// use [`Board::all_positions`] here instead of [`Board::possible_moves`]
|
||||||
.possible_moves(color)
|
// 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)))
|
.flat_map(|(i, j)| board.what_if(i, j, color).map(|x| (i, j, x)))
|
||||||
.map(|(i, j, (new_board, captured))| Move {
|
.map(|(i, j, (new_board, captured))| Move {
|
||||||
i,
|
i,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user