mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
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:
@ -673,7 +673,7 @@ func (ic *ContainerEngine) ContainerRestore(ctx context.Context, namesOrIds []st
|
|||||||
}
|
}
|
||||||
ctrs = make([]*libpod.Container, 0, len(containers))
|
ctrs = make([]*libpod.Container, 0, len(containers))
|
||||||
for i := range containers {
|
for i := range containers {
|
||||||
ctrs[i] = containers[i].Container
|
ctrs = append(ctrs, containers[i].Container)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
for _, nameOrID := range namesOrIds {
|
for _, nameOrID := range namesOrIds {
|
||||||
|
Reference in New Issue
Block a user