Skip to content
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

Fix performance-noexcept-move-constructor clang-tidy warning #6933

Merged
merged 10 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Checks: >
modernize-concat-nested-namespaces,
modernize-use-using,
performance-*,
-performance-noexcept-move-constructor,
-performance-no-int-to-ptr,
-performance-enum-size,
-performance-avoid-endl,
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- NodeJS:
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
- Misc:
- FIXED: Fix performance-noexcept-move-constructor clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6933)
- FIXED: Fix performance-noexcept-swap clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6931)
- CHANGED: Use custom struct instead of std::pair in QueryHeap. [#6921](https://github.com/Project-OSRM/osrm-backend/pull/6921)
- CHANGED: Use std::string_view::starts_with instead of boost::starts_with. [#6918](https://github.com/Project-OSRM/osrm-backend/pull/6918)
Expand Down
2 changes: 1 addition & 1 deletion include/server/http/header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct header
// explicitly use default copy c'tor as adding move c'tor
header &operator=(const header &other) = default;
header(std::string name, std::string value) : name(std::move(name)), value(std::move(value)) {}
header(header &&other) : name(std::move(other.name)), value(std::move(other.value)) {}
header(header &&other) noexcept : name(std::move(other.name)), value(std::move(other.value)) {}

void clear()
{
Expand Down
4 changes: 2 additions & 2 deletions include/util/concurrent_id_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct ConcurrentIDMap
mutable UpgradableMutex mutex;

ConcurrentIDMap() = default;
ConcurrentIDMap(ConcurrentIDMap &&other)
ConcurrentIDMap(ConcurrentIDMap &&other) noexcept
{
if (this != &other)
{
Expand All @@ -36,7 +36,7 @@ struct ConcurrentIDMap
data = std::move(other.data);
}
}
ConcurrentIDMap &operator=(ConcurrentIDMap &&other)
ConcurrentIDMap &operator=(ConcurrentIDMap &&other) noexcept
{
if (this != &other)
{
Expand Down
4 changes: 2 additions & 2 deletions include/util/deallocating_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ template <typename ElementT> class DeallocatingVector
}

// moving is fine
DeallocatingVector(DeallocatingVector &&other) { swap(other); }
DeallocatingVector &operator=(DeallocatingVector &&other)
DeallocatingVector(DeallocatingVector &&other) noexcept { swap(other); }
DeallocatingVector &operator=(DeallocatingVector &&other) noexcept
{
swap(other);
return *this;
Expand Down
4 changes: 2 additions & 2 deletions include/util/dynamic_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ template <typename EdgeDataT> class DynamicGraph
return *this;
}

DynamicGraph(DynamicGraph &&other)
DynamicGraph(DynamicGraph &&other) noexcept
{
number_of_nodes = other.number_of_nodes;
// atomics can't be moved this is why we need an own constructor
Expand All @@ -164,7 +164,7 @@ template <typename EdgeDataT> class DynamicGraph
edge_list = std::move(other.edge_list);
}

DynamicGraph &operator=(DynamicGraph &&other)
DynamicGraph &operator=(DynamicGraph &&other) noexcept
{
number_of_nodes = other.number_of_nodes;
// atomics can't be moved this is why we need an own constructor
Expand Down
Loading