mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
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:
committed by
Joost VandeVondele
parent
7a3483fa9e
commit
731ad9bbc3
@@ -32,6 +32,7 @@ Antoine Champion (antoinechampion)
|
||||
Aram Tumanian (atumanian)
|
||||
Arjun Temurnikar
|
||||
Aron Petkovski (fury)
|
||||
Arseniy Surkov (codedeliveryservice)
|
||||
Artem Solopiy (EntityFX)
|
||||
Auguste Pop
|
||||
Balazs Szilagyi
|
||||
|
||||
+2
-4
@@ -183,7 +183,6 @@ class Position {
|
||||
Square& rfrom,
|
||||
Square& rto,
|
||||
DirtyPiece* const dp = nullptr);
|
||||
template<bool AfterMove>
|
||||
Key adjust_key50(Key k) const;
|
||||
|
||||
// Data members
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user