X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=0ca539ae235797afa29867368938a3a948f0aaab;hp=ae247c0476ba700367dbddd61cc259ca6a257787;hb=d543a64cc7fc06daed275b332b10ea06ba738001;hpb=87f7e99bc4ddeee7ca6b098d73620e2de2b1287e diff --git a/src/search.cpp b/src/search.cpp index ae247c04..0ca539ae 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -291,7 +291,7 @@ void Search::think() { // is given, with the subset of legal moves to search. for (MoveList ml(pos); !ml.end(); ++ml) if ( SearchMoves.empty() - || std::count(SearchMoves.begin(), SearchMoves.end(), ml.move())) + || count(SearchMoves.begin(), SearchMoves.end(), ml.move())) RootMoves.push_back(RootMove(ml.move())); if (Options["OwnBook"].value()) @@ -302,9 +302,9 @@ void Search::think() { Move bookMove = book.probe(pos, Options["Best Book Move"].value()); if ( bookMove != MOVE_NONE - && std::count(RootMoves.begin(), RootMoves.end(), bookMove)) + && count(RootMoves.begin(), RootMoves.end(), bookMove)) { - std::swap(RootMoves[0], *std::find(RootMoves.begin(), RootMoves.end(), bookMove)); + std::swap(RootMoves[0], *find(RootMoves.begin(), RootMoves.end(), bookMove)); goto finish; } } @@ -568,7 +568,7 @@ namespace { if (skillBest == MOVE_NONE) // Still unassigned ? skillBest = do_skill_level(); - std::swap(RootMoves[0], *std::find(RootMoves.begin(), RootMoves.end(), skillBest)); + std::swap(RootMoves[0], *find(RootMoves.begin(), RootMoves.end(), skillBest)); } } @@ -877,7 +877,7 @@ split_point_start: // At split points actual search starts from here // At root obey the "searchmoves" option and skip moves not listed in Root // Move List, as a consequence any illegal move is also skipped. In MultiPV // mode we also skip PV moves which have been already searched. - if (RootNode && !std::count(RootMoves.begin() + PVIdx, RootMoves.end(), move)) + if (RootNode && !count(RootMoves.begin() + PVIdx, RootMoves.end(), move)) continue; // At PV and SpNode nodes we want all moves to be legal since the beginning @@ -1060,7 +1060,7 @@ split_point_start: // At split points actual search starts from here // be trusted, and we don't update the best move and/or PV. if (RootNode && !Signals.stop) { - RootMove& rm = *std::find(RootMoves.begin(), RootMoves.end(), move); + RootMove& rm = *find(RootMoves.begin(), RootMoves.end(), move); rm.nodes += pos.nodes_searched() - nodes; // PV move or new best move ? @@ -1141,7 +1141,9 @@ split_point_start: // At split points actual search starts from here TT.store(posKey, value_to_tt(bestValue, ss->ply), vt, depth, move, ss->eval, ss->evalMargin); // Update killers and history for non capture cut-off moves - if (bestValue >= beta && !pos.is_capture_or_promotion(move)) + if ( bestValue >= beta + && !pos.is_capture_or_promotion(move) + && !inCheck) { if (move != ss->killers[0]) {