mirror of
https://github.com/kopia/kopia.git
synced 2026-05-24 14:44:47 -04:00
performance: added wrapper around io.Copy()
this pools copy buffers so they can be reused instead of throwing away after each io.Copy()
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/kopia/kopia/fs"
|
||||
"github.com/kopia/kopia/internal/iocopy"
|
||||
"github.com/kopia/kopia/repo/logging"
|
||||
"github.com/kopia/kopia/repo/object"
|
||||
)
|
||||
@@ -280,7 +281,7 @@ func downloadFile(ctx context.Context, f fs.File, fname string) error {
|
||||
}
|
||||
defer dst.Close() //nolint:errcheck
|
||||
|
||||
_, err = io.Copy(dst, src)
|
||||
_, err = iocopy.Copy(dst, src)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user