]> git.sesse.net Git - stockfish/commitdiff
Simplify condition for backward pawn
authorhomoSapiensSapiens <reuvenpe2005@gmail.com>
Thu, 22 Aug 2013 12:34:13 +0000 (15:34 +0300)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 22 Aug 2013 12:39:08 +0000 (14:39 +0200)
No functional changes.

src/pawns.cpp

index 718dd575957076d73e62b0bf47350619e826891c..5a65422cb009b42360c0ef2c5b83134ad7c75b01 100644 (file)
@@ -129,15 +129,15 @@ namespace {
         opposed  =   theirPawns & forward_bb(Us, s);
         passed   = !(theirPawns & passed_pawn_mask(Us, s));
 
-        // Test for backward pawn
-        backward = false;
-
+        // Test for backward pawn.
         // If the pawn is passed, isolated, or member of a pawn chain it cannot
         // be backward. If there are friendly pawns behind on adjacent files
         // or if can capture an enemy pawn it cannot be backward either.
-        if (   !(passed | isolated | chain)
-            && !(ourPawns & pawn_attack_span(Them, s))
-            && !(pos.attacks_from<PAWN>(s, Us) & theirPawns))
+        if (   (passed | isolated | chain)
+            || (ourPawns & pawn_attack_span(Them, s))
+            || (pos.attacks_from<PAWN>(s, Us) & theirPawns))
+            backward = false;
+        else
         {
             // We now know that there are no friendly pawns beside or behind this
             // pawn on adjacent files. We now check whether the pawn is