diff options
-rw-r--r-- | src/modules/m_stripcolor.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp index cd4f35c4b..86f307bae 100644 --- a/src/modules/m_stripcolor.cpp +++ b/src/modules/m_stripcolor.cpp @@ -72,8 +72,8 @@ class ModuleStripColor : public Module { /* refactor this completely due to SQUIT bug since the old code would strip last char and replace with \0 --peavey */ int seq = 0; - std::string::iterator i,safei; - for (i = sentence.begin(); i != sentence.end();) + + for (std::string::iterator i = sentence.begin(); i != sentence.end();) { if (*i == 3) seq = 1; @@ -89,20 +89,7 @@ class ModuleStripColor : public Module seq = 0; if (seq || ((*i == 2) || (*i == 15) || (*i == 22) || (*i == 21) || (*i == 31))) - { - if (i != sentence.begin()) - { - safei = i; - --i; - sentence.erase(safei); - ++i; - } - else - { - sentence.erase(i); - i = sentence.begin(); - } - } + i = sentence.erase(i); else ++i; } |