]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
Shallow depth pruning on NonPV advanced pawn push
[stockfish] / src / pawns.cpp
index 1825b6e286be564edd9f1be685098529d144e949..3ddf70308c51f70577743257ab7814cbb0240937 100644 (file)
@@ -69,7 +69,7 @@ namespace {
   Score evaluate(const Position& pos, Pawns::Entry* e) {
 
     constexpr Color     Them = (Us == WHITE ? BLACK : WHITE);
-    constexpr Direction Up   = (Us == WHITE ? NORTH : SOUTH);
+    constexpr Direction Up   = pawn_push(Us);
 
     Bitboard neighbours, stoppers, support, phalanx, opposed;
     Bitboard lever, leverPush, blocked;
@@ -108,7 +108,7 @@ namespace {
         // A pawn is backward when it is behind all pawns of the same color on
         // the adjacent files and cannot safely advance.
         backward =  !(neighbours & forward_ranks_bb(Them, s + Up))
-                  && (stoppers & (leverPush | blocked));
+                  && (leverPush | blocked);
 
         // Compute additional span if pawn is not backward nor blocked
         if (!backward && !blocked)