diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:05:43 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:05:43 +0100 |
commit | 582fc32574a3b158c81e49cb00e6ae59205e66ba (patch) | |
tree | ac64a3243e0d2121709f685695247052858115c8 /util/embedded_builder.h | |
parent | 2761bffa96595ac1698d86bbc2e95ebb0d4d6e93 (diff) | |
download | mongodb-582fc32574a3b158c81e49cb00e6ae59205e66ba.tar.gz |
Imported Upstream version 1.8.0
Diffstat (limited to 'util/embedded_builder.h')
-rw-r--r-- | util/embedded_builder.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/util/embedded_builder.h b/util/embedded_builder.h index 8ca47e5..abf518e 100644 --- a/util/embedded_builder.h +++ b/util/embedded_builder.h @@ -29,10 +29,10 @@ namespace mongo { // parameter in lex ascending order. void prepareContext( string &name ) { int i = 1, n = _builders.size(); - while( i < n && - name.substr( 0, _builders[ i ].first.length() ) == _builders[ i ].first && - ( name[ _builders[i].first.length() ] == '.' || name[ _builders[i].first.length() ] == 0 ) - ){ + while( i < n && + name.substr( 0, _builders[ i ].first.length() ) == _builders[ i ].first && + ( name[ _builders[i].first.length() ] == '.' || name[ _builders[i].first.length() ] == 0 ) + ) { name = name.substr( _builders[ i ].first.length() + 1 ); ++i; } @@ -54,7 +54,7 @@ namespace mongo { } BufBuilder &subarrayStartAs( string name ) { prepareContext( name ); - return back()->subarrayStart( name.c_str() ); + return back()->subarrayStart( name ); } void done() { while( ! _builderStorage.empty() ) @@ -72,7 +72,7 @@ namespace mongo { private: void addBuilder( const string &name ) { - shared_ptr< BSONObjBuilder > newBuilder( new BSONObjBuilder( back()->subobjStart( name.c_str() ) ) ); + shared_ptr< BSONObjBuilder > newBuilder( new BSONObjBuilder( back()->subobjStart( name ) ) ); _builders.push_back( make_pair( name, newBuilder.get() ) ); _builderStorage.push_back( newBuilder ); } @@ -83,10 +83,10 @@ namespace mongo { } BSONObjBuilder *back() { return _builders.back().second; } - + vector< pair< string, BSONObjBuilder * > > _builders; vector< shared_ptr< BSONObjBuilder > > _builderStorage; }; - + } //namespace mongo |