mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 02:27:00 +08:00
apply if constexpr to additional instances
as a form of documentation, and a hint to the compiler. closes https://github.com/official-stockfish/Stockfish/pull/4345 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
734315ff30
commit
a2038c1a01
@@ -388,10 +388,10 @@ namespace {
|
||||
template<Tracing T> template<Color Us, PieceType Pt>
|
||||
Score Evaluation<T>::pieces() {
|
||||
|
||||
constexpr Color Them = ~Us;
|
||||
constexpr Direction Down = -pawn_push(Us);
|
||||
constexpr Bitboard OutpostRanks = (Us == WHITE ? Rank4BB | Rank5BB | Rank6BB
|
||||
: Rank5BB | Rank4BB | Rank3BB);
|
||||
constexpr Color Them = ~Us;
|
||||
[[maybe_unused]] constexpr Direction Down = -pawn_push(Us);
|
||||
[[maybe_unused]] constexpr Bitboard OutpostRanks = (Us == WHITE ? Rank4BB | Rank5BB | Rank6BB
|
||||
: Rank5BB | Rank4BB | Rank3BB);
|
||||
Bitboard b1 = pos.pieces(Us, Pt);
|
||||
Bitboard b, bb;
|
||||
Score score = SCORE_ZERO;
|
||||
@@ -430,7 +430,7 @@ namespace {
|
||||
int mob = popcount(b & mobilityArea[Us]);
|
||||
mobility[Us] += MobilityBonus[Pt - 2][mob];
|
||||
|
||||
if (Pt == BISHOP || Pt == KNIGHT)
|
||||
if constexpr (Pt == BISHOP || Pt == KNIGHT)
|
||||
{
|
||||
// Bonus if the piece is on an outpost square or can reach one
|
||||
// Bonus for knights (UncontestedOutpost) if few relevant targets
|
||||
|
||||
Reference in New Issue
Block a user