projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
067a870
)
updates
silc.server.0.7.9
author
Pekka Riikonen
<priikone@silcnet.org>
Fri, 1 Feb 2002 08:07:42 +0000
(08:07 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Fri, 1 Feb 2002 08:07:42 +0000
(08:07 +0000)
lib/silcutil/silchashtable.c
patch
|
blob
|
history
diff --git
a/lib/silcutil/silchashtable.c
b/lib/silcutil/silchashtable.c
index 31f333082cfbf0a4a109216a3fafc8c18fa90eac..ca91ca1b66e05e4035d5a58b95cd4b759a39d759 100644
(file)
--- a/
lib/silcutil/silchashtable.c
+++ b/
lib/silcutil/silchashtable.c
@@
-215,10
+215,14
@@
silc_hash_table_find_internal_all(SilcHashTable ht, void *key,
void *foreach_user_context)
{
SilcHashTableEntry *entry;
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));
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 = &ht->table[i];
if (compare) {
while (*entry) {
@@
-233,6
+237,8
@@
silc_hash_table_find_internal_all(SilcHashTable ht, void *key,
entry = &(*entry)->next;
}
}
entry = &(*entry)->next;
}
}
+
+ ht->auto_rehash = auto_rehash;
}
/* Internal routine to add new key to the hash table */
}
/* Internal routine to add new key to the hash table */
@@
-712,10
+718,13
@@
void silc_hash_table_foreach(SilcHashTable ht, SilcHashForeach foreach,
{
SilcHashTableEntry e, tmp;
int i;
{
SilcHashTableEntry e, tmp;
int i;
+ bool auto_rehash;
if (!foreach)
return;
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) {
for (i = 0; i < primesize[ht->table_size]; i++) {
e = ht->table[i];
while (e) {
@@
-725,6
+734,7
@@
void silc_hash_table_foreach(SilcHashTable ht, SilcHashForeach foreach,
e = tmp;
}
}
e = tmp;
}
}
+ ht->auto_rehash = auto_rehash;
}
/* Rehashs the hash table. The size of the new hash table is provided
}
/* Rehashs the hash table. The size of the new hash table is provided