resolver/registry: small slice optimization
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
622490fbf3
commit
24c20b6907
@ -19,8 +19,7 @@ func (r *Resolver) Resolve(name string) ([]*resolver.Record, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var records []*resolver.Record
|
records := make([]*resolver.Record, 0, len(services))
|
||||||
|
|
||||||
for _, service := range services {
|
for _, service := range services {
|
||||||
for _, node := range service.Nodes {
|
for _, node := range service.Nodes {
|
||||||
records = append(records, &resolver.Record{
|
records = append(records, &resolver.Record{
|
||||||
|
Loading…
Reference in New Issue
Block a user