summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/limit.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2019-09-04 15:32:56 +0000
committerevergreen <evergreen@mongodb.com>2019-09-04 15:32:56 +0000
commitb13188206e74dbeb66c4b663d83ed1d1f97c286b (patch)
tree01bcfe63112a9a4981a622a5370493d7d089a7a5 /src/mongo/db/exec/limit.cpp
parentd9d50312ccdfcfb628d89f34c0dcda05c8f921bc (diff)
downloadmongo-b13188206e74dbeb66c4b663d83ed1d1f97c286b.tar.gz
SERVER-42852 Make PlanStage consistently hold children by unique_ptr.
Diffstat (limited to 'src/mongo/db/exec/limit.cpp')
-rw-r--r--src/mongo/db/exec/limit.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp
index 605babeeb31..e800d614039 100644
--- a/src/mongo/db/exec/limit.cpp
+++ b/src/mongo/db/exec/limit.cpp
@@ -43,10 +43,13 @@ using std::vector;
// static
const char* LimitStage::kStageType = "LIMIT";
-LimitStage::LimitStage(OperationContext* opCtx, long long limit, WorkingSet* ws, PlanStage* child)
+LimitStage::LimitStage(OperationContext* opCtx,
+ long long limit,
+ WorkingSet* ws,
+ std::unique_ptr<PlanStage> child)
: PlanStage(kStageType, opCtx), _ws(ws), _numToReturn(limit) {
_specificStats.limit = _numToReturn;
- _children.emplace_back(child);
+ _children.emplace_back(std::move(child));
}
LimitStage::~LimitStage() {}