Skip to content

Commit c052e03

Browse files
lucasartzamar
authored andcommitted
Retire dangerous flag
Replace by its value where it is used. Code is more clear that way. No functional change. Resolves #402
1 parent 69a1a80 commit c052e03

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/search.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ namespace {
531531
Depth extension, newDepth, predictedDepth;
532532
Value bestValue, value, ttValue, eval, nullValue, futilityValue;
533533
bool ttHit, inCheck, givesCheck, singularExtensionNode, improving;
534-
bool captureOrPromotion, dangerous, doFullDepthSearch;
534+
bool captureOrPromotion, doFullDepthSearch;
535535
int moveCount, quietCount;
536536

537537
// Step 1. Initialize node
@@ -847,10 +847,6 @@ namespace {
847847
? ci.checkSquares[type_of(pos.piece_on(from_sq(move)))] & to_sq(move)
848848
: pos.gives_check(move, ci);
849849

850-
dangerous = givesCheck
851-
|| type_of(move) != NORMAL
852-
|| pos.advanced_pawn_push(move);
853-
854850
// Step 12. Extend checks
855851
if (givesCheck && pos.see_sign(move) >= VALUE_ZERO)
856852
extension = ONE_PLY;
@@ -883,7 +879,9 @@ namespace {
883879
if ( !RootNode
884880
&& !captureOrPromotion
885881
&& !inCheck
886-
&& !dangerous
882+
&& !givesCheck
883+
&& type_of(move) == NORMAL
884+
&& !pos.advanced_pawn_push(move)
887885
&& bestValue > VALUE_MATED_IN_MAX_PLY)
888886
{
889887
// Move count based pruning

0 commit comments

Comments
 (0)