Perfomance: Preallocate slices (#61580)

This commit is contained in:
Denis Limarev
2023-01-17 17:50:17 +06:00
committed by GitHub
parent d2a5b9b289
commit e6dee8a723
13 changed files with 20 additions and 17 deletions

View File

@@ -56,7 +56,7 @@ func getDatasourcePluginSlugs(baseUrl string) ([]string, error) {
if err != nil {
return nil, err
}
var slugs []string
slugs := make([]string, 0, len(res.Items))
for _, meta := range res.Items {
slugs = append(slugs, meta.Slug)
}