mesa: use pre_hashed version of search for the mesa hash table

The key is just an unsigned int so there is never any real hashing
done.

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Timothy Arceri 2017-04-10 22:21:37 +10:00
parent d0f381f865
commit c72170fb1f

View file

@ -183,7 +183,9 @@ _mesa_HashLookup_unlocked(struct _mesa_HashTable *table, GLuint key)
if (key == DELETED_KEY_VALUE) if (key == DELETED_KEY_VALUE)
return table->deleted_key_data; return table->deleted_key_data;
entry = _mesa_hash_table_search(table->ht, uint_key(key)); entry = _mesa_hash_table_search_pre_hashed(table->ht,
uint_hash(key),
uint_key(key));
if (!entry) if (!entry)
return NULL; return NULL;
@ -347,7 +349,9 @@ _mesa_HashRemove_unlocked(struct _mesa_HashTable *table, GLuint key)
if (key == DELETED_KEY_VALUE) { if (key == DELETED_KEY_VALUE) {
table->deleted_key_data = NULL; table->deleted_key_data = NULL;
} else { } else {
entry = _mesa_hash_table_search(table->ht, uint_key(key)); entry = _mesa_hash_table_search_pre_hashed(table->ht,
uint_hash(key),
uint_key(key));
_mesa_hash_table_remove(table->ht, entry); _mesa_hash_table_remove(table->ht, entry);
} }
} }