From 8b418f081f7ecbfdd51c84fae2298f927155fac0 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 10 Aug 2018 07:46:42 +0100 Subject: 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. --- src/modules/m_spanningtree/treesocket2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/m_spanningtree/treesocket2.cpp') 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); } -- cgit v1.3.1-10-gc9f91