]> git.sesse.net Git - stockfish/commitdiff
Space inflate extension() code
authorMarco Costalba <mcostalba@gmail.com>
Sun, 26 Oct 2008 17:16:23 +0000 (18:16 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 26 Oct 2008 20:30:21 +0000 (21:30 +0100)
No functional change.

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

index d19c9a9015423192991319e4e6b910db955c4e8e..f29041847c0ae033cc4b25d403f266fc633a15f5 100644 (file)
@@ -1997,26 +1997,35 @@ namespace {
 
   Depth extension(const Position &pos, Move m, bool pvNode,
                   bool check, bool singleReply, bool mateThreat) {
+
     Depth result = Depth(0);
 
-    if(check)
-      result += CheckExtension[pvNode];
-    if(singleReply)
-      result += SingleReplyExtension[pvNode];
-    if(pos.move_is_pawn_push_to_7th(m))
-      result += PawnPushTo7thExtension[pvNode];
-    if(pos.move_is_passed_pawn_push(m))
-      result += PassedPawnExtension[pvNode];
-    if(mateThreat)
-      result += MateThreatExtension[pvNode];
-    if(pos.midgame_value_of_piece_on(move_to(m)) >= RookValueMidgame
-       && (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK)
-           - pos.midgame_value_of_piece_on(move_to(m)) == Value(0))
-       && !move_promotion(m))
-      result += PawnEndgameExtension[pvNode];
-    if(pvNode && pos.move_is_capture(m)
-       && pos.type_of_piece_on(move_to(m)) != PAWN && pos.see(m) >= 0)
-      result += OnePly/2;
+    if (check)
+        result += CheckExtension[pvNode];
+
+    if (singleReply)
+        result += SingleReplyExtension[pvNode];
+
+    if (pos.move_is_pawn_push_to_7th(m))
+        result += PawnPushTo7thExtension[pvNode];
+
+    if (pos.move_is_passed_pawn_push(m))
+        result += PassedPawnExtension[pvNode];
+
+    if (mateThreat)
+        result += MateThreatExtension[pvNode];
+
+    if (   pos.midgame_value_of_piece_on(move_to(m)) >= RookValueMidgame\r
+        && (  pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK)\r
+            - pos.midgame_value_of_piece_on(move_to(m)) == Value(0))\r
+        && !move_promotion(m))
+        result += PawnEndgameExtension[pvNode];
+    
+    if (   pvNode
+        && pos.move_is_capture(m)
+        && pos.type_of_piece_on(move_to(m)) != PAWN
+        && pos.see(m) >= 0)
+        result += OnePly/2;
 
     return Min(result, OnePly);
   }