Skip to content

Commit

Permalink
Avoid copy of vectors in MakeRoute function (#6939)
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou authored Jun 10, 2024
1 parent 89435aa commit 054161f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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 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)
- FIXED: Fix performance-noexcept-move-constructor clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6933)
- FIXED: Fix performance-noexcept-swap clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6931)
Expand Down
8 changes: 4 additions & 4 deletions include/engine/api/route_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ class RouteAPI : public BaseAPI
unpacked_path_segments,
source_traversed_in_reverse,
target_traversed_in_reverse);
std::vector<guidance::RouteLeg> legs = legs_info.first;
std::vector<guidance::LegGeometry> leg_geometries = legs_info.second;
std::vector<guidance::RouteLeg> &legs = legs_info.first;
std::vector<guidance::LegGeometry> &leg_geometries = legs_info.second;
auto route = guidance::assembleRoute(legs);

// Fill legs
Expand Down Expand Up @@ -716,8 +716,8 @@ class RouteAPI : public BaseAPI
unpacked_path_segments,
source_traversed_in_reverse,
target_traversed_in_reverse);
std::vector<guidance::RouteLeg> legs = legs_info.first;
std::vector<guidance::LegGeometry> leg_geometries = legs_info.second;
std::vector<guidance::RouteLeg> &legs = legs_info.first;
std::vector<guidance::LegGeometry> &leg_geometries = legs_info.second;

auto route = guidance::assembleRoute(legs);
boost::optional<util::json::Value> json_overview =
Expand Down

0 comments on commit 054161f

Please sign in to comment.