Fix capacity of slice (#2148)

The append keep the initial len and append to end of the
original slice
This commit is contained in:
Zoltan Papp 2024-06-18 15:31:40 +02:00 committed by GitHub
parent 85d17cbc89
commit 919c1cb3d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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...)
}