mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Small cleanups
closes https://github.com/official-stockfish/Stockfish/pull/2628 No functional change
This commit is contained in:
@@ -740,7 +740,7 @@ namespace {
|
||||
// Now apply the bonus: note that we find the attacking side by extracting the
|
||||
// sign of the midgame or endgame values, and that we carefully cap the bonus
|
||||
// so that the midgame and endgame scores do not change sign after the bonus.
|
||||
int u = ((mg > 0) - (mg < 0)) * std::max(std::min(complexity + 50, 0), -abs(mg));
|
||||
int u = ((mg > 0) - (mg < 0)) * Utility::clamp(complexity + 50, -abs(mg), 0);
|
||||
int v = ((eg > 0) - (eg < 0)) * std::max(complexity, -abs(eg));
|
||||
|
||||
if (T)
|
||||
@@ -815,7 +815,8 @@ namespace {
|
||||
initialize<WHITE>();
|
||||
initialize<BLACK>();
|
||||
|
||||
// Pieces should be evaluated first (populate attack tables)
|
||||
// Pieces evaluated first (also populates attackedBy, attackedBy2).
|
||||
// Note that the order of evaluation of the terms is left unspecified
|
||||
score += pieces<WHITE, KNIGHT>() - pieces<BLACK, KNIGHT>()
|
||||
+ pieces<WHITE, BISHOP>() - pieces<BLACK, BISHOP>()
|
||||
+ pieces<WHITE, ROOK >() - pieces<BLACK, ROOK >()
|
||||
@@ -823,6 +824,7 @@ namespace {
|
||||
|
||||
score += mobility[WHITE] - mobility[BLACK];
|
||||
|
||||
// More complex interactions that require fully populated attack bitboards
|
||||
score += king< WHITE>() - king< BLACK>()
|
||||
+ threats<WHITE>() - threats<BLACK>()
|
||||
+ passed< WHITE>() - passed< BLACK>()
|
||||
|
||||
Reference in New Issue
Block a user