mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-15 06:58:37 +02:00
Merge pull request #13096 from mitaclaw/ranges-modernization-7-rewrite
Ranges Algorithms Modernization - Rewrite
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user