X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhashcomp.cpp;h=3fb7f84fbf0fde09d799a6091faeca177b4e39f9;hb=8f7cdd5b61112802973470e74a87da52ee064920;hp=8c34c8a5603984f9f1a5cc5731beb73200ec5d17;hpb=553a8da754c8cd308bad2008018849714e70f9b7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 8c34c8a56..3fb7f84fb 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 @@ -150,11 +147,7 @@ void nspace::strlower(char *n) } -#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; for (irc::string::const_iterator x = s.begin(); x != s.end(); ++x) /* ++x not x++, as its faster */ @@ -333,7 +326,7 @@ bool irc::sepstream::GetToken(std::string &token) n++; } - token = ""; + token.clear(); return false; } @@ -451,7 +444,7 @@ int irc::modestacker::GetStackedLine(std::vector &result, int max_l irc::stringjoiner::stringjoiner(const std::string &seperator, const std::vector &sequence, int begin, int end) { if (end < begin) - throw "stringjoiner logic error, this causes problems."; + return; // nothing to do here for (int v = begin; v < end; v++) joined.append(sequence[v]).append(seperator); @@ -461,7 +454,7 @@ irc::stringjoiner::stringjoiner(const std::string &seperator, const std::vector< irc::stringjoiner::stringjoiner(const std::string &seperator, const std::deque &sequence, int begin, int end) { if (end < begin) - throw "stringjoiner logic error, this causes problems."; + return; // nothing to do here for (int v = begin; v < end; v++) joined.append(sequence[v]).append(seperator); @@ -471,7 +464,7 @@ irc::stringjoiner::stringjoiner(const std::string &seperator, const std::dequeGetToken(x); + sep.GetToken(x); if (x.empty()) return 0; while (Overlaps(atoi(x.c_str()))) { - if (!sep->GetToken(x)) + if (!sep.GetToken(x)) return 0; }