From dc589650427f2ab444a7ebf78fb59ee751a4c2c8 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Mon, 2 May 2022 10:53:41 +0200 Subject: use std::vector> instead of map --- zenserver/cache/structuredcachestore.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'zenserver/cache/structuredcachestore.cpp') diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index e9c051f88..9cfb5fbf3 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -156,24 +156,6 @@ namespace { return BucketDir / (std::string("zen") + LegacyDataExtension); } - std::vector MakeDiskIndexEntries(const std::unordered_map& MovedChunks, - const std::vector& DeletedChunks) - { - std::vector result; - result.reserve(MovedChunks.size()); - for (const auto& MovedEntry : MovedChunks) - { - result.push_back({.Key = MovedEntry.first, .Location = MovedEntry.second}); - } - for (const IoHash& ChunkHash : DeletedChunks) - { - DiskLocation Location; - Location.Flags |= DiskLocation::kTombStone; - result.push_back({.Key = ChunkHash, .Location = Location}); - } - return result; - } - bool ValidateLegacyEntry(const LegacyDiskIndexEntry& Entry, std::string& OutReason) { if (Entry.Key == IoHash::Zero) @@ -1659,8 +1641,8 @@ ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx) m_PayloadAlignment, false, [this, &DeletedChunks, &ChunkIndexToChunkHash, &Index, &ReadBlockTimeUs, &ReadBlockLongestTimeUs]( - const std::unordered_map& MovedChunks, - const std::vector& RemovedChunks) { + const std::vector>& MovedChunks, + const std::vector& RemovedChunks) { std::vector LogEntries; LogEntries.reserve(MovedChunks.size() + RemovedChunks.size()); for (const auto& Entry : MovedChunks) -- cgit v1.2.3