Skip to content

Commit

Permalink
Remove dead code in search
Browse files Browse the repository at this point in the history
We can never have bestValue == -VALUE_INFINITE at
the end of move loop because if no legal move exists
we detect it with previous condition on !moveCount,
if a legal move exists we never prune it due to
futility pruning condition:

bestValue > VALUE_MATED_IN_MAX_PLY

So this code never executes, as I have also verified
directly.

Issue reported by Joona.

No functional change.
  • Loading branch information
mcostalba committed May 1, 2014
1 parent cf50e26 commit 626dc8a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/search.cpp
Expand Up @@ -1017,10 +1017,6 @@ namespace {
return excludedMove ? alpha
: inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()];

// If we have pruned all the moves without searching return a fail-low score
if (bestValue == -VALUE_INFINITE)
bestValue = alpha;

TT.store(posKey, value_to_tt(bestValue, ss->ply),
bestValue >= beta ? BOUND_LOWER :
PvNode && bestMove ? BOUND_EXACT : BOUND_UPPER,
Expand Down

0 comments on commit 626dc8a

Please sign in to comment.