mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 21:42:38 +08:00
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:
@ -87,7 +87,7 @@ func (i *Initializer) awsEnvVars() []string {
|
||||
type pluginSettings map[string]string
|
||||
|
||||
func (ps pluginSettings) asEnvVar(prefix string, hostEnv []string) []string {
|
||||
var env []string
|
||||
env := make([]string, 0, len(ps))
|
||||
for k, v := range ps {
|
||||
key := fmt.Sprintf("%s_%s", prefix, strings.ToUpper(k))
|
||||
if value := os.Getenv(key); value != "" {
|
||||
|
Reference in New Issue
Block a user