mirror of
https://github.com/containers/podman.git
synced 2025-06-23 10:38:20 +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))
|
||||
for i := range containers {
|
||||
ctrs[i] = containers[i].Container
|
||||
ctrs = append(ctrs, containers[i].Container)
|
||||
}
|
||||
default:
|
||||
for _, nameOrID := range namesOrIds {
|
||||
|
Reference in New Issue
Block a user