From: Marco Costalba Date: Fri, 13 Jul 2012 08:54:24 +0000 (+0200) Subject: Remove redundant condition in is_dangerous() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=6e5a334c9502fde4a3da88a615f10181a2ab7367 Remove redundant condition in is_dangerous() A pawn on 7th is always passed so retire this redundant condition. No funtional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 9478ef17..4b189933 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -171,14 +171,10 @@ namespace { // 'dangerous' moves so that we avoid to prune it. FORCE_INLINE bool is_dangerous(const Position& pos, Move m, bool captureOrPromotion) { - // Test for a pawn pushed to 7th or a passed pawn move - if (type_of(pos.piece_moved(m)) == PAWN) - { - Color c = pos.side_to_move(); - if ( relative_rank(c, to_sq(m)) == RANK_7 - || pos.pawn_is_passed(c, to_sq(m))) - return true; - } + // Test for a passed pawn move + if ( type_of(pos.piece_moved(m)) == PAWN + && pos.pawn_is_passed(pos.side_to_move(), to_sq(m))) + return true; // Test for a capture that triggers a pawn endgame if ( captureOrPromotion