forked from TrueCloudLab/restic
Simplify buffer growing in Restorer.verifyFile
Suggested-by: Igor Fedorenko <igor@ifedorenko.com>
This commit is contained in:
parent
de8521ae56
commit
d4225ec803
1 changed files with 1 additions and 5 deletions
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in a new issue