]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Small code style in qsearch
[stockfish] / src / search.cpp
index fa483fbcd839682d761951c586c1c966c1dcc48b..bd482eaeb769d1a63f6e55c17903e29c797c38bb 100644 (file)
@@ -1434,12 +1434,11 @@ namespace {
             assert(tte->static_value() != VALUE_NONE);
 
             evalMargin = tte->static_value_margin();
-            bestValue = tte->static_value();
+            ss->eval = bestValue = tte->static_value();
         }
         else
-            bestValue = evaluate(pos, evalMargin);
+            ss->eval = bestValue = evaluate(pos, evalMargin);
 
-        ss->eval = bestValue;
         update_gains(pos, (ss-1)->currentMove, (ss-1)->eval, ss->eval);
 
         // Stand pat. Return immediately if static value is at least beta
@@ -1458,7 +1457,7 @@ namespace {
         deepChecks = (depth == -ONE_PLY && bestValue >= beta - PawnValueMidgame / 8);
 
         // Futility pruning parameters, not needed when in check
-        futilityBase = bestValue + FutilityMarginQS + evalMargin;
+        futilityBase = ss->eval + evalMargin + FutilityMarginQS;
         enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMidgame;
     }
 
@@ -1498,11 +1497,10 @@ namespace {
           }
       }
 
-      // Detect blocking evasions that are candidate to be pruned
+      // Detect non-capture evasions that are candidate to be pruned
       evasionPrunable =   isCheck
                        && bestValue > value_mated_in(PLY_MAX)
                        && !pos.move_is_capture(move)
-                       && pos.type_of_piece_on(move_from(move)) != KING
                        && !pos.can_castle(pos.side_to_move());
 
       // Don't search moves with negative SEE values
@@ -1545,11 +1543,6 @@ namespace {
     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, evalMargin);
 
-    // Update killers only for checking moves that fails high
-    if (    bestValue >= beta
-        && !pos.move_is_capture_or_promotion(ss->bestMove))
-        update_killers(ss->bestMove, ss);
-
     assert(bestValue > -VALUE_INFINITE && bestValue < VALUE_INFINITE);
 
     return bestValue;