From a9670e15843c06b3bacdc661bd3666d402df09df Mon Sep 17 00:00:00 2001 From: Alexander Neben Date: Thu, 21 Jul 2022 15:22:49 +0000 Subject: SERVER-67133 Debug mode fixes --- src/mongo/base/dependency_graph.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mongo/base') 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 DependencyGraph::topSort(std::vector* 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); -- cgit v1.2.1