mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 18:46:59 +08:00
Remove redundant king square parameter
We don't need to pass the king square as an explicit parameter to the functions king_safety() and do_king_safety() since we already pass in the position. STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 69686 W: 14894 L: 14866 D: 39926 http://tests.stockfishchess.org/tests/view/5be84ac20ebc595e0ae3283c No functional change.
This commit is contained in:
committed by
Stéphane Nicolet
parent
30a905c95d
commit
68209c9121
@@ -237,8 +237,9 @@ Value Entry::evaluate_shelter(const Position& pos, Square ksq) {
|
||||
/// when king square changes, which is about 20% of total king_safety() calls.
|
||||
|
||||
template<Color Us>
|
||||
Score Entry::do_king_safety(const Position& pos, Square ksq) {
|
||||
Score Entry::do_king_safety(const Position& pos) {
|
||||
|
||||
Square ksq = pos.square<KING>(Us);
|
||||
kingSquares[Us] = ksq;
|
||||
castlingRights[Us] = pos.can_castle(Us);
|
||||
int minKingPawnDistance = 0;
|
||||
@@ -260,7 +261,7 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) {
|
||||
}
|
||||
|
||||
// Explicit template instantiation
|
||||
template Score Entry::do_king_safety<WHITE>(const Position& pos, Square ksq);
|
||||
template Score Entry::do_king_safety<BLACK>(const Position& pos, Square ksq);
|
||||
template Score Entry::do_king_safety<WHITE>(const Position& pos);
|
||||
template Score Entry::do_king_safety<BLACK>(const Position& pos);
|
||||
|
||||
} // namespace Pawns
|
||||
|
||||
Reference in New Issue
Block a user