From 159f54fcb550d6ff660efd2832ac5ae8b6fced56 Mon Sep 17 00:00:00 2001 From: Qingyang Chen Date: Fri, 19 Jun 2015 17:20:36 -0400 Subject: SERVER-16889 Modernize getExecutor*(), PlanExecutor::make() signatures --- src/mongo/db/dbhelpers.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mongo/db/dbhelpers.cpp') diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 0517552c7c2..b4e76483a1f 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -135,15 +135,14 @@ RecordId Helpers::findOne(OperationContext* txn, massert(17244, "Could not canonicalize " + query.toString(), statusWithCQ.isOK()); unique_ptr cq = std::move(statusWithCQ.getValue()); - PlanExecutor* rawExec; size_t options = requireIndex ? QueryPlannerParams::NO_TABLE_SCAN : QueryPlannerParams::DEFAULT; - massert( - 17245, - "Could not get executor for query " + query.toString(), - getExecutor(txn, collection, cq.release(), PlanExecutor::YIELD_MANUAL, &rawExec, options) - .isOK()); + auto statusWithPlanExecutor = + getExecutor(txn, collection, std::move(cq), PlanExecutor::YIELD_MANUAL, options); + massert(17245, + "Could not get executor for query " + query.toString(), + statusWithPlanExecutor.isOK()); - unique_ptr exec(rawExec); + unique_ptr exec = std::move(statusWithPlanExecutor.getValue()); PlanExecutor::ExecState state; RecordId loc; if (PlanExecutor::ADVANCED == (state = exec->getNext(NULL, &loc))) { -- cgit v1.2.1