Enable even more clang-tidy checks (#6273)

This commit is contained in:
Siarhei Fedartsou
2022-07-04 22:46:59 +02:00
committed by GitHub
parent 19d2ec56b8
commit 06b1b980bb
39 changed files with 84 additions and 76 deletions
+2 -2
View File
@@ -192,8 +192,8 @@ util::json::Object makeRouteStep(guidance::RouteStep step, util::json::Value geo
}
}
route_step.values["mode"] = extractor::travelModeToString(std::move(step.mode));
route_step.values["maneuver"] = makeStepManeuver(std::move(step.maneuver));
route_step.values["mode"] = extractor::travelModeToString(step.mode);
route_step.values["maneuver"] = makeStepManeuver(step.maneuver);
route_step.values["geometry"] = std::move(geometry);
route_step.values["driving_side"] = step.is_left_hand_driving ? "left" : "right";
+7 -2
View File
@@ -484,7 +484,9 @@ std::
// OSM elements Lua parser
tbb::filter_t<SharedBuffer, ParsedBuffer> buffer_transformer(
tbb::filter::parallel, [&](const SharedBuffer buffer) {
tbb::filter::parallel,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[&](const SharedBuffer buffer) {
ParsedBuffer parsed_buffer;
parsed_buffer.buffer = buffer;
scripting_environment.ProcessElements(*buffer,
@@ -531,7 +533,9 @@ std::
});
tbb::filter_t<SharedBuffer, std::shared_ptr<ExtractionRelationContainer>> buffer_relation_cache(
tbb::filter::parallel, [&](const SharedBuffer buffer) {
tbb::filter::parallel,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[&](const SharedBuffer buffer) {
if (!buffer)
return std::shared_ptr<ExtractionRelationContainer>{};
@@ -568,6 +572,7 @@ std::
unsigned number_of_relations = 0;
tbb::filter_t<std::shared_ptr<ExtractionRelationContainer>, void> buffer_storage_relation(
tbb::filter::serial_in_order,
// NOLINTNEXTLINE(performance-unnecessary-value-param)
[&](const std::shared_ptr<ExtractionRelationContainer> parsed_relations) {
number_of_relations += parsed_relations->GetRelationsNum();
relations.Merge(std::move(*parsed_relations));
@@ -419,10 +419,10 @@ bool MergableRoadDetector::HaveSameDirection(const NodeID intersection_node,
// sampling to correctly weight longer segments in regression calculations
const auto constexpr SAMPLE_INTERVAL = 5;
coordinates_to_the_left = coordinate_extractor.SampleCoordinates(
std::move(coordinates_to_the_left), distance_to_extract, SAMPLE_INTERVAL);
coordinates_to_the_left, distance_to_extract, SAMPLE_INTERVAL);
coordinates_to_the_right = coordinate_extractor.SampleCoordinates(
std::move(coordinates_to_the_right), distance_to_extract, SAMPLE_INTERVAL);
coordinates_to_the_right, distance_to_extract, SAMPLE_INTERVAL);
/* extract the number of lanes for a road
* restricts a vector to the last two thirds of the length
+1 -1
View File
@@ -891,7 +891,7 @@ void Sol2ScriptingEnvironment::ProcessElements(
{
local_context.ProcessNode(node, result_node, relations);
}
resulting_nodes.push_back({node, std::move(result_node)});
resulting_nodes.push_back({node, result_node});
}
break;
case osmium::item_type::way:
@@ -109,8 +109,8 @@ std::unordered_set<EdgeID> findSegregatedNodes(const extractor::NodeBasedGraphFa
};
auto isSegregated = [&](NodeID node1,
std::vector<EdgeInfo> v1,
std::vector<EdgeInfo> v2,
const std::vector<EdgeInfo> &v1,
const std::vector<EdgeInfo> &v2,
EdgeInfo const &current,
double edge_length) {
// Internal intersection edges must be short and cannot be a roundabout.
+1 -1
View File
@@ -64,7 +64,7 @@ bool TurnLaneData::operator<(const TurnLaneData &other) const
std::find(tag_by_modifier, tag_by_modifier + 8, other.tag);
}
LaneDataVector laneDataFromDescription(TurnLaneDescription turn_lane_description)
LaneDataVector laneDataFromDescription(const TurnLaneDescription &turn_lane_description)
{
typedef std::unordered_map<TurnLaneType::Mask, std::pair<LaneID, LaneID>> LaneMap;
// TODO need to handle cases that have none-in between two identical values
+1
View File
@@ -70,6 +70,7 @@ namespace
template <typename T> inline bool is_aligned(const void *pointer)
{
// NOLINTNEXTLINE(misc-redundant-expression)
static_assert(sizeof(T) % alignof(T) == 0, "pointer can not be used as an array pointer");
return reinterpret_cast<uintptr_t>(pointer) % alignof(T) == 0;
}
+2 -2
View File
@@ -55,7 +55,7 @@ util::json::Object
CoordinateVectorToMultiPoint::operator()(const std::vector<util::Coordinate> &input_coordinates,
const boost::optional<json::Object> &properties) const
{
const auto coordinates = makeJsonArray(input_coordinates);
auto coordinates = makeJsonArray(input_coordinates);
return makeFeature("MultiPoint", std::move(coordinates), properties);
}
@@ -64,7 +64,7 @@ util::json::Object
CoordinateVectorToLineString::operator()(const std::vector<util::Coordinate> &input_coordinates,
const boost::optional<json::Object> &properties) const
{
const auto coordinates = makeJsonArray(input_coordinates);
auto coordinates = makeJsonArray(input_coordinates);
return makeFeature("LineString", std::move(coordinates), properties);
}