Merge pull request #17755 from adrianreber/2023-03-13-pre-allocate

Use append() to add elements to a slice (restore)
This commit is contained in:
OpenShift Merge Robot 2023-03-15 20:35:01 -04:00 committed by GitHub
commit 9119157920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -673,7 +673,7 @@ func (ic *ContainerEngine) ContainerRestore(ctx context.Context, namesOrIds []st
}
ctrs = make([]*libpod.Container, 0, len(containers))
for i := range containers {
ctrs[i] = containers[i].Container
ctrs = append(ctrs, containers[i].Container)
}
default:
for _, nameOrID := range namesOrIds {