[Mesa-dev] [PATCH 1/3] hash_table: Rename insert_with_hash to insert_pre_hashed

Jason Ekstrand jason at jlekstrand.net
Thu Jan 15 09:35:47 PST 2015


We already have search_pre_hashed.  This makes the APIs match better.
---
 src/glsl/nir/nir_lower_locals_to_regs.c | 2 +-
 src/mesa/main/hash.c                    | 2 +-
 src/util/hash_table.c                   | 4 ++--
 src/util/hash_table.h                   | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/glsl/nir/nir_lower_locals_to_regs.c b/src/glsl/nir/nir_lower_locals_to_regs.c
index c08a15b..b187541 100644
--- a/src/glsl/nir/nir_lower_locals_to_regs.c
+++ b/src/glsl/nir/nir_lower_locals_to_regs.c
@@ -118,7 +118,7 @@ get_reg_for_deref(nir_deref_var *deref, struct locals_to_regs_state *state)
    reg->num_components = glsl_get_vector_elements(tail->type);
    reg->num_array_elems = array_size > 1 ? array_size : 0;
 
-   _mesa_hash_table_insert_with_hash(state->regs_table, hash, deref, reg);
+   _mesa_hash_table_insert_pre_hashed(state->regs_table, hash, deref, reg);
 
    return reg;
 }
diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c
index a8c796b..1a152ec 100644
--- a/src/mesa/main/hash.c
+++ b/src/mesa/main/hash.c
@@ -277,7 +277,7 @@ _mesa_HashInsert_unlocked(struct _mesa_HashTable *table, GLuint key, void *data)
       if (entry) {
          entry->data = data;
       } else {
-         _mesa_hash_table_insert_with_hash(table->ht, hash, uint_key(key), data);
+         _mesa_hash_table_insert_pre_hashed(table->ht, hash, uint_key(key), data);
       }
    }
 }
diff --git a/src/util/hash_table.c b/src/util/hash_table.c
index ac187b2..81816d1 100644
--- a/src/util/hash_table.c
+++ b/src/util/hash_table.c
@@ -334,8 +334,8 @@ _mesa_hash_table_insert(struct hash_table *ht, const void *key, void *data)
 }
 
 struct hash_entry *
-_mesa_hash_table_insert_with_hash(struct hash_table *ht, uint32_t hash,
-                                  const void *key, void *data)
+_mesa_hash_table_insert_pre_hashed(struct hash_table *ht, uint32_t hash,
+                                   const void *key, void *data)
 {
    assert(ht->key_hash_function == NULL || hash == ht->key_hash_function(key));
    return hash_table_insert(ht, hash, key, data);
diff --git a/src/util/hash_table.h b/src/util/hash_table.h
index 7f9fd62..eb9dbc3 100644
--- a/src/util/hash_table.h
+++ b/src/util/hash_table.h
@@ -70,8 +70,8 @@ void _mesa_hash_table_set_deleted_key(struct hash_table *ht,
 struct hash_entry *
 _mesa_hash_table_insert(struct hash_table *ht, const void *key, void *data);
 struct hash_entry *
-_mesa_hash_table_insert_with_hash(struct hash_table *ht, uint32_t hash,
-                                  const void *key, void *data);
+_mesa_hash_table_insert_pre_hashed(struct hash_table *ht, uint32_t hash,
+                                   const void *key, void *data);
 struct hash_entry *
 _mesa_hash_table_search(struct hash_table *ht, const void *key);
 struct hash_entry *
-- 
2.2.1



More information about the mesa-dev mailing list