From b33d7fe508f85014be4c7b4e242d98ed8f7e132c Mon Sep 17 00:00:00 2001 From: momo5502 Date: Wed, 12 Jul 2017 13:39:45 +0200 Subject: [PATCH] [General] Use stable sorting algorithm --- src/Components/Modules/Friends.cpp | 2 +- src/Components/Modules/ServerList.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Modules/Friends.cpp b/src/Components/Modules/Friends.cpp index 23dc60cf..5f29daa9 100644 --- a/src/Components/Modules/Friends.cpp +++ b/src/Components/Modules/Friends.cpp @@ -13,7 +13,7 @@ namespace Components void Friends::SortIndividualList(std::vector* list) { - std::sort(list->begin(), list->end(), [](Friends::Friend const& friend1, Friends::Friend const& friend2) + std::stable_sort(list->begin(), list->end(), [](Friends::Friend const& friend1, Friends::Friend const& friend2) { return friend1.cleanName.compare(friend2.cleanName) < 0; }); diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index 5599485c..f4c141ba 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -558,7 +558,7 @@ namespace Components Game::menuDef_t* menu = Game::Menus_FindByName(Game::uiContext, "pc_join_unranked"); if (!menu || !Game::Menu_IsVisible(Game::uiContext, menu)) return; - std::sort(ServerList::VisibleList.begin(), ServerList::VisibleList.end(), [](const unsigned int &server1, const unsigned int &server2) -> bool + std::stable_sort(ServerList::VisibleList.begin(), ServerList::VisibleList.end(), [](const unsigned int &server1, const unsigned int &server2) -> bool { ServerInfo* info1 = nullptr; ServerInfo* info2 = nullptr;