Skip to content

Commit 4833357

Browse files
committed
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 <[email protected]>
1 parent ed9d298 commit 4833357

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/domain/infra/abi/system_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool,
8383
return err
8484
}
8585

86-
paths := []string{}
86+
paths := make([]string, 0, len(ctrs))
8787
for _, ctr := range ctrs {
8888
paths = append(paths, ctr.ConfigNoCopy().ConmonPidFile)
8989
}

0 commit comments

Comments
 (0)