diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-02 10:53:41 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-02 10:53:41 +0200 |
| commit | dc589650427f2ab444a7ebf78fb59ee751a4c2c8 (patch) | |
| tree | bf3c37a143bd8707f6e2c0e2b8802f243f523d33 /zenstore/compactcas.cpp | |
| parent | refactor structured cache to use blockstore migrate (diff) | |
| download | zen-dc589650427f2ab444a7ebf78fb59ee751a4c2c8.tar.xz zen-dc589650427f2ab444a7ebf78fb59ee751a4c2c8.zip | |
use std::vector<std::pair>> instead of map
Diffstat (limited to 'zenstore/compactcas.cpp')
| -rw-r--r-- | zenstore/compactcas.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index 8d90ba186..6a9cba817 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -48,22 +48,6 @@ struct CasDiskIndexHeader static_assert(sizeof(CasDiskIndexHeader) == 32); namespace { - std::vector<CasDiskIndexEntry> MakeCasDiskEntries(const std::unordered_map<IoHash, BlockStoreDiskLocation>& MovedChunks, - const std::vector<IoHash>& DeletedChunks) - { - std::vector<CasDiskIndexEntry> result; - result.reserve(MovedChunks.size()); - for (const auto& MovedEntry : MovedChunks) - { - result.push_back({.Key = MovedEntry.first, .Location = MovedEntry.second}); - } - for (const IoHash& ChunkHash : DeletedChunks) - { - result.push_back({.Key = ChunkHash, .Flags = CasDiskIndexEntry::kTombstone}); - } - return result; - } - const char* IndexExtension = ".uidx"; const char* LogExtension = ".ulog"; @@ -493,8 +477,8 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) m_PayloadAlignment, false, [this, &DeletedChunks, &ChunkIndexToChunkHash, &LocationMap, &ReadBlockTimeUs, &ReadBlockLongestTimeUs]( - const std::unordered_map<size_t, BlockStoreLocation>& MovedChunks, - const std::vector<size_t>& RemovedChunks) { + const std::vector<std::pair<size_t, BlockStoreLocation>>& MovedChunks, + const std::vector<size_t>& RemovedChunks) { std::vector<CasDiskIndexEntry> LogEntries; LogEntries.reserve(MovedChunks.size() + RemovedChunks.size()); for (const auto& Entry : MovedChunks) |