preallocating slices (#904)

* preallocated some slices when size is known

* gofmt

* gofmt
This commit is contained in:
Till Knuesting
2019-11-04 10:33:53 +00:00
committed by Asim Aslam
parent 2f3c251b00
commit 24b8d2a315
6 changed files with 8 additions and 8 deletions

View File

@@ -171,7 +171,7 @@ func (n *Network) Routes(ctx context.Context, req *pbNet.RoutesRequest, resp *pb
return errors.InternalServerError("go.micro.network", "failed to list routes: %s", err)
}
var respRoutes []*pbRtr.Route
respRoutes := make([]*pbRtr.Route, 0, len(routes))
for _, route := range routes {
respRoute := &pbRtr.Route{
Service: route.Service,