]> git.sesse.net Git - stockfish/commitdiff
Remove dead code in search
authorMarco Costalba <mcostalba@gmail.com>
Thu, 1 May 2014 05:44:32 +0000 (07:44 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 1 May 2014 05:46:44 +0000 (07:46 +0200)
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.

src/search.cpp

index 0068cbcac2e609079da443003ca267a87745c933..3d18e6d2c709eded247e0b8af5d2ec53b5fed288 100644 (file)
@@ -1017,10 +1017,6 @@ moves_loop: // When in check and at SpNode search starts from here
         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,