From 957b034805985d40a25d8521996791c74c055a64 Mon Sep 17 00:00:00 2001 From: skilion Date: Sat, 11 Mar 2017 14:21:00 +0100 Subject: [PATCH] exit early if the item is to be deleted --- src/sync.d | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sync.d b/src/sync.d index 82e93ffd..5bfac586 100644 --- a/src/sync.d +++ b/src/sync.d @@ -167,6 +167,13 @@ final class SyncEngine } } + // check if the item is to be deleted + if (isItemDeleted(item)) { + log.vlog("The item is marked for deletion"); + if (cached) idsToDelete ~= id; + return; + } + // compute the path of the item string path = "."; if (parentId) { @@ -174,11 +181,7 @@ final class SyncEngine } ItemType type; - if (isItemDeleted(item)) { - log.vlog("The item is marked for deletion"); - if (cached) idsToDelete ~= id; - return; - } else if (isItemFile(item)) { + if (isItemFile(item)) { type = ItemType.file; if (!path.matchFirst(skipFile).empty) { log.vlog("Filtered out");