]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Remove a wrong FIXME
[stockfish] / src / search.cpp
index 65395b4ec95943171b5bafddde76d4bf0e41c0bb..43b850bd557efbe219f1972744a8f0ea5772af02 100644 (file)
@@ -1148,6 +1148,10 @@ namespace {
         && !value_is_mate(beta)
         && !pos.has_pawn_on_7th(pos.side_to_move()))
     {
+        // Pass ss->eval to qsearch() and avoid an evaluate call
+        if (!tte || tte->static_value() == VALUE_NONE)
+            TT.store(posKey, ss->eval, VALUE_TYPE_EXACT, Depth(-127*OnePly), MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]);
+
         Value rbeta = beta - razor_margin(depth);
         Value v = qsearch<NonPV>(pos, ss, rbeta-1, rbeta, Depth(0));
         if (v < rbeta)
@@ -1530,7 +1534,7 @@ namespace {
         // Stand pat. Return immediately if static value is at least beta
         if (bestValue >= beta)
         {
-            if (!tte) // FIXME, remove condition
+            if (!tte)
                 TT.store(pos.get_key(), value_to_tt(bestValue, ply), VALUE_TYPE_LOWER, Depth(-127*OnePly), MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]);
 
             return bestValue;