]> git.sesse.net Git - stockfish/commitdiff
Move moveCount update near the SpNode case
authorMarco Costalba <mcostalba@gmail.com>
Sat, 30 Oct 2010 17:18:48 +0000 (18:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 30 Oct 2010 17:26:41 +0000 (18:26 +0100)
No functional change.

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

index dcfedcdbe0b05afa14e2c3b6221ee4cfff67ad61..f3b092d2dc1910365d70245409dbaa2392d6f792 100644 (file)
@@ -1194,16 +1194,17 @@ split_point_start: // At split points actual search starts from here
            && (move = mp.get_next_move()) != MOVE_NONE
            && !ThreadsMgr.thread_should_stop(threadID))
     {
            && (move = mp.get_next_move()) != MOVE_NONE
            && !ThreadsMgr.thread_should_stop(threadID))
     {
+      assert(move_is_ok(move));
+
       if (SpNode)
       {
           moveCount = ++sp->moveCount;
           lock_release(&(sp->lock));
       }
       if (SpNode)
       {
           moveCount = ++sp->moveCount;
           lock_release(&(sp->lock));
       }
-
-      assert(move_is_ok(move));
-
-      if (move == excludedMove)
+      else if (move == excludedMove)
           continue;
           continue;
+      else
+          movesSearched[moveCount++] = move;
 
       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);
@@ -1235,13 +1236,9 @@ split_point_start: // At split points actual search starts from here
           }
       }
 
           }
       }
 
-      newDepth = depth - ONE_PLY + ext;
-
       // Update current move (this must be done after singular extension search)
       // Update current move (this must be done after singular extension search)
-      movesSearched[moveCount] = ss->currentMove = move;
-
-      if (!SpNode)
-          moveCount++;
+      ss->currentMove = move;
+      newDepth = depth - ONE_PLY + ext;
 
       // Step 12. Futility pruning (is omitted in PV nodes)
       if (   !PvNode
 
       // Step 12. Futility pruning (is omitted in PV nodes)
       if (   !PvNode
@@ -1399,7 +1396,7 @@ split_point_start: // At split points actual search starts from here
 
     if (SpNode)
     {
 
     if (SpNode)
     {
-        /* Here we have the lock still grabbed */
+        // Here we have the lock still grabbed
         sp->slaves[threadID] = 0;
         lock_release(&(sp->lock));
         return bestValue;
         sp->slaves[threadID] = 0;
         lock_release(&(sp->lock));
         return bestValue;