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:
commit
9119157920
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue