[ Edit by Mathieu Desnoyers:
This is an optimisation that checks if the reverse hash value is
equal before calling the comparison function. Given comparing a
reverse hash is much faster than comparison, this accelarates the
lookups and add. ]
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
goto gc_node;
if ((mode == ADD_UNIQUE || mode == ADD_REPLACE)
&& !is_dummy(next)
+ && clear_flag(iter)->p.reverse_hash == node->p.reverse_hash
&& !ht->compare_fct(node->key, node->key_len,
clear_flag(iter)->key,
clear_flag(iter)->key_len)) {
next = rcu_dereference(node->p.next);
if (likely(!is_removed(next))
&& !is_dummy(next)
+ && clear_flag(node)->p.reverse_hash == reverse_hash
&& likely(!ht->compare_fct(node->key, node->key_len, key, key_len))) {
break;
}