aboutsummaryrefslogtreecommitdiff
path: root/zenstore/blockstore.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-05-02 10:53:41 +0200
committerDan Engelbrecht <[email protected]>2022-05-02 10:53:41 +0200
commitdc589650427f2ab444a7ebf78fb59ee751a4c2c8 (patch)
treebf3c37a143bd8707f6e2c0e2b8802f243f523d33 /zenstore/blockstore.cpp
parentrefactor structured cache to use blockstore migrate (diff)
downloadzen-dc589650427f2ab444a7ebf78fb59ee751a4c2c8.tar.xz
zen-dc589650427f2ab444a7ebf78fb59ee751a4c2c8.zip
use std::vector<std::pair>> instead of map
Diffstat (limited to 'zenstore/blockstore.cpp')
-rw-r--r--zenstore/blockstore.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/zenstore/blockstore.cpp b/zenstore/blockstore.cpp
index 3358075ec..593ccc529 100644
--- a/zenstore/blockstore.cpp
+++ b/zenstore/blockstore.cpp
@@ -459,8 +459,8 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot,
continue;
}
- std::unordered_map<size_t, BlockStoreLocation> MovedChunks;
- std::vector<uint8_t> Chunk;
+ std::vector<std::pair<size_t, BlockStoreLocation>> MovedChunks;
+ std::vector<uint8_t> Chunk;
for (const size_t& ChunkIndex : KeepMap)
{
const BlockStoreLocation ChunkLocation = ChunkLocations[ChunkIndex];
@@ -541,8 +541,8 @@ BlockStore::ReclaimSpace(const ReclaimSnapshotState& Snapshot,
}
NewBlockFile->Write(Chunk.data(), Chunk.size(), WriteOffset);
- MovedChunks[ChunkIndex] = {.BlockIndex = NewBlockIndex, .Offset = WriteOffset, .Size = Chunk.size()};
- WriteOffset = RoundUp(WriteOffset + Chunk.size(), PayloadAlignment);
+ MovedChunks.push_back({ChunkIndex, {.BlockIndex = NewBlockIndex, .Offset = WriteOffset, .Size = Chunk.size()}});
+ WriteOffset = RoundUp(WriteOffset + Chunk.size(), PayloadAlignment);
}
Chunk.clear();
if (NewBlockFile)