Enable performance-move-const-arg clang-tidy check (#6319)

This commit is contained in:
Siarhei Fedartsou
2022-08-23 19:03:41 +02:00
committed by GitHub
parent 869b3fae82
commit 8e74b7af9d
19 changed files with 55 additions and 63 deletions
@@ -23,7 +23,7 @@ inline auto contractFullGraph(ContractorGraph contractor_graph,
auto edges = toEdges<QueryEdge>(std::move(contractor_graph));
std::vector<bool> edge_filter(edges.size(), true);
return GraphAndFilter{QueryGraph{num_nodes, std::move(edges)}, {std::move(edge_filter)}};
return GraphAndFilter{QueryGraph{num_nodes, edges}, {std::move(edge_filter)}};
}
inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
@@ -91,7 +91,7 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
edge_container.Merge(toEdges<QueryEdge>(std::move(filtered_core_graph)));
}
return GraphAndFilter{QueryGraph{num_nodes, std::move(edge_container.edges)},
return GraphAndFilter{QueryGraph{num_nodes, edge_container.edges},
edge_container.MakeEdgeFilters()};
}
} // namespace contractor
+2 -2
View File
@@ -58,8 +58,8 @@ struct QueryEdge
QueryEdge() : source(SPECIAL_NODEID), target(SPECIAL_NODEID) {}
QueryEdge(NodeID source, NodeID target, EdgeData data)
: source(source), target(target), data(std::move(data))
QueryEdge(NodeID source, NodeID target, const EdgeData &data)
: source(source), target(target), data(data)
{
}
@@ -99,7 +99,7 @@ inline LegGeometry assembleGeometry(const datafacade::BaseDataFacade &facade,
(path_point.weight_until_turn - path_point.weight_of_turn) /
facade.GetWeightMultiplier(),
path_point.datasource_id});
geometry.locations.push_back(std::move(coordinate));
geometry.locations.push_back(coordinate);
geometry.node_ids.push_back(node_id);
}
}
@@ -63,8 +63,8 @@ struct InternalExtractorEdge
WeightData weight_data,
DurationData duration_data,
util::Coordinate source_coordinate)
: result(source, target, 0, 0, 0, {}, -1, {}), weight_data(std::move(weight_data)),
duration_data(std::move(duration_data)), source_coordinate(std::move(source_coordinate))
: result(source, target, 0, 0, 0, {}, -1, {}), weight_data(weight_data),
duration_data(duration_data), source_coordinate(source_coordinate)
{
}
@@ -72,7 +72,7 @@ struct InternalExtractorEdge
WeightData weight_data,
DurationData duration_data,
util::Coordinate source_coordinate)
: result(std::move(edge)), weight_data(weight_data), duration_data(duration_data),
: result(edge), weight_data(weight_data), duration_data(duration_data),
source_coordinate(source_coordinate)
{
}
+3 -2
View File
@@ -24,9 +24,10 @@ namespace partitioner
// located at for use in the inertial flow sorting by slope.
struct BisectionNode
{
BisectionNode(util::Coordinate coordinate_ = {util::FloatLongitude{0}, util::FloatLatitude{0}},
BisectionNode(const util::Coordinate &coordinate_ = {util::FloatLongitude{0},
util::FloatLatitude{0}},
const NodeID original_id_ = SPECIAL_NODEID)
: coordinate(std::move(coordinate_)), original_id(original_id_)
: coordinate(coordinate_), original_id(original_id_)
{
}
@@ -195,7 +195,7 @@ inline DynamicEdgeBasedGraph LoadEdgeBasedGraph(const boost::filesystem::path &p
auto directed = splitBidirectionalEdges(edges);
auto tidied = prepareEdgesForUsageInGraph<DynamicEdgeBasedGraphEdge>(std::move(directed));
return DynamicEdgeBasedGraph(number_of_edge_based_nodes, std::move(tidied), checksum);
return DynamicEdgeBasedGraph(number_of_edge_based_nodes, tidied, checksum);
}
} // namespace partitioner
+1 -1
View File
@@ -59,7 +59,7 @@ class BaseDataLayout
public:
virtual ~BaseDataLayout() = default;
inline void SetBlock(const std::string &name, Block block) { blocks[name] = std::move(block); }
inline void SetBlock(const std::string &name, const Block &block) { blocks[name] = block; }
inline std::uint64_t GetBlockEntries(const std::string &name) const
{
+26 -34
View File
@@ -77,7 +77,7 @@ inline auto make_name_table_view(const SharedDataIndex &index, const std::string
auto values =
make_vector_view<extractor::NameTableView::IndexedData::ValueType>(index, name + "/values");
extractor::NameTableView::IndexedData index_data_view{std::move(blocks), std::move(values)};
extractor::NameTableView::IndexedData index_data_view{blocks, values};
return extractor::NameTableView{index_data_view};
}
@@ -156,14 +156,14 @@ inline auto make_segment_data_view(const SharedDataIndex &index, const std::stri
auto rev_datasources_list =
make_vector_view<DatasourceID>(index, name + "/reverse_data_sources");
return extractor::SegmentDataView{std::move(geometry_begin_indices),
std::move(node_list),
std::move(fwd_weight_list),
std::move(rev_weight_list),
std::move(fwd_duration_list),
std::move(rev_duration_list),
std::move(fwd_datasources_list),
std::move(rev_datasources_list)};
return extractor::SegmentDataView{geometry_begin_indices,
node_list,
fwd_weight_list,
rev_weight_list,
fwd_duration_list,
rev_duration_list,
fwd_datasources_list,
rev_datasources_list};
}
inline auto make_coordinates_view(const SharedDataIndex &index, const std::string &name)
@@ -214,7 +214,7 @@ inline auto make_search_tree_view(const SharedDataIndex &index, const std::strin
}
return util::StaticRTree<RTreeLeaf, storage::Ownership::View>{
std::move(search_tree), std::move(rtree_level_starts), path, std::move(coordinates)};
search_tree, rtree_level_starts, path, coordinates};
}
inline auto make_intersection_bearings_view(const SharedDataIndex &index, const std::string &name)
@@ -225,13 +225,11 @@ inline auto make_intersection_bearings_view(const SharedDataIndex &index, const
index, name + "/class_id_to_ranges/diff_blocks");
auto bearing_values = make_vector_view<DiscreteBearing>(index, name + "/bearing_values");
util::RangeTable<16, storage::Ownership::View> bearing_range_table(
std::move(bearing_offsets),
std::move(bearing_blocks),
static_cast<unsigned>(bearing_values.size()));
bearing_offsets, bearing_blocks, static_cast<unsigned>(bearing_values.size()));
auto bearing_class_id = make_vector_view<BearingClassID>(index, name + "/node_to_class_id");
return extractor::IntersectionBearingsView{
std::move(bearing_values), std::move(bearing_class_id), std::move(bearing_range_table)};
bearing_values, bearing_class_id, bearing_range_table};
}
inline auto make_entry_classes_view(const SharedDataIndex &index, const std::string &name)
@@ -252,8 +250,7 @@ inline auto make_contracted_metric_view(const SharedDataIndex &index, const std:
edge_filter.push_back(make_vector_view<bool>(index, filter_name));
}));
return contractor::ContractedMetricView{{std::move(node_list), std::move(edge_list)},
std::move(edge_filter)};
return contractor::ContractedMetricView{{node_list, edge_list}, std::move(edge_filter)};
}
inline auto make_partition_view(const SharedDataIndex &index, const std::string &name)
@@ -264,8 +261,7 @@ inline auto make_partition_view(const SharedDataIndex &index, const std::string
auto partition = make_vector_view<PartitionID>(index, name + "/partition");
auto cell_to_children = make_vector_view<CellID>(index, name + "/cell_to_children");
return partitioner::MultiLevelPartitionView{
level_data_ptr, std::move(partition), std::move(cell_to_children)};
return partitioner::MultiLevelPartitionView{level_data_ptr, partition, cell_to_children};
}
inline auto make_timestamp_view(const SharedDataIndex &index, const std::string &name)
@@ -280,10 +276,8 @@ inline auto make_cell_storage_view(const SharedDataIndex &index, const std::stri
auto cells = make_vector_view<partitioner::CellStorageView::CellData>(index, name + "/cells");
auto level_offsets = make_vector_view<std::uint64_t>(index, name + "/level_to_cell_offset");
return partitioner::CellStorageView{std::move(source_boundary),
std::move(destination_boundary),
std::move(cells),
std::move(level_offsets)};
return partitioner::CellStorageView{
source_boundary, destination_boundary, cells, level_offsets};
}
inline auto make_filtered_cell_metric_view(const SharedDataIndex &index,
@@ -301,8 +295,7 @@ inline auto make_filtered_cell_metric_view(const SharedDataIndex &index,
auto durations = make_vector_view<EdgeDuration>(index, durations_block_id);
auto distances = make_vector_view<EdgeDistance>(index, distances_block_id);
return customizer::CellMetricView{
std::move(weights), std::move(durations), std::move(distances)};
return customizer::CellMetricView{weights, durations, distances};
}
inline auto make_cell_metric_view(const SharedDataIndex &index, const std::string &name)
@@ -321,8 +314,7 @@ inline auto make_cell_metric_view(const SharedDataIndex &index, const std::strin
auto durations = make_vector_view<EdgeDuration>(index, durations_block_id);
auto distances = make_vector_view<EdgeDistance>(index, distances_block_id);
cell_metric_excludes.push_back(customizer::CellMetricView{
std::move(weights), std::move(durations), std::move(distances)});
cell_metric_excludes.push_back(customizer::CellMetricView{weights, durations, distances});
}
return cell_metric_excludes;
@@ -342,14 +334,14 @@ inline auto make_multi_level_graph_view(const SharedDataIndex &index, const std:
auto is_forward_edge = make_vector_view<bool>(index, name + "/is_forward_edge");
auto is_backward_edge = make_vector_view<bool>(index, name + "/is_backward_edge");
return customizer::MultiLevelEdgeBasedGraphView(std::move(node_list),
std::move(edge_list),
std::move(node_to_offset),
std::move(node_weights),
std::move(node_durations),
std::move(node_distances),
std::move(is_forward_edge),
std::move(is_backward_edge));
return customizer::MultiLevelEdgeBasedGraphView(node_list,
edge_list,
node_to_offset,
node_weights,
node_durations,
node_distances,
is_forward_edge,
is_backward_edge);
}
inline auto make_maneuver_overrides_views(const SharedDataIndex &index, const std::string &name)