mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00: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:
parent
6becc81446
commit
6e5a334c95
1 changed files with 4 additions and 8 deletions
|
@ -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();
|
|
||||||
if ( relative_rank(c, to_sq(m)) == RANK_7
|
|
||||||
|| pos.pawn_is_passed(c, to_sq(m)))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
// Test for a capture that triggers a pawn endgame
|
// Test for a capture that triggers a pawn endgame
|
||||||
if ( captureOrPromotion
|
if ( captureOrPromotion
|
||||||
|
|
Loading…
Add table
Reference in a new issue