diff options
author | Alberto Lerner <alerner@10gen.com> | 2010-07-04 11:08:00 -0400 |
---|---|---|
committer | Alberto Lerner <alerner@10gen.com> | 2010-07-04 11:08:00 -0400 |
commit | bd0fb49da5bf6f6232b5da52b1eb98adc2abbaa2 (patch) | |
tree | 99b817e565f4c271fc6375c75c716e72f84c4b13 /s/config.cpp | |
parent | 7cc51e8cd5f49615a1eeea4e859fde019289a815 (diff) | |
download | mongo-bd0fb49da5bf6f6232b5da52b1eb98adc2abbaa2.tar.gz |
More stringutil goodies
Diffstat (limited to 's/config.cpp')
-rw-r--r-- | s/config.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/s/config.cpp b/s/config.cpp index e999d4dead5..fb1487abb4d 100644 --- a/s/config.cpp +++ b/s/config.cpp @@ -366,7 +366,7 @@ namespace mongo { bool ConfigServer::init( string s ){ vector<string> configdbs; - splitStringDelim( s, configdbs, ',' ); + splitStringDelim( s, &configdbs, ',' ); return init( configdbs ); } @@ -380,16 +380,11 @@ namespace mongo { } ourHostname = hn; - stringstream fullString; - set<string> hosts; for ( size_t i=0; i<configHosts.size(); i++ ){ string host = configHosts[i]; hosts.insert( getHost( host , false ) ); configHosts[i] = getHost( host , true ); - if ( i > 0 ) - fullString << ","; - fullString << configHosts[i]; } for ( set<string>::iterator i=hosts.begin(); i!=hosts.end(); i++ ){ @@ -407,8 +402,10 @@ namespace mongo { return false; } - _primary.setAddress( fullString.str() , true ); - log(1) << " config string : " << fullString.str() << endl; + string fullString; + joinStringDelim( configHosts, &fullString, ',' ); + _primary.setAddress( fullString , true ); + log(1) << " config string : " << fullString << endl; return true; } |