misc: fix rehashing hashtable entries
We need to hash the key instead of the whole entry, otherwise, we have dead/wrong entries in the hash-table after a rehash-round. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
2e06e93a80
commit
f880a3abdb
@ -305,8 +305,9 @@ bool kmscon_direct_equal(const void *data1, const void *data2)
|
|||||||
static size_t rehash(const void *ele, void *priv)
|
static size_t rehash(const void *ele, void *priv)
|
||||||
{
|
{
|
||||||
struct kmscon_hashtable *tbl = priv;
|
struct kmscon_hashtable *tbl = priv;
|
||||||
|
const struct kmscon_hashentry *ent = ele;
|
||||||
|
|
||||||
return tbl->hash_cb(ele);
|
return tbl->hash_cb(ent->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
int kmscon_hashtable_new(struct kmscon_hashtable **out,
|
int kmscon_hashtable_new(struct kmscon_hashtable **out,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user