]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
Replace std::deque with std::vector in spanningtree and related modules
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index b117ebe822fc34c8c14ea28c5387ae36124d1dd8..bc9388c94956287c8a6f94e7716be03525d0bb6f 100644 (file)
@@ -38,7 +38,7 @@ void TreeSocket::WriteLine(std::string line)
 
 
 /* Handle ERROR command */
-bool TreeSocket::Error(std::deque<std::string> &params)
+bool TreeSocket::Error(parameterlist &params)
 {
        if (params.size() < 1)
                return false;
@@ -47,7 +47,7 @@ bool TreeSocket::Error(std::deque<std::string> &params)
        return false;
 }
 
-void TreeSocket::Split(const std::string &line, std::deque<std::string> &n)
+void TreeSocket::Split(const std::string &line, parameterlist &n)
 {
        n.clear();
        irc::tokenstream tokens(line);
@@ -61,7 +61,7 @@ void TreeSocket::Split(const std::string &line, std::deque<std::string> &n)
 
 bool TreeSocket::ProcessLine(std::string &line)
 {
-       std::deque<std::string> params;
+       parameterlist params;
        irc::string command;
        std::string prefix;
 
@@ -80,17 +80,20 @@ bool TreeSocket::ProcessLine(std::string &line)
        if ((params[0][0] == ':') && (params.size() > 1))
        {
                prefix = params[0].substr(1);
-               params.pop_front();
 
                if (prefix.empty())
                {
                        this->SendError("BUG (?) Empty prefix recieved: " + line);
                        return false;
                }
+               command = params[1].c_str();
+               params.erase(params.begin(), params.begin() + 2);
+       }
+       else
+       {
+               command = params[0].c_str();
+               params.erase(params.begin());
        }
-
-       command = params[0].c_str();
-       params.pop_front();
 
        switch (this->LinkState)
        {