@@ -518,17 +518,17 @@ std::optional<path> route_bidirectional(ways const& w,
518
518
return *direct;
519
519
}
520
520
521
- b.reset (max, from, to);
522
- if (b.radius_ == max) {
523
- return std::nullopt ;
524
- }
525
-
526
521
auto const limit_squared_max_matching_distance =
527
522
geo::approx_squared_distance (from.pos_ , to.pos_ ,
528
523
b.distance_lon_degrees_ ) /
529
524
kMaxMatchingDistanceSquaredRatio ;
530
525
531
526
for (auto const accept_bad_max_matching_dist : {false , true }) {
527
+ b.reset (max, from, to);
528
+ if (b.radius_ == max) {
529
+ return std::nullopt ;
530
+ }
531
+
532
532
for (auto const [i, start] : utl::enumerate (from_match)) {
533
533
if (b.max_reached_1_ && component_seen (w, from_match, i)) {
534
534
continue ;
@@ -617,10 +617,10 @@ std::optional<path> route_dijkstra(ways const& w,
617
617
}
618
618
619
619
auto const distance_lng_degrees = geo::approx_distance_lng_degrees (from.pos_ );
620
-
621
- d.reset (max);
622
- auto should_continue = true ;
623
620
for (auto const accept_bad_max_matching_dist : {false , true }) {
621
+ d.reset (max);
622
+ auto should_continue = true ;
623
+
624
624
auto const limit_squared_max_matching_distance =
625
625
accept_bad_max_matching_dist
626
626
? std::numeric_limits<double >::max ()
@@ -694,9 +694,9 @@ std::vector<std::optional<path>> route(
694
694
auto const distance_lng_degrees = geo::approx_distance_lng_degrees (from.pos_ );
695
695
696
696
d.reset (max);
697
- auto should_continue = true ;
698
697
699
698
for (auto const accept_bad_max_matching_dist : {false , true }) {
699
+ auto should_continue = true ;
700
700
for (auto const [i, start] : utl::enumerate (from_match)) {
701
701
if (!should_continue && component_seen (w, from_match, i)) {
702
702
continue ;
0 commit comments