From 12b51c5eb8c41412a0fda922d9502d56d70e42ab Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 23 Jan 2016 18:26:01 +0000 Subject: [PATCH] Remove duplicate check for filter IncludeObject --- fs/operations.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/operations.go b/fs/operations.go index 89a89b27b..8e93a09aa 100644 --- a/fs/operations.go +++ b/fs/operations.go @@ -456,11 +456,13 @@ func syncCopyMove(fdst, fsrc Fs, Delete bool, DoMove bool) error { var srcFiles map[string]Object var srcObjects = make(ObjectsChan, Config.Transfers) + // Read dst files including excluded files if DeleteExcluded is set go func() { dstFiles = readFilesMap(fdst, Config.Filter.DeleteExcluded) listWg.Done() }() + // Read src file not including excluded files go func() { srcFiles = readFilesMap(fsrc, false) listWg.Done() @@ -543,16 +545,12 @@ func syncCopyMove(fdst, fsrc Fs, Delete bool, DoMove bool) error { go func() { for src := range srcObjects { - if !Config.Filter.IncludeObject(src) { - Debug(src, "Excluding from sync") + remote := src.Remote() + if dst, dstFound := dstFiles[remote]; dstFound { + toBeChecked <- ObjectPair{src, dst} } else { - remote := src.Remote() - if dst, dstFound := dstFiles[remote]; dstFound { - toBeChecked <- ObjectPair{src, dst} - } else { - // No need to check since doesn't exist - toBeUploaded <- ObjectPair{src, nil} - } + // No need to check since doesn't exist + toBeUploaded <- ObjectPair{src, nil} } } close(toBeChecked)