util/hash_table: don't compare deleted entries
The equivalent of the last patch for the hash table. I'm not aware of any issues this fixes. v2: - use entry_is_deleted (Timothy) Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Signed-off-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
@@ -300,7 +300,8 @@ hash_table_insert(struct hash_table *ht, uint32_t hash,
|
||||
* required to avoid memory leaks, perform a search
|
||||
* before inserting.
|
||||
*/
|
||||
if (entry->hash == hash &&
|
||||
if (!entry_is_deleted(ht, entry) &&
|
||||
entry->hash == hash &&
|
||||
ht->key_equals_function(key, entry->key)) {
|
||||
entry->key = key;
|
||||
entry->data = data;
|
||||
|
||||
Reference in New Issue
Block a user