diff options
author | Qingyang Chen <qingyang.chen@10gen.com> | 2015-07-01 16:34:41 -0400 |
---|---|---|
committer | Qingyang Chen <qingyang.chen@10gen.com> | 2015-07-06 10:51:24 -0400 |
commit | 875b1b06e49f12c4e55200d441bcdeefc07d8310 (patch) | |
tree | c2fff98611d57d4aec85ec9036aa9ffd21e87cea /src/mongo/db/commands/compact.cpp | |
parent | 2f6e7ad9733e4b0532038f193f071a37c321c26d (diff) | |
download | mongo-875b1b06e49f12c4e55200d441bcdeefc07d8310.tar.gz |
SERVER-19247 remove implicit conversion from NamespaceString to std::string
Diffstat (limited to 'src/mongo/db/commands/compact.cpp')
-rw-r--r-- | src/mongo/db/commands/compact.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index a71357cb53a..df298009476 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -103,13 +103,13 @@ public: return false; } - NamespaceString ns(nsToCompact); - if (!ns.isNormal()) { + NamespaceString nss(nsToCompact); + if (!nss.isNormal()) { errmsg = "bad namespace name"; return false; } - if (ns.isSystem()) { + if (nss.isSystem()) { // items in system.* cannot be moved as there might be pointers to them // i.e. system.indexes entries are pointed to from NamespaceDetails errmsg = "can't compact a system namespace"; @@ -150,7 +150,7 @@ public: ScopedTransaction transaction(txn, MODE_IX); AutoGetDb autoDb(txn, db, MODE_X); Database* const collDB = autoDb.getDb(); - Collection* collection = collDB ? collDB->getCollection(ns) : NULL; + Collection* collection = collDB ? collDB->getCollection(nss) : NULL; // If db/collection does not exist, short circuit and return. if (!collDB || !collection) { @@ -158,15 +158,15 @@ public: return false; } - OldClientContext ctx(txn, ns); - BackgroundOperation::assertNoBgOpInProgForNs(ns.ns()); + OldClientContext ctx(txn, nss.ns()); + BackgroundOperation::assertNoBgOpInProgForNs(nss.ns()); if (collection->isCapped()) { errmsg = "cannot compact a capped collection"; return false; } - log() << "compact " << ns << " begin, options: " << compactOptions.toString(); + log() << "compact " << nss.ns() << " begin, options: " << compactOptions.toString(); StatusWith<CompactStats> status = collection->compact(txn, &compactOptions); if (!status.isOK()) @@ -175,7 +175,7 @@ public: if (status.getValue().corruptDocuments > 0) result.append("invalidObjects", status.getValue().corruptDocuments); - log() << "compact " << ns << " end"; + log() << "compact " << nss.ns() << " end"; return true; } |