Skip to content

Commit 464ebdf

Browse files
Vizvezdenecvondele
authored andcommitted
Small cleanup
In search remove one condition check and reorder conditions. Removes some code. Passed non-regression test: https://tests.stockfishchess.org/tests/view/64548fa06206ee34ebf853ad LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 282976 W: 75327 L: 75374 D: 132275 Ptnml(0-2): 604, 29673, 80995, 29598, 618 closes #4557 No functional change
1 parent 2844219 commit 464ebdf

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/search.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,13 @@ namespace {
13101310
if (PvNode && !rootNode) // Update pv even in fail-high case
13111311
update_pv(ss->pv, move, (ss+1)->pv);
13121312

1313-
if (PvNode && value < beta) // Update alpha! Always alpha < beta
1313+
if (value >= beta)
1314+
{
1315+
ss->cutoffCnt += 1 + !ttMove;
1316+
assert(value >= beta); // Fail high
1317+
break;
1318+
}
1319+
else
13141320
{
13151321
// Reduce other moves if we have found at least one score improvement (~1 Elo)
13161322
if ( depth > 1
@@ -1319,13 +1325,7 @@ namespace {
13191325
depth -= 1;
13201326

13211327
assert(depth > 0);
1322-
alpha = value;
1323-
}
1324-
else
1325-
{
1326-
ss->cutoffCnt += 1 + !ttMove;
1327-
assert(value >= beta); // Fail high
1328-
break;
1328+
alpha = value; // Update alpha! Always alpha < beta
13291329
}
13301330
}
13311331
}

0 commit comments

Comments
 (0)