Merge pull request #6367 from danpls/fix-npos
tokenizeString: Fix semantic mistake
This commit is contained in:
commit
f89fa29914
1 changed files with 2 additions and 2 deletions
|
@ -1259,9 +1259,9 @@ template<class C> C tokenizeString(std::string_view s, std::string_view separato
|
||||||
{
|
{
|
||||||
C result;
|
C result;
|
||||||
auto pos = s.find_first_not_of(separators, 0);
|
auto pos = s.find_first_not_of(separators, 0);
|
||||||
while (pos != std::string::npos) {
|
while (pos != std::string_view::npos) {
|
||||||
auto end = s.find_first_of(separators, pos + 1);
|
auto end = s.find_first_of(separators, pos + 1);
|
||||||
if (end == std::string::npos) end = s.size();
|
if (end == std::string_view::npos) end = s.size();
|
||||||
result.insert(result.end(), std::string(s, pos, end - pos));
|
result.insert(result.end(), std::string(s, pos, end - pos));
|
||||||
pos = s.find_first_not_of(separators, end);
|
pos = s.find_first_not_of(separators, end);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue