diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenremotestore/projectstore/remoteprojectstore.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/zenremotestore/projectstore/remoteprojectstore.cpp b/src/zenremotestore/projectstore/remoteprojectstore.cpp index 0e18cc6b0..b566e5bed 100644 --- a/src/zenremotestore/projectstore/remoteprojectstore.cpp +++ b/src/zenremotestore/projectstore/remoteprojectstore.cpp @@ -2830,9 +2830,12 @@ ParseOplogContainer(const CbObject& ContainerObject, for (CbFieldView ChunkField : ChunksArray) { IoHash ChunkHash = ChunkField.AsBinaryAttachment(); - if (OpsAttachments.contains(ChunkHash) && !HasAttachment(ChunkHash)) + if (OpsAttachments.erase(ChunkHash) == 1) { - NeededChunks.emplace_back(ChunkHash); + if (!HasAttachment(ChunkHash)) + { + NeededChunks.emplace_back(ChunkHash); + } } } } @@ -2841,9 +2844,12 @@ ParseOplogContainer(const CbObject& ContainerObject, for (CbFieldView ChunkField : ChunksArray) { const IoHash ChunkHash = ChunkField.AsHash(); - if (OpsAttachments.contains(ChunkHash) && !HasAttachment(ChunkHash)) + if (OpsAttachments.erase(ChunkHash) == 1) { - NeededChunks.emplace_back(ChunkHash); + if (!HasAttachment(ChunkHash)) + { + NeededChunks.emplace_back(ChunkHash); + } } } } @@ -2871,11 +2877,16 @@ ParseOplogContainer(const CbObject& ContainerObject, for (CbFieldView LargeChunksField : LargeChunksArray) { IoHash AttachmentHash = LargeChunksField.AsBinaryAttachment(); - if (OpsAttachments.contains(AttachmentHash) && !HasAttachment(AttachmentHash)) + + if (OpsAttachments.erase(AttachmentHash) == 1) { - OnNeedAttachment(AttachmentHash); - NeedAttachmentCount++; + if (!HasAttachment(AttachmentHash)) + { + OnNeedAttachment(AttachmentHash); + NeedAttachmentCount++; + } } + if (remotestore_impl::IsCancelled(OptionalContext)) { return RemoteProjectStore::Result{.ErrorCode = gsl::narrow<int>(HttpResponseCode::OK), |