Simplify buffer growing in Restorer.verifyFile

Suggested-by: Igor Fedorenko <igor@ifedorenko.com>
This commit is contained in:
greatroar 2020-03-16 10:24:24 +01:00 committed by Michael Eischer
parent de8521ae56
commit d4225ec803
1 changed files with 1 additions and 5 deletions

View File

@ -397,11 +397,7 @@ func (res *Restorer) verifyFile(target string, node *restic.Node, buf []byte) ([
}
if length > uint(cap(buf)) {
newcap := uint(2 * cap(buf))
if newcap < length {
newcap = length
}
buf = make([]byte, newcap)
buf = make([]byte, 2*length)
}
buf = buf[:length]