summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 20:16:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-09 20:16:43 +0000
commit0cf08426b2ff53d6fc1ca8125a57c79d87070b7b (patch)
tree36e30bdb829460fa63c9875e60b9d988b60d0747 /src
parent7a3d08f06cc22688a70c5274fe0dd489f93e9794 (diff)
Speedups
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3602 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/cull_list.cpp16
-rw-r--r--src/userprocess.cpp2
-rw-r--r--src/users.cpp6
3 files changed, 20 insertions, 4 deletions
diff --git a/src/cull_list.cpp b/src/cull_list.cpp
index a8188701a..b7254fd0b 100644
--- a/src/cull_list.cpp
+++ b/src/cull_list.cpp
@@ -87,6 +87,12 @@ CullItem::CullItem(userrec* u, std::string &r)
this->reason = r;
}
+CullItem::CullItem(userrec* u, const char* r)
+{
+ this->user = u;
+ this->reason = r;
+}
+
userrec* CullItem::GetUser()
{
return this->user;
@@ -113,6 +119,16 @@ void CullList::AddItem(userrec* user, std::string &reason)
}
}
+void CullList::AddItem(userrec* user, const char* reason)
+{
+ if (exempt.find(user) == exempt.end())
+ {
+ CullItem item(user,reason);
+ list.push_back(item);
+ exempt[user] = user->signon;
+ }
+}
+
int CullList::Apply()
{
int n = 0;
diff --git a/src/userprocess.cpp b/src/userprocess.cpp
index 30f7d49f8..0c72a53b5 100644
--- a/src/userprocess.cpp
+++ b/src/userprocess.cpp
@@ -404,7 +404,7 @@ void DoBackgroundUserStuff(time_t TIME)
*/
curr->FlushWriteBuf();
- if (curr->GetWriteError() != "")
+ if (*curr->GetWriteError())
{
GlobalGoners.AddItem(curr,curr->GetWriteError());
continue;
diff --git a/src/users.cpp b/src/users.cpp
index a0929d684..3b6a10197 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -357,7 +357,7 @@ std::string userrec::GetBuffer()
void userrec::AddWriteBuf(std::string data)
{
- if (this->GetWriteError() != "")
+ if (*this->GetWriteError())
return;
if (sendq.length() + data.length() > (unsigned)this->sendqmax)
{
@@ -405,9 +405,9 @@ void userrec::SetWriteError(std::string error)
this->WriteError = error;
}
-std::string userrec::GetWriteError()
+const char* userrec::GetWriteError()
{
- return this->WriteError;
+ return this->WriteError.c_str();
}
void AddOper(userrec* user)