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

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]