]> git.sesse.net Git - stockfish/blobdiff - src/movepick.cpp
Small codestyle touches
[stockfish] / src / movepick.cpp
index b0469a66abd5f08ce6facf8754ea1344f895e887..2e8eb665b9acd04573c9e438d77212f2888ccff6 100644 (file)
@@ -75,7 +75,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h,
   int searchTT = ttm;
   ttMoves[0].move = ttm;
   badCaptureThreshold = 0;
-  lastBadCapture = badCaptures;
+  badCaptures = moves + MOVES_MAX;
 
   pinned = p.pinned_pieces(pos.side_to_move());
 
@@ -148,10 +148,10 @@ void MovePicker::go_next_phase() {
       return;
 
   case PH_BAD_CAPTURES:
-      // Bad captures SEE value is already calculated so just sort them
-      // to get SEE move ordering.
+      // Bad captures SEE value is already calculated so just pick
+      // them in order to get SEE move ordering.
       curMove = badCaptures;
-      lastMove = lastBadCapture;
+      lastMove = moves + MOVES_MAX;
       return;
 
   case PH_EVASIONS:
@@ -292,12 +292,10 @@ Move MovePicker::get_next_move() {
                   if (seeValue >= badCaptureThreshold)
                       return move;
 
-                  // Losing capture, move it to the badCaptures[] array, note
+                  // Losing capture, move it to the tail of the array, note
                   // that move has now been already checked for legality.
-                  assert(int(lastBadCapture - badCaptures) < 63);
-                  lastBadCapture->move = move;
-                  lastBadCapture->score = seeValue;
-                  lastBadCapture++;
+                  (--badCaptures)->move = move;
+                  badCaptures->score = seeValue;
               }
               break;