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:
parent
5657e59006
commit
0d9b1aa1cb
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user