summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/sort.cpp
diff options
context:
space:
mode:
authorQingyang Chen <qingyang.chen@10gen.com>2015-06-25 13:50:50 -0400
committerQingyang Chen <qingyang.chen@10gen.com>2015-06-29 16:05:26 -0400
commit9d72fd0f2f18b66423b9107e30cf2792656d2eab (patch)
tree20a29314d23e781d0e01ce9a8e877294abe6a6de /src/mongo/db/exec/sort.cpp
parentd7466fbe4ec1be205945170f038bbc37737abcb1 (diff)
downloadmongo-9d72fd0f2f18b66423b9107e30cf2792656d2eab.tar.gz
SERVER-16889.5 PlanExecutor::getStats() and PlanStage::getStats() return unique_ptr
Diffstat (limited to 'src/mongo/db/exec/sort.cpp')
-rw-r--r--src/mongo/db/exec/sort.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp
index 7aeef7ee68b..246462f953c 100644
--- a/src/mongo/db/exec/sort.cpp
+++ b/src/mongo/db/exec/sort.cpp
@@ -41,13 +41,15 @@
#include "mongo/db/query/lite_parsed_query.h"
#include "mongo/db/query/query_knobs.h"
#include "mongo/db/query/query_planner.h"
+#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
namespace mongo {
-using std::unique_ptr;
using std::endl;
+using std::unique_ptr;
using std::vector;
+using stdx::make_unique;
// static
const char* SortStage::kStageType = "SORT";
@@ -455,7 +457,7 @@ vector<PlanStage*> SortStage::getChildren() const {
return children;
}
-PlanStageStats* SortStage::getStats() {
+unique_ptr<PlanStageStats> SortStage::getStats() {
_commonStats.isEOF = isEOF();
const size_t maxBytes = static_cast<size_t>(internalQueryExecMaxBlockingSortBytes);
_specificStats.memLimit = maxBytes;
@@ -463,10 +465,10 @@ PlanStageStats* SortStage::getStats() {
_specificStats.limit = _limit;
_specificStats.sortPattern = _pattern.getOwned();
- unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SORT));
- ret->specific.reset(new SortStats(_specificStats));
- ret->children.push_back(_child->getStats());
- return ret.release();
+ unique_ptr<PlanStageStats> ret = make_unique<PlanStageStats>(_commonStats, STAGE_SORT);
+ ret->specific = make_unique<SortStats>(_specificStats);
+ ret->children.push_back(_child->getStats().release());
+ return ret;
}
const CommonStats* SortStage::getCommonStats() const {