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

build: slices.Contains, added in go1.21

Nick Craig-Woodb0031690889d
diff --git a/backend/onedrive/metadata.go b/backend/onedrive/metadata.go
index 2d3476937..d6df4dd1e 100644
--- a/backend/onedrive/metadata.go
+++ b/backend/onedrive/metadata.go
@@ -421,12 +421,7 @@ func (m *Metadata) orderPermissions(xs []*api.PermissionsType) {
if hasUserIdentity(p.GetGrantedTo(m.fs.driveType)) {
return true
}
- for _, identity := range p.GetGrantedToIdentities(m.fs.driveType) {
- if hasUserIdentity(identity) {
- return true
- }
- }
- return false
+ return slices.ContainsFunc(p.GetGrantedToIdentities(m.fs.driveType), hasUserIdentity)
}
// Put Permissions with a user first, leaving unsorted otherwise
slices.SortStableFunc(xs, func(a, b *api.PermissionsType) int {