mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Super fast hidden_checkers()
Rewritten hidden_checkers() to avoid calling sliders attacks functions but just a much faster squares_between() Also a good code semplification. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -312,8 +312,8 @@ private:
|
||||
template<PieceType Piece>
|
||||
void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates);
|
||||
|
||||
template<PieceType Piece, bool FindPinned>
|
||||
Bitboard hidden_checks(Color c, Square ksq, Bitboard& pinners) const;
|
||||
template<bool FindPinned>
|
||||
Bitboard hidden_checkers(Color c) const;
|
||||
|
||||
// Computing hash keys from scratch (for initialization and debugging)
|
||||
Key compute_key() const;
|
||||
@@ -566,6 +566,14 @@ inline Bitboard Position::checkers() const {
|
||||
return st->checkersBB;
|
||||
}
|
||||
|
||||
inline Bitboard Position::pinned_pieces(Color c) const {
|
||||
return hidden_checkers<true>(c);
|
||||
}
|
||||
|
||||
inline Bitboard Position::discovered_check_candidates(Color c) const {
|
||||
return hidden_checkers<false>(c);
|
||||
}
|
||||
|
||||
inline bool Position::is_check() const {
|
||||
return st->checkersBB != EmptyBoardBB;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user