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:
committed by
Asim Aslam
parent
4a694c9d02
commit
f67c5e779f
@ -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()...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user