summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/test_commands.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2023-02-15 14:12:23 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-02-15 15:41:49 +0000
commitc3a54fa12ceb2e4e7b5fad5bd117bbab9b9c486f (patch)
tree26e1b286c300deb75b72e1747900c39347415aca /src/mongo/db/commands/test_commands.cpp
parent8f36c90d997708507e1d73c4200d79a92619f422 (diff)
downloadmongo-c3a54fa12ceb2e4e7b5fad5bd117bbab9b9c486f.tar.gz
SERVER-73818 Remove CollectionPtr from CollectionCatalog interface
Interfaces instead return 'const Collection*' and if a CollectionPtr is needed it must be created by the user.
Diffstat (limited to 'src/mongo/db/commands/test_commands.cpp')
-rw-r--r--src/mongo/db/commands/test_commands.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp
index a11d35b4cbd..b28dae581e0 100644
--- a/src/mongo/db/commands/test_commands.cpp
+++ b/src/mongo/db/commands/test_commands.cpp
@@ -104,8 +104,8 @@ public:
WriteUnitOfWork wunit(opCtx);
UnreplicatedWritesBlock unreplicatedWritesBlock(opCtx);
- CollectionPtr collection =
- CollectionCatalog::get(opCtx)->lookupCollectionByNamespace(opCtx, nss);
+ CollectionPtr collection(
+ CollectionCatalog::get(opCtx)->lookupCollectionByNamespace(opCtx, nss));
if (!collection) {
collection = CollectionPtr(db->createCollection(opCtx, nss));
uassert(ErrorCodes::CannotCreateCollection, "could not create collection", collection);