2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-03 17:40:53 +00:00

Remove unneeded buffers from Archiver.SaveFile()

This commit is contained in:
Alexander Neumann 2015-02-16 23:47:32 +01:00
parent d4cfa7b797
commit 4fd8222da6

View File

@ -166,15 +166,12 @@ func (arch *Archiver) SaveFile(node *Node) (Blobs, error) {
chunks := 0
for {
buf := GetChunkBuf("blob chunker")
chunk, err := chnker.Next()
if err == io.EOF {
FreeChunkBuf("blob chunker", buf)
break
}
if err != nil {
FreeChunkBuf("blob chunker", buf)
return nil, arrar.Annotate(err, "SaveFile() chunker.Next()")
}
@ -191,8 +188,6 @@ func (arch *Archiver) SaveFile(node *Node) (Blobs, error) {
panic(err)
}
FreeChunkBuf("blob chunker", buf)
arch.p.Report(Stat{Bytes: blob.Size})
arch.blobToken <- token
ch <- blob