{
gl_hash_entry_t *old_table = list->table;
/* Allocate the new table. */
- gl_hash_entry_t *new_table =
- (gl_hash_entry_t *) xzalloc (new_size * sizeof (gl_hash_entry_t));
+ gl_hash_entry_t *new_table = XCALLOC (new_size, gl_hash_entry_t);
size_t i;
/* Iterate through the entries of the old table. */
{
gl_hash_entry_t next = node->hash_next;
/* Add the entry to the new table. */
- size_t index = node->hashcode % new_size;
- node->hash_next = new_table[index];
- new_table[index] = node;
+ size_t bucket = node->hashcode % new_size;
+ node->hash_next = new_table[bucket];
+ new_table[bucket] = node;
node = next;
}