Skip to content

Commit

Permalink
Merge branch 'fix/sonarcloud-bugs'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Sep 8, 2023
2 parents 0688604 + 32c0782 commit 0662ae0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- Meaningless `location_index` provided in output for break steps (#877)
- `max_travel_time` not accounted for with vehicle steps in solving mode (#954)
- `max_travel_time` not accounted for in `RouteSplit` (#941)
- Address sonarcloud "bugs" reports (#984)

## [v1.13.0] - 2023-01-31

Expand Down
16 changes: 7 additions & 9 deletions src/algorithms/munkres.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All rights reserved (see LICENSE).
*/

#include <algorithm>
#include <cassert>
#include <limits>
#include <set>
Expand Down Expand Up @@ -115,15 +116,12 @@ minimum_weight_perfect_matching(const Matrix<T>& m) {
// Step 3.

// First y in equality neighbors not in T_set.
Index chosen_y;
for (auto const& edge : alternating_tree) {
if (T_set.find(edge.first) == T_set.end()) {
// MUST happen before endge reaches the end of
// alternating_tree.
chosen_y = edge.first;
break;
}
}
const auto it =
std::ranges::find_if(alternating_tree, [&](const auto& edge) {
return T_set.find(edge.first) == T_set.end();
});
assert(it != alternating_tree.end());
auto chosen_y = it->first;

auto matching_y = matching_yx.find(chosen_y);
if (matching_y != matching_yx.end()) {
Expand Down
5 changes: 3 additions & 2 deletions src/structures/vroom/input/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void Input::set_geometry(bool geometry) {
void Input::add_routing_wrapper(const std::string& profile) {
#if !USE_ROUTING
throw RoutingException("VROOM compiled without routing support.");
#endif
#else

if (!_has_all_coordinates) {
throw InputException("Missing coordinates for routing engine.");
Expand Down Expand Up @@ -78,11 +78,11 @@ void Input::add_routing_wrapper(const std::string& profile) {
} catch (const osrm::exception& e) {
throw InputException("Invalid profile: " + profile);
}
break;
#else
// Attempt to use libosrm while compiling without it.
throw RoutingException("VROOM compiled without libosrm installed.");
#endif
break;
case ROUTER::ORS: {
// Use ORS http wrapper.
auto search = _servers.find(profile);
Expand All @@ -102,6 +102,7 @@ void Input::add_routing_wrapper(const std::string& profile) {
std::make_unique<routing::ValhallaWrapper>(profile, search->second);
} break;
}
#endif
}

void Input::check_job(Job& job) {
Expand Down

0 comments on commit 0662ae0

Please sign in to comment.