aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/cachedisklayer.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-12-05 16:21:47 -0500
committerGitHub <[email protected]>2023-12-05 22:21:47 +0100
commit4aa1b4d6e3312e72952d26ccd702209e7051e258 (patch)
tree10f16efcce8c8a404c937f0c47f7bde523fcd64c /src/zenserver/cache/cachedisklayer.cpp
parenthttp plugin dependency fixes (#590) (diff)
downloadzen-4aa1b4d6e3312e72952d26ccd702209e7051e258.tar.xz
zen-4aa1b4d6e3312e72952d26ccd702209e7051e258.zip
Use correct iterator index when looking up memcached payload in GatherReferences (#591)
* Use correct iterator index when looking up memcached payload in gatherreferences
Diffstat (limited to 'src/zenserver/cache/cachedisklayer.cpp')
-rw-r--r--src/zenserver/cache/cachedisklayer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/zenserver/cache/cachedisklayer.cpp b/src/zenserver/cache/cachedisklayer.cpp
index a4a37b0af..700529443 100644
--- a/src/zenserver/cache/cachedisklayer.cpp
+++ b/src/zenserver/cache/cachedisklayer.cpp
@@ -1954,10 +1954,9 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx)
for (const auto& Entry : StructuredItemsWithUnknownAttachments)
{
- const IoHash& Key = Entry.first;
- size_t PayloadIndex = Entry.second;
- BucketPayload& Payload = Payloads[PayloadIndex];
- const DiskLocation& Loc = Payload.Location;
+ const IoHash& Key = Entry.first;
+ BucketPayload& Payload = Payloads[Entry.second];
+ const DiskLocation& Loc = Payload.Location;
{
IoBuffer Buffer;
if (Loc.IsFlagSet(DiskLocation::kStandaloneFile))
@@ -1980,7 +1979,7 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx)
#endif // CALCULATE_BLOCKING_TIME
if (auto It = m_Index.find(Key); It != m_Index.end())
{
- const BucketPayload& CachedPayload = Payloads[PayloadIndex];
+ const BucketPayload& CachedPayload = Payloads[It->second];
if (CachedPayload.MemCached)
{
Buffer = m_MemCachedPayloads[CachedPayload.MemCached];