Skip to content

Commit

Permalink
Small tweaks to recent code changes
Browse files Browse the repository at this point in the history
As a note, current 2 LMR conditions on stat score
could be simplified in a single line:

r -= ((ss->statScore >= 0) - ((ss-1)->statScore >= 0)) * ONE_PLY;

We keep them splitted in 2 "if" statements because are easier
to (immediately) read.

No functional change.
  • Loading branch information
mcostalba authored and snicolet committed Jul 31, 2018
1 parent 9afa03b commit fae5727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ namespace {
int lmrDepth = std::max(newDepth - reduction<PvNode>(improving, depth, moveCount), DEPTH_ZERO) / ONE_PLY;

// Countermoves based pruning (~20 Elo)
if ( lmrDepth <= ((ss-1)->statScore > 0 ? 3 : 2)
if ( lmrDepth < 3 + ((ss-1)->statScore > 0)
&& (*contHist[0])[movedPiece][to_sq(move)] < CounterMovePruneThreshold
&& (*contHist[1])[movedPiece][to_sq(move)] < CounterMovePruneThreshold)
continue;
Expand Down

0 comments on commit fae5727

Please sign in to comment.