0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-49099 Remove the Node::swap() function in Biggie

This commit is contained in:
Yuhong Zhang 2020-07-09 15:43:33 +00:00 committed by Evergreen Agent
parent ab4d803f1f
commit 77ffbcb4f5

View File

@ -818,18 +818,6 @@ private:
virtual ~Node() = default;
friend void swap(Node& first, Node& second) {
std::swap(first.trieKey, second.trieKey);
std::swap(first.depth, second.depth);
std::swap(first.data, second.data);
std::swap(first.children, second.children);
}
Node& operator=(const Node other) {
swap(*this, other);
return *this;
}
bool isLeaf() const {
return !_numChildren;
}
@ -866,17 +854,8 @@ private:
_nextVersion->_hasPreviousVersion = false;
}
friend void swap(Head& first, Head& second) {
Node::swap(first, second);
}
Head(Head&& other) : Node(std::move(other)) {}
Head& operator=(const Head other) {
swap(*this, other);
return *this;
}
bool hasPreviousVersion() const {
return _hasPreviousVersion;
}