summaryrefslogtreecommitdiff
path: root/src/mongo/db/update_index_data.cpp
diff options
context:
space:
mode:
authorTyler Brock <tyler.brock@gmail.com>2015-02-06 14:29:45 -0500
committerTyler Brock <tyler.brock@gmail.com>2015-02-06 16:37:35 -0500
commitaa9980b8c02de71c6918fba4aba9f22dd10eed01 (patch)
tree3ade9078069c7e1317a8b31c2e1fc427977d7abe /src/mongo/db/update_index_data.cpp
parent3a7675bb6fa110a10be307db3201bfb348cf41cf (diff)
downloadmongo-aa9980b8c02de71c6918fba4aba9f22dd10eed01.tar.gz
SERVER-16940 Change pass-by-const-ref of StringData to pass-by-value
Diffstat (limited to 'src/mongo/db/update_index_data.cpp')
-rw-r--r--src/mongo/db/update_index_data.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/update_index_data.cpp b/src/mongo/db/update_index_data.cpp
index 45e9f90c90c..3a6dcb56676 100644
--- a/src/mongo/db/update_index_data.cpp
+++ b/src/mongo/db/update_index_data.cpp
@@ -38,7 +38,7 @@ namespace mongo {
UpdateIndexData::UpdateIndexData() : _allPathsIndexed( false ) { }
- void UpdateIndexData::addPath( const StringData& path ) {
+ void UpdateIndexData::addPath( StringData path ) {
string s;
if ( getCanonicalIndexField( path, &s ) ) {
_canonicalPaths.insert( s );
@@ -48,7 +48,7 @@ namespace mongo {
}
}
- void UpdateIndexData::addPathComponent( const StringData& pathComponent ) {
+ void UpdateIndexData::addPathComponent( StringData pathComponent ) {
_pathComponents.insert( pathComponent.toString() );
}
@@ -62,7 +62,7 @@ namespace mongo {
_allPathsIndexed = false;
}
- bool UpdateIndexData::mightBeIndexed( const StringData& path ) const {
+ bool UpdateIndexData::mightBeIndexed( StringData path ) const {
if ( _allPathsIndexed ) {
return true;
}
@@ -100,7 +100,7 @@ namespace mongo {
return false;
}
- bool UpdateIndexData::_startsWith( const StringData& a, const StringData& b ) const {
+ bool UpdateIndexData::_startsWith( StringData a, StringData b ) const {
if ( !a.startsWith( b ) )
return false;
@@ -112,7 +112,7 @@ namespace mongo {
return a[b.size()] == '.';
}
- bool getCanonicalIndexField( const StringData& fullName, string* out ) {
+ bool getCanonicalIndexField( StringData fullName, string* out ) {
// check if fieldName contains ".$" or ".###" substrings (#=digit) and skip them
// however do not skip the first field even if it meets these criteria