mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 23:49:15 +01:00
crypt: use an in place filter for encrypting directory entries
This commit is contained in:
parent
5250fcdf08
commit
e069fc439e
@ -170,9 +170,9 @@ func (f *Fs) addDir(entries *fs.DirEntries, dir *fs.Dir) {
|
||||
*entries = append(*entries, f.newDir(dir))
|
||||
}
|
||||
|
||||
// Encrypt some directory entries
|
||||
// Encrypt some directory entries. This alters entries returning it as newEntries.
|
||||
func (f *Fs) encryptEntries(entries fs.DirEntries) (newEntries fs.DirEntries, err error) {
|
||||
newEntries = make(fs.DirEntries, 0, len(entries))
|
||||
newEntries = entries[:0] // in place filter
|
||||
for _, entry := range entries {
|
||||
switch x := entry.(type) {
|
||||
case fs.Object:
|
||||
|
Loading…
Reference in New Issue
Block a user