util/hash_table: add _mesa_hash_table_num_entries
[mesa.git] / src / mesa / main / hash.c
index 315b5d64004b80656640ce096e3ccfc88241848a..ab1b9e907ae5af5b8386b5361437551c3599ec00 100644 (file)
@@ -496,14 +496,12 @@ _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys)
 GLuint
 _mesa_HashNumEntries(const struct _mesa_HashTable *table)
 {
-   struct hash_entry *entry;
    GLuint count = 0;
 
    if (table->deleted_key_data)
       count++;
 
-   hash_table_foreach(table->ht, entry)
-      count++;
+   count += _mesa_hash_table_num_entries(table->ht);
 
    return count;
 }