From 4833357c724f76e73af4d1eb9fe6e01a7d235751 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 25 Nov 2025 13:58:41 +0100 Subject: [PATCH] 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 --- pkg/domain/infra/abi/system_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/domain/infra/abi/system_linux.go b/pkg/domain/infra/abi/system_linux.go index 1cfbef3ab2..da16961e69 100644 --- a/pkg/domain/infra/abi/system_linux.go +++ b/pkg/domain/infra/abi/system_linux.go @@ -83,7 +83,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool, return err } - paths := []string{} + paths := make([]string, 0, len(ctrs)) for _, ctr := range ctrs { paths = append(paths, ctr.ConfigNoCopy().ConmonPidFile) }