summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorDavid Percy <david.percy@mongodb.com>2022-04-11 21:20:57 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-18 17:49:56 +0000
commit3197971a3b481538c485c40f77199f7780747613 (patch)
tree9def93f22517e1617ae14e83fae0d83327fc9e1a /src/mongo/s
parentef19a6cd0bff73be9314a46ca92d4ac82e30b9fd (diff)
downloadmongo-3197971a3b481538c485c40f77199f7780747613.tar.gz
SERVER-35512 Use unique_ptr in QuerySolutionNode::children and clone()
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/chunk_manager.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/s/chunk_manager.cpp b/src/mongo/s/chunk_manager.cpp
index 888ba644b52..c269d700f5e 100644
--- a/src/mongo/s/chunk_manager.cpp
+++ b/src/mongo/s/chunk_manager.cpp
@@ -654,7 +654,7 @@ IndexBounds ChunkManager::collapseQuerySolution(const QuerySolutionNode* node) {
if (node->children.size() == 1) {
// e.g. FETCH -> IXSCAN
- return collapseQuerySolution(node->children.front());
+ return collapseQuerySolution(node->children.front().get());
}
// children.size() > 1, assert it's OR / SORT_MERGE.
@@ -671,20 +671,18 @@ IndexBounds ChunkManager::collapseQuerySolution(const QuerySolutionNode* node) {
IndexBounds bounds;
- for (std::vector<QuerySolutionNode*>::const_iterator it = node->children.begin();
- it != node->children.end();
- it++) {
+ for (auto it = node->children.begin(); it != node->children.end(); it++) {
// The first branch under OR
if (it == node->children.begin()) {
invariant(bounds.size() == 0);
- bounds = collapseQuerySolution(*it);
+ bounds = collapseQuerySolution(it->get());
if (bounds.size() == 0) { // Got unexpected node in query solution tree
return IndexBounds();
}
continue;
}
- IndexBounds childBounds = collapseQuerySolution(*it);
+ IndexBounds childBounds = collapseQuerySolution(it->get());
if (childBounds.size() == 0) {
// Got unexpected node in query solution tree
return IndexBounds();