Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: preallocate map size

jon4hz1693db319951
diff --git a/cli/packages/cmd/secrets.go b/cli/packages/cmd/secrets.go
index 625152aa95..93f418d75e 100644
--- a/cli/packages/cmd/secrets.go
+++ b/cli/packages/cmd/secrets.go
@@ -587,7 +587,7 @@ func addHash(input string) string {
}
func getSecretsByKeys(secrets []models.SingleEnvironmentVariable) map[string]models.SingleEnvironmentVariable {
- secretMapByName := make(map[string]models.SingleEnvironmentVariable)
+ secretMapByName := make(map[string]models.SingleEnvironmentVariable, len(secrets))
for _, secret := range secrets {
secretMapByName[secret.Key] = secret