Skip to content

Commit 5aa0040

Browse files
committed
chore: remove redundant wrapper for nsToDatabaseSubstring
1 parent 77d23dc commit 5aa0040

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

src/mongo/db/namespace_string.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -894,15 +894,6 @@ inline StringData nsToDatabaseSubstring(StringData ns) {
894894
return ns.substr(0, i);
895895
}
896896

897-
/**
898-
* "database.a.b.c" -> "database"
899-
*
900-
* TODO: make this return a StringData
901-
*/
902-
inline std::string nsToDatabase(StringData ns) {
903-
return std::string{nsToDatabaseSubstring(ns)};
904-
}
905-
906897
/**
907898
* "database.a.b.c" -> "a.b.c"
908899
*/

src/mongo/db/namespace_string_test.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,6 @@ TEST_F(NamespaceStringTest, DbForSharding) {
230230
TEST_F(NamespaceStringTest, nsToDatabase1) {
231231
ASSERT_EQUALS("foo", nsToDatabaseSubstring("foo.bar"));
232232
ASSERT_EQUALS("foo", nsToDatabaseSubstring("foo"));
233-
ASSERT_EQUALS("foo", nsToDatabase("foo.bar"));
234-
ASSERT_EQUALS("foo", nsToDatabase("foo"));
235-
ASSERT_EQUALS("foo", nsToDatabase(std::string("foo.bar")));
236-
ASSERT_EQUALS("foo", nsToDatabase(std::string("foo")));
237233
}
238234

239235
TEST_F(NamespaceStringTest, NamespaceStringParse1) {

0 commit comments

Comments
 (0)