Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/mongo/db/namespace_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -900,15 +900,6 @@ inline StringData nsToDatabaseSubstring(StringData ns) {
return ns.substr(0, i);
}

/**
* "database.a.b.c" -> "database"
*
* TODO SERVER-123310: make this return a StringData
*/
inline std::string nsToDatabase(StringData ns) {
return std::string{nsToDatabaseSubstring(ns)};
}

/**
* "database.a.b.c" -> "a.b.c"
*/
Expand Down
4 changes: 0 additions & 4 deletions src/mongo/db/namespace_string_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ TEST_F(NamespaceStringTest, DbForSharding) {
TEST_F(NamespaceStringTest, nsToDatabase1) {
ASSERT_EQUALS("foo", nsToDatabaseSubstring("foo.bar"));
ASSERT_EQUALS("foo", nsToDatabaseSubstring("foo"));
ASSERT_EQUALS("foo", nsToDatabase("foo.bar"));
ASSERT_EQUALS("foo", nsToDatabase("foo"));
ASSERT_EQUALS("foo", nsToDatabase(std::string("foo.bar")));
ASSERT_EQUALS("foo", nsToDatabase(std::string("foo")));
}

TEST_F(NamespaceStringTest, NamespaceStringParse1) {
Expand Down