mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-07 20:34:25 +00:00
perf(config): avoid copying structs in server validation loop
- Use indexing instead of range value to prevent 208 byte copies per iteration
This commit is contained in:
@@ -79,7 +79,8 @@ func (sc *ServersConfig) Validate() error {
|
||||
}
|
||||
|
||||
// Validate each instance
|
||||
for name, instance := range sc.Instances {
|
||||
for name := range sc.Instances {
|
||||
instance := sc.Instances[name]
|
||||
if instance.Name != name {
|
||||
return fmt.Errorf("server instance name mismatch: key='%s', name='%s'", name, instance.Name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user