Skip to content

Commit 8fd8d0c

Browse files
Fix performance-noexcept-move-constructor clang-tidy warning (#6933)
1 parent c57b0d2 commit 8fd8d0c

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ Checks: >
5858
modernize-concat-nested-namespaces,
5959
modernize-use-using,
6060
performance-*,
61-
-performance-noexcept-move-constructor,
6261
-performance-no-int-to-ptr,
6362
-performance-enum-size,
6463
-performance-avoid-endl,

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- NodeJS:
2525
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
2626
- Misc:
27+
- FIXED: Fix performance-noexcept-move-constructor clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6933)
2728
- FIXED: Fix performance-noexcept-swap clang-tidy warning. [#6931](https://github.com/Project-OSRM/osrm-backend/pull/6931)
2829
- CHANGED: Use custom struct instead of std::pair in QueryHeap. [#6921](https://github.com/Project-OSRM/osrm-backend/pull/6921)
2930
- CHANGED: Use std::string_view::starts_with instead of boost::starts_with. [#6918](https://github.com/Project-OSRM/osrm-backend/pull/6918)

include/server/http/header.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct header
1212
// explicitly use default copy c'tor as adding move c'tor
1313
header &operator=(const header &other) = default;
1414
header(std::string name, std::string value) : name(std::move(name)), value(std::move(value)) {}
15-
header(header &&other) : name(std::move(other.name)), value(std::move(other.value)) {}
15+
header(header &&other) noexcept : name(std::move(other.name)), value(std::move(other.value)) {}
1616

1717
void clear()
1818
{

include/util/concurrent_id_map.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct ConcurrentIDMap
2626
mutable UpgradableMutex mutex;
2727

2828
ConcurrentIDMap() = default;
29-
ConcurrentIDMap(ConcurrentIDMap &&other)
29+
ConcurrentIDMap(ConcurrentIDMap &&other) noexcept
3030
{
3131
if (this != &other)
3232
{
@@ -36,7 +36,7 @@ struct ConcurrentIDMap
3636
data = std::move(other.data);
3737
}
3838
}
39-
ConcurrentIDMap &operator=(ConcurrentIDMap &&other)
39+
ConcurrentIDMap &operator=(ConcurrentIDMap &&other) noexcept
4040
{
4141
if (this != &other)
4242
{

include/util/deallocating_vector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ template <typename ElementT> class DeallocatingVector
204204
}
205205

206206
// moving is fine
207-
DeallocatingVector(DeallocatingVector &&other) { swap(other); }
208-
DeallocatingVector &operator=(DeallocatingVector &&other)
207+
DeallocatingVector(DeallocatingVector &&other) noexcept { swap(other); }
208+
DeallocatingVector &operator=(DeallocatingVector &&other) noexcept
209209
{
210210
swap(other);
211211
return *this;

include/util/dynamic_graph.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ template <typename EdgeDataT> class DynamicGraph
154154
return *this;
155155
}
156156

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

167-
DynamicGraph &operator=(DynamicGraph &&other)
167+
DynamicGraph &operator=(DynamicGraph &&other) noexcept
168168
{
169169
number_of_nodes = other.number_of_nodes;
170170
// atomics can't be moved this is why we need an own constructor

0 commit comments

Comments
 (0)