]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
Simplify weak lever
[stockfish] / src / pawns.cpp
index 9755c2ec2e0e20258f046610797efb40a40c65e7..86c4b8ef2520eba9a1b64bf231ca93e5f2aadc16 100644 (file)
@@ -70,7 +70,7 @@ namespace {
     constexpr Color     Them = (Us == WHITE ? BLACK : WHITE);
     constexpr Direction Up   = (Us == WHITE ? NORTH : SOUTH);
 
-    Bitboard b, neighbours, stoppers, doubled, support, phalanx;
+    Bitboard neighbours, stoppers, doubled, support, phalanx;
     Bitboard lever, leverPush;
     Square s;
     bool opposed, backward, passed;
@@ -145,11 +145,10 @@ namespace {
             score -= Doubled;
     }
 
-    // Penalize the unsupported and non passed pawns attacked twice by the enemy
-    b =   ourPawns
-        & doubleAttackThem
-        & ~(e->pawnAttacks[Us] | e->passedPawns[Us]);
-    score -= WeakLever * popcount(b);
+    // Penalize our unsupported pawns attacked twice by enemy pawns
+    score -= WeakLever * popcount(  ourPawns
+                                  & doubleAttackThem
+                                  & ~e->pawnAttacks[Us]);
 
     return score;
   }