repository: Reuse buffers in Repository.LoadUnpacked

This method had a buffer argument, but that was nil at all call sites.
That's removed, and instead LoadUnpacked now reuses whatever it
allocates inside its retry loop.
This commit is contained in:
greatroar authored and Michael Eischer committed 2023-01-30 22:01:01 +01:00
1 parent febb32b5b4
commit d129baba7a
7 files changed
+20 -25

No files matched your search

+1 -1
View File
@@ -72,7 +72,7 @@ func runCat(ctx context.Context, gopts GlobalOptions, args []string) error {
Println(string(buf))
return nil
case "index":
buf, err := repo.LoadUnpacked(ctx, restic.IndexFile, id, nil)
buf, err := repo.LoadUnpacked(ctx, restic.IndexFile, id)
if err != nil {
return err
}