Skip to content

Commit 09fe7d3

Browse files
author
Roman Wu
committed
Refactor secret deduplication to use struct for improved memory efficiency
1 parent 76516d6 commit 09fe7d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/docker-mcp/internal/gateway/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ func (c *FileBasedConfiguration) readToolsConfig(ctx context.Context) (config.To
393393

394394
func (c *FileBasedConfiguration) readDockerDesktopSecrets(ctx context.Context, servers map[string]catalog.Server, serverNames []string) (map[string]string, error) {
395395
// Use a map to deduplicate secret names
396-
uniqueSecretNames := make(map[string]bool)
396+
uniqueSecretNames := make(map[string]struct{})
397397

398398
for _, serverName := range serverNames {
399399
serverName := strings.TrimSpace(serverName)
@@ -404,7 +404,7 @@ func (c *FileBasedConfiguration) readDockerDesktopSecrets(ctx context.Context, s
404404
}
405405

406406
for _, s := range serverSpec.Secrets {
407-
uniqueSecretNames[s.Name] = true
407+
uniqueSecretNames[s.Name] = struct{}{}
408408
}
409409
}
410410

0 commit comments

Comments
 (0)