From: Marco Costalba Date: Fri, 6 Aug 2010 21:30:50 +0000 (+0100) Subject: Move depth computation out of fail low loop X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=2170fa18bf59f977138f9de2389cbfdd85d84415;hp=be540b6dd73eab00444c068fad707e88b223d608 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 --- 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;