Skip to content

Commit 73d89a5

Browse files
committed
CXX-3037 Address Coverity issue 119926 (#1140)
1 parent 591ab14 commit 73d89a5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/mongocxx/lib/mongocxx/v_noabi/mongocxx/events/topology_description.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ namespace mongocxx {
2222
namespace v_noabi {
2323
namespace events {
2424

25-
topology_description::server_descriptions::server_descriptions(
26-
server_descriptions&& other) noexcept {
27-
swap(other);
25+
topology_description::server_descriptions::server_descriptions(server_descriptions&& other) noexcept
26+
: _container(std::move(other._container)), _sds(other._sds), _size(other._size) {
27+
other._sds = nullptr;
28+
other._size = 0u;
2829
}
2930

3031
topology_description::server_descriptions& topology_description::server_descriptions::operator=(
3132
server_descriptions&& other) noexcept {
32-
swap(other);
33+
auto tmp = std::move(other);
34+
swap(tmp);
3335
return *this;
3436
}
3537

0 commit comments

Comments
 (0)