From 2548ab79209616b24af4661ce2cb829ea025a686 Mon Sep 17 00:00:00 2001 From: rshokri Date: Sun, 19 Nov 2023 13:07:22 +0330 Subject: [PATCH 1/3] sort manuever overrides vector after partition --- src/partitioner/partitioner.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/partitioner/partitioner.cpp b/src/partitioner/partitioner.cpp index 636bd290e45..40042462d70 100644 --- a/src/partitioner/partitioner.cpp +++ b/src/partitioner/partitioner.cpp @@ -162,6 +162,13 @@ int Partitioner::Run(const PartitionerConfig &config) extractor::files::readManeuverOverrides(filename, maneuver_overrides, node_sequences); renumber(maneuver_overrides, permutation); renumber(node_sequences, permutation); + + // Although the vector is already sorted, the rename function changes the identifiers, so the order is not sorted now. + // So we sort by `from_node` again, so that later lookups can be done with a binary search. + std::sort(maneuver_overrides.begin(), + maneuver_overrides.end(), + [](const auto &a, const auto &b) { return a.start_node < b.start_node; }); + extractor::files::writeManeuverOverrides(filename, maneuver_overrides, node_sequences); } if (boost::filesystem::exists(config.GetPath(".osrm.hsgr"))) From e1aecf2c4e59b32145217b0a33a7d087a4ecd12c Mon Sep 17 00:00:00 2001 From: Michael Bell Date: Sun, 24 Mar 2024 20:24:59 +0000 Subject: [PATCH 2/3] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa6ef8c73b4..8c5ba3407e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ - Routing: - FIXED: Fix adding traffic signal penalties during compression [#6419](https://github.com/Project-OSRM/osrm-backend/pull/6419) - FIXED: Correctly handle compressed traffic signals. [#6724](https://github.com/Project-OSRM/osrm-backend/pull/6724) + - FIXED: Fix bug when searching for maneuver overrides [#6739](https://github.com/Project-OSRM/osrm-backend/pull/6739) # 5.27.1 - Changes from 5.27.0 - Misc: From c5d3c65f4c007174459950f4db140b2a778b3b65 Mon Sep 17 00:00:00 2001 From: Michael Bell Date: Sun, 24 Mar 2024 20:32:44 +0000 Subject: [PATCH 3/3] clang-format --- src/partitioner/partitioner.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/partitioner/partitioner.cpp b/src/partitioner/partitioner.cpp index 40042462d70..e8544bf64de 100644 --- a/src/partitioner/partitioner.cpp +++ b/src/partitioner/partitioner.cpp @@ -163,12 +163,13 @@ int Partitioner::Run(const PartitionerConfig &config) renumber(maneuver_overrides, permutation); renumber(node_sequences, permutation); - // Although the vector is already sorted, the rename function changes the identifiers, so the order is not sorted now. - // So we sort by `from_node` again, so that later lookups can be done with a binary search. + // Although the vector is already sorted, the rename function changes the identifiers, so + // the order is not sorted now. So we sort by `from_node` again, so that later lookups can + // be done with a binary search. std::sort(maneuver_overrides.begin(), - maneuver_overrides.end(), - [](const auto &a, const auto &b) { return a.start_node < b.start_node; }); - + maneuver_overrides.end(), + [](const auto &a, const auto &b) { return a.start_node < b.start_node; }); + extractor::files::writeManeuverOverrides(filename, maneuver_overrides, node_sequences); } if (boost::filesystem::exists(config.GetPath(".osrm.hsgr")))