summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Blob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DiscIO/Blob.cpp')
-rw-r--r--Source/Core/DiscIO/Blob.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp
index 32c559b6eb..a3d9d8deb8 100644
--- a/Source/Core/DiscIO/Blob.cpp
+++ b/Source/Core/DiscIO/Blob.cpp
@@ -57,12 +57,15 @@ SectorReader::Cache* SectorReader::GetEmptyCacheLine()
{
Cache* oldest = &m_cache[0];
// Find the Least Recently Used cache line to replace.
- for (auto& cache_entry : m_cache)
- {
- if (cache_entry.IsLessRecentlyUsedThan(*oldest))
- oldest = &cache_entry;
- cache_entry.ShiftLRU();
- }
+ std::for_each(m_cache.begin() + 1, m_cache.end(), [&](Cache& line) {
+ if (line.IsLessRecentlyUsedThan(*oldest))
+ {
+ oldest->ShiftLRU();
+ oldest = &line;
+ return;
+ }
+ line.ShiftLRU();
+ });
oldest->Reset();
return oldest;
}