preallocated slices (#934)
This commit is contained in:
committed by
Asim Aslam
parent
c696a859be
commit
5ae3e179b9
@@ -582,7 +582,7 @@ func (g *grpcServer) Register() error {
|
||||
return subscriberList[i].topic > subscriberList[j].topic
|
||||
})
|
||||
|
||||
var endpoints []*registry.Endpoint
|
||||
endpoints := make([]*registry.Endpoint, 0, len(handlerList)+len(subscriberList))
|
||||
for _, n := range handlerList {
|
||||
endpoints = append(endpoints, g.handlers[n].Endpoints()...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user