Fix rehashing the nodes to a hash of a new size.

SVN revision: 18518
This commit is contained in:
rbdpngn 2005-11-17 15:15:37 +00:00 committed by rbdpngn
parent 41f9c95d96
commit d7aa8d7dc9
1 changed files with 3 additions and 5 deletions

View File

@ -438,6 +438,7 @@ void *ecore_hash_remove(Ecore_Hash *hash, void *key)
node->value = NULL;
_ecore_hash_node_destroy(node, hash->free_key,
NULL);
hash->nodes--;
}
}
@ -670,13 +671,10 @@ _ecore_hash_rehash(Ecore_Hash *hash, Ecore_Hash_Node **old_table, int old_size)
for (i = 0; i < ecore_prime_table[old_size]; i++) {
/* Hash into a new list to avoid loops of rehashing the same
* nodes */
old = old_table[i];
old_table[i] = NULL;
/* Loop through re-adding each node to the hash table */
while ((old = old_table[i])) {
_ecore_hash_add_node(hash, old);
old_table[i] = old->next;
old->next = NULL;
_ecore_hash_add_node(hash, old);
}
}