From 02ebad55af6c76ac9e36832f9be041f547f63b7c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 21 Feb 2023 03:24:17 +0300 Subject: perf: check depth == 0 as early as possible --- src/board/engine.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/board/engine.rs b/src/board/engine.rs index 1516784..ad2b3b2 100644 --- a/src/board/engine.rs +++ b/src/board/engine.rs @@ -370,13 +370,13 @@ impl Board { None => {}, } - let mut moves = self.generate_pseudolegal_moves(color); - moves = self.order_moves(moves, parent_killers.to_vec()); - if depth_left == 0 { return (self.quiscence(alpha, beta), principal_variation); } + let mut moves = self.generate_pseudolegal_moves(color); + moves = self.order_moves(moves, parent_killers.to_vec()); + let mut should_pv_search = true; let mut legal_move_found = false; for mov in moves { -- cgit v1.2.3