]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Simplify aspiration window code
[stockfish] / src / search.cpp
index fc94f4f79347dfc14dc6fe5e186c90ca3a1d0fac..15a9cde5b706914ffe1904ca74d060769ff892c2 100644 (file)
@@ -364,8 +364,6 @@ namespace {
                 if (Signals.stop)
                     return;
 
-                delta += delta / 2;
-
                 // In case of failing low/high increase aspiration window and
                 // research, otherwise exit the loop.
                 if (bestValue <= alpha)
@@ -381,6 +379,8 @@ namespace {
                 else
                     break;
 
+                delta += delta / 2;
+
                 assert(alpha >= -VALUE_INFINITE && beta <= VALUE_INFINITE);
 
                 // Give some update (without cluttering the UI) before to research
@@ -811,12 +811,7 @@ split_point_start: // At split points actual search starts from here
       givesCheck = pos.move_gives_check(move, ci);
       dangerous =   givesCheck
                  || pos.is_passed_pawn_push(move)
-                 || type_of(move) == CASTLE
-                 || (   captureOrPromotion // Entering a pawn endgame?
-                     && type_of(pos.piece_on(to_sq(move))) != PAWN
-                     && type_of(move) == NORMAL
-                     && (  pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK)
-                         - PieceValue[MG][pos.piece_on(to_sq(move))] == VALUE_ZERO));
+                 || type_of(move) == CASTLE;
 
       // Step 12. Extend checks and, in PV nodes, also dangerous moves
       if (PvNode && dangerous)