]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Index en-passant zobrist keys by file
[stockfish] / src / position.h
index 8229e71b4a1a4e8c3c66f7cdcd12cbaa580635b2..7db5fa453ff9e644b1a9806e26b917a9861c5e63 100644 (file)
@@ -257,7 +257,7 @@ private:
   // Static variables
   static Score pieceSquareTable[16][64]; // [piece][square]
   static Key zobrist[2][8][64];          // [color][pieceType][square]/[piece count]
-  static Key zobEp[64];                  // [square]
+  static Key zobEp[8];                   // [file]
   static Key zobCastle[16];              // [castleRight]
   static Key zobSideToMove;
   static Key zobExclusion;
@@ -345,10 +345,9 @@ inline Square Position::castle_rook_square(CastleRight f) const {
 
 template<PieceType Pt>
 inline Bitboard Position::attacks_from(Square s) const {
-  return  Pt == BISHOP ? bishop_attacks_bb(s, occupied_squares())
-        : Pt == ROOK   ? rook_attacks_bb(s, occupied_squares())
+  return  Pt == BISHOP || Pt == ROOK ? attacks_bb<Pt>(s, occupied_squares())
         : Pt == QUEEN  ? attacks_from<ROOK>(s) | attacks_from<BISHOP>(s)
-                       : StepAttacksBB[Pt][s];
+        : StepAttacksBB[Pt][s];
 }
 
 template<>