1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-05-18 00:48:57 -04: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; bool found = false;
for (auto n:s) { for (auto n:s) {
if (found || (n != c)) { if (found) {
buff += n;
continue;
}
if (n != c) {
buff += n; buff += n;
} }
else if (!found && n == c && buff != "") { else if (n == c && buff != "") {
v.push_back(buff); v.push_back(buff);
buff = ""; buff = "";
found = true; found = true;