Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

fs: Use an in place filter in ListDirSorted

Nick Craig-Wood4fd957033279
diff --git a/fs/operations.go b/fs/operations.go
index b8f1e83b7..8129d9726 100644
--- a/fs/operations.go
+++ b/fs/operations.go
@@ -607,7 +607,7 @@ func ListDirSorted(fs Fs, includeAll bool, dir string) (entries DirEntries, err
// filter the entries if required
if !includeAll {
- newEntries := make(DirEntries, 0, len(entries))
+ newEntries := entries[:0] // in place filter
for _, entry := range entries {
switch x := entry.(type) {
case Object: