Skip to content
Snippets Groups Projects
Commit 9ff4cf0b authored by Adrien Béraud's avatar Adrien Béraud
Browse files

split_string_to_unsigned: use string_view

Change-Id: I40a4f6be0ed1cda1df1ca529fa16f3a61d4d93db
parent 9501a2a4
Branches
No related tags found
No related merge requests found
...@@ -112,7 +112,7 @@ trim(std::string_view s) ...@@ -112,7 +112,7 @@ trim(std::string_view s)
} }
std::vector<unsigned> std::vector<unsigned>
split_string_to_unsigned(const std::string& str, char delim) split_string_to_unsigned(std::string_view str, char delim)
{ {
std::vector<unsigned> output; std::vector<unsigned> output;
for (auto first = str.data(), second = str.data(), last = first + str.size(); second != last && first != last; first = second + 1) { for (auto first = str.data(), second = str.data(), last = first + str.size(); second != last && first != last; first = second + 1) {
......
...@@ -172,7 +172,7 @@ std::vector<std::string_view> split_string(std::string_view str, std::string_vie ...@@ -172,7 +172,7 @@ std::vector<std::string_view> split_string(std::string_view str, std::string_vie
return output; return output;
} }
std::vector<unsigned> split_string_to_unsigned(const std::string& s, char sep); std::vector<unsigned> split_string_to_unsigned(std::string_view s, char sep);
void string_replace(std::string& str, const std::string& from, const std::string& to); void string_replace(std::string& str, const std::string& from, const std::string& to);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment