From 5c3884653e2374e7138476f6ae21c9226417b7f6 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 27 Feb 2025 21:39:25 -0500 Subject: [PATCH] move around if statement in prune_bad_children --- src/logic/future_moves.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index 70d0e63..cba8ba5 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -330,11 +330,6 @@ impl FutureMoves { } fn prune_bad_children(&mut self) { - // values are needed in order to prune and see what's best - self.compute_values(0..self.arena_len()); - - let by_depth = self.by_depth(0..self.arena.len()); - if self .config .max_depth @@ -344,6 +339,11 @@ impl FutureMoves { return; } + // values are needed in order to prune and see what's best + self.compute_values(0..self.arena_len()); + + let by_depth = self.by_depth(0..self.arena.len()); + for (depth, indexes) in by_depth { // TODO! maybe update by_depth every iteration or something? if depth > self.current_depth.saturating_sub(self.config.up_to_minus) {