X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=action.h;h=a0a1173e4cc0ce9ff6507f615e8c911ed529bb7c;hp=606857d8524ade62545f3455d8984e0dfbe4325a;hb=47c99f0a381056fb14d9871fc9f93536624df780;hpb=e63ff9d398f93d974d59dab49ac3b9e55f52ab01 diff --git a/action.h b/action.h index 606857d..a0a1173 100644 --- a/action.h +++ b/action.h @@ -15,9 +15,10 @@ namespace __gnu_cxx { struct hash< std::basic_string > { size_t operator()(const std::basic_string& s) const { - const std::collate& c = std::use_facet< std::collate >(std::locale()); - - return c.hash(s.c_str(), s.c_str() + s.size()); + size_t hash = 0; + for (unsigned int i = 0; i < s.size(); ++i) + hash += static_cast(s[i]); + return hash + s.size(); } @@ -28,9 +29,10 @@ namespace __gnu_cxx { size_t operator()(const std::basic_string& s) const { - const std::collate& c = std::use_facet< std::collate >(std::locale()); - - return c.hash(s.c_str(), s.c_str() + s.size()); + size_t hash = 0; + for (unsigned int i = 0; i < s.size(); ++i) + hash += static_cast(s[i]); + return hash + s.size(); } };