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