diff options
author | ADAM David Alan Martin <adam.martin@10gen.com> | 2017-03-10 18:34:08 -0500 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2017-03-10 18:34:08 -0500 |
commit | 04b8ed12d08affcb06e88c8a2b4398628ae0aa62 (patch) | |
tree | 3e1a43aa762a2136422b4fa66f70ee89222d29a1 /src/mongo/db/query/plan_ranker.cpp | |
parent | 56810e6acb3a0425284189d852eaefb391e5f800 (diff) | |
download | mongo-04b8ed12d08affcb06e88c8a2b4398628ae0aa62.tar.gz |
SERVER-27975 Remove many uses of `OwnedPointerVector`
This removes many of the remaining uses of the deprecated
`OwnedPointerVector` type.
Diffstat (limited to 'src/mongo/db/query/plan_ranker.cpp')
-rw-r--r-- | src/mongo/db/query/plan_ranker.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/query/plan_ranker.cpp b/src/mongo/db/query/plan_ranker.cpp index 964d3448576..c5c9436c2de 100644 --- a/src/mongo/db/query/plan_ranker.cpp +++ b/src/mongo/db/query/plan_ranker.cpp @@ -76,14 +76,14 @@ size_t PlanRanker::pickBestPlan(const vector<CandidatePlan>& candidates, PlanRan double eofBonus = 1.0; // Each plan will have a stat tree. - vector<PlanStageStats*> statTrees; + std::vector<std::unique_ptr<PlanStageStats>> statTrees; // Get stat trees from each plan. // Copy stats trees instead of transferring ownership // because multi plan runner will need its own stats // trees for explain. for (size_t i = 0; i < candidates.size(); ++i) { - statTrees.push_back(candidates[i].root->getStats().release()); + statTrees.push_back(candidates[i].root->getStats()); } // Holds (score, candidateInndex). @@ -98,7 +98,7 @@ size_t PlanRanker::pickBestPlan(const vector<CandidatePlan>& candidates, PlanRan LOG(2) << "Scoring query plan: " << redact(Explain::getPlanSummary(candidates[i].root)) << " planHitEOF=" << statTrees[i]->common.isEOF; - double score = scoreTree(statTrees[i]); + double score = scoreTree(statTrees[i].get()); LOG(5) << "score = " << score; if (statTrees[i]->common.isEOF) { LOG(5) << "Adding +" << eofBonus << " EOF bonus to score."; @@ -151,7 +151,7 @@ size_t PlanRanker::pickBestPlan(const vector<CandidatePlan>& candidates, PlanRan score -= eofBonus; } - why->stats.mutableVector().push_back(statTrees[candidateIndex]); + why->stats.push_back(std::move(statTrees[candidateIndex])); why->scores.push_back(score); why->candidateOrder.push_back(candidateIndex); } |