aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-02-21 03:24:17 +0300
committereug-vs <eugene@eug-vs.xyz>2023-02-21 03:24:17 +0300
commit02ebad55af6c76ac9e36832f9be041f547f63b7c (patch)
treeb8b5a2195b434e5850287a913d3e2458b16b68b6
parentfa6f6c3f5f8f872a216ccdb593492775c0d265a1 (diff)
downloadchessnost-02ebad55af6c76ac9e36832f9be041f547f63b7c.tar.gz
perf: check depth == 0 as early as possible
-rw-r--r--src/board/engine.rs6
1 files 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 {