mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[traffic] Use references for loop, not copies
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -1075,7 +1075,7 @@ void RoutingTraffDecoder::DecodeLocationDirection(traffxml::TraffMessage & messa
|
|||||||
routing::RouteSegment & closestRSegment = rsegments.front();
|
routing::RouteSegment & closestRSegment = rsegments.front();
|
||||||
double closestDist = ms::DistanceOnEarth(at, mercator::ToLatLon(closestRSegment.GetJunction().GetPoint()));
|
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 we have more than two checkpoints, fake segments can occur in the middle, skip them.
|
||||||
if (rsegment.GetSegment().GetMwmId() == routing::kFakeNumMwmId)
|
if (rsegment.GetSegment().GetMwmId() == routing::kFakeNumMwmId)
|
||||||
@@ -1092,7 +1092,7 @@ void RoutingTraffDecoder::DecodeLocationDirection(traffxml::TraffMessage & messa
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
// from–[via]–to, add all real segments
|
// from–[via]–to, add all real segments
|
||||||
for (auto rsegment : rsegments)
|
for (auto & rsegment : rsegments)
|
||||||
{
|
{
|
||||||
routing::Segment & segment = rsegment.GetSegment();
|
routing::Segment & segment = rsegment.GetSegment();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user