diff options
author | Qingyang Chen <qingyang.chen@10gen.com> | 2015-06-25 13:50:50 -0400 |
---|---|---|
committer | Qingyang Chen <qingyang.chen@10gen.com> | 2015-06-29 16:05:26 -0400 |
commit | 9d72fd0f2f18b66423b9107e30cf2792656d2eab (patch) | |
tree | 20a29314d23e781d0e01ce9a8e877294abe6a6de /src/mongo/db/exec/count_scan.cpp | |
parent | d7466fbe4ec1be205945170f038bbc37737abcb1 (diff) | |
download | mongo-9d72fd0f2f18b66423b9107e30cf2792656d2eab.tar.gz |
SERVER-16889.5 PlanExecutor::getStats() and PlanStage::getStats() return unique_ptr
Diffstat (limited to 'src/mongo/db/exec/count_scan.cpp')
-rw-r--r-- | src/mongo/db/exec/count_scan.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/exec/count_scan.cpp b/src/mongo/db/exec/count_scan.cpp index 23499102147..ccd2b7339c3 100644 --- a/src/mongo/db/exec/count_scan.cpp +++ b/src/mongo/db/exec/count_scan.cpp @@ -31,11 +31,13 @@ #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/exec/scoped_timer.h" #include "mongo/db/index/index_descriptor.h" +#include "mongo/stdx/memory.h" namespace mongo { using std::unique_ptr; using std::vector; +using stdx::make_unique; // static const char* CountScan::kStageType = "COUNT_SCAN"; @@ -160,14 +162,14 @@ vector<PlanStage*> CountScan::getChildren() const { return empty; } -PlanStageStats* CountScan::getStats() { - unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_COUNT_SCAN)); +unique_ptr<PlanStageStats> CountScan::getStats() { + unique_ptr<PlanStageStats> ret = make_unique<PlanStageStats>(_commonStats, STAGE_COUNT_SCAN); - CountScanStats* countStats = new CountScanStats(_specificStats); + unique_ptr<CountScanStats> countStats = make_unique<CountScanStats>(_specificStats); countStats->keyPattern = _specificStats.keyPattern.getOwned(); - ret->specific.reset(countStats); + ret->specific = std::move(countStats); - return ret.release(); + return ret; } const CommonStats* CountScan::getCommonStats() const { |