Skip to content

Commit

Permalink
Avoid copy of intersection in totalTurnAngle (Project-OSRM#6938)
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou authored Jun 10, 2024
1 parent 0188d2b commit de2f392
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- NodeJS:
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
- Misc:
- CHANGED: Avoid copy of intersection in totalTurnAngle. [#6938](https://github.com/Project-OSRM/osrm-backend/pull/6938)
- CHANGED: Use std::unordered_map::emplace instead of operator[] when producing JSONs. [#6936](https://github.com/Project-OSRM/osrm-backend/pull/6936)
- CHANGED: Avoid copy of vectors in MakeRoute function. [#6939](https://github.com/Project-OSRM/osrm-backend/pull/6939)
- FIXED: Fix bugprone-unused-return-value clang-tidy warning. [#6934](https://github.com/Project-OSRM/osrm-backend/pull/6934)
Expand Down
4 changes: 2 additions & 2 deletions include/engine/guidance/collapsing_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit de2f392

Please sign in to comment.