]> git.sesse.net Git - stockfish/commitdiff
Move singleEvasion assignment out of move's loop
authorMarco Costalba <mcostalba@gmail.com>
Thu, 1 Jul 2010 21:18:53 +0000 (22:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 1 Jul 2010 21:18:53 +0000 (22:18 +0100)
We don't need to recheck after every move.

Spotted by Ralph Stoesser.

No functional change.

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

index 99f3614d1ea5f27c78d5c53eebb9d2062d69bd68..9cffc1cc3aff6aab23242113aa34acf18a740fed 100644 (file)
@@ -1061,7 +1061,7 @@ namespace {
     Depth ext, newDepth;
     Value bestValue, value, oldAlpha;
     Value refinedValue, nullValue, futilityValueScaled; // Non-PV specific
     Depth ext, newDepth;
     Value bestValue, value, oldAlpha;
     Value refinedValue, nullValue, futilityValueScaled; // Non-PV specific
-    bool isCheck, singleEvasion, moveIsCheck, captureOrPromotion, dangerous;
+    bool isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
     bool mateThreat = false;
     int moveCount = 0;
     int threadID = pos.thread();
     bool mateThreat = false;
     int moveCount = 0;
     int threadID = pos.thread();
@@ -1257,11 +1257,12 @@ namespace {
     // Initialize a MovePicker object for the current position
     MovePicker mp = MovePicker(pos, ttMove, depth, H, ss, (PvNode ? -VALUE_INFINITE : beta));
     CheckInfo ci(pos);
     // Initialize a MovePicker object for the current position
     MovePicker mp = MovePicker(pos, ttMove, depth, H, ss, (PvNode ? -VALUE_INFINITE : beta));
     CheckInfo ci(pos);
-    bool singularExtensionNode =   depth >= SingularExtensionDepth[PvNode]
-                                && tte && tte->move()
-                                && !excludedMove // Do not allow recursive singular extension search
-                                && is_lower_bound(tte->type())
-                                && tte->depth() >= depth - 3 * OnePly;
+    singleEvasion = isCheck && mp.number_of_evasions() == 1;
+    singularExtensionNode =   depth >= SingularExtensionDepth[PvNode]
+                           && tte && tte->move()
+                           && !excludedMove // Do not allow recursive singular extension search
+                           && is_lower_bound(tte->type())
+                           && tte->depth() >= depth - 3 * OnePly;
 
     // Step 10. Loop through moves
     // Loop through all legal moves until no moves remain or a beta cutoff occurs
 
     // Step 10. Loop through moves
     // Loop through all legal moves until no moves remain or a beta cutoff occurs
@@ -1274,7 +1275,6 @@ namespace {
       if (move == excludedMove)
           continue;
 
       if (move == excludedMove)
           continue;
 
-      singleEvasion = (isCheck && mp.number_of_evasions() == 1);
       moveIsCheck = pos.move_is_check(move, ci);
       captureOrPromotion = pos.move_is_capture_or_promotion(move);
 
       moveIsCheck = pos.move_is_check(move, ci);
       captureOrPromotion = pos.move_is_capture_or_promotion(move);