diff options
Diffstat (limited to 'src/mongo/db/ops')
52 files changed, 67 insertions, 67 deletions
diff --git a/src/mongo/db/ops/delete.cpp b/src/mongo/db/ops/delete.cpp index c35697b75f5..92dca155c61 100644 --- a/src/mongo/db/ops/delete.cpp +++ b/src/mongo/db/ops/delete.cpp @@ -42,7 +42,7 @@ namespace mongo { */ long long deleteObjects(OperationContext* txn, Database* db, - const StringData& ns, + StringData ns, BSONObj pattern, PlanExecutor::YieldPolicy policy, bool justOne, diff --git a/src/mongo/db/ops/delete.h b/src/mongo/db/ops/delete.h index 0367ce8c165..7616bb9bcec 100644 --- a/src/mongo/db/ops/delete.h +++ b/src/mongo/db/ops/delete.h @@ -42,7 +42,7 @@ namespace mongo { // If justOne is true, deletedId is set to the id of the deleted object. long long deleteObjects(OperationContext* txn, Database* db, - const StringData& ns, + StringData ns, BSONObj pattern, PlanExecutor::YieldPolicy policy, bool justOne, diff --git a/src/mongo/db/ops/insert.cpp b/src/mongo/db/ops/insert.cpp index 131ebbc67b7..f410962b5b3 100644 --- a/src/mongo/db/ops/insert.cpp +++ b/src/mongo/db/ops/insert.cpp @@ -132,7 +132,7 @@ namespace mongo { return StatusWith<BSONObj>( b.obj() ); } - Status userAllowedWriteNS( const StringData& ns ) { + Status userAllowedWriteNS( StringData ns ) { return userAllowedWriteNS( nsToDatabaseSubstring( ns ), nsToCollectionSubstring( ns ) ); } @@ -140,7 +140,7 @@ namespace mongo { return userAllowedWriteNS( ns.db(), ns.coll() ); } - Status userAllowedWriteNS( const StringData& db, const StringData& coll ) { + Status userAllowedWriteNS( StringData db, StringData coll ) { // validity checking if ( db.size() == 0 ) diff --git a/src/mongo/db/ops/insert.h b/src/mongo/db/ops/insert.h index cc3082c2f4b..c62985f2ec3 100644 --- a/src/mongo/db/ops/insert.h +++ b/src/mongo/db/ops/insert.h @@ -45,8 +45,8 @@ namespace mongo { * does NOT to permission checking, that is elsewhere * for example, can't write to foo.system.bar */ - Status userAllowedWriteNS( const StringData& db, const StringData& coll ); - Status userAllowedWriteNS( const StringData& ns ); + Status userAllowedWriteNS( StringData db, StringData coll ); + Status userAllowedWriteNS( StringData ns ); Status userAllowedWriteNS( const NamespaceString& ns ); } diff --git a/src/mongo/db/ops/log_builder.cpp b/src/mongo/db/ops/log_builder.cpp index 8b58de50f1c..437c9056e5e 100644 --- a/src/mongo/db/ops/log_builder.cpp +++ b/src/mongo/db/ops/log_builder.cpp @@ -89,7 +89,7 @@ namespace mongo { return addToSection(elt, &_setAccumulator, kSet); } - Status LogBuilder::addToSetsWithNewFieldName(const StringData& name, + Status LogBuilder::addToSetsWithNewFieldName(StringData name, const mutablebson::Element val) { mutablebson::Element elemToSet = _logRoot.getDocument().makeElementWithNewFieldName(name, val); @@ -103,7 +103,7 @@ namespace mongo { return addToSets(elemToSet); } - Status LogBuilder::addToSetsWithNewFieldName(const StringData& name, + Status LogBuilder::addToSetsWithNewFieldName(StringData name, const BSONElement& val){ mutablebson::Element elemToSet = _logRoot.getDocument().makeElementWithNewFieldName(name, val); @@ -117,7 +117,7 @@ namespace mongo { return addToSets(elemToSet); } - Status LogBuilder::addToSets(const StringData& name, const SafeNum& val){ + Status LogBuilder::addToSets(StringData name, const SafeNum& val){ mutablebson::Element elemToSet = _logRoot.getDocument().makeElementSafeNum(name, val); if (!elemToSet.ok()) return Status(ErrorCodes::InternalError, diff --git a/src/mongo/db/ops/log_builder.h b/src/mongo/db/ops/log_builder.h index 7f422e06224..d35f48846f4 100644 --- a/src/mongo/db/ops/log_builder.h +++ b/src/mongo/db/ops/log_builder.h @@ -70,7 +70,7 @@ namespace mongo { * * If any problem occurs then the operation will stop and return that error Status. */ - Status addToSets(const StringData& name, const SafeNum& val); + Status addToSets(StringData name, const SafeNum& val); /** * Convenience method which calls addToSets after @@ -78,7 +78,7 @@ namespace mongo { * * If any problem occurs then the operation will stop and return that error Status. */ - Status addToSetsWithNewFieldName(const StringData& name, const mutablebson::Element val); + Status addToSetsWithNewFieldName(StringData name, const mutablebson::Element val); /** * Convenience method which calls addToSets after @@ -86,7 +86,7 @@ namespace mongo { * * If any problem occurs then the operation will stop and return that error Status. */ - Status addToSetsWithNewFieldName(const StringData& name, const BSONElement& val); + Status addToSetsWithNewFieldName(StringData name, const BSONElement& val); /** Add the given path as a new entry in the '$unset' section of the log. If an * '$unset' section does not yet exist, it will be created. If this LogBuilder is diff --git a/src/mongo/db/ops/modifier_add_to_set.cpp b/src/mongo/db/ops/modifier_add_to_set.cpp index 4eb01f40eeb..381d06632e3 100644 --- a/src/mongo/db/ops/modifier_add_to_set.cpp +++ b/src/mongo/db/ops/modifier_add_to_set.cpp @@ -211,7 +211,7 @@ namespace mongo { } Status ModifierAddToSet::prepare(mb::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(root.getDocument())); diff --git a/src/mongo/db/ops/modifier_add_to_set.h b/src/mongo/db/ops/modifier_add_to_set.h index d5187ad1dab..296009385b9 100644 --- a/src/mongo/db/ops/modifier_add_to_set.h +++ b/src/mongo/db/ops/modifier_add_to_set.h @@ -59,7 +59,7 @@ namespace mongo { * valid array to set-union to, othwise returns a status describing the error. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** Updates the Element used in prepare with the effects of the $addToSet operation. */ diff --git a/src/mongo/db/ops/modifier_add_to_set_test.cpp b/src/mongo/db/ops/modifier_add_to_set_test.cpp index 78e1880d417..45741b4c000 100644 --- a/src/mongo/db/ops/modifier_add_to_set_test.cpp +++ b/src/mongo/db/ops/modifier_add_to_set_test.cpp @@ -63,7 +63,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_bit.cpp b/src/mongo/db/ops/modifier_bit.cpp index 6c26dfeea8c..c6d221875f9 100644 --- a/src/mongo/db/ops/modifier_bit.cpp +++ b/src/mongo/db/ops/modifier_bit.cpp @@ -151,7 +151,7 @@ namespace mongo { } Status ModifierBit::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(root.getDocument())); diff --git a/src/mongo/db/ops/modifier_bit.h b/src/mongo/db/ops/modifier_bit.h index e6c337857f1..1f5a9437f1e 100644 --- a/src/mongo/db/ops/modifier_bit.h +++ b/src/mongo/db/ops/modifier_bit.h @@ -63,7 +63,7 @@ namespace mongo { * configures the internal state of the mod as necessary. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** Updates the Element used in prepare with the effects of the $bit operation */ diff --git a/src/mongo/db/ops/modifier_bit_test.cpp b/src/mongo/db/ops/modifier_bit_test.cpp index fb1d79b7837..3d19808757e 100644 --- a/src/mongo/db/ops/modifier_bit_test.cpp +++ b/src/mongo/db/ops/modifier_bit_test.cpp @@ -65,7 +65,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_compare.cpp b/src/mongo/db/ops/modifier_compare.cpp index dee2b1ef2ef..6d37e4b2797 100644 --- a/src/mongo/db/ops/modifier_compare.cpp +++ b/src/mongo/db/ops/modifier_compare.cpp @@ -95,7 +95,7 @@ namespace mongo { } Status ModifierCompare::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(root.getDocument())); diff --git a/src/mongo/db/ops/modifier_compare.h b/src/mongo/db/ops/modifier_compare.h index 880869d803c..4d1afbcacf7 100644 --- a/src/mongo/db/ops/modifier_compare.h +++ b/src/mongo/db/ops/modifier_compare.h @@ -72,7 +72,7 @@ namespace mongo { * error. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** diff --git a/src/mongo/db/ops/modifier_compare_test.cpp b/src/mongo/db/ops/modifier_compare_test.cpp index ba5c9b6d7b8..9f19dd1d718 100644 --- a/src/mongo/db/ops/modifier_compare_test.cpp +++ b/src/mongo/db/ops/modifier_compare_test.cpp @@ -63,13 +63,13 @@ namespace { , _mod((modObj.firstElement().fieldNameStringData() == "$min") ? ModifierCompare::MIN : ModifierCompare::MAX) { - const StringData& modName = modObj.firstElement().fieldName(); + StringData modName = modObj.firstElement().fieldName(); ASSERT_OK(_mod.init(modObj[modName].embeddedObject().firstElement(), ModifierInterface::Options::normal())); } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_current_date.cpp b/src/mongo/db/ops/modifier_current_date.cpp index e00f64631e6..aa683a5404f 100644 --- a/src/mongo/db/ops/modifier_current_date.cpp +++ b/src/mongo/db/ops/modifier_current_date.cpp @@ -150,7 +150,7 @@ namespace mongo { } Status ModifierCurrentDate::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(root.getDocument())); diff --git a/src/mongo/db/ops/modifier_current_date.h b/src/mongo/db/ops/modifier_current_date.h index 469b1cca5e8..09e56c9c8ac 100644 --- a/src/mongo/db/ops/modifier_current_date.h +++ b/src/mongo/db/ops/modifier_current_date.h @@ -62,7 +62,7 @@ namespace mongo { /** Evaluates the validity of applying $currentDate. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** Updates the node passed in prepare with the results from prepare */ diff --git a/src/mongo/db/ops/modifier_current_date_test.cpp b/src/mongo/db/ops/modifier_current_date_test.cpp index 0b1f64c5a00..512c857bc1b 100644 --- a/src/mongo/db/ops/modifier_current_date_test.cpp +++ b/src/mongo/db/ops/modifier_current_date_test.cpp @@ -82,7 +82,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_inc.cpp b/src/mongo/db/ops/modifier_inc.cpp index ad5364317aa..a967e0a734a 100644 --- a/src/mongo/db/ops/modifier_inc.cpp +++ b/src/mongo/db/ops/modifier_inc.cpp @@ -127,7 +127,7 @@ namespace mongo { } Status ModifierInc::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(root.getDocument())); diff --git a/src/mongo/db/ops/modifier_inc.h b/src/mongo/db/ops/modifier_inc.h index 8e51d8ac6e1..62c81cafbee 100644 --- a/src/mongo/db/ops/modifier_inc.h +++ b/src/mongo/db/ops/modifier_inc.h @@ -73,7 +73,7 @@ namespace mongo { * effects, handling upcasting and overflow as necessary. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** Updates the node passed in prepare with the results of the $inc */ diff --git a/src/mongo/db/ops/modifier_inc_test.cpp b/src/mongo/db/ops/modifier_inc_test.cpp index 68d3db810e6..8a97bc490e7 100644 --- a/src/mongo/db/ops/modifier_inc_test.cpp +++ b/src/mongo/db/ops/modifier_inc_test.cpp @@ -63,13 +63,13 @@ namespace { : _modObj(modObj) , _mod(mongoutils::str::equals(modObj.firstElement().fieldName(), "$mul") ? ModifierInc::MODE_MUL : ModifierInc::MODE_INC) { - const StringData& modName = modObj.firstElement().fieldName(); + StringData modName = modObj.firstElement().fieldName(); ASSERT_OK(_mod.init(_modObj[modName].embeddedObject().firstElement(), ModifierInterface::Options::normal())); } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_interface.h b/src/mongo/db/ops/modifier_interface.h index 873d18e78c3..3574615e6f4 100644 --- a/src/mongo/db/ops/modifier_interface.h +++ b/src/mongo/db/ops/modifier_interface.h @@ -114,7 +114,7 @@ namespace mongo { */ struct ExecInfo; virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, /* IN-OUT */ ExecInfo* execInfo) = 0; /** diff --git a/src/mongo/db/ops/modifier_object_replace.cpp b/src/mongo/db/ops/modifier_object_replace.cpp index 9c026d4f069..dc714b52105 100644 --- a/src/mongo/db/ops/modifier_object_replace.cpp +++ b/src/mongo/db/ops/modifier_object_replace.cpp @@ -106,7 +106,7 @@ namespace mongo { } Status ModifierObjectReplace::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(&root.getDocument())); diff --git a/src/mongo/db/ops/modifier_object_replace.h b/src/mongo/db/ops/modifier_object_replace.h index fe00f57ea29..393036d610b 100644 --- a/src/mongo/db/ops/modifier_object_replace.h +++ b/src/mongo/db/ops/modifier_object_replace.h @@ -69,7 +69,7 @@ namespace mongo { * noOp. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** diff --git a/src/mongo/db/ops/modifier_object_replace_test.cpp b/src/mongo/db/ops/modifier_object_replace_test.cpp index f6c450c68fb..77946d11e05 100644 --- a/src/mongo/db/ops/modifier_object_replace_test.cpp +++ b/src/mongo/db/ops/modifier_object_replace_test.cpp @@ -70,7 +70,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_pop.cpp b/src/mongo/db/ops/modifier_pop.cpp index dada6d66be7..e5fd836dea7 100644 --- a/src/mongo/db/ops/modifier_pop.cpp +++ b/src/mongo/db/ops/modifier_pop.cpp @@ -117,7 +117,7 @@ namespace mongo { } Status ModifierPop::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(&root.getDocument())); diff --git a/src/mongo/db/ops/modifier_pop.h b/src/mongo/db/ops/modifier_pop.h index c8ab8ef8977..c495c4c07fa 100644 --- a/src/mongo/db/ops/modifier_pop.h +++ b/src/mongo/db/ops/modifier_pop.h @@ -61,7 +61,7 @@ namespace mongo { bool* positional = NULL); virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); diff --git a/src/mongo/db/ops/modifier_pop_test.cpp b/src/mongo/db/ops/modifier_pop_test.cpp index e33ace66db9..283b9bc5a81 100644 --- a/src/mongo/db/ops/modifier_pop_test.cpp +++ b/src/mongo/db/ops/modifier_pop_test.cpp @@ -65,7 +65,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_pull.cpp b/src/mongo/db/ops/modifier_pull.cpp index 858603087d9..5fe94e878ea 100644 --- a/src/mongo/db/ops/modifier_pull.cpp +++ b/src/mongo/db/ops/modifier_pull.cpp @@ -140,7 +140,7 @@ namespace mongo { } Status ModifierPull::prepare(mb::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(root.getDocument())); diff --git a/src/mongo/db/ops/modifier_pull.h b/src/mongo/db/ops/modifier_pull.h index f2fdba0cf24..25a7f784f2a 100644 --- a/src/mongo/db/ops/modifier_pull.h +++ b/src/mongo/db/ops/modifier_pull.h @@ -52,7 +52,7 @@ namespace mongo { /** Decides which portion of the array items will be removed from the provided element */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** Updates the Element used in prepare with the effects of the $pull operation. */ diff --git a/src/mongo/db/ops/modifier_pull_all.cpp b/src/mongo/db/ops/modifier_pull_all.cpp index af595d6cd74..c8a73abe1e0 100644 --- a/src/mongo/db/ops/modifier_pull_all.cpp +++ b/src/mongo/db/ops/modifier_pull_all.cpp @@ -137,7 +137,7 @@ namespace mongo { } Status ModifierPullAll::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(&root.getDocument())); diff --git a/src/mongo/db/ops/modifier_pull_all.h b/src/mongo/db/ops/modifier_pull_all.h index 349aa71d186..bdc96b18b74 100644 --- a/src/mongo/db/ops/modifier_pull_all.h +++ b/src/mongo/db/ops/modifier_pull_all.h @@ -59,7 +59,7 @@ namespace mongo { bool* positional = NULL); virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); diff --git a/src/mongo/db/ops/modifier_pull_all_test.cpp b/src/mongo/db/ops/modifier_pull_all_test.cpp index 5c266e0a8ed..4d689f36ee5 100644 --- a/src/mongo/db/ops/modifier_pull_all_test.cpp +++ b/src/mongo/db/ops/modifier_pull_all_test.cpp @@ -67,7 +67,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_pull_test.cpp b/src/mongo/db/ops/modifier_pull_test.cpp index af457dd8cbc..e0918b24db5 100644 --- a/src/mongo/db/ops/modifier_pull_test.cpp +++ b/src/mongo/db/ops/modifier_pull_test.cpp @@ -63,7 +63,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_push.cpp b/src/mongo/db/ops/modifier_push.cpp index 68b3ae82cff..70a227fddbd 100644 --- a/src/mongo/db/ops/modifier_push.cpp +++ b/src/mongo/db/ops/modifier_push.cpp @@ -436,7 +436,7 @@ namespace mongo { } Status ModifierPush::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(&root.getDocument())); diff --git a/src/mongo/db/ops/modifier_push.h b/src/mongo/db/ops/modifier_push.h index d44d9a09769..bc2929555f5 100644 --- a/src/mongo/db/ops/modifier_push.h +++ b/src/mongo/db/ops/modifier_push.h @@ -84,7 +84,7 @@ namespace mongo { * 'false' for those two options. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** diff --git a/src/mongo/db/ops/modifier_push_test.cpp b/src/mongo/db/ops/modifier_push_test.cpp index 79b8bbaf6d2..884566d48ac 100644 --- a/src/mongo/db/ops/modifier_push_test.cpp +++ b/src/mongo/db/ops/modifier_push_test.cpp @@ -489,13 +489,13 @@ namespace { : _mod(mongoutils::str::equals(modObj.firstElement().fieldName(), "$pushAll") ? ModifierPush::PUSH_ALL : ModifierPush::PUSH_NORMAL) { _modObj = modObj; - const StringData& modName = modObj.firstElement().fieldName(); + StringData modName = modObj.firstElement().fieldName(); ASSERT_OK(_mod.init(_modObj[modName].embeddedObject().firstElement(), ModifierInterface::Options::normal())); } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_rename.cpp b/src/mongo/db/ops/modifier_rename.cpp index c2a86e5cb0d..13ec0c70beb 100644 --- a/src/mongo/db/ops/modifier_rename.cpp +++ b/src/mongo/db/ops/modifier_rename.cpp @@ -132,7 +132,7 @@ namespace mongo { } Status ModifierRename::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { // Rename doesn't work with positional fields ($) dassert(matchedField.empty()); diff --git a/src/mongo/db/ops/modifier_rename.h b/src/mongo/db/ops/modifier_rename.h index f57b3cb4ef4..a0407ab9d31 100644 --- a/src/mongo/db/ops/modifier_rename.h +++ b/src/mongo/db/ops/modifier_rename.h @@ -70,7 +70,7 @@ namespace mongo { * -- Neither 'to' nor 'from' have an array ancestor */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** diff --git a/src/mongo/db/ops/modifier_rename_test.cpp b/src/mongo/db/ops/modifier_rename_test.cpp index 606337bdd7c..637926da8e1 100644 --- a/src/mongo/db/ops/modifier_rename_test.cpp +++ b/src/mongo/db/ops/modifier_rename_test.cpp @@ -65,7 +65,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_set.cpp b/src/mongo/db/ops/modifier_set.cpp index 4f015359437..fe808138c68 100644 --- a/src/mongo/db/ops/modifier_set.cpp +++ b/src/mongo/db/ops/modifier_set.cpp @@ -120,7 +120,7 @@ namespace mongo { } Status ModifierSet::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(&root.getDocument())); diff --git a/src/mongo/db/ops/modifier_set.h b/src/mongo/db/ops/modifier_set.h index 237ad903472..eeae479a162 100644 --- a/src/mongo/db/ops/modifier_set.h +++ b/src/mongo/db/ops/modifier_set.h @@ -72,7 +72,7 @@ namespace mongo { * error. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** diff --git a/src/mongo/db/ops/modifier_set_test.cpp b/src/mongo/db/ops/modifier_set_test.cpp index 48dbf556ba3..1a7e1db5a68 100644 --- a/src/mongo/db/ops/modifier_set_test.cpp +++ b/src/mongo/db/ops/modifier_set_test.cpp @@ -65,14 +65,14 @@ namespace { ModifierSet::SET_ON_INSERT : ModifierSet::SET_NORMAL) { _modObj = modObj; - const StringData& modName = modObj.firstElement().fieldName(); + StringData modName = modObj.firstElement().fieldName(); ASSERT_OK(_mod.init(_modObj[modName].embeddedObject().firstElement(), !fromRepl ? ModifierInterface::Options::normal(): ModifierInterface::Options::fromRepl())); } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/modifier_table.cpp b/src/mongo/db/ops/modifier_table.cpp index 2f4f2bd418d..f35e79cf5c5 100644 --- a/src/mongo/db/ops/modifier_table.cpp +++ b/src/mongo/db/ops/modifier_table.cpp @@ -60,7 +60,7 @@ namespace modifiertable { string name; ModifierType type; - ModifierEntry(const StringData& name, ModifierType type) + ModifierEntry(StringData name, ModifierType type) : name(name.toString()) , type(type) { } @@ -129,7 +129,7 @@ namespace modifiertable { return Status::OK(); } - ModifierType getType(const StringData& typeStr) { + ModifierType getType(StringData typeStr) { NameMap::const_iterator it = MODIFIER_NAME_MAP->find(typeStr); if (it == MODIFIER_NAME_MAP->end()) { return MOD_UNKNOWN; diff --git a/src/mongo/db/ops/modifier_table.h b/src/mongo/db/ops/modifier_table.h index 69aadab0839..8087114e657 100644 --- a/src/mongo/db/ops/modifier_table.h +++ b/src/mongo/db/ops/modifier_table.h @@ -58,7 +58,7 @@ namespace modifiertable { * Returns the modifier type for 'typeStr', if it was recognized as an existing update * mod, or MOD_UNKNOWN otherwise. */ - ModifierType getType(const StringData& typeStr); + ModifierType getType(StringData typeStr); /** * Instantiate an update mod that corresponds to 'modType' or NULL if 'modType' is not diff --git a/src/mongo/db/ops/modifier_unset.cpp b/src/mongo/db/ops/modifier_unset.cpp index b5f55f86708..9b54480c62d 100644 --- a/src/mongo/db/ops/modifier_unset.cpp +++ b/src/mongo/db/ops/modifier_unset.cpp @@ -111,7 +111,7 @@ namespace mongo { } Status ModifierUnset::prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo) { _preparedState.reset(new PreparedState(&root.getDocument())); diff --git a/src/mongo/db/ops/modifier_unset.h b/src/mongo/db/ops/modifier_unset.h index 7a825465896..aff10a80e07 100644 --- a/src/mongo/db/ops/modifier_unset.h +++ b/src/mongo/db/ops/modifier_unset.h @@ -68,7 +68,7 @@ namespace mongo { * 'execInfo' accordingly. Return OK if successful or a status describing the error. */ virtual Status prepare(mutablebson::Element root, - const StringData& matchedField, + StringData matchedField, ExecInfo* execInfo); /** diff --git a/src/mongo/db/ops/modifier_unset_test.cpp b/src/mongo/db/ops/modifier_unset_test.cpp index d181bd57d99..3ca4957e94c 100644 --- a/src/mongo/db/ops/modifier_unset_test.cpp +++ b/src/mongo/db/ops/modifier_unset_test.cpp @@ -65,7 +65,7 @@ namespace { } Status prepare(Element root, - const StringData& matchedField, + StringData matchedField, ModifierInterface::ExecInfo* execInfo) { return _mod.prepare(root, matchedField, execInfo); } diff --git a/src/mongo/db/ops/path_support.cpp b/src/mongo/db/ops/path_support.cpp index 857a54c4b52..4ac4b03fb36 100644 --- a/src/mongo/db/ops/path_support.cpp +++ b/src/mongo/db/ops/path_support.cpp @@ -43,7 +43,7 @@ namespace pathsupport { namespace { - bool isNumeric(const StringData& str, size_t* num) { + bool isNumeric(StringData str, size_t* num) { size_t res = 0; for (size_t i = 0; i < str.size(); ++i) { if (str[i] < '0' || str[i] > '9') { diff --git a/src/mongo/db/ops/path_support_test.cpp b/src/mongo/db/ops/path_support_test.cpp index f65cebabf6d..7a93d73c269 100644 --- a/src/mongo/db/ops/path_support_test.cpp +++ b/src/mongo/db/ops/path_support_test.cpp @@ -478,7 +478,7 @@ namespace { } static void assertContains(const EqualityMatches& equalities, - const StringData& path, + StringData path, int value) { assertContains(equalities, BSON(path << value)); } @@ -750,7 +750,7 @@ namespace { // static void assertParent(const EqualityMatches& equalities, - const StringData& pathStr, + StringData pathStr, const BSONObj& wrapped) { FieldRef path(pathStr); @@ -779,13 +779,13 @@ namespace { } static void assertParent(const EqualityMatches& equalities, - const StringData& path, - const StringData& parentPath, + StringData path, + StringData parentPath, int value) { assertParent(equalities, path, BSON(parentPath << value)); } - static void assertNoParent(const EqualityMatches& equalities, const StringData& pathStr) { + static void assertNoParent(const EqualityMatches& equalities, StringData pathStr) { FieldRef path(pathStr); diff --git a/src/mongo/db/ops/update_driver.cpp b/src/mongo/db/ops/update_driver.cpp index 20a25d9c792..c1235c8b93e 100644 --- a/src/mongo/db/ops/update_driver.cpp +++ b/src/mongo/db/ops/update_driver.cpp @@ -221,7 +221,7 @@ namespace mongo { return status; } - Status UpdateDriver::update(const StringData& matchedField, + Status UpdateDriver::update(StringData matchedField, mutablebson::Document* doc, BSONObj* logOpRec, FieldRefSet* updatedFields, diff --git a/src/mongo/db/ops/update_driver.h b/src/mongo/db/ops/update_driver.h index ace7390a1de..067c432ebe2 100644 --- a/src/mongo/db/ops/update_driver.h +++ b/src/mongo/db/ops/update_driver.h @@ -95,7 +95,7 @@ namespace mongo { * If a non-NULL updatedField vector* is supplied, * then all updated fields will be added to it. */ - Status update(const StringData& matchedField, + Status update(StringData matchedField, mutablebson::Document* doc, BSONObj* logOpRec = NULL, FieldRefSet* updatedFields = NULL, |