From 62b2b939b5825e48c89b8a3ebb97d9fc38cb59e5 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 21 Sep 2024 14:43:21 -0700 Subject: Simplify `std::find_if` with `std::ranges::find` and projections In LabelMap.cpp, the code is currently unused so I was unable to test it. In WiiUtils.cpp, the magic value `1u` was replaced by the constant value `DiscIO::PARTITION_UPDATE`. --- Source/Core/VideoCommon/VideoBackendBase.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Source/Core/VideoCommon/VideoBackendBase.cpp') diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index e8f9f91b41..0234496e3f 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -278,9 +278,7 @@ void VideoBackendBase::ActivateBackend(const std::string& name) g_video_backend = GetDefaultVideoBackend(); const auto& backends = GetAvailableBackends(); - const auto iter = std::find_if(backends.begin(), backends.end(), [&name](const auto& backend) { - return name == backend->GetName(); - }); + const auto iter = std::ranges::find(backends, name, &VideoBackendBase::GetName); if (iter == backends.end()) return; -- cgit v1.2.3