[traffic] Use references for loop, not copies

Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
mvglasow
2025-10-25 15:12:05 +03:00
parent 9065f45b21
commit 3ec32e4415

View File

@@ -1075,7 +1075,7 @@ void RoutingTraffDecoder::DecodeLocationDirection(traffxml::TraffMessage & messa
routing::RouteSegment & closestRSegment = rsegments.front();
double closestDist = ms::DistanceOnEarth(at, mercator::ToLatLon(closestRSegment.GetJunction().GetPoint()));
for (auto rsegment : rsegments)
for (auto & rsegment : rsegments)
{
// If we have more than two checkpoints, fake segments can occur in the middle, skip them.
if (rsegment.GetSegment().GetMwmId() == routing::kFakeNumMwmId)
@@ -1092,7 +1092,7 @@ void RoutingTraffDecoder::DecodeLocationDirection(traffxml::TraffMessage & messa
}
else
// from[via]to, add all real segments
for (auto rsegment : rsegments)
for (auto & rsegment : rsegments)
{
routing::Segment & segment = rsegment.GetSegment();