summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/mobile
diff options
context:
space:
mode:
authorZach Yam <zach.yam@mongodb.com>2019-06-07 16:04:08 -0400
committerZach Yam <zach.yam@mongodb.com>2019-06-12 10:44:04 -0400
commit90a74a50044d4daff7fa66e050bd76e70a0c7e56 (patch)
tree217077f05cfebe7aa8a37a6ab60440ce111aaf88 /src/mongo/db/storage/mobile
parent2cd33c3953e54018d8ed687f6c03c7575fe518eb (diff)
downloadmongo-90a74a50044d4daff7fa66e050bd76e70a0c7e56.tar.gz
Make get(Grouped)SortedDataInterface return a unique pointer
Diffstat (limited to 'src/mongo/db/storage/mobile')
-rw-r--r--src/mongo/db/storage/mobile/mobile_kv_engine.cpp9
-rw-r--r--src/mongo/db/storage/mobile/mobile_kv_engine.h5
2 files changed, 6 insertions, 8 deletions
diff --git a/src/mongo/db/storage/mobile/mobile_kv_engine.cpp b/src/mongo/db/storage/mobile/mobile_kv_engine.cpp
index 3426827ee1e..4c8b2401683 100644
--- a/src/mongo/db/storage/mobile/mobile_kv_engine.cpp
+++ b/src/mongo/db/storage/mobile/mobile_kv_engine.cpp
@@ -235,13 +235,12 @@ Status MobileKVEngine::createSortedDataInterface(OperationContext* opCtx,
return MobileIndex::create(opCtx, ident.toString());
}
-SortedDataInterface* MobileKVEngine::getSortedDataInterface(OperationContext* opCtx,
- StringData ident,
- const IndexDescriptor* desc) {
+std::unique_ptr<SortedDataInterface> MobileKVEngine::getSortedDataInterface(
+ OperationContext* opCtx, StringData ident, const IndexDescriptor* desc) {
if (desc->unique()) {
- return new MobileIndexUnique(opCtx, desc, ident.toString());
+ return std::make_unique<MobileIndexUnique>(opCtx, desc, ident.toString());
}
- return new MobileIndexStandard(opCtx, desc, ident.toString());
+ return std::make_unique<MobileIndexStandard>(opCtx, desc, ident.toString());
}
Status MobileKVEngine::dropIdent(OperationContext* opCtx, StringData ident) {
diff --git a/src/mongo/db/storage/mobile/mobile_kv_engine.h b/src/mongo/db/storage/mobile/mobile_kv_engine.h
index a2e6f7702f1..10da2d2e1a0 100644
--- a/src/mongo/db/storage/mobile/mobile_kv_engine.h
+++ b/src/mongo/db/storage/mobile/mobile_kv_engine.h
@@ -68,9 +68,8 @@ public:
StringData ident,
const IndexDescriptor* desc) override;
- SortedDataInterface* getSortedDataInterface(OperationContext* opCtx,
- StringData ident,
- const IndexDescriptor* desc) override;
+ std::unique_ptr<SortedDataInterface> getSortedDataInterface(
+ OperationContext* opCtx, StringData ident, const IndexDescriptor* desc) override;
Status beginBackup(OperationContext* opCtx) override {
return Status::OK();