Merge pull request #10488 from dcantah/avoid-realloc

Avoid potential reallocs by pre-sizing some slices
This commit is contained in:
Samuel Karp
2024-07-22 05:39:19 +00:00
committed by GitHub
5 changed files with 17 additions and 17 deletions

View File

@@ -119,9 +119,9 @@ When '--all-platforms' is given all images in a manifest list must be available.
exportOpts = append(exportOpts, tarchive.WithSkipNonDistributableBlobs)
}
storeOpts := []image.StoreOpt{}
for _, img := range images {
storeOpts = append(storeOpts, image.WithExtraReference(img))
storeOpts := make([]image.StoreOpt, len(images))
for i, img := range images {
storeOpts[i] = image.WithExtraReference(img)
}
return client.Transfer(ctx,