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

@@ -22,7 +22,7 @@ func (r *Router) Lookup(ctx context.Context, req *pb.LookupRequest, resp *pb.Loo
return errors.InternalServerError("go.micro.router", "failed to lookup routes: %v", err)
}
var respRoutes []*pb.Route
respRoutes := make([]*pb.Route, 0, len(routes))
for _, route := range routes {
respRoute := &pb.Route{
Service: route.Service,