1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 23:23:12 +02:00

Optimizations of much of the more commonly used code

This commit is contained in:
Adam
2013-04-07 23:46:44 -05:00
parent 36602224b8
commit fb7fef7a84
64 changed files with 772 additions and 806 deletions
+5 -5
View File
@@ -152,18 +152,18 @@ Serializable* ChanAccess::Unserialize(Serializable *obj, Serialize::Data &data)
return access;
}
bool ChanAccess::Matches(const User *u, const NickCore *nc) const
bool ChanAccess::Matches(const User *u, const NickCore *acc) const
{
bool is_mask = this->mask.find_first_of("!@?*") != Anope::string::npos;
if (u && is_mask && Anope::Match(u->nick, this->mask))
return true;
else if (u && Anope::Match(u->GetDisplayedMask(), this->mask))
return true;
else if (nc)
for (unsigned i = nc->aliases->size(); i > 0; --i)
else if (acc)
for (unsigned i = 0; i < acc->aliases->size(); ++i)
{
const NickAlias *na = nc->aliases->at(i - 1);
if (na && Anope::Match(na->nick, this->mask))
const NickAlias *na = acc->aliases->at(i);
if (Anope::Match(na->nick, this->mask))
return true;
}
return false;