Skip to content

Commit b9f5d1c

Browse files
R-Pelegmcostalba
authored andcommitted
Simplify condition for backward pawn
No functional changes.
1 parent c4533e0 commit b9f5d1c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/pawns.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ namespace {
129129
opposed = theirPawns & forward_bb(Us, s);
130130
passed = !(theirPawns & passed_pawn_mask(Us, s));
131131

132-
// Test for backward pawn
133-
backward = false;
134-
132+
// Test for backward pawn.
135133
// If the pawn is passed, isolated, or member of a pawn chain it cannot
136134
// be backward. If there are friendly pawns behind on adjacent files
137135
// or if can capture an enemy pawn it cannot be backward either.
138-
if ( !(passed | isolated | chain)
139-
&& !(ourPawns & pawn_attack_span(Them, s))
140-
&& !(pos.attacks_from<PAWN>(s, Us) & theirPawns))
136+
if ( (passed | isolated | chain)
137+
|| (ourPawns & pawn_attack_span(Them, s))
138+
|| (pos.attacks_from<PAWN>(s, Us) & theirPawns))
139+
backward = false;
140+
else
141141
{
142142
// We now know that there are no friendly pawns beside or behind this
143143
// pawn on adjacent files. We now check whether the pawn is

0 commit comments

Comments
 (0)