summaryrefslogtreecommitdiff
path: root/src/mongo/base
diff options
context:
space:
mode:
authorAlexander Neben <alexander.neben@mongodb.com>2022-07-21 15:22:49 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-21 15:54:31 +0000
commita9670e15843c06b3bacdc661bd3666d402df09df (patch)
tree0e2d9801bffbafb88ab63a177f05e719297568b1 /src/mongo/base
parentf2fdac7de514b76a1e951bb7c9c12924fe50ac46 (diff)
downloadmongo-a9670e15843c06b3bacdc661bd3666d402df09df.tar.gz
SERVER-67133 Debug mode fixes
Diffstat (limited to 'src/mongo/base')
-rw-r--r--src/mongo/base/dependency_graph.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/base/dependency_graph.cpp b/src/mongo/base/dependency_graph.cpp
index 8d9107b5a10..612fcbc7d3d 100644
--- a/src/mongo/base/dependency_graph.cpp
+++ b/src/mongo/base/dependency_graph.cpp
@@ -105,6 +105,9 @@ std::vector<std::string> DependencyGraph::topSort(std::vector<std::string>* cycl
// Swap the pointers in the `elements` vector that point to `a` and `b`.
// Update their 'membership' data members to reflect the change.
auto swapPositions = [](Element& a, Element& b) {
+ if (&a == &b) {
+ return;
+ }
using std::swap;
swap(*a.membership, *b.membership);
swap(a.membership, b.membership);