summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/GameFileCache.cpp
diff options
context:
space:
mode:
authormitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-09-21 14:43:21 -0700
committermitaclaw <140017135+mitaclaw@users.noreply.github.com>2025-03-09 13:26:35 -0700
commit62b2b939b5825e48c89b8a3ebb97d9fc38cb59e5 (patch)
treeaf5356391662ec172ec15454d3f844fa2b67db19 /Source/Core/UICommon/GameFileCache.cpp
parent1e5e9219cd122761911bb426750af72c750c7efd (diff)
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`.
Diffstat (limited to 'Source/Core/UICommon/GameFileCache.cpp')
-rw-r--r--Source/Core/UICommon/GameFileCache.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Source/Core/UICommon/GameFileCache.cpp b/Source/Core/UICommon/GameFileCache.cpp
index d5b970d29c..90dd0c63fc 100644
--- a/Source/Core/UICommon/GameFileCache.cpp
+++ b/Source/Core/UICommon/GameFileCache.cpp
@@ -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)
{