mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Rename and de-templetize sort()
Rename to insertion_sort so to avoid confusion with std::sort, also move it to movepicker.cpp and use the bit slower std::stable_sort in search.cpp where it is used in not performance critical paths. No functional change.
This commit is contained in:
@@ -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<RootMove>(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<RootMove>(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;
|
||||
|
||||
Reference in New Issue
Block a user