util: pass std::string_view to tokenize_string()

This saves some overhead because some callers pass a plain C string
here which needed to be copied to a temporary std::string.
This commit is contained in:
Max Kellermann 2020-01-31 13:10:04 +01:00
parent e068ad8a53
commit f1566bda14
2 changed files with 4 additions and 3 deletions

View file

@ -1501,7 +1501,7 @@ TEST_CASE("util tokenize_string")
CHECK(v2.size() == 1);
}
vector<string>* tokenize_string(const string &input, const string& delim,
vector<string>* tokenize_string(const std::string_view input, const std::string_view delim,
vector<string>* rval, int limit)
{
if ( ! rval )