1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[xhr] Small rewrite of explode

This commit is contained in:
Witold Filipczyk 2022-09-25 19:44:01 +02:00
parent 5657e59006
commit 0d9b1aa1cb

View File

@ -518,10 +518,14 @@ explode(const std::string& s, const char& c)
bool found = false;
for (auto n:s) {
if (found || (n != c)) {
if (found) {
buff += n;
continue;
}
if (n != c) {
buff += n;
}
else if (!found && n == c && buff != "") {
else if (n == c && buff != "") {
v.push_back(buff);
buff = "";
found = true;