- fix stringToVector if the string ends in a separator. issue #328

This commit is contained in:
Fledge68 2022-12-10 16:07:47 -06:00
parent d5bfdedb19
commit 4be2d6efda
2 changed files with 0 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

View File

@ -105,11 +105,6 @@ vector<string> stringToVector(const string &text, char sep)
{ {
vector<string> v; vector<string> v;
if (text.empty()) return v; if (text.empty()) return v;
u32 count = 1;
for (u32 i = 0; i < text.size(); ++i)
if (text[i] == sep)
++count;
v.reserve(count);
string::size_type off = 0; string::size_type off = 0;
string::size_type i = 0; string::size_type i = 0;
do do
@ -131,11 +126,6 @@ vector<wstringEx> stringToVector(const wstringEx &text, char sep)
{ {
vector<wstringEx> v; vector<wstringEx> v;
if (text.empty()) return v; if (text.empty()) return v;
u32 count = 1;
for (u32 i = 0; i < text.size(); ++i)
if (text[i] == sep)
++count;
v.reserve(count);
wstringEx::size_type off = 0; wstringEx::size_type off = 0;
wstringEx::size_type i = 0; wstringEx::size_type i = 0;
do do