diff --git a/src/util/hash_table.c b/src/util/hash_table.c index d27ba74b909..632d70230fc 100644 --- a/src/util/hash_table.c +++ b/src/util/hash_table.c @@ -250,10 +250,7 @@ _mesa_hash_table_clear(struct hash_table *ht, struct hash_entry *entry; for (entry = ht->table; entry != ht->table + ht->size; entry++) { - if (entry->key == NULL) - continue; - - if (delete_function != NULL && entry->key != ht->deleted_key) + if (entry_is_present(ht, entry) && delete_function != NULL) delete_function(entry); entry->key = NULL;