1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

preallocated slices (#917)

This commit is contained in:
Till Knuesting
2019-11-05 17:43:12 +00:00
committed by Asim Aslam
parent 4a694c9d02
commit f67c5e779f
10 changed files with 10 additions and 10 deletions

View File

@ -490,7 +490,7 @@ func (s *rpcServer) 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, s.handlers[n].Endpoints()...)
}