Retire attackers_to(Square s, Color c)

Use the definition in the few places where is needed.

As a nice side effect there is also an optimization in
generate_evasions() where the bitboard of enemy pieces
is computed only once and out of a tight loop.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-09-20 10:47:59 +01:00
parent 6845397c5c
commit 84d6fe0f31
3 changed files with 16 additions and 21 deletions
-6
View File
@@ -197,7 +197,6 @@ public:
// Information about attacks to or from a given square
Bitboard attackers_to(Square s) const;
Bitboard attackers_to(Square s, Color c) const;
Bitboard piece_attacks_from(Piece p, Square s) const;
Bitboard pawn_attacks_from(Square s, Color c) const;
template<PieceType> Bitboard piece_attacks_from(Square s) const;
@@ -470,11 +469,6 @@ inline bool Position::is_check() const {
return st->checkersBB != EmptyBoardBB;
}
inline Bitboard Position::attackers_to(Square s, Color c) const {
return attackers_to(s) & pieces_of_color(c);
}
inline bool Position::pawn_is_passed(Color c, Square s) const {
return !(pieces(PAWN, opposite_color(c)) & passed_pawn_mask(c, s));
}