mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Perfomance: add preallocation for some slices (#59263)
add preallocation for some slices
This commit is contained in:
@@ -49,7 +49,7 @@ type slotandname struct {
|
||||
var allslots []slotandname
|
||||
|
||||
func init() {
|
||||
var all []string
|
||||
all := make([]string, 0, len(PermittedCUEImports()))
|
||||
for _, im := range PermittedCUEImports() {
|
||||
all = append(all, fmt.Sprintf("\t%s", im))
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ func (fs *FS) Add(ctx context.Context, pluginID string, pluginArchive *zip.ReadC
|
||||
|
||||
fs.log.Successf("Downloaded and extracted %s v%s zip successfully to %s", res.ID, res.Info.Version, pluginDir)
|
||||
|
||||
var deps []*Dependency
|
||||
deps := make([]*Dependency, 0, len(res.Dependencies.Plugins))
|
||||
for _, plugin := range res.Dependencies.Plugins {
|
||||
deps = append(deps, &Dependency{
|
||||
ID: plugin.ID,
|
||||
|
||||
Reference in New Issue
Block a user