void *foreach_user_context)
{
SilcHashTableEntry *entry;
+ bool auto_rehash;
uint32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
SILC_HT_DEBUG(("index %d key %p", i, key));
+ auto_rehash = ht->auto_rehash;
+ ht->auto_rehash = FALSE;
+
entry = &ht->table[i];
if (compare) {
while (*entry) {
entry = &(*entry)->next;
}
}
+
+ ht->auto_rehash = auto_rehash;
}
/* Internal routine to add new key to the hash table */
{
SilcHashTableEntry e, tmp;
int i;
+ bool auto_rehash;
if (!foreach)
return;
+ auto_rehash = ht->auto_rehash;
+ ht->auto_rehash = FALSE;
for (i = 0; i < primesize[ht->table_size]; i++) {
e = ht->table[i];
while (e) {
e = tmp;
}
}
+ ht->auto_rehash = auto_rehash;
}
/* Rehashs the hash table. The size of the new hash table is provided