preallocated slices (#934)

This commit is contained in:
Till Knuesting 2019-11-11 00:03:51 +00:00 committed by Vasiliy Tolstov
parent f867969aa3
commit 592f1fb218

View File

@ -582,7 +582,7 @@ func (g *grpcServer) Register() error {
return subscriberList[i].topic > subscriberList[j].topic return subscriberList[i].topic > subscriberList[j].topic
}) })
var endpoints []*registry.Endpoint endpoints := make([]*registry.Endpoint, 0, len(handlerList)+len(subscriberList))
for _, n := range handlerList { for _, n := range handlerList {
endpoints = append(endpoints, g.handlers[n].Endpoints()...) endpoints = append(endpoints, g.handlers[n].Endpoints()...)
} }