From a2e924039bb96c0b923512dbb6903de9bb6bbd21 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 17 May 2011 23:39:14 +0100 Subject: [PATCH] Retire move_is_capture_or_promotion() No functional change. Signed-off-by: Marco Costalba --- src/movepick.cpp | 2 +- src/position.h | 7 ------- src/search.cpp | 10 ++++++---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index d8c9fbbb..4be0f69a 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -110,7 +110,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h) // Skip TT move if is not a capture or a promotion, this avoids // qsearch tree explosion due to a possible perpetual check or // similar rare cases when TT table is full. - if (ttm != MOVE_NONE && !pos.move_is_capture_or_promotion(ttm)) + if (ttm != MOVE_NONE && !pos.move_is_capture(ttm) && !move_is_promotion(ttm)) searchTT = ttMoves[0].move = MOVE_NONE; } diff --git a/src/position.h b/src/position.h index 5db64ec3..04592d27 100644 --- a/src/position.h +++ b/src/position.h @@ -191,7 +191,6 @@ public: bool move_gives_check(Move m) const; bool move_gives_check(Move m, const CheckInfo& ci) const; bool move_is_capture(Move m) const; - bool move_is_capture_or_promotion(Move m) const; bool move_is_passed_pawn_push(Move m) const; bool move_attacks_square(Move m, Square s) const; @@ -530,12 +529,6 @@ inline bool Position::move_is_capture(Move m) const { return !square_is_empty(move_to(m)) || move_is_ep(m); } -inline bool Position::move_is_capture_or_promotion(Move m) const { - - assert (m != MOVE_NONE && m != MOVE_NULL); - return move_is_capture(m) || move_is_promotion(m); -} - inline PieceType Position::captured_piece_type() const { return st->capturedType; } diff --git a/src/search.cpp b/src/search.cpp index 0fbdab56..dcfb7d46 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -937,7 +937,7 @@ split_point_start: // At split points actual search starts from here // At Root and at first iteration do a PV search on all the moves to score root moves isPvMove = (PvNode && moveCount <= (Root ? depth <= ONE_PLY ? 1000 : MultiPV : 1)); givesCheck = pos.move_gives_check(move, ci); - captureOrPromotion = pos.move_is_capture_or_promotion(move); + captureOrPromotion = pos.move_is_capture(move) || move_is_promotion(move); // Step 11. Decide the new search depth ext = extension(pos, move, captureOrPromotion, givesCheck, &dangerous); @@ -1215,7 +1215,8 @@ split_point_start: // At split points actual search starts from here // Update killers and history only for non capture moves that fails high if ( bestValue >= beta - && !pos.move_is_capture_or_promotion(move)) + && !pos.move_is_capture(move) + && !move_is_promotion(move)) { if (move != ss->killers[0]) { @@ -1383,7 +1384,8 @@ split_point_start: // At split points actual search starts from here && !inCheck && givesCheck && move != ttMove - && !pos.move_is_capture_or_promotion(move) + && !pos.move_is_capture(move) + && !move_is_promotion(move) && ss->eval + PawnValueMidgame / 4 < beta && !check_is_dangerous(pos, move, futilityBase, beta, &bestValue)) { @@ -1626,7 +1628,7 @@ split_point_start: // At split points actual search starts from here assert(move_is_ok(m)); assert(threat && move_is_ok(threat)); assert(!pos.move_gives_check(m)); - assert(!pos.move_is_capture_or_promotion(m)); + assert(!pos.move_is_capture(m) && !move_is_promotion(m)); assert(!pos.move_is_passed_pawn_push(m)); Square mfrom, mto, tfrom, tto; -- 2.39.2