diff options
Diffstat (limited to 'common/idstringlist.h')
-rw-r--r-- | common/idstringlist.h | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/common/idstringlist.h b/common/idstringlist.h index 24a46731..f101ecca 100644 --- a/common/idstringlist.h +++ b/common/idstringlist.h @@ -22,6 +22,7 @@ #define IDSTRING_LIST_H #include <boost/functional/hash.hpp> +#include "hashlib.h" #include "idstring.h" #include "nextpnr_namespaces.h" #include "sso_array.h" @@ -67,22 +68,16 @@ struct IdStringList static IdStringList concat(IdStringList a, IdStringList b); IdStringList slice(size_t s, size_t e) const; -}; - -NEXTPNR_NAMESPACE_END -namespace std { -template <> struct hash<NEXTPNR_NAMESPACE_PREFIX IdStringList> -{ - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX IdStringList &obj) const noexcept + unsigned int hash() const { - std::size_t seed = 0; - boost::hash_combine(seed, hash<size_t>()(obj.size())); - for (auto &id : obj) - boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(id)); - return seed; + unsigned int h = mkhash_init; + for (const auto &val : ids) + h = mkhash(h, val.hash()); + return h; } }; -} // namespace std + +NEXTPNR_NAMESPACE_END #endif /* IDSTRING_LIST_H */ |