mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
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 <mcostalba@gmail.com>
This commit is contained in:
@@ -171,14 +171,10 @@ namespace {
|
|||||||
// 'dangerous' moves so that we avoid to prune it.
|
// 'dangerous' moves so that we avoid to prune it.
|
||||||
FORCE_INLINE bool is_dangerous(const Position& pos, Move m, bool captureOrPromotion) {
|
FORCE_INLINE bool is_dangerous(const Position& pos, Move m, bool captureOrPromotion) {
|
||||||
|
|
||||||
// Test for a pawn pushed to 7th or a passed pawn move
|
// Test for a passed pawn move
|
||||||
if (type_of(pos.piece_moved(m)) == PAWN)
|
if ( type_of(pos.piece_moved(m)) == PAWN
|
||||||
{
|
&& pos.pawn_is_passed(pos.side_to_move(), to_sq(m)))
|
||||||
Color c = pos.side_to_move();
|
return true;
|
||||||
if ( relative_rank(c, to_sq(m)) == RANK_7
|
|
||||||
|| pos.pawn_is_passed(c, to_sq(m)))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test for a capture that triggers a pawn endgame
|
// Test for a capture that triggers a pawn endgame
|
||||||
if ( captureOrPromotion
|
if ( captureOrPromotion
|
||||||
|
|||||||
Reference in New Issue
Block a user