preallocating slices (#904)
* preallocated some slices when size is known * gofmt * gofmt
This commit is contained in:
committed by
Asim Aslam
parent
2f3c251b00
commit
24b8d2a315
@@ -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,
|
||||
|
Reference in New Issue
Block a user