From 6cc66282a534c7630dca0e7d22e6f50f29ead3f9 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 29 Oct 2007 00:37:47 +0000 Subject: 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 --- src/xline.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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; -- cgit v1.2.3