Upgrade formatting to clang-format 10 (#5895)
* Update formatting tools to clang-format-10 * Reformat using clang-format-10.0.09
This commit is contained in:
@@ -39,7 +39,7 @@ unsigned calculateOverviewZoomLevel(const std::vector<LegGeometry> &leg_geometri
|
||||
|
||||
return util::viewport::getFittedZoom(south_west, north_east);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::vector<util::Coordinate> assembleOverview(const std::vector<LegGeometry> &leg_geometries,
|
||||
const bool use_simplification)
|
||||
|
||||
@@ -48,7 +48,7 @@ std::pair<short, short> getArriveBearings(const LegGeometry &leg_geometry,
|
||||
return std::make_pair<short, short>(
|
||||
std::round(util::coordinate_calculation::bearing(pre_turn_coordinate, turn_coordinate)), 0);
|
||||
}
|
||||
} // ns detail
|
||||
} // ns engine
|
||||
} // ns guidance
|
||||
} // ns detail
|
||||
} // namespace detail
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -181,9 +181,10 @@ bool isUTurn(const RouteStepIterator step_prior_to_intersection,
|
||||
const auto only_allowed_turn = (numberOfAllowedTurns(*step_leaving_intersection) == 1) &&
|
||||
noIntermediaryIntersections(*step_entering_intersection);
|
||||
|
||||
return collapsable || isLinkRoad(*step_prior_to_intersection,
|
||||
*step_entering_intersection,
|
||||
*step_leaving_intersection) ||
|
||||
return collapsable ||
|
||||
isLinkRoad(*step_prior_to_intersection,
|
||||
*step_entering_intersection,
|
||||
*step_leaving_intersection) ||
|
||||
only_allowed_turn;
|
||||
}
|
||||
|
||||
|
||||
@@ -706,8 +706,9 @@ void applyOverrides(const datafacade::BaseDataFacade &facade,
|
||||
<< " direction was "
|
||||
<< osrm::guidance::instructionModifierToString(
|
||||
step_to_update->maneuver.instruction.direction_modifier)
|
||||
<< " now " << osrm::guidance::instructionModifierToString(
|
||||
maneuver_relation.direction)
|
||||
<< " now "
|
||||
<< osrm::guidance::instructionModifierToString(
|
||||
maneuver_relation.direction)
|
||||
<< std::endl;
|
||||
step_to_update->maneuver.instruction.direction_modifier =
|
||||
maneuver_relation.direction;
|
||||
|
||||
@@ -38,29 +38,30 @@ std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps)
|
||||
|
||||
// suppresses name segments that announce already known names or announce a name that will be
|
||||
// only available for a very short time
|
||||
const auto reduce_verbosity_if_possible = [suppress, can_be_extended_to](
|
||||
RouteStepIterator ¤t_turn_itr, RouteStepIterator &previous_turn_itr) {
|
||||
if (haveSameName(*previous_turn_itr, *current_turn_itr))
|
||||
suppress(*previous_turn_itr, *current_turn_itr);
|
||||
else
|
||||
{
|
||||
// remember the location of the name change so we can advance the previous turn
|
||||
const auto location_of_name_change = current_turn_itr;
|
||||
auto distance = current_turn_itr->distance;
|
||||
// sum up all distances that can be relevant to the name change
|
||||
while (can_be_extended_to(*(current_turn_itr + 1)) &&
|
||||
distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
{
|
||||
++current_turn_itr;
|
||||
distance += current_turn_itr->distance;
|
||||
}
|
||||
|
||||
if (distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
const auto reduce_verbosity_if_possible =
|
||||
[suppress, can_be_extended_to](RouteStepIterator ¤t_turn_itr,
|
||||
RouteStepIterator &previous_turn_itr) {
|
||||
if (haveSameName(*previous_turn_itr, *current_turn_itr))
|
||||
suppress(*previous_turn_itr, *current_turn_itr);
|
||||
else
|
||||
previous_turn_itr = location_of_name_change;
|
||||
}
|
||||
};
|
||||
{
|
||||
// remember the location of the name change so we can advance the previous turn
|
||||
const auto location_of_name_change = current_turn_itr;
|
||||
auto distance = current_turn_itr->distance;
|
||||
// sum up all distances that can be relevant to the name change
|
||||
while (can_be_extended_to(*(current_turn_itr + 1)) &&
|
||||
distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
{
|
||||
++current_turn_itr;
|
||||
distance += current_turn_itr->distance;
|
||||
}
|
||||
|
||||
if (distance < NAME_SEGMENT_CUTOFF_LENGTH)
|
||||
suppress(*previous_turn_itr, *current_turn_itr);
|
||||
else
|
||||
previous_turn_itr = location_of_name_change;
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_ASSERT(!hasTurnType(steps.back()) && hasWaypointType(steps.back()));
|
||||
for (auto previous_turn_itr = steps.begin(), current_turn_itr = std::next(previous_turn_itr);
|
||||
|
||||
Reference in New Issue
Block a user