From 9a114e2cb92c9c209e3b53f2ae992cd23d68b8df Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 12 Feb 2025 10:28:55 -0500 Subject: [PATCH] remove extra call to `propegate_from_dry` --- src/complexagent.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/complexagent.rs b/src/complexagent.rs index 119fb0b..8d12813 100644 --- a/src/complexagent.rs +++ b/src/complexagent.rs @@ -115,8 +115,9 @@ impl FutureMoves { ) -> impl Iterator { 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,