]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Minor code style tweaks
[stockfish] / src / evaluate.cpp
index 9d98a63b6cd15afb6badaf708423c9dd5881e471..f4186686b6a2a5d6083050e55fc91e760f7e883b 100644 (file)
@@ -337,9 +337,8 @@ namespace {
             else if (bb &= b & ~pos.pieces(Us))
                 score += Outpost[Pt == BISHOP][bool(attackedBy[Us][PAWN] & bb)];
 
-            // Bonus when behind a pawn
-            if (    relative_rank(Us, s) < RANK_5
-                && (pos.pieces(PAWN) & (s + pawn_push(Us))))
+            // Knight and Bishop bonus for being right behind a pawn
+            if (shift<Down>(pos.pieces(PAWN)) & s)
                 score += MinorBehindPawn;
 
             // Penalty if the piece is far from the king