mirror of
https://github.com/octoleo/restic.git
synced 2025-01-22 14:48:24 +00:00
Simplify buffer growing in Restorer.verifyFile
Suggested-by: Igor Fedorenko <igor@ifedorenko.com>
This commit is contained in:
parent
de8521ae56
commit
d4225ec803
@ -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…
x
Reference in New Issue
Block a user