From: Joost VandeVondele Date: Sun, 31 Mar 2019 08:44:55 +0000 (+0200) Subject: Remove duplication. (#2068) X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=d1f76ebcd8cc475d08b468efe4b467e014efef14 Remove duplication. (#2068) always use the implementation of gives_check in position, no need to hand-inline part of the implementation in search. LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 57895 W: 12632 L: 12582 D: 32681 http://tests.stockfishchess.org/tests/view/5c9eaa4b0ebc5925cfffc9e3 No functional change. --- diff --git a/src/search.cpp b/src/search.cpp index 7043e49d..3319ee94 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -116,13 +116,6 @@ namespace { void update_quiet_stats(const Position& pos, Stack* ss, Move move, Move* quiets, int quietCount, int bonus); void update_capture_stats(const Position& pos, Move move, Move* captures, int captureCount, int bonus); - inline bool gives_check(const Position& pos, Move move) { - Color us = pos.side_to_move(); - return type_of(move) == NORMAL && !(pos.blockers_for_king(~us) & pos.pieces(us)) - ? pos.check_squares(type_of(pos.moved_piece(move))) & to_sq(move) - : pos.gives_check(move); - } - // perft() is our utility to verify move generation. All the leaf nodes up // to the given depth are generated and counted, and the sum is returned. template @@ -887,7 +880,7 @@ moves_loop: // When in check, search starts from here extension = DEPTH_ZERO; captureOrPromotion = pos.capture_or_promotion(move); movedPiece = pos.moved_piece(move); - givesCheck = gives_check(pos, move); + givesCheck = pos.gives_check(move); // Step 13. Extensions (~70 Elo) @@ -1313,7 +1306,7 @@ moves_loop: // When in check, search starts from here { assert(is_ok(move)); - givesCheck = gives_check(pos, move); + givesCheck = pos.gives_check(move); moveCount++;