preallocated slices (#934)
This commit is contained in:
parent
f867969aa3
commit
592f1fb218
2
grpc.go
2
grpc.go
@ -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()...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user