summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/find_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/find_cmd.cpp')
-rw-r--r--src/mongo/db/commands/find_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp
index 5610c4799db..82c63c01cf8 100644
--- a/src/mongo/db/commands/find_cmd.cpp
+++ b/src/mongo/db/commands/find_cmd.cpp
@@ -126,8 +126,7 @@ public:
ExplainCommon::Verbosity verbosity,
const rpc::ServerSelectionMetadata&,
BSONObjBuilder* out) const override {
- const std::string fullns = parseNs(dbname, cmdObj);
- const NamespaceString nss(fullns);
+ const NamespaceString nss(parseNs(dbname, cmdObj));
if (!nss.isValid()) {
return {ErrorCodes::InvalidNamespace,
str::stream() << "Invalid collection name: " << nss.ns()};
@@ -183,8 +182,7 @@ public:
int options,
std::string& errmsg,
BSONObjBuilder& result) override {
- const std::string fullns = parseNs(dbname, cmdObj);
- const NamespaceString nss(fullns);
+ const NamespaceString nss(parseNs(dbname, cmdObj));
if (!nss.isValid() || nss.isCommand() || nss.isSpecialCommand()) {
return appendCommandStatus(result,
{ErrorCodes::InvalidNamespace,