Skip to content

Commit e69d00d

Browse files
committed
SERVER-19367 Return ConnectionString by value, not by reference
1 parent e586a59 commit e69d00d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/mongo/s/chunk.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,9 @@ bool Chunk::splitIfShould(long dataWritten) const {
619619
}
620620
}
621621

622-
const ConnectionString& Chunk::_getShardConnectionString() const {
622+
std::string Chunk::_getShardConnectionString() const {
623623
const auto shard = grid.shardRegistry()->getShard(getShardId());
624-
return shard->getConnString();
624+
return shard->getConnString().toString();
625625
}
626626

627627
long Chunk::getPhysicalSize() const {

src/mongo/s/chunk.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ class Chunk {
252252

253253
private:
254254
/**
255-
* Returns the connection string for the shard on which this chunk lives on.
255+
* Returns the connection string for the shard on which this chunk resides.
256256
*/
257-
const ConnectionString& _getShardConnectionString() const;
257+
std::string _getShardConnectionString() const;
258258

259259
// if min/max key is pos/neg infinity
260260
bool _minIsInf() const;

0 commit comments

Comments
 (0)