mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-06 19:22:39 +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
|
@ -65,9 +65,7 @@ void GameFileCache::Clear(DeleteOnDisk delete_on_disk)
|
|||
std::shared_ptr<const GameFile> GameFileCache::AddOrGet(const std::string& path,
|
||||
bool* cache_changed)
|
||||
{
|
||||
auto it = std::find_if(
|
||||
m_cached_files.begin(), m_cached_files.end(),
|
||||
[&path](const std::shared_ptr<GameFile>& file) { return file->GetFilePath() == path; });
|
||||
auto it = std::ranges::find(m_cached_files, path, &GameFile::GetFilePath);
|
||||
const bool found = it != m_cached_files.cend();
|
||||
if (!found)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue