Micro optimization in extension()
authorMarco Costalba <mcostalba@gmail.com>
Mon, 29 Dec 2008 10:57:07 +0000 (11:57 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 29 Dec 2008 11:18:36 +0000 (12:18 +0100)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 2fe6a5c1f68322cf8a28790c64bda74831ca965e..3529627fd4d946949c9794b487f6c7eea44b25c8 100644 (file)
@@ -2195,15 +2195,18 @@ namespace {
     if (mateThreat)
         result += MateThreatExtension[pvNode];
 
     if (mateThreat)
         result += MateThreatExtension[pvNode];
 
-    if (pos.move_is_pawn_push_to_7th(m))
+    if (pos.type_of_piece_on(move_from(m)) == PAWN)
     {
     {
-        result += PawnPushTo7thExtension[pvNode];
-        *dangerous = true;
-    }
-    if (pos.move_is_passed_pawn_push(m))
-    {
-        result += PassedPawnExtension[pvNode];
-        *dangerous = true;
+        if (pos.move_is_pawn_push_to_7th(m))
+        {
+            result += PawnPushTo7thExtension[pvNode];
+            *dangerous = true;
+        }
+        if (pos.move_is_passed_pawn_push(m))
+        {
+            result += PassedPawnExtension[pvNode];
+            *dangerous = true;
+        }
     }
 
     if (   pos.move_is_capture(m)
     }
 
     if (   pos.move_is_capture(m)