From 5d66586c381201742a813b394662bbefadc8edf4 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 14 May 2026 18:31:01 +0000 Subject: [PATCH] Fix route priority sort indexing Signed-off-by: Bradley Dice --- cpp/src/routing/adapters/adapted_sol.cuh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cpp/src/routing/adapters/adapted_sol.cuh b/cpp/src/routing/adapters/adapted_sol.cuh index 463f876ff7..e94e401202 100644 --- a/cpp/src/routing/adapters/adapted_sol.cuh +++ b/cpp/src/routing/adapters/adapted_sol.cuh @@ -370,13 +370,8 @@ struct adapted_sol_t { // we favor removal of routes with less number of nodes to maintain structure if (num_routes_to_remove <= remove_route_ids.size()) { // if remove_route_ids is sufficiently large then proceed to remove (a subset) of them - std::vector route_priority; - route_priority.reserve(remove_route_ids.size()); - for (auto& id : remove_route_ids) { - route_priority.push_back(routes[id].length); - } std::sort(remove_route_ids.begin(), remove_route_ids.end(), [&](auto i, auto j) { - return route_priority[i] < route_priority[j]; + return routes[i].length < routes[j].length; }); remove_route_ids.resize(num_routes_to_remove); } else {