X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=5921ae0fd77a093c95b59e3c0c8f3a1b2d02bc04;hp=b271e0e20f151e2997f06109ffea50b5da3caf9f;hb=c71ae794df257e3d6f1e925b6d013434bb2f99ef;hpb=409930e98c48f9d149c2324c911c52325f368edd diff --git a/src/search.cpp b/src/search.cpp index b271e0e2..5921ae0f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -570,12 +570,13 @@ namespace { // because all the values but the first are usually set to // -VALUE_INFINITE and we want to keep the same order for all // the moves but the new PV that goes to head. + sort(Rml.begin() + MultiPVIteration, Rml.end()); + + // In case we have found an exact score reorder the PV moves + // before leaving the fail high/low loop, otherwise leave the + // last PV move in its position so to be searched again. if (value > alpha && value < beta) - sort(Rml.begin(), Rml.end()); - else - // In MultiPV mode, sort only the tail of the list - // until all fail-highs and fail-lows have been resolved - sort(Rml.begin() + MultiPVIteration, Rml.end()); + sort(Rml.begin(), Rml.begin() + MultiPVIteration); // Write PV back to transposition table in case the relevant entries // have been overwritten during the search.