Simplify adjust_key50 template

Remove the AfterMove template from the adjust_key50 function, which is only ever called with false.

closes https://github.com/official-stockfish/Stockfish/pull/6278

No functional change
This commit is contained in:
Arseniy Surkov
2025-08-30 15:17:57 +02:00
committed by Joost VandeVondele
parent 7a3483fa9e
commit 731ad9bbc3
2 changed files with 4 additions and 5 deletions
+3 -5
View File
@@ -183,8 +183,7 @@ class Position {
Square& rfrom,
Square& rto,
DirtyPiece* const dp = nullptr);
template<bool AfterMove>
Key adjust_key50(Key k) const;
Key adjust_key50(Key k) const;
// Data members
Piece board[SQUARE_NB];
@@ -283,11 +282,10 @@ inline Bitboard Position::pinners(Color c) const { return st->pinners[c]; }
inline Bitboard Position::check_squares(PieceType pt) const { return st->checkSquares[pt]; }
inline Key Position::key() const { return adjust_key50<false>(st->key); }
inline Key Position::key() const { return adjust_key50(st->key); }
template<bool AfterMove>
inline Key Position::adjust_key50(Key k) const {
return st->rule50 < 14 - AfterMove ? k : k ^ make_key((st->rule50 - (14 - AfterMove)) / 8);
return st->rule50 < 14 ? k : k ^ make_key((st->rule50 - 14) / 8);
}
inline Key Position::pawn_key() const { return st->pawnKey; }