                recompute_backoff = std::max(0, recompute_backoff - 1);
                recompute_countdown = 0;
              }
            }
          }
        }
      } else {
 
</s> remove             last_maneuver_distance = next_maneuver_distance;
          }
        } else {
          // Destination reached
          Params().remove("NavDestination");

          // Clear route if driving away from destination
          float d = segment.maneuver().position().distanceTo(to_QGeoCoordinate(*last_position));
          if (d > REROUTE_DISTANCE) {
            clearRoute();
 </s> add  </s> remove         // Handle transition to next route segment
        auto next_segment = segment.nextRouteSegment();
        if (next_segment.isValid()) {
          auto next_maneuver = next_segment.maneuver();
          if (next_maneuver.isValid()) {
            float next_maneuver_distance = next_maneuver.position().distanceTo(to_QGeoCoordinate(*last_position));
            // Switch to next route segment
            if (next_maneuver_distance < REROUTE_DISTANCE && next_maneuver_distance > last_maneuver_distance) {
 </s> add           // Transition to next route segment
          if (distance_to_maneuver < -MANEUVER_TRANSITION_THRESHOLD) {
            auto next_segment = segment.nextRouteSegment();
            if (next_segment.isValid()) { </s> remove         }
 </s> add  </s> remove             emit instructionsChanged(banner_0, distance < show_at);
 </s> add             emit instructionsChanged(banner_0, distance_to_maneuver < show_at); </s> remove   double last_maneuver_distance = 1000;
 </s> add 
            } else {
              // Destination reached
              Params().remove("NavDestination");

              // Clear route if driving away from destination
              float d = segment.maneuver().position().distanceTo(to_QGeoCoordinate(*last_position));
              if (d > REROUTE_DISTANCE) {
                clearRoute();
              }
                recompute_backoff = std::max(0, recompute_backoff - 1);
                recompute_countdown = 0;
            } else {
              // Destination reached
              Params().remove("NavDestination");

              // Clear route if driving away from destination
              float d = segment.maneuver().position().distanceTo(to_QGeoCoordinate(*last_position));
              if (d > REROUTE_DISTANCE) {
                clearRoute();
              }
              }
            }
          }
        }
      } else {
keep add keep keep keep keep keep
 nav: simplify segment transition (#21383) 
selfdrive/ui/qt/maps/map.cc