Avoid copy of intersection in totalTurnAngle

This commit is contained in:
Siarhei Fedartsou 2024-06-09 19:29:18 +02:00
parent 89435aa87f
commit e85a237180

View File

@ -202,8 +202,8 @@ inline double totalTurnAngle(const RouteStep &entry_step, const RouteStep &exit_
if (entry_step.geometry_begin > exit_step.geometry_begin)
return totalTurnAngle(exit_step, entry_step);
const auto exit_intersection = exit_step.intersections.front();
const auto entry_intersection = entry_step.intersections.front();
const auto& exit_intersection = exit_step.intersections.front();
const auto& entry_intersection = entry_step.intersections.front();
if ((exit_intersection.out >= exit_intersection.bearings.size()) ||
(entry_intersection.in >= entry_intersection.bearings.size()))
return entry_intersection.bearings[entry_intersection.out];