Skip to content

Commit

Permalink
Fix capacity of slice (#2148)
Browse files Browse the repository at this point in the history
The append keep the initial len and append to end of the
original slice
  • Loading branch information
pappz authored Jun 18, 2024
1 parent 85d17cb commit 919c1cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/internal/routemanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (m *DefaultManager) classifyRoutes(newRoutes []*route.Route) (map[route.ID]

func (m *DefaultManager) clientRoutes(initialRoutes []*route.Route) []*route.Route {
_, crMap := m.classifyRoutes(initialRoutes)
rs := make([]*route.Route, len(crMap))
rs := make([]*route.Route, 0, len(crMap))
for _, routes := range crMap {
rs = append(rs, routes...)
}
Expand Down

0 comments on commit 919c1cb

Please sign in to comment.