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

Every node is responsible for initializing its own SearchStack entry

More logical than doing partly initialization at init_ss_array()

No functional change

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Joona Kiiski 2010-07-18 23:54:40 +03:00 committed by Marco Costalba
parent 66c5835080
commit b75e68860c

View file

@ -760,7 +760,9 @@ namespace {
beta = *betaPtr; beta = *betaPtr;
isCheck = pos.is_check(); isCheck = pos.is_check();
// Step 1. Initialize node and poll (omitted at root, init_ss_array() has already initialized root node) // Step 1. Initialize node (polling is omitted at root)
ss->init();
// Step 2. Check for aborted search (omitted at root) // Step 2. Check for aborted search (omitted at root)
// Step 3. Mate distance pruning (omitted at root) // Step 3. Mate distance pruning (omitted at root)
// Step 4. Transposition table lookup (omitted at root) // Step 4. Transposition table lookup (omitted at root)
@ -2208,12 +2210,9 @@ namespace {
ss->reduction = Depth(0); ss->reduction = Depth(0);
if (i < 3) if (i < 3)
{
ss->init();
ss->initKillers(); ss->initKillers();
} }
} }
}
// wait_for_stop_or_ponderhit() is called when the maximum depth is reached // wait_for_stop_or_ponderhit() is called when the maximum depth is reached
@ -2747,6 +2746,7 @@ namespace {
// Find a quick score for the move // Find a quick score for the move
init_ss_array(ss, PLY_MAX_PLUS_2); init_ss_array(ss, PLY_MAX_PLUS_2);
ss[0].init();
ss[0].eval = VALUE_NONE; ss[0].eval = VALUE_NONE;
ss[0].currentMove = cur->move; ss[0].currentMove = cur->move;
pos.do_move(cur->move, st); pos.do_move(cur->move, st);