mirror of https://github.com/containers/image.git
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:
parent
aaadde2550
commit
e0e52ec1c3
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue