Upgrade clang-format to version 15 (#6859)
This commit is contained in:
@@ -317,7 +317,8 @@ double findClosestDistance(const std::vector<Coordinate> &lhs, const std::vector
|
||||
{
|
||||
double current_min = std::numeric_limits<double>::max();
|
||||
|
||||
const auto compute_minimum_distance_in_rhs = [¤t_min, &rhs](const Coordinate coordinate) {
|
||||
const auto compute_minimum_distance_in_rhs = [¤t_min, &rhs](const Coordinate coordinate)
|
||||
{
|
||||
current_min =
|
||||
std::min(current_min, findClosestDistance(coordinate, rhs.begin(), rhs.end()));
|
||||
return false;
|
||||
@@ -331,9 +332,8 @@ double findClosestDistance(const std::vector<Coordinate> &lhs, const std::vector
|
||||
std::vector<double> getDeviations(const std::vector<Coordinate> &from,
|
||||
const std::vector<Coordinate> &to)
|
||||
{
|
||||
auto find_deviation = [&to](const Coordinate coordinate) {
|
||||
return findClosestDistance(coordinate, to.begin(), to.end());
|
||||
};
|
||||
auto find_deviation = [&to](const Coordinate coordinate)
|
||||
{ return findClosestDistance(coordinate, to.begin(), to.end()); };
|
||||
|
||||
std::vector<double> deviations_from;
|
||||
deviations_from.reserve(from.size());
|
||||
@@ -385,9 +385,9 @@ double computeArea(const std::vector<Coordinate> &polygon)
|
||||
// ⚠ ref_latitude is the standard parallel for the equirectangular projection
|
||||
// that is not an area-preserving projection
|
||||
const auto ref_point =
|
||||
std::min_element(polygon.begin(), polygon.end(), [](const auto &lhs, const auto &rhs) {
|
||||
return lhs.lat < rhs.lat;
|
||||
});
|
||||
std::min_element(polygon.begin(),
|
||||
polygon.end(),
|
||||
[](const auto &lhs, const auto &rhs) { return lhs.lat < rhs.lat; });
|
||||
const auto ref_latitude = ref_point->lat;
|
||||
|
||||
// Compute area of under a curve and a line that is parallel the equator with ref_latitude
|
||||
|
||||
+2
-1
@@ -73,7 +73,8 @@ void Log::Init()
|
||||
{
|
||||
const bool is_terminal = IsStdoutATTY();
|
||||
|
||||
auto format = [is_terminal](const char *level, const char *color) {
|
||||
auto format = [is_terminal](const char *level, const char *color)
|
||||
{
|
||||
const auto timestamp = std::chrono::system_clock::now();
|
||||
return fmt::format("{}[{:%FT%H:%M:}{:%S}] [{}] ",
|
||||
is_terminal ? color : "",
|
||||
|
||||
@@ -327,13 +327,9 @@ struct opening_hours_grammar : qi::grammar<Iterator, Skipper, std::vector<Openin
|
||||
|
||||
// clang-format on
|
||||
|
||||
BOOST_SPIRIT_DEBUG_NODES((time_domain)(rule_sequence)(any_rule_separator)(
|
||||
selector_sequence)(wide_range_selectors)(small_range_selectors)(time_selector)(
|
||||
timespan)(time)(extended_time)(variable_time)(weekday_selector)(weekday_sequence)(
|
||||
weekday_range)(holiday_sequence)(nth_entry)(nth)(day_offset)(week_selector)(week)(
|
||||
monthday_selector)(monthday_range)(date_offset)(date_from)(date_to)(variable_date)(
|
||||
year_selector)(year_range)(plus_or_minus)(hour_minutes)(extended_hour_minutes)(comment)(
|
||||
hour)(extended_hour)(minute)(daynum)(weeknum)(year));
|
||||
BOOST_SPIRIT_DEBUG_NODES(
|
||||
(
|
||||
time_domain)(rule_sequence)(any_rule_separator)(selector_sequence)(wide_range_selectors)(small_range_selectors)(time_selector)(timespan)(time)(extended_time)(variable_time)(weekday_selector)(weekday_sequence)(weekday_range)(holiday_sequence)(nth_entry)(nth)(day_offset)(week_selector)(week)(monthday_selector)(monthday_range)(date_offset)(date_from)(date_to)(variable_date)(year_selector)(year_range)(plus_or_minus)(hour_minutes)(extended_hour_minutes)(comment)(hour)(extended_hour)(minute)(daynum)(weeknum)(year));
|
||||
}
|
||||
|
||||
qi::rule<Iterator, Skipper, std::vector<OpeningHours>()> time_domain;
|
||||
|
||||
@@ -79,7 +79,8 @@ void Timezoner::LoadLocalTimesRTree(rapidjson::Document &geojson, std::time_t ut
|
||||
// Lambda function that returns local time in the tzname time zone
|
||||
// Thread safety: MT-Unsafe const:env
|
||||
std::unordered_map<std::string, struct tm> local_time_memo;
|
||||
auto get_local_time_in_tz = [utc_time, &local_time_memo](const char *tzname) {
|
||||
auto get_local_time_in_tz = [utc_time, &local_time_memo](const char *tzname)
|
||||
{
|
||||
auto it = local_time_memo.find(tzname);
|
||||
if (it == local_time_memo.end())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user