X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhashcomp.cpp;h=e0347421b29d01fb89e7cedd13d89aacde04fb74;hb=68211809ee3111bdc9609fbd46dc3c875fbb5ea6;hp=2cb6fb972326984582d81d1d4ecdf15acfd31c61;hpb=388e4ff40931dda5870ddef149e54bdcc6c5a711;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 2cb6fb972..e0347421b 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -127,15 +127,12 @@ void nspace::strlower(char *n) } } -#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) - size_t nspace::hash_compare >::operator()(const std::string &s) const +#ifdef HASHMAP_DEPRECATED + size_t CoreExport nspace::insensitive::operator()(const std::string &s) const #else - #ifdef HASHMAP_DEPRECATED - size_t CoreExport nspace::insensitive::operator()(const std::string &s) const - #else - size_t nspace::hash::operator()(const std::string &s) const - #endif + size_t nspace::hash::operator()(const std::string &s) const #endif + { /* XXX: NO DATA COPIES! :) * The hash function here is practically @@ -143,20 +140,16 @@ void nspace::strlower(char *n) * only with *x replaced with national_case_insensitive_map[*x]. * This avoids a copy to use hash */ - register size_t t = 0; + size_t t = 0; for (std::string::const_iterator x = s.begin(); x != s.end(); ++x) /* ++x not x++, as its faster */ t = 5 * t + national_case_insensitive_map[(unsigned char)*x]; return t; } -#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) - size_t nspace::hash_compare >::operator()(const irc::string &s) const -#else - size_t CoreExport irc::hash::operator()(const irc::string &s) const -#endif +size_t CoreExport irc::hash::operator()(const irc::string &s) const { - register size_t t = 0; + 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 + national_case_insensitive_map[(unsigned char)*x]; return t; @@ -333,7 +326,7 @@ bool irc::sepstream::GetToken(std::string &token) n++; } - token = ""; + token.clear(); return false; }