Skip to content

Commit 05a479a

Browse files
committed
Fixes.
1 parent 598f4af commit 05a479a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/common/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace xgboost::common {
8585

8686
auto first = str.find_first_not_of(" \t\n\r");
8787
if (first == std::string_view::npos) {
88-
return "";
88+
return {};
8989
}
9090
return str.substr(first);
9191
}
@@ -96,7 +96,7 @@ namespace xgboost::common {
9696
}
9797
auto last = str.find_last_not_of(" \t\n\r");
9898
if (last == std::string_view::npos) {
99-
return "";
99+
return {};
100100
}
101101
return str.substr(0, last + 1);
102102
}

tests/cpp/common/test_common.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TEST(Common, Split) {
3636
std::string str{chars};
3737
auto res_str = Split(str, ',');
3838
std::string_view view{chars};
39-
auto res_view = Split(str, ',');
39+
auto res_view = Split(view, ',');
4040
ASSERT_EQ(res_view.size(), res_str.size());
4141
ASSERT_EQ(res_view.size(), n);
4242
for (std::size_t i = 0; i < res_str.size(); ++i) {

0 commit comments

Comments
 (0)