summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_rs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/dbclient_rs.cpp')
-rw-r--r--src/mongo/client/dbclient_rs.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index 368b1534ccb..b6b28375246 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -211,7 +211,7 @@ bool _isSecondaryCommand(StringData commandName, const BSONObj& commandArgs) {
}
// Internal implementation of isSecondaryQuery, takes previously-parsed read preference
-bool _isSecondaryQuery(const string& ns,
+bool _isSecondaryQuery(StringData ns,
const BSONObj& filter,
const ReadPreferenceSetting& readPref) {
// If the read pref is primary only, this is not a secondary query
@@ -502,8 +502,8 @@ std::unique_ptr<DBClientCursor> DBClientReplicaSet::find(FindCommandRequest find
const ReadPreferenceSetting& readPref,
ExhaustMode exhaustMode) {
invariant(findRequest.getNamespaceOrUUID().nss());
- const std::string nss = findRequest.getNamespaceOrUUID().nss()->ns().toString();
- if (_isSecondaryQuery(nss, findRequest.toBSON(BSONObj{}), readPref)) {
+ const StringData ns = findRequest.getNamespaceOrUUID().nss()->ns();
+ if (_isSecondaryQuery(ns, findRequest.toBSON(BSONObj{}), readPref)) {
LOGV2_DEBUG(5951202,
3,
"dbclient_rs query using secondary or tagged node selection",