summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.cpp
diff options
context:
space:
mode:
authorQingyang Chen <qingyang.chen@10gen.com>2015-06-19 17:20:36 -0400
committerQingyang Chen <qingyang.chen@10gen.com>2015-06-26 10:10:34 -0400
commit159f54fcb550d6ff660efd2832ac5ae8b6fced56 (patch)
tree2b6ac085b3375ce151d92fa1db9b4a38d92da25f /src/mongo/db/dbhelpers.cpp
parent2931e33f4d6efb3aa176eaa951be6c91abce2b43 (diff)
downloadmongo-159f54fcb550d6ff660efd2832ac5ae8b6fced56.tar.gz
SERVER-16889 Modernize getExecutor*(), PlanExecutor::make() signatures
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r--src/mongo/db/dbhelpers.cpp13
1 files changed, 6 insertions, 7 deletions
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<CanonicalQuery> 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<PlanExecutor> exec(rawExec);
+ unique_ptr<PlanExecutor> exec = std::move(statusWithPlanExecutor.getValue());
PlanExecutor::ExecState state;
RecordId loc;
if (PlanExecutor::ADVANCED == (state = exec->getNext(NULL, &loc))) {