File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ namespace xgboost::common {
85
85
86
86
auto first = str.find_first_not_of (" \t\n\r " );
87
87
if (first == std::string_view::npos) {
88
- return " " ;
88
+ return {} ;
89
89
}
90
90
return str.substr (first);
91
91
}
@@ -96,7 +96,7 @@ namespace xgboost::common {
96
96
}
97
97
auto last = str.find_last_not_of (" \t\n\r " );
98
98
if (last == std::string_view::npos) {
99
- return " " ;
99
+ return {} ;
100
100
}
101
101
return str.substr (0 , last + 1 );
102
102
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ TEST(Common, Split) {
36
36
std::string str{chars};
37
37
auto res_str = Split (str, ' ,' );
38
38
std::string_view view{chars};
39
- auto res_view = Split (str , ' ,' );
39
+ auto res_view = Split (view , ' ,' );
40
40
ASSERT_EQ (res_view.size (), res_str.size ());
41
41
ASSERT_EQ (res_view.size (), n);
42
42
for (std::size_t i = 0 ; i < res_str.size (); ++i) {
You can’t perform that action at this time.
0 commit comments