Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/restapi/stops_for_route_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ func processTripGroups(

func generatePolylines(shapes []gtfsdb.GetShapesGroupedByTripHeadSignRow) []models.Polyline {
var polylines []models.Polyline
var coords [][]float64
// This prevents repeated memory re-allocation during the loop.
coords := make([][]float64, 0, len(shapes))
for _, shape := range shapes {
coords = append(coords, []float64{shape.Lat, shape.Lon})
}
Expand Down
Loading