evaluate_passed_pawns() micro-optmization
authorMarco Costalba <mcostalba@gmail.com>
Tue, 6 Jan 2009 15:06:08 +0000 (16:06 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 6 Jan 2009 15:06:08 +0000 (16:06 +0100)
No functional change, only a bit faster.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp

index 3be9939b7c8d0c89d9ca1225e14c4d912fc4f497..2bfe52384e4048bfad5aecb812d5640b9a95b6e1 100644 (file)
@@ -937,7 +937,7 @@ namespace {
             ebonus += Value(square_distance(theirKingSq, blockSq) * 6 * tr);
 
             // If the pawn is free to advance, increase bonus
-            if (pos.square_is_empty(blockSq))
+            if (tr != 0 && pos.square_is_empty(blockSq))
             {
                 b2 = squares_in_front_of(us, s);
                 b3 = b2 & ei.attacked_by(them);