mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-17 07:41:39 +00:00
Merge pull request #13096 from mitaclaw/ranges-modernization-7-rewrite
Ranges Algorithms Modernization - Rewrite
This commit is contained in:
commit
96c9591b99
7 changed files with 26 additions and 38 deletions
|
@ -314,20 +314,14 @@ void GeckoCodeWidget::SortAlphabetically()
|
|||
|
||||
void GeckoCodeWidget::SortEnabledCodesFirst()
|
||||
{
|
||||
std::stable_sort(m_gecko_codes.begin(), m_gecko_codes.end(), [](const auto& a, const auto& b) {
|
||||
return a.enabled && a.enabled != b.enabled;
|
||||
});
|
||||
|
||||
std::ranges::stable_partition(m_gecko_codes, std::identity{}, &Gecko::GeckoCode::enabled);
|
||||
UpdateList();
|
||||
SaveCodes();
|
||||
}
|
||||
|
||||
void GeckoCodeWidget::SortDisabledCodesFirst()
|
||||
{
|
||||
std::stable_sort(m_gecko_codes.begin(), m_gecko_codes.end(), [](const auto& a, const auto& b) {
|
||||
return !a.enabled && a.enabled != b.enabled;
|
||||
});
|
||||
|
||||
std::ranges::stable_partition(m_gecko_codes, std::logical_not{}, &Gecko::GeckoCode::enabled);
|
||||
UpdateList();
|
||||
SaveCodes();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue