diff options
| author | Dan Engelbrecht <[email protected]> | 2022-03-23 12:12:09 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-03-31 11:29:27 +0200 |
| commit | 84bb2d132e5f58421285a887405a1f5ff0f767a9 (patch) | |
| tree | 3d632fee51cddf43bda20d94557ae2d2cb8d71d8 /zenstore/compactcas.cpp | |
| parent | cleanup duplicate code in CollectGarbage (diff) | |
| download | zen-84bb2d132e5f58421285a887405a1f5ff0f767a9.tar.xz zen-84bb2d132e5f58421285a887405a1f5ff0f767a9.zip | |
cleanup
Diffstat (limited to 'zenstore/compactcas.cpp')
| -rw-r--r-- | zenstore/compactcas.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index dc16305d0..b951ac0b3 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -449,9 +449,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) DeleteChunks.back().reserve(GuesstimateCountPerBlock); } - const bool PerformDelete = GcCtx.IsDeletionMode() && GcCtx.CollectSmallObjects(); uint64_t DeleteCount = {}; - uint64_t MoveCount = {}; uint64_t NewTotalSize = 0; GcCtx.FilterCas(TotalChunkHashes, [&](const IoHash& ChunkHash, bool Keep) { @@ -473,6 +471,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) } }); + const bool PerformDelete = GcCtx.IsDeletionMode() && GcCtx.CollectSmallObjects(); if (!PerformDelete) { uint64_t TotalSize = m_TotalSize.load(std::memory_order_relaxed); @@ -491,9 +490,8 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx) uint64_t WriteOffset = {}; uint32_t NewBlockIndex = {}; std::vector<IoHash> DeletedChunks; + std::vector<IoHash> MovedChunks; DeletedChunks.reserve(DeleteCount); - std::vector<IoHash> MovedChunks; - DeletedChunks.reserve(MoveCount); std::unordered_map<IoHash, BlockStoreDiskLocation> MovedBlockChunks; for (auto BlockIndex : BlocksToReWrite) |