From b9f5d1c6ff1193d7409065322a76f59385baee3e Mon Sep 17 00:00:00 2001 From: homoSapiensSapiens Date: Thu, 22 Aug 2013 15:34:13 +0300 Subject: [PATCH] Simplify condition for backward pawn No functional changes. --- src/pawns.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pawns.cpp b/src/pawns.cpp index 718dd575..5a65422c 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -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(s, Us) & theirPawns)) + if ( (passed | isolated | chain) + || (ourPawns & pawn_attack_span(Them, s)) + || (pos.attacks_from(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 -- 2.39.2