[General] Use stable sorting algorithm

This commit is contained in:
momo5502 2017-07-12 13:39:45 +02:00
parent ef4a2492af
commit b33d7fe508
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ namespace Components
void Friends::SortIndividualList(std::vector<Friends::Friend>* 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;
});

View File

@ -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;