diff options
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index 5c71ad7bb..d28964502 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -1694,21 +1694,20 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx) std::vector<IoHash> ExpiredKeys; ExpiredKeys.reserve(1024); + + std::vector<IoHash> Cids; + Cids.reserve(1024); + for (const auto& Entry : Index) { + const IoHash& Key = Entry.first; if (Entry.second.LastAccess < ExpireTicks) { - ExpiredKeys.push_back(Entry.first); + ExpiredKeys.push_back(Key); + continue; } - } - std::vector<IoHash> Cids; - Cids.reserve(1024); - - for (const auto& Key : ExpiredKeys) - { - IndexEntry& Entry = Index[Key]; - const DiskLocation& Loc = Entry.Location; + const DiskLocation& Loc = Entry.second.Location; if (Loc.IsFlagSet(DiskLocation::kStructured)) { @@ -1743,7 +1742,7 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx) } GcCtx.ContributeCids(Cids); - GcCtx.ContributeCacheKeys(m_BucketName, {}, std::move(ExpiredKeys)); + GcCtx.ContributeCacheKeys(m_BucketName, std::move(ExpiredKeys)); } void |