aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zenremotestore/builds/buildstorageoperations.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/zenremotestore/builds/buildstorageoperations.cpp b/src/zenremotestore/builds/buildstorageoperations.cpp
index 26968efc1..2319ad66d 100644
--- a/src/zenremotestore/builds/buildstorageoperations.cpp
+++ b/src/zenremotestore/builds/buildstorageoperations.cpp
@@ -1969,13 +1969,14 @@ BuildsOperationUpdateFolder::Execute(FolderContent& OutLocalFolderState)
{
if (!m_Options.WipeTargetFolder)
{
+ // Check if it is already in the correct place
if (auto RemotePathIt = RemotePathToRemoteIndex.find(LocalPath.generic_string());
RemotePathIt != RemotePathToRemoteIndex.end())
{
const uint32_t RemotePathIndex = RemotePathIt->second;
if (m_RemoteContent.RawHashes[RemotePathIndex] == RawHash)
{
- // It is already in it's desired place
+ // It is already in it's correct place
RemotePathIndexToLocalPathIndex[RemotePathIndex] = LocalPathIndex;
SequenceHashToLocalPathIndex.insert({RawHash, LocalPathIndex});
MatchCount++;
@@ -1991,31 +1992,27 @@ BuildsOperationUpdateFolder::Execute(FolderContent& OutLocalFolderState)
PathMismatchCount++;
}
}
+
+ // Do we need it?
if (m_RemoteLookup.RawHashToSequenceIndex.contains(RawHash))
{
if (!CachedRemoteSequences.contains(RawHash))
{
- ZEN_TRACE_CPU("MoveToCache");
- // We need it
+ // We need it, make sure we move it to the cache
FilesToCache.push_back(LocalPathIndex);
CachedRemoteSequences.insert(RawHash);
+ continue;
}
else
{
- // We already have it
SkippedCount++;
}
}
- else if (!m_Options.WipeTargetFolder)
- {
- // We don't need it
- RemoveLocalPathIndexes.push_back(LocalPathIndex);
- DeleteCount++;
- }
}
- else if (!m_Options.WipeTargetFolder)
+
+ if (!m_Options.WipeTargetFolder)
{
- // Delete local file as we did not scavenge the folder
+ // Explicitly delete the unneeded local file
RemoveLocalPathIndexes.push_back(LocalPathIndex);
DeleteCount++;
}