summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-29 00:37:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-10-29 00:37:47 +0000
commit6cc66282a534c7630dca0e7d22e6f50f29ead3f9 (patch)
tree4e6b8ceff53f6c125670e7409f6fd0331835adf7
parentb253374745d237924c9478ec94ffa333c5492ed1 (diff)
A few more timesaving checks.
The more astute amongst you will have noticed all the Add?Line functions now look practically identical. This paves the way for us to have one generic one, but before we do this i'd rather have us add an XLine* pointer to it, not a hostmask or something non-generic. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8423 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/xline.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 072320555..329b0e6e8 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -323,6 +323,9 @@ void ELine::Unset()
QLine* XLineManager::matches_qline(const char* nick)
{
+ if (lookup_lines.find('Q') == lookup_lines.end())
+ return NULL;
+
if (lookup_lines.find('Q') != lookup_lines.end() && lookup_lines['Q'].empty())
return NULL;
@@ -336,6 +339,9 @@ QLine* XLineManager::matches_qline(const char* nick)
GLine* XLineManager::matches_gline(User* user)
{
+ if (lookup_lines.find('G') == lookup_lines.end())
+ return NULL;
+
if (lookup_lines.find('G') != lookup_lines.end() && lookup_lines['G'].empty())
return NULL;
@@ -348,6 +354,9 @@ GLine* XLineManager::matches_gline(User* user)
ELine* XLineManager::matches_exception(User* user)
{
+ if (lookup_lines.find('E') == lookup_lines.end())
+ return NULL;
+
if (lookup_lines.find('E') != lookup_lines.end() && lookup_lines['E'].empty())
return NULL;
@@ -424,6 +433,9 @@ void XLineManager::zline_set_creation_time(const char* ip, time_t create_time)
ZLine* XLineManager::matches_zline(User *u)
{
+ if (lookup_lines.find('Z') == lookup_lines.end())
+ return NULL;
+
if (lookup_lines.find('Z') != lookup_lines.end() && lookup_lines['Z'].empty())
return NULL;
@@ -437,6 +449,9 @@ ZLine* XLineManager::matches_zline(User *u)
KLine* XLineManager::matches_kline(User* user)
{
+ if (lookup_lines.find('K') == lookup_lines.end())
+ return NULL;
+
if (lookup_lines.find('K') != lookup_lines.end() && lookup_lines['K'].empty())
return NULL;