mirror of
https://github.com/containers/podman.git
synced 2025-11-30 01:58:46 +08:00
preallocate paths in SetupRootless
Just a minor improvement as we know the size needed for the slice we can allocate it only once instead of the append having to resize it. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -83,7 +83,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
paths := []string{}
|
paths := make([]string, 0, len(ctrs))
|
||||||
for _, ctr := range ctrs {
|
for _, ctr := range ctrs {
|
||||||
paths = append(paths, ctr.ConfigNoCopy().ConmonPidFile)
|
paths = append(paths, ctr.ConfigNoCopy().ConmonPidFile)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user