summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/plan_ranking.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2018-01-09 17:57:41 -0500
committerDavid Storch <david.storch@10gen.com>2018-01-11 18:43:25 -0500
commite377025071e4c9fff336fc57741e5cc8511607af (patch)
treed34bb3208881fecce2d41b1905fe34d849f1d92c /src/mongo/dbtests/plan_ranking.cpp
parentc16959f19705772d01e1053899048869aafe4537 (diff)
downloadmongo-e377025071e4c9fff336fc57741e5cc8511607af.tar.gz
SERVER-32603 Modernize QueryPlanner methods to use unique_ptr.
Diffstat (limited to 'src/mongo/dbtests/plan_ranking.cpp')
-rw-r--r--src/mongo/dbtests/plan_ranking.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/dbtests/plan_ranking.cpp b/src/mongo/dbtests/plan_ranking.cpp
index 80399f73b06..affc2bca9d0 100644
--- a/src/mongo/dbtests/plan_ranking.cpp
+++ b/src/mongo/dbtests/plan_ranking.cpp
@@ -115,9 +115,9 @@ public:
plannerParams.options &= ~QueryPlannerParams::KEEP_MUTATIONS;
// Plan.
- vector<QuerySolution*> solutions;
- Status status = QueryPlanner::plan(*cq, plannerParams, &solutions);
- ASSERT(status.isOK());
+ auto statusWithSolutions = QueryPlanner::plan(*cq, plannerParams);
+ ASSERT_OK(statusWithSolutions.getStatus());
+ auto solutions = std::move(statusWithSolutions.getValue());
ASSERT_GREATER_THAN_OR_EQUALS(solutions.size(), 1U);
@@ -128,8 +128,8 @@ public:
for (size_t i = 0; i < solutions.size(); ++i) {
PlanStage* root;
ASSERT(StageBuilder::build(&_opCtx, collection, *cq, *solutions[i], ws.get(), &root));
- // Takes ownership of all (actually some) arguments.
- _mps->addPlan(solutions[i], root, ws.get());
+ // Takes ownership of 'root'.
+ _mps->addPlan(std::move(solutions[i]), root, ws.get());
}
// This is what sets a backup plan, should we test for it.
PlanYieldPolicy yieldPolicy(PlanExecutor::NO_YIELD,