summaryrefslogtreecommitdiff
path: root/src/mongo/db/field_ref_set.cpp
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-12-22 10:49:36 -0500
committerAndrew Morrow <acm@10gen.com>2014-01-04 14:55:32 -0500
commit344b86426595713e32fefa2e5a627988b04529fb (patch)
treef3b55a41393fa2d179ce19860a983553304a4166 /src/mongo/db/field_ref_set.cpp
parent7829e62e06559b75c6121e0486d4f1769f4dbfa6 (diff)
downloadmongo-344b86426595713e32fefa2e5a627988b04529fb.tar.gz
SERVER-10159 Store the FieldRef for _id in a file static to avoid a dynamic allocation
Diffstat (limited to 'src/mongo/db/field_ref_set.cpp')
-rw-r--r--src/mongo/db/field_ref_set.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/db/field_ref_set.cpp b/src/mongo/db/field_ref_set.cpp
index 46b09e8dd4b..509de2845fc 100644
--- a/src/mongo/db/field_ref_set.cpp
+++ b/src/mongo/db/field_ref_set.cpp
@@ -67,8 +67,7 @@ namespace mongo {
return foundConflict;
StringData prefixStr = safeFirstPart(toCheck);
- FieldRef prefixField;
- prefixField.parse(prefixStr);
+ FieldRef prefixField(prefixStr);
FieldSet::iterator it = _fieldSet.lower_bound(&prefixField);
// Now, iterate over all the present fields in the set that have the same prefix.
@@ -122,8 +121,7 @@ namespace mongo {
// At each insertion, we only need to bother checking the fields in the set that have
// at least some common prefix with the 'toInsert' field.
StringData prefixStr = safeFirstPart(toInsert);
- FieldRef prefixField;
- prefixField.parse(prefixStr);
+ FieldRef prefixField(prefixStr);
FieldSet::iterator it = _fieldSet.lower_bound(&prefixField);
// Now, iterate over all the present fields in the set that have the same prefix.