template<>
class hash<rspamd::css::css_property> {
public:
+ using is_avalanching = void;
/* Mix bits to provide slightly better distribution but being constexpr */
constexpr size_t operator() (const rspamd::css::css_property &prop) const {
std::size_t key = 0xdeadbeef ^static_cast<std::size_t>(prop.type);
template<>
class hash<rspamd::css::css_rule> {
public:
+ using is_avalanching = void;
constexpr auto operator()(const rspamd::css::css_rule &rule) const -> auto {
return hash<rspamd::css::css_property>()(rule.get_prop());
}
template<>
class hash<rspamd::css::css_selector> {
public:
+ using is_avalanching = void;
auto operator() (const rspamd::css::css_selector &sel) const -> std::size_t {
if (sel.type == rspamd::css::css_selector::selector_type::SELECTOR_TAG) {
return static_cast<std::size_t>(std::get<tag_id_t>(sel.value));
struct smart_str_hash {
using is_transparent = void;
+ using is_avalanching = typename ankerl::unordered_dense::hash<std::string_view>::is_avalanching;
auto operator()(const std::string &a) const {
return ankerl::unordered_dense::hash<std::string>()(a);
}