]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Don't log search info after a stop
[stockfish] / src / search.cpp
index fa12ee7109c77ad66b4f02eb8b65acc6379205a8..479710784021fc2e3daee473309d5ca20b897ce9 100644 (file)
@@ -467,7 +467,7 @@ namespace {
         if (SkillLevelEnabled && depth == 1 + SkillLevel)
             skillBest = do_skill_level();
 
-        if (Options["Use Search Log"])
+        if (!Signals.stop && Options["Use Search Log"])
              pv_info_to_log(pos, depth, bestValue, elapsed_time(), &RootMoves[0].pv[0]);
 
         // Filter out startup noise when monitoring best move stability
@@ -1363,8 +1363,7 @@ split_point_start: // At split points actual search starts from here
         return true;
 
     // Rule 2. Queen contact check is very dangerous
-    if (   type_of(pc) == QUEEN
-        && bit_is_set(kingAtt, to))
+    if (type_of(pc) == QUEEN && (kingAtt & to))
         return true;
 
     // Rule 3. Creating new double threats with checks
@@ -1419,23 +1418,21 @@ split_point_start: // At split points actual search starts from here
 
     // Case 3: Moving through the vacated square
     p2 = pos.piece_on(f2);
-    if (   piece_is_slider(p2)
-        && bit_is_set(squares_between(f2, t2), f1))
+    if (piece_is_slider(p2) && (squares_between(f2, t2) & f1))
       return true;
 
     // Case 4: The destination square for m2 is defended by the moving piece in m1
     p1 = pos.piece_on(t1);
-    if (bit_is_set(pos.attacks_from(p1, t1), t2))
+    if (pos.attacks_from(p1, t1) & t2)
         return true;
 
     // Case 5: Discovered check, checking piece is the piece moved in m1
     ksq = pos.king_square(pos.side_to_move());
-    if (    piece_is_slider(p1)
-        &&  bit_is_set(squares_between(t1, ksq), f2))
+    if (piece_is_slider(p1) && (squares_between(t1, ksq) & f2))
     {
         Bitboard occ = pos.occupied_squares();
-        xor_bit(&occ, f2);
-        if (bit_is_set(pos.attacks_from(p1, t1, occ), ksq))
+        occ ^= f2;
+        if (pos.attacks_from(p1, t1, occ) & ksq)
             return true;
     }
     return false;
@@ -1505,9 +1502,9 @@ split_point_start: // At split points actual search starts from here
 
     // Case 3: If the moving piece in the threatened move is a slider, don't
     // prune safe moves which block its ray.
-    if (   piece_is_slider(pos.piece_on(tfrom))
-        && bit_is_set(squares_between(tfrom, tto), mto)
-        && pos.see_sign(m) >= 0)
+    if (    piece_is_slider(pos.piece_on(tfrom))
+        && (squares_between(tfrom, tto) & mto)
+        &&  pos.see_sign(m) >= 0)
         return true;
 
     return false;