Modernize std::find_if with ranges

In BTEmu.cpp, `std::mem_fn` was not necessary for the predicate to compile.
This commit is contained in:
mitaclaw
2024-10-10 15:28:11 -07:00
parent 6ca7e2856b
commit e4fb837f4b
24 changed files with 60 additions and 72 deletions
+3 -4
View File
@@ -117,10 +117,9 @@ void Reload()
std::optional<std::string> GetNetworkPatch(std::string_view source, IsKD is_kd)
{
const auto patch =
std::find_if(s_patches.begin(), s_patches.end(), [&source, &is_kd](const NetworkPatch& p) {
return p.source == source && p.is_kd == is_kd && p.enabled;
});
const auto patch = std::ranges::find_if(s_patches, [&source, &is_kd](const NetworkPatch& p) {
return p.source == source && p.is_kd == is_kd && p.enabled;
});
if (patch == s_patches.end())
return std::nullopt;