mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-16 23:31:40 +00:00
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`.
This commit is contained in:
parent
1e5e9219cd
commit
62b2b939b5
20 changed files with 44 additions and 79 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue