]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Super fast hidden_checkers()
[stockfish] / src / position.h
index 8e29eb13458390ff2d4a405ffd61cebd794f46ee..ac63c11c36e612a09aa59b4e779b39bc1c74fb2e 100644 (file)
@@ -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;
 }