Do not look up path twice in dirImageSource.GetBlob

In principle this may return incorrect results if the underlying file is
replaced between the two calls, in practice computing and looking up the
path twice is just unnecessary overhead.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2016-07-13 18:59:27 +02:00
parent aaadde2550
commit e0e52ec1c3
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ func (s *dirImageSource) GetBlob(digest string) (io.ReadCloser, int64, error) {
if err != nil {
return nil, 0, nil
}
fi, err := os.Stat(s.ref.layerPath(digest))
fi, err := r.Stat()
if err != nil {
return nil, 0, nil
}