ue2_literal: better hash function

This commit is contained in:
Justin Viiret
2017-08-10 15:12:28 +10:00
committed by Matthew Barr
parent 1aad3b0ed1
commit 25170b32eb
2 changed files with 8 additions and 1 deletions

View File

@@ -205,6 +205,8 @@ public:
nocase.swap(other.nocase);
}
size_t hash() const;
private:
friend const_iterator;
std::string s;
@@ -321,7 +323,7 @@ struct hash<ue2::ue2_literal::elem> {
template<>
struct hash<ue2::ue2_literal> {
size_t operator()(const ue2::ue2_literal &lit) const {
return ue2::ue2_hasher()(lit);
return lit.hash();
}
};