mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 15:01:16 +01:00
Modernize std::set_intersection
with ranges
This commit is contained in:
parent
728663bdc0
commit
88a1a5b4f2
@ -111,8 +111,7 @@ ProfileCycler::GetMatchingProfilesFromSetting(const std::string& setting,
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> result;
|
std::vector<std::string> result;
|
||||||
std::set_intersection(profiles.begin(), profiles.end(), profiles_from_setting.begin(),
|
std::ranges::set_intersection(profiles, profiles_from_setting, std::back_inserter(result));
|
||||||
profiles_from_setting.end(), std::back_inserter(result));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,10 +631,10 @@ bool PopulateConfig(GLContext* m_main_gl_context)
|
|||||||
g_Config.backend_info.AAModes.clear();
|
g_Config.backend_info.AAModes.clear();
|
||||||
g_Config.backend_info.AAModes.reserve(std::min(color_aa_modes.size(), depth_aa_modes.size()));
|
g_Config.backend_info.AAModes.reserve(std::min(color_aa_modes.size(), depth_aa_modes.size()));
|
||||||
// We only want AA modes that are supported for both the color and depth textures. Probably
|
// We only want AA modes that are supported for both the color and depth textures. Probably
|
||||||
// the support is the same, though. rbegin/rend are used to swap the order ahead of time.
|
// the support is the same, though. views::reverse is used to swap the order ahead of time.
|
||||||
std::set_intersection(color_aa_modes.rbegin(), color_aa_modes.rend(), depth_aa_modes.rbegin(),
|
std::ranges::set_intersection(color_aa_modes | std::views::reverse,
|
||||||
depth_aa_modes.rend(),
|
depth_aa_modes | std::views::reverse,
|
||||||
std::back_inserter(g_Config.backend_info.AAModes));
|
std::back_inserter(g_Config.backend_info.AAModes));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user