X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=74dc9e29bdb4f2fafa53eb95a1b208413d2bfa45;hp=091c00fe2e06a9e8b6c194bdc460440d9f3d957c;hb=733d0099b2a3e3ad594bb551d37c8a06c62f13db;hpb=fe3352665b2dfc6c339136856c782057a5c5476e diff --git a/src/search.cpp b/src/search.cpp index 091c00fe..74dc9e29 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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;