mirror of
https://github.com/rclone/rclone.git
synced 2025-06-25 06:23:03 +02:00
fs: Use an in place filter in ListDirSorted
This commit is contained in:
parent
8d77e48190
commit
4fd9570332
@ -607,7 +607,7 @@ func ListDirSorted(fs Fs, includeAll bool, dir string) (entries DirEntries, err
|
|||||||
|
|
||||||
// filter the entries if required
|
// filter the entries if required
|
||||||
if !includeAll {
|
if !includeAll {
|
||||||
newEntries := make(DirEntries, 0, len(entries))
|
newEntries := entries[:0] // in place filter
|
||||||
for _, entry := range entries {
|
for _, entry := range entries {
|
||||||
switch x := entry.(type) {
|
switch x := entry.(type) {
|
||||||
case Object:
|
case Object:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user