1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

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 <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-08-06 22:30:50 +01:00
parent be540b6dd7
commit 2170fa18bf

View file

@ -715,6 +715,7 @@ namespace {
alpha = *alphaPtr; alpha = *alphaPtr;
beta = *betaPtr; beta = *betaPtr;
isCheck = pos.is_check(); isCheck = pos.is_check();
depth = (Iteration - 2) * OnePly + InitialDepth;
// Step 1. Initialize node (polling is omitted at root) // Step 1. Initialize node (polling is omitted at root)
ss->currentMove = ss->bestMove = MOVE_NONE; ss->currentMove = ss->bestMove = MOVE_NONE;
@ -764,7 +765,6 @@ namespace {
captureOrPromotion = pos.move_is_capture_or_promotion(move); captureOrPromotion = pos.move_is_capture_or_promotion(move);
// Step 11. Decide the new search depth // Step 11. Decide the new search depth
depth = (Iteration - 2) * OnePly + InitialDepth;
ext = extension<PV>(pos, move, captureOrPromotion, moveIsCheck, false, false, &dangerous); ext = extension<PV>(pos, move, captureOrPromotion, moveIsCheck, false, false, &dangerous);
newDepth = depth + ext; newDepth = depth + ext;