diff options
| author | Adam <Adam@drink-coca-cola.info> | 2010-05-14 20:35:38 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-06-18 21:01:53 -0400 |
| commit | f049124905bd9f53439293e873003cb027a17b91 (patch) | |
| tree | 352ed9251fd47055dd770aa2d5eabb20247e4b43 /src/modules/ns_maxemail.c | |
| parent | 81a45520a773732c9f46785f27aa1956150775d7 (diff) | |
Rewrote the hashing system to use std::tr1::unordered_map
Diffstat (limited to 'src/modules/ns_maxemail.c')
| -rw-r--r-- | src/modules/ns_maxemail.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/modules/ns_maxemail.c b/src/modules/ns_maxemail.c index e98dc62d7..2399dba68 100644 --- a/src/modules/ns_maxemail.c +++ b/src/modules/ns_maxemail.c @@ -127,20 +127,17 @@ class NSMaxEmail : public Module int count_email_in_use(const char *email, User * u) { - NickCore *nc; - int i; int count = 0; if (!email) return 0; - for (i = 0; i < 1024; ++i) + for (nickcore_map::const_iterator it = NickCoreList.begin(); it != NickCoreList.end(); ++it) { - for (nc = nclists[i]; nc; nc = nc->next) - { - if (!(u->Account() && u->Account() == nc) && nc->email && !stricmp(nc->email, email)) - ++count; - } + NickCore *nc = it->second; + + if (!(u->Account() && u->Account() == nc) && nc->email && !stricmp(nc->email, email)) + ++count; } return count; |
