summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2019-04-03 18:16:29 -0400
committerBilly Donahue <billy.donahue@mongodb.com>2019-04-08 12:15:08 -0400
commit573921791c4d20e0d1603fd0a200d90d74b65bd5 (patch)
tree9ec3957126fecc636cb31874376f09b6161965ff /src/mongo/db/exec
parentf8f872e029ba3b1f32d8499c912756d48dc1a03b (diff)
downloadmongo-573921791c4d20e0d1603fd0a200d90d74b65bd5.tar.gz
SERVER-40476 remove mongoutils::str::equals
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r--src/mongo/db/exec/projection.cpp2
-rw-r--r--src/mongo/db/exec/projection_exec.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/exec/projection.cpp b/src/mongo/db/exec/projection.cpp
index 2b8984ead68..33ecf709de9 100644
--- a/src/mongo/db/exec/projection.cpp
+++ b/src/mongo/db/exec/projection.cpp
@@ -136,7 +136,7 @@ void ProjectionStage::getSimpleInclusionFields(const BSONObj& projObj, FieldSet*
BSONElement elt = projObjIt.next();
// Must deal with the _id case separately as there is an implicit _id: 1 in the
// projection.
- if (mongoutils::str::equals(elt.fieldName(), kIdField) && !elt.trueValue()) {
+ if ((elt.fieldNameStringData() == kIdField) && !elt.trueValue()) {
includeId = false;
continue;
}
diff --git a/src/mongo/db/exec/projection_exec.cpp b/src/mongo/db/exec/projection_exec.cpp
index f30eedaf6d8..987ce85252b 100644
--- a/src/mongo/db/exec/projection_exec.cpp
+++ b/src/mongo/db/exec/projection_exec.cpp
@@ -61,7 +61,7 @@ ProjectionExec::ProjectionExec(OperationContext* opCtx,
invariant(1 == obj.nFields());
BSONElement e2 = obj.firstElement();
- if (mongoutils::str::equals(e2.fieldName(), "$slice")) {
+ if (e2.fieldNameStringData() == "$slice") {
if (e2.isNumber()) {
int i = e2.numberInt();
if (i < 0) {
@@ -82,7 +82,7 @@ ProjectionExec::ProjectionExec(OperationContext* opCtx,
add(e.fieldName(), skip, limit);
}
- } else if (mongoutils::str::equals(e2.fieldName(), "$elemMatch")) {
+ } else if (e2.fieldNameStringData() == "$elemMatch") {
_arrayOpType = ARRAY_OP_ELEM_MATCH;
// Create a MatchExpression for the elemMatch.
@@ -99,7 +99,7 @@ ProjectionExec::ProjectionExec(OperationContext* opCtx,
statusWithMatcher.getValue().release();
add(e.fieldName(), true);
- } else if (mongoutils::str::equals(e2.fieldName(), "$meta")) {
+ } else if (e2.fieldNameStringData() == "$meta") {
invariant(String == e2.type());
if (e2.valuestr() == QueryRequest::metaTextScore) {
_meta[e.fieldName()] = META_TEXT_SCORE;
@@ -125,7 +125,7 @@ ProjectionExec::ProjectionExec(OperationContext* opCtx,
} else {
MONGO_UNREACHABLE;
}
- } else if (mongoutils::str::equals(e.fieldName(), "_id") && !e.trueValue()) {
+ } else if ((e.fieldNameStringData() == "_id") && !e.trueValue()) {
_includeID = false;
} else {
add(e.fieldName(), e.trueValue());
@@ -258,7 +258,7 @@ StatusWith<BSONObj> ProjectionExec::projectCovered(const std::vector<IndexKeyDat
mmb::Document projectedDoc;
for (auto&& specElt : _source) {
- if (mongoutils::str::equals("_id", specElt.fieldName())) {
+ if (specElt.fieldNameStringData() == "_id") {
continue;
}
@@ -340,7 +340,7 @@ Status ProjectionExec::projectHelper(const BSONObj& in,
BSONElement elt = it.next();
// Case 1: _id
- if (mongoutils::str::equals("_id", elt.fieldName())) {
+ if ("_id" == elt.fieldNameStringData()) {
if (_includeID) {
bob->append(elt);
}