Merge pull request #33838 from lixiaobing1/masterRange

optimize for loop with rootfs.DiffIDs
Upstream-commit: 74a5b14c80022392c17100e1cde6727842eceb6f
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2017-06-27 14:34:10 -07:00
committed by GitHub

View File

@ -147,7 +147,7 @@ func (p *v2Pusher) pushV2Tag(ctx context.Context, ref reference.NamedTagged, id
}
// Loop bounds condition is to avoid pushing the base layer on Windows.
for i := 0; i < len(rootfs.DiffIDs); i++ {
for range rootfs.DiffIDs {
descriptor := descriptorTemplate
descriptor.layer = l
descriptor.checkedDigests = make(map[digest.Digest]struct{})