diff options
| author | 2008-05-08 16:38:30 +0000 | |
|---|---|---|
| committer | 2008-05-08 16:38:30 +0000 | |
| commit | d0646a9b10ee279c8932542657fb320b39face65 (patch) | |
| tree | fc706e1918dc129d6ba975c855422153a0d8dea5 /src/modules/m_banexception.cpp | |
| parent | Masterful rewrite of User::AddBuffer to remove a string copy (and make more e... (diff) | |
| download | inspircd++-d0646a9b10ee279c8932542657fb320b39face65.tar.gz inspircd++-d0646a9b10ee279c8932542657fb320b39face65.tar.bz2 inspircd++-d0646a9b10ee279c8932542657fb320b39face65.zip | |
Remove a level of nesting from this
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9662 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_banexception.cpp')
| -rw-r--r-- | src/modules/m_banexception.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index 609e5c221..c39a74164 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -69,19 +69,21 @@ public: if (list) { - char mask[MAXBUF]; - snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString()); - for (modelist::iterator it = list->begin(); it != list->end(); it++) + // No list, so let them in anyway. + return 0; + } + + char mask[MAXBUF]; + snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString()); + + for (modelist::iterator it = list->begin(); it != list->end(); it++) + { + if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true))) { - if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true))) - { - // They match an entry on the list, so let them in. - return 1; - } + // They match an entry on the list, so let them in. + return 1; } - return 0; } - // or if there wasn't a list, there can't be anyone on it, so we don't need to do anything. } return 0; } |
