static void
add_to_bucket (gl_list_t list, gl_list_node_t new_node)
{
- size_t index = new_node->h.hashcode % list->table_size;
+ size_t bucket = new_node->h.hashcode % list->table_size;
/* If no duplicates are allowed, multiple nodes are not needed. */
if (list->base.allow_duplicates)
gl_listelement_equals_fn equals = list->base.equals_fn;
gl_hash_entry_t *entryp;
- for (entryp = &list->table[index]; *entryp != NULL; entryp = &(*entryp)->hash_next)
+ for (entryp = &list->table[bucket]; *entryp != NULL; entryp = &(*entryp)->hash_next)
{
gl_hash_entry_t entry = *entryp;
}
}
/* If no duplicates are allowed, multiple nodes are not needed. */
- new_node->h.hash_next = list->table[index];
- list->table[index] = &new_node->h;
+ new_node->h.hash_next = list->table[bucket];
+ list->table[bucket] = &new_node->h;
}
/* Remove a node from the hash table structure.
static void
remove_from_bucket (gl_list_t list, gl_list_node_t old_node)
{
- size_t index = old_node->h.hashcode % list->table_size;
+ size_t bucket = old_node->h.hashcode % list->table_size;
if (list->base.allow_duplicates)
{
gl_listelement_equals_fn equals = list->base.equals_fn;
gl_hash_entry_t *entryp;
- for (entryp = &list->table[index]; ; entryp = &(*entryp)->hash_next)
+ for (entryp = &list->table[bucket]; ; entryp = &(*entryp)->hash_next)
{
gl_hash_entry_t entry = *entryp;
/* If no duplicates are allowed, multiple nodes are not needed. */
gl_hash_entry_t *entryp;
- for (entryp = &list->table[index]; ; entryp = &(*entryp)->hash_next)
+ for (entryp = &list->table[bucket]; ; entryp = &(*entryp)->hash_next)
{
if (*entryp == &old_node->h)
{