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

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 {