diff options
| author | Stefan Boberg <[email protected]> | 2021-09-21 15:42:42 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-21 15:42:42 +0200 |
| commit | bd540d333e920f3c93ebaaf2bd175194b3877c1b (patch) | |
| tree | 9c97ad87207e636ce452b420b80ae6ca653420f0 /zenstore/compactcas.cpp | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-bd540d333e920f3c93ebaaf2bd175194b3877c1b.tar.xz zen-bd540d333e920f3c93ebaaf2bd175194b3877c1b.zip | |
Encapsulated containers in CasChunkSet to allow for more efficient udpates/queries
Diffstat (limited to 'zenstore/compactcas.cpp')
| -rw-r--r-- | zenstore/compactcas.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp index f17b8d376..5fc3ac356 100644 --- a/zenstore/compactcas.cpp +++ b/zenstore/compactcas.cpp @@ -147,20 +147,7 @@ CasContainerStrategy::FilterChunks(CasChunkSet& InOutChunks) // we're likely to already have a large proportion of the // chunks in the set - std::unordered_set<IoHash> HaveSet; - - for (const IoHash& Hash : InOutChunks.GetChunkSet()) - { - if (HaveChunk(Hash)) - { - HaveSet.insert(Hash); - } - } - - for (const IoHash& Hash : HaveSet) - { - InOutChunks.RemoveIfPresent(Hash); - } + InOutChunks.RemoveChunksIf([&](const IoHash& Hash) { return HaveChunk(Hash); }); } void @@ -213,7 +200,8 @@ CasContainerStrategy::Scrub(ScrubContext& Ctx) continue; } - const IoHash ComputedHash = IoHash::HashBuffer(reinterpret_cast<uint8_t*>(BufferBase) + Entry.second.Offset - WindowStart, Entry.second.Size); + const IoHash ComputedHash = + IoHash::HashBuffer(reinterpret_cast<uint8_t*>(BufferBase) + Entry.second.Offset - WindowStart, Entry.second.Size); if (Entry.first != ComputedHash) { |