]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/xline.cpp
Remove unnecessary string copy in XLineManager::InvokeStats
[user/henk/code/inspircd.git] / src / xline.cpp
index ed3ed6364b1ef01714867cf57e0f64026211c48c..720dbcc501b69d61569bf9136762de8bb652b383 100644 (file)
@@ -252,8 +252,6 @@ IdentHostPair XLineManager::IdentSplit(const std::string &ident_and_host)
 
 bool XLineManager::AddLine(XLine* line, User* user)
 {
-       ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
-
        if (line->duration && ServerInstance->Time() > line->expiry)
                return false; // Don't apply expired XLines.
 
@@ -273,6 +271,8 @@ bool XLineManager::AddLine(XLine* line, User* user)
        if (!xlf)
                return false;
 
+       ServerInstance->BanCache->RemoveEntries(line->type, false); // XXX perhaps remove ELines here?
+
        if (xlf->AutoApplyToUserList(line))
                pending_lines.push_back(line);
 
@@ -447,8 +447,6 @@ void XLineManager::ApplyLines()
 
 void XLineManager::InvokeStats(const std::string &type, int numeric, User* user, string_list &results)
 {
-       std::string sn = ServerInstance->Config->ServerName;
-
        ContainerIter n = lookup_lines.find(type);
 
        time_t current = ServerInstance->Time();
@@ -468,8 +466,8 @@ void XLineManager::InvokeStats(const std::string &type, int numeric, User* user,
                                ExpireLine(n, i);
                        }
                        else
-                               results.push_back(sn+" "+ConvToStr(numeric)+" "+user->nick+" :"+i->second->Displayable()+" "+
-                                       ConvToStr(i->second->set_time)+" "+ConvToStr(i->second->duration)+" "+std::string(i->second->source)+" :"+(i->second->reason));
+                               results.push_back(ServerInstance->Config->ServerName+" "+ConvToStr(numeric)+" "+user->nick+" :"+i->second->Displayable()+" "+
+                                       ConvToStr(i->second->set_time)+" "+ConvToStr(i->second->duration)+" "+i->second->source+" :"+i->second->reason);
                        i = safei;
                }
        }