simplify hash calculation (we don't need combine with which(), using hash<T> is sufficient)

This commit is contained in:
artemp 2016-12-13 15:50:00 +01:00
parent 8e15353818
commit 0307499753

View file

@ -56,11 +56,6 @@ struct value_hasher
return static_cast<std::size_t>(val.hashCode()); return static_cast<std::size_t>(val.hashCode());
} }
std::size_t operator()(value_integer val) const
{
return static_cast<std::size_t>(val);
}
template <class T> template <class T>
std::size_t operator()(T const& val) const std::size_t operator()(T const& val) const
{ {
@ -74,10 +69,7 @@ struct value_hasher
template <typename T> template <typename T>
std::size_t value_hash(T const& val) std::size_t value_hash(T const& val)
{ {
std::size_t seed = 0; return util::apply_visitor(detail::value_hasher(), val);
detail::hash_combine(seed, util::apply_visitor(detail::value_hasher(), val));
detail::hash_combine(seed, val.which());
return seed;
} }
} // namespace mapnik } // namespace mapnik