archiver: Improve buffer pool

This commit is contained in:
Alexander Neumann
2018-04-29 15:34:41 +02:00
parent 39ac12f6ea
commit 78bd591c7c
4 changed files with 28 additions and 29 deletions

View File

@@ -172,7 +172,7 @@ func (arch *Archiver) saveTree(ctx context.Context, t *restic.Tree) (restic.ID,
// adds a newline after each object)
buf = append(buf, '\n')
b := Buffer{Data: buf}
b := &Buffer{Data: buf}
res := arch.blobSaver.Save(ctx, restic.TreeBlob, b)
if res.Err() != nil {
return restic.ID{}, s, res.Err()