From 592f1fb218c4b9aa7a4d54fa1f6119ab83a11413 Mon Sep 17 00:00:00 2001 From: Till Knuesting Date: Mon, 11 Nov 2019 00:03:51 +0000 Subject: [PATCH] preallocated slices (#934) --- grpc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grpc.go b/grpc.go index 9b66428..ef61308 100644 --- a/grpc.go +++ b/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()...) }