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

rcat: fix slowdown on systems with multiple hashes

Nick Craig-Woodc014b2e66bb7
diff --git a/fs/operations/operations.go b/fs/operations/operations.go
index ad5d20b0a..81c723174 100644
--- a/fs/operations/operations.go
+++ b/fs/operations/operations.go
@@ -1222,8 +1222,9 @@ func Rcat(ctx context.Context, fdst fs.Fs, dstFileName string, in io.ReadCloser,
}()
in = tr.Account(in).WithBuffer()
- hashOption := &fs.HashesOption{Hashes: fdst.Hashes()}
- hash, err := hash.NewMultiHasherTypes(fdst.Hashes())
+ hashes := hash.NewHashSet(fdst.Hashes().GetOne()) // just pick one hash
+ hashOption := &fs.HashesOption{Hashes: hashes}
+ hash, err := hash.NewMultiHasherTypes(hashes)
if err != nil {
return nil, err
}