Merge pull request #487 from stevvooe/use-pool-in-copy

content: use buffer pool in hash copy
This commit is contained in:
Derek McGowan 2017-02-02 15:42:46 -08:00 committed by GitHub
commit 29132c4061

View file

@ -284,7 +284,10 @@ func (cs *Store) Resume(ref string) (*Writer, error) {
}
defer fp.Close()
offset, err := io.Copy(digester.Hash(), fp)
p := bufPool.Get().([]byte)
defer bufPool.Put(p)
offset, err := io.CopyBuffer(digester.Hash(), fp, p)
if err != nil {
return nil, err
}