mirror of
https://github.com/status-im/consul.git
synced 2025-01-27 05:57:03 +00:00
Preallocates result struct, which was a profiling hot spot.
This commit is contained in:
parent
970bb771f9
commit
3a855d362f
@ -1248,7 +1248,7 @@ func (s *StateStore) parseCheckServiceNodes(
|
||||
return 0, nil, err
|
||||
}
|
||||
|
||||
var results structs.CheckServiceNodes
|
||||
results := make(structs.CheckServiceNodes, 0, len(services))
|
||||
for _, sn := range services {
|
||||
// Retrieve the node.
|
||||
n, err := tx.First("nodes", "id", sn.Node)
|
||||
|
Loading…
x
Reference in New Issue
Block a user