From: Marco Costalba Date: Mon, 13 Sep 2010 07:49:49 +0000 (+0200) Subject: Retire badCaptures[] array in MovePicker X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=42ed4889876e761b006d0452e6cad9fdb94094f0;ds=sidebyside Retire badCaptures[] array in MovePicker Use the tail of moves[] array to store bad captures. No functional change but some move reorder. Verified with old perft. Signed-off-by: Marco Costalba --- diff --git a/src/movepick.cpp b/src/movepick.cpp index b0469a66..c2b8924a 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -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 + 256; 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 + 256; 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; diff --git a/src/movepick.h b/src/movepick.h index 4a461056..1a652d6f 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -65,8 +65,8 @@ private: MoveStack ttMoves[2], killers[2]; int badCaptureThreshold, phase; const uint8_t* phasePtr; - MoveStack *curMove, *lastMove, *lastGoodNonCapture, *lastBadCapture; - MoveStack moves[256], badCaptures[64]; + MoveStack *curMove, *lastMove, *lastGoodNonCapture, *badCaptures; + MoveStack moves[256]; };