projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
autoupdate
[gnulib.git]
/
lib
/
gl_anyhash_list2.h
diff --git
a/lib/gl_anyhash_list2.h
b/lib/gl_anyhash_list2.h
index
eb8d6e9
..
d719116
100644
(file)
--- a/
lib/gl_anyhash_list2.h
+++ b/
lib/gl_anyhash_list2.h
@@
-100,8
+100,7
@@
hash_resize (gl_list_t list, size_t estimate)
{
gl_hash_entry_t *old_table = list->table;
/* Allocate the new table. */
{
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. */
size_t i;
/* Iterate through the entries of the old table. */
@@
-113,9
+112,9
@@
hash_resize (gl_list_t list, size_t estimate)
{
gl_hash_entry_t next = node->hash_next;
/* Add the entry to the new 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;
}
node = next;
}