-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable performance-move-const-arg clang-tidy check #6319
Merged
SiarheiFedartsou
merged 4 commits into
Project-OSRM:master
from
SiarheiFedartsou:sf-performance-move-const-arg2
Aug 23, 2022
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
bb3e065
Enable performance-move-const-arg clang-tidy check
SiarheiFedartsou 872e56a
Enable performance-move-const-arg clang-tidy check
SiarheiFedartsou f799dae
Enable performance-move-const-arg clang-tidy check
SiarheiFedartsou 812908b
Merge branch 'master' into sf-performance-move-const-arg2
SiarheiFedartsou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
} | ||
|
||
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we could probably change the signature of constructor to accept rvalues, but I decided to just keep things "as is" for now.