mirror of
https://github.com/restic/restic.git
synced 2025-02-22 06:01:36 +00:00
Remove unneeded buffers from Archiver.SaveFile()
This commit is contained in:
parent
d4cfa7b797
commit
4fd8222da6
1 changed files with 0 additions and 5 deletions
|
@ -166,15 +166,12 @@ func (arch *Archiver) SaveFile(node *Node) (Blobs, error) {
|
||||||
chunks := 0
|
chunks := 0
|
||||||
|
|
||||||
for {
|
for {
|
||||||
buf := GetChunkBuf("blob chunker")
|
|
||||||
chunk, err := chnker.Next()
|
chunk, err := chnker.Next()
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
FreeChunkBuf("blob chunker", buf)
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
FreeChunkBuf("blob chunker", buf)
|
|
||||||
return nil, arrar.Annotate(err, "SaveFile() chunker.Next()")
|
return nil, arrar.Annotate(err, "SaveFile() chunker.Next()")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,8 +188,6 @@ func (arch *Archiver) SaveFile(node *Node) (Blobs, error) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeChunkBuf("blob chunker", buf)
|
|
||||||
|
|
||||||
arch.p.Report(Stat{Bytes: blob.Size})
|
arch.p.Report(Stat{Bytes: blob.Size})
|
||||||
arch.blobToken <- token
|
arch.blobToken <- token
|
||||||
ch <- blob
|
ch <- blob
|
||||||
|
|
Loading…
Reference in a new issue