diff options
| author | 2018-08-10 07:46:42 +0100 | |
|---|---|---|
| committer | 2018-08-10 13:55:32 +0100 | |
| commit | 8b418f081f7ecbfdd51c84fae2298f927155fac0 (patch) | |
| tree | b600035f9346e081482fe1cad75b12697b56ae4a /src/modules/m_spanningtree/treesocket2.cpp | |
| parent | Remove the integer overloads of irc::tokenparser::GetToken(). (diff) | |
Split irc::tokenparser::GetToken into GetMiddle and GetTrailing.
This simplifies the logic of irc::tokenparser considerably and
removes all of the magic index guessing that was used previously.
Diffstat (limited to 'src/modules/m_spanningtree/treesocket2.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index d9083016c..3bc1fc71a 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -42,7 +42,7 @@ void TreeSocket::Split(const std::string& line, std::string& prefix, std::string { irc::tokenstream tokens(line); - if (!tokens.GetToken(prefix)) + if (!tokens.GetMiddle(prefix)) return; if (prefix[0] == ':') @@ -54,7 +54,7 @@ void TreeSocket::Split(const std::string& line, std::string& prefix, std::string this->SendError("BUG (?) Empty prefix received: " + line); return; } - if (!tokens.GetToken(command)) + if (!tokens.GetMiddle(command)) { this->SendError("BUG (?) Empty command received: " + line); return; @@ -69,7 +69,7 @@ void TreeSocket::Split(const std::string& line, std::string& prefix, std::string this->SendError("BUG (?) Empty command received: " + line); std::string param; - while (tokens.GetToken(param)) + while (tokens.GetTrailing(param)) { params.push_back(param); } |
