From 2170fa18bf59f977138f9de2389cbfdd85d84415 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 6 Aug 2010 22:30:50 +0100 Subject: [PATCH 1/1] Move depth computation out of fail low loop In root_search() we can compute depth at the beginning once and for all. Spotted by Ralph Stoesser. No functional change. Signed-off-by: Marco Costalba --- src/search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index 2ab98397..fff00026 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -715,6 +715,7 @@ namespace { alpha = *alphaPtr; beta = *betaPtr; isCheck = pos.is_check(); + depth = (Iteration - 2) * OnePly + InitialDepth; // Step 1. Initialize node (polling is omitted at root) ss->currentMove = ss->bestMove = MOVE_NONE; @@ -764,7 +765,6 @@ namespace { captureOrPromotion = pos.move_is_capture_or_promotion(move); // Step 11. Decide the new search depth - depth = (Iteration - 2) * OnePly + InitialDepth; ext = extension(pos, move, captureOrPromotion, moveIsCheck, false, false, &dangerous); newDepth = depth + ext; -- 2.39.2