]> git.sesse.net Git - stockfish/commitdiff
Store in TT with depth == -OnePly instead of -1
authorMarco Costalba <mcostalba@gmail.com>
Wed, 18 Aug 2010 14:20:24 +0000 (15:20 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 19 Aug 2010 12:48:26 +0000 (13:48 +0100)
When depth < DEPTH_ZERO we store with the same depth all
the positions, use -OnePly instead of -1 for consistency
with depth arithmetic.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 8c941794bc4f9fbf436e363061acb64e4c630043..032ff4034153e1ed8acc939e1fc39a60b5f0795b 100644 (file)
@@ -1546,7 +1546,7 @@ namespace {
         return value_mated_in(ply);
 
     // Update transposition table
         return value_mated_in(ply);
 
     // Update transposition table
-    Depth d = (depth == DEPTH_ZERO ? DEPTH_ZERO : Depth(-1));
+    Depth d = (depth == DEPTH_ZERO ? DEPTH_ZERO : DEPTH_ZERO - ONE_PLY);
     ValueType vt = (bestValue <= oldAlpha ? VALUE_TYPE_UPPER : bestValue >= beta ? VALUE_TYPE_LOWER : VALUE_TYPE_EXACT);
     TT.store(pos.get_key(), value_to_tt(bestValue, ply), vt, d, ss->bestMove, ss->eval, ei.kingDanger[pos.side_to_move()]);
 
     ValueType vt = (bestValue <= oldAlpha ? VALUE_TYPE_UPPER : bestValue >= beta ? VALUE_TYPE_LOWER : VALUE_TYPE_EXACT);
     TT.store(pos.get_key(), value_to_tt(bestValue, ply), vt, d, ss->bestMove, ss->eval, ei.kingDanger[pos.side_to_move()]);