X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=b9cbb956d823b9cb7bb30605bdd3524f46d608c2;hp=091c00fe2e06a9e8b6c194bdc460440d9f3d957c;hb=76caef8ba1fb4ca0520a8e2b42815d626484e93c;hpb=fe3352665b2dfc6c339136856c782057a5c5476e diff --git a/src/search.cpp b/src/search.cpp index 091c00fe..b9cbb956 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -182,7 +182,7 @@ void Search::think() { static PolyglotBook book; // Defined static to initialize the PRNG only once RootColor = RootPos.side_to_move(); - TimeMgr.init(Limits, RootPos.startpos_ply_counter(), RootColor); + TimeMgr.init(Limits, RootPos.game_ply(), RootColor); if (RootMoves.empty()) { @@ -354,7 +354,7 @@ namespace { // we want to keep the same order for all the moves but the new // PV that goes to the front. Note that in case of MultiPV search // the already searched PV lines are preserved. - sort(RootMoves.begin() + PVIdx, RootMoves.end()); + std::stable_sort(RootMoves.begin() + PVIdx, RootMoves.end()); // Write PV back to transposition table in case the relevant // entries have been overwritten during the search. @@ -399,7 +399,7 @@ namespace { } // Sort the PV lines searched so far and update the GUI - sort(RootMoves.begin(), RootMoves.begin() + PVIdx + 1); + std::stable_sort(RootMoves.begin(), RootMoves.begin() + PVIdx + 1); if (PVIdx + 1 == PVSize || Time::now() - SearchTime > 3000) sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;