Skip to content

Commit

Permalink
Remove a superfluous subtrahend
Browse files Browse the repository at this point in the history
The '- 1' subtrahend was introduced for guarding against null move
search at root, which would be nonsense. But this is actually already
guaranteed by the !PvNode condition. This followed from the discussion
in pull request 1609: #1609

No functional change
  • Loading branch information
pb00068 authored and snicolet committed Jun 5, 2018
1 parent 6b5d671 commit b939788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/search.cpp
Expand Up @@ -751,7 +751,7 @@ namespace {
&& ss->staticEval >= beta - 36 * depth / ONE_PLY + 225
&& !excludedMove
&& pos.non_pawn_material(us)
&& (ss->ply > thisThread->nmpMinPly || us != thisThread->nmpColor))
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
{
assert(eval - beta >= 0);

Expand Down Expand Up @@ -780,7 +780,7 @@ namespace {

// Do verification search at high depths, with null move pruning disabled
// for us, until ply exceeds nmpMinPly.
thisThread->nmpMinPly = ss->ply + 3 * (depth-R) / 4 - 1;
thisThread->nmpMinPly = ss->ply + 3 * (depth-R) / 4;
thisThread->nmpColor = us;

Value v = search<NonPV>(pos, ss, beta-1, beta, depth-R, false);
Expand Down

0 comments on commit b939788

Please sign in to comment.