mirror of
https://github.com/anope/anope.git
synced 2026-07-01 00:46:38 +02:00
Removed the old unordered_map code
This commit is contained in:
@@ -26,26 +26,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* VS 2008 specific function */
|
||||
bool Anope::hash::operator()(const Anope::string &s1, const Anope::string &s2) const
|
||||
{
|
||||
return s1.str().compare(s2.str()) < 0;
|
||||
}
|
||||
|
||||
/** Hash an Anope::string for unordered_map
|
||||
* @param s The string
|
||||
* @return A hash value for the string
|
||||
*/
|
||||
bool Anope::hash::operator()(const Anope::string &s) const
|
||||
{
|
||||
register size_t t = 0;
|
||||
|
||||
for (Anope::string::const_iterator it = s.begin(), it_end = s.end(); it != it_end; ++it)
|
||||
t = 5 * t + *it;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
bool irc::irc_char_traits::eq(char c1st, char c2nd)
|
||||
{
|
||||
return rfc_case_insensitive_map[static_cast<unsigned char>(c1st)] == rfc_case_insensitive_map[static_cast<unsigned char>(c2nd)];
|
||||
@@ -87,31 +67,6 @@ const char *irc::irc_char_traits::find(const char *s1, int n, char c)
|
||||
return n >= 0 ? s1 : NULL;
|
||||
}
|
||||
|
||||
/* VS 2008 specific function */
|
||||
bool irc::hash::operator()(const Anope::string &s1, const Anope::string &s2) const
|
||||
{
|
||||
return s1.irc_str().compare(s2.irc_str()) < 0;
|
||||
}
|
||||
|
||||
/** Hash an irc::string for unordered_map
|
||||
* @param s The string
|
||||
* @return A hash value for the string
|
||||
*/
|
||||
size_t irc::hash::operator()(const irc::string &s) const
|
||||
{
|
||||
register size_t t = 0;
|
||||
|
||||
for (irc::string::const_iterator it = s.begin(), it_end = s.end(); it != it_end; ++it)
|
||||
t = 5 * t + rfc_case_insensitive_map[static_cast<const unsigned char>(*it)];
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
size_t irc::hash::operator()(const Anope::string &s) const
|
||||
{
|
||||
return operator()(s.irc_str());
|
||||
}
|
||||
|
||||
bool ci::ci_char_traits::eq(char c1st, char c2nd)
|
||||
{
|
||||
return ascii_case_insensitive_map[static_cast<unsigned char>(c1st)] == ascii_case_insensitive_map[static_cast<unsigned char>(c2nd)];
|
||||
@@ -153,51 +108,6 @@ const char *ci::ci_char_traits::find(const char *s1, int n, char c)
|
||||
return n >= 0 ? s1 : NULL;
|
||||
}
|
||||
|
||||
/* VS 2008 specific function */
|
||||
bool ci::hash::operator()(const Anope::string &s1, const Anope::string &s2) const
|
||||
{
|
||||
return s1.ci_str().compare(s2.ci_str()) < 0;
|
||||
}
|
||||
|
||||
/** Hash a ci::string for unordered_map
|
||||
* @param s The string
|
||||
* @return A hash value for the string
|
||||
*/
|
||||
size_t ci::hash::operator()(const ci::string &s) const
|
||||
{
|
||||
register size_t t = 0;
|
||||
|
||||
for (ci::string::const_iterator it = s.begin(), it_end = s.end(); it != it_end; ++it)
|
||||
t = 5 * t + ascii_case_insensitive_map[static_cast<const unsigned char>(*it)];
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
size_t ci::hash::operator()(const Anope::string &s) const
|
||||
{
|
||||
return operator()(s.ci_str());
|
||||
}
|
||||
|
||||
/** Compare two Anope::strings as ci::strings
|
||||
* @param s1 The first string
|
||||
* @param s2 The second string
|
||||
* @return true if they are equal
|
||||
*/
|
||||
bool std::equal_to<ci::string>::operator()(const Anope::string &s1, const Anope::string &s2) const
|
||||
{
|
||||
return s1.ci_str() == s2.ci_str();
|
||||
}
|
||||
|
||||
/** Compare two Anope::strings as irc::strings
|
||||
* @param s1 The first string
|
||||
* @param s2 The second string
|
||||
* @return true if they are equal
|
||||
*/
|
||||
bool std::equal_to<irc::string>::operator()(const Anope::string &s1, const Anope::string &s2) const
|
||||
{
|
||||
return s1.irc_str() == s2.irc_str();
|
||||
}
|
||||
|
||||
/** Compare two Anope::strings as ci::strings and find which one is less
|
||||
* @param s1 The first string
|
||||
* @param s2 The second string
|
||||
|
||||
Reference in New Issue
Block a user