diff options
| author | Per Larsson <[email protected]> | 2021-09-21 16:27:01 +0200 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-09-21 16:27:01 +0200 |
| commit | 1630b31fa2752fcaf63edb0aaea04ff85f70ba15 (patch) | |
| tree | 0a5f739a342200d97e7361298cae27cc6c176de1 /zenstore/compactcas.cpp | |
| parent | Refactored get/set cache pyload. (diff) | |
| parent | Update README.md (diff) | |
| download | zen-1630b31fa2752fcaf63edb0aaea04ff85f70ba15.tar.xz zen-1630b31fa2752fcaf63edb0aaea04ff85f70ba15.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
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) { |