diff options
Diffstat (limited to 'src/mongo/db/query/plan_cache.cpp')
-rw-r--r-- | src/mongo/db/query/plan_cache.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mongo/db/query/plan_cache.cpp b/src/mongo/db/query/plan_cache.cpp index debb7c80fdf..0f0c885b37d 100644 --- a/src/mongo/db/query/plan_cache.cpp +++ b/src/mongo/db/query/plan_cache.cpp @@ -32,6 +32,11 @@ #include "mongo/db/query/plan_cache.h" +#include <algorithm> +#include <math.h> +#include <memory> +#include <vector> + #include "mongo/base/owned_pointer_vector.h" #include "mongo/client/dbclientinterface.h" // For QueryOption_foobar #include "mongo/db/matcher/expression_array.h" @@ -43,9 +48,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" -#include <algorithm> -#include <math.h> -#include <memory> +#include "mongo/util/transitional_tools_do_not_use/vector_spooling.h" namespace mongo { namespace { @@ -361,13 +364,14 @@ PlanCacheEntry::~PlanCacheEntry() { } PlanCacheEntry* PlanCacheEntry::clone() const { - OwnedPointerVector<QuerySolution> solutions; + std::vector<std::unique_ptr<QuerySolution>> solutions; for (size_t i = 0; i < plannerData.size(); ++i) { - QuerySolution* qs = new QuerySolution(); + auto qs = stdx::make_unique<QuerySolution>(); qs->cacheData.reset(plannerData[i]->clone()); - solutions.mutableVector().push_back(qs); + solutions.push_back(std::move(qs)); } - PlanCacheEntry* entry = new PlanCacheEntry(solutions.vector(), decision->clone()); + PlanCacheEntry* entry = new PlanCacheEntry( + transitional_tools_do_not_use::unspool_vector(solutions), decision->clone()); // Copy query shape. entry->query = query.getOwned(); |