content: use buffer pool in hash copy

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2017-02-01 18:14:37 -08:00
parent e1eeb40d1d
commit 5ff837e2e7
No known key found for this signature in database
GPG key ID: 67B3DED84EDC823F

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
}