mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Assorted trivial cleanups (July 2019)
No functional change
This commit is contained in:
committed by
Stéphane Nicolet
parent
66a3c2968b
commit
7efc39d683
@@ -505,9 +505,6 @@ namespace {
|
||||
// Enemies not strongly protected and under our attack
|
||||
weak = pos.pieces(Them) & ~stronglyProtected & attackedBy[Us][ALL_PIECES];
|
||||
|
||||
// Safe or protected squares
|
||||
safe = ~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES];
|
||||
|
||||
// Bonus according to the kind of attacking pieces
|
||||
if (defended | weak)
|
||||
{
|
||||
@@ -544,6 +541,14 @@ namespace {
|
||||
|
||||
score += RestrictedPiece * popcount(b);
|
||||
|
||||
// Protected or unattacked squares
|
||||
safe = ~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES];
|
||||
|
||||
// Bonus for attacking enemy pieces with our relatively safe pawns
|
||||
b = pos.pieces(Us, PAWN) & safe;
|
||||
b = pawn_attacks_bb<Us>(b) & nonPawnEnemies;
|
||||
score += ThreatBySafePawn * popcount(b);
|
||||
|
||||
// Find squares where our pawns can push on the next move
|
||||
b = shift<Up>(pos.pieces(Us, PAWN)) & ~pos.pieces();
|
||||
b |= shift<Up>(b & TRank3BB) & ~pos.pieces();
|
||||
@@ -555,12 +560,6 @@ namespace {
|
||||
b = pawn_attacks_bb<Us>(b) & nonPawnEnemies;
|
||||
score += ThreatByPawnPush * popcount(b);
|
||||
|
||||
// Our safe or protected pawns
|
||||
b = pos.pieces(Us, PAWN) & safe;
|
||||
|
||||
b = pawn_attacks_bb<Us>(b) & nonPawnEnemies;
|
||||
score += ThreatBySafePawn * popcount(b);
|
||||
|
||||
// Bonus for threats on the next moves against enemy queen
|
||||
if (pos.count<QUEEN>(Them) == 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user