Performance: add preallocation for some slice/map (#57860)
This change preallocates slices and maps where the size of the data is known before the object is created. Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
This commit is contained in:
co-authored by
Joe Blubaugh
parent
460be70261
commit
4d8287b319
@@ -146,7 +146,7 @@ func canUpdate(v1, v2 string) bool {
|
||||
}
|
||||
|
||||
func (s *PluginsService) pluginIDsCSV(m map[string]plugins.PluginDTO) string {
|
||||
var ids []string
|
||||
ids := make([]string, 0, len(m))
|
||||
for pluginID := range m {
|
||||
ids = append(ids, pluginID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user