diff options
Diffstat (limited to 'src/mongo/db/auth/user_name.cpp')
-rw-r--r-- | src/mongo/db/auth/user_name.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mongo/db/auth/user_name.cpp b/src/mongo/db/auth/user_name.cpp index 422f415d478..c2e768edf95 100644 --- a/src/mongo/db/auth/user_name.cpp +++ b/src/mongo/db/auth/user_name.cpp @@ -35,20 +35,19 @@ namespace mongo { - UserName::UserName(StringData user, StringData dbname) { - _fullName.resize(user.size() + dbname.size() + 1); - std::string::iterator iter = std::copy(user.rawData(), - user.rawData() + user.size(), - _fullName.begin()); - *iter = '@'; - ++iter; - iter = std::copy(dbname.rawData(), dbname.rawData() + dbname.size(), iter); - dassert(iter == _fullName.end()); - _splitPoint = user.size(); - } +UserName::UserName(StringData user, StringData dbname) { + _fullName.resize(user.size() + dbname.size() + 1); + std::string::iterator iter = + std::copy(user.rawData(), user.rawData() + user.size(), _fullName.begin()); + *iter = '@'; + ++iter; + iter = std::copy(dbname.rawData(), dbname.rawData() + dbname.size(), iter); + dassert(iter == _fullName.end()); + _splitPoint = user.size(); +} - std::ostream& operator<<(std::ostream& os, const UserName& name) { - return os << name.getFullName(); - } +std::ostream& operator<<(std::ostream& os, const UserName& name) { + return os << name.getFullName(); +} } // namespace mongo |