From 6bd9e67851ee7294e3529c3d7a4b05aa8601a2e3 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 13 Dec 2006 20:07:08 +0000 Subject: Change m_watch to use hash_map rather than map, because of the large number of entries we deal with it will usually be faster git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5979 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/hashcomp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/hashcomp.cpp') diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 6154a4b55..e076d1d71 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -92,6 +92,14 @@ size_t nspace::hash::operator()(const string &s) const return t; } +size_t nspace::hash::operator()(const irc::string &s) const +{ + register size_t t = 0; + for (irc::string::const_iterator x = s.begin(); x != s.end(); ++x) /* ++x not x++, as its faster */ + t = 5 * t + lowermap[(unsigned char)*x]; + return t; +} + bool irc::StrHashComp::operator()(const std::string& s1, const std::string& s2) const { unsigned char* n1 = (unsigned char*)s1.c_str(); -- cgit v1.3.1-10-gc9f91