summaryrefslogtreecommitdiff
path: root/lib/gl_anytreehash_list1.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2006-10-10 12:48:57 +0000
committerBruno Haible <bruno@clisp.org>2006-10-10 12:48:57 +0000
commit935e9f0bda3d20a28516e3e369946fe6fbe60043 (patch)
tree2788f8d2b2ce4186bcbb449a27c1c457ed66d667 /lib/gl_anytreehash_list1.h
parent33e26f502397b23115df4d7f6af2e82af55b0f91 (diff)
downloadgnulib-935e9f0bda3d20a28516e3e369946fe6fbe60043.tar.gz
Avoid using the variable name 'index' for two completely different things.
Diffstat (limited to 'lib/gl_anytreehash_list1.h')
-rw-r--r--lib/gl_anytreehash_list1.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/gl_anytreehash_list1.h b/lib/gl_anytreehash_list1.h
index f6e319b490..fac02b6aed 100644
--- a/lib/gl_anytreehash_list1.h
+++ b/lib/gl_anytreehash_list1.h
@@ -109,7 +109,7 @@ gl_oset_first (gl_oset_t set)
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)
@@ -119,7 +119,7 @@ add_to_bucket (gl_list_t list, gl_list_node_t new_node)
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;
@@ -171,8 +171,8 @@ add_to_bucket (gl_list_t list, gl_list_node_t new_node)
}
}
/* 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.
@@ -184,7 +184,7 @@ add_to_bucket (gl_list_t list, gl_list_node_t new_node)
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)
{
@@ -193,7 +193,7 @@ remove_from_bucket (gl_list_t list, gl_list_node_t old_node)
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;
@@ -239,7 +239,7 @@ remove_from_bucket (gl_list_t list, gl_list_node_t old_node)
/* 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)
{