Splitting an empty string now returns an empty vector
This commit is contained in:
parent
9656f088e7
commit
784ab635ee
|
@ -44,6 +44,9 @@ Vector<String> split(StringView str, char separator, char escape)
|
||||||
Vector<StringView> split(StringView str, char separator)
|
Vector<StringView> split(StringView str, char separator)
|
||||||
{
|
{
|
||||||
Vector<StringView> res;
|
Vector<StringView> res;
|
||||||
|
if (str.empty())
|
||||||
|
return res;
|
||||||
|
|
||||||
auto beg = str.begin();
|
auto beg = str.begin();
|
||||||
for (auto it = beg; it != str.end(); ++it)
|
for (auto it = beg; it != str.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user