mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 07:27:46 +00:00
Use CheckInfo to store pinned bitboard
This trivial change gives an impressive 2,5% speedup !!!! Also retire one unused move_gives_check() overload. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+5
-9
@@ -90,13 +90,14 @@ CheckInfo::CheckInfo(const Position& pos) {
|
||||
|
||||
ksq = pos.king_square(them);
|
||||
dcCandidates = pos.discovered_check_candidates(us);
|
||||
pinned = pos.pinned_pieces(us);
|
||||
|
||||
checkSq[PAWN] = pos.attacks_from<PAWN>(ksq, them);
|
||||
checkSq[PAWN] = pos.attacks_from<PAWN>(ksq, them);
|
||||
checkSq[KNIGHT] = pos.attacks_from<KNIGHT>(ksq);
|
||||
checkSq[BISHOP] = pos.attacks_from<BISHOP>(ksq);
|
||||
checkSq[ROOK] = pos.attacks_from<ROOK>(ksq);
|
||||
checkSq[QUEEN] = checkSq[BISHOP] | checkSq[ROOK];
|
||||
checkSq[KING] = EmptyBoardBB;
|
||||
checkSq[ROOK] = pos.attacks_from<ROOK>(ksq);
|
||||
checkSq[QUEEN] = checkSq[BISHOP] | checkSq[ROOK];
|
||||
checkSq[KING] = EmptyBoardBB;
|
||||
}
|
||||
|
||||
|
||||
@@ -746,11 +747,6 @@ bool Position::move_is_pl(const Move m) const {
|
||||
|
||||
/// Position::move_gives_check() tests whether a pseudo-legal move is a check
|
||||
|
||||
bool Position::move_gives_check(Move m) const {
|
||||
|
||||
return move_gives_check(m, CheckInfo(*this));
|
||||
}
|
||||
|
||||
bool Position::move_gives_check(Move m, const CheckInfo& ci) const {
|
||||
|
||||
assert(is_ok());
|
||||
|
||||
Reference in New Issue
Block a user