mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 02:57:11 +08:00
Simplify a condition in search()
And rearrange best value update in case of SpNode. No functional change.
This commit is contained in:
@@ -902,7 +902,7 @@ split_point_start: // At split points actual search starts from here
|
||||
continue;
|
||||
}
|
||||
|
||||
pvMove = PvNode ? moveCount == 1 : false;
|
||||
pvMove = PvNode && moveCount == 1;
|
||||
ss->currentMove = move;
|
||||
if (!SpNode && !captureOrPromotion && playedMoveCount < 64)
|
||||
movesSearched[playedMoveCount++] = move;
|
||||
@@ -994,24 +994,21 @@ split_point_start: // At split points actual search starts from here
|
||||
|
||||
if (value > bestValue)
|
||||
{
|
||||
bestValue = value;
|
||||
if (SpNode) sp->bestValue = value;
|
||||
bestValue = SpNode ? sp->bestValue = value : value;
|
||||
|
||||
if (value > alpha)
|
||||
{
|
||||
bestMove = move;
|
||||
if (SpNode) sp->bestMove = move;
|
||||
bestMove = SpNode ? sp->bestMove = move : move;
|
||||
|
||||
if (PvNode && value < beta)
|
||||
{
|
||||
alpha = value; // Update alpha here! Always alpha < beta
|
||||
if (SpNode) sp->alpha = value;
|
||||
}
|
||||
if (PvNode && value < beta) // Update alpha! Always alpha < beta
|
||||
alpha = SpNode ? sp->alpha = value : value;
|
||||
else
|
||||
{
|
||||
assert(value >= beta); // Fail high
|
||||
|
||||
if (SpNode) sp->cutoff = true;
|
||||
if (SpNode)
|
||||
sp->cutoff = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user