hashtable.c (ht_expand): Avoid calculating rehash for the common case that the first probe hits an empty...
* hashtable.c (ht_expand): Avoid calculating rehash for the common case that the first probe hits an empty hash table slot. From-SVN: r70706
This commit is contained in:
parent
a30f2d659c
commit
4ae2e3e922
@ -1,3 +1,8 @@
|
||||
2003-08-22 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* hashtable.c (ht_expand): Avoid calculating rehash for the common
|
||||
case that the first probe hits an empty hash table slot.
|
||||
|
||||
2003-08-22 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* config/ia64/hpux.h (SUPPORTS_INIT_PRIORITY): Define to 0.
|
||||
|
@ -184,19 +184,18 @@ ht_expand (hash_table *table)
|
||||
unsigned int index, hash, hash2;
|
||||
|
||||
hash = (*p)->hash_value;
|
||||
hash2 = ((hash * 17) & sizemask) | 1;
|
||||
index = hash & sizemask;
|
||||
|
||||
for (;;)
|
||||
if (nentries[index])
|
||||
{
|
||||
if (! nentries[index])
|
||||
hash2 = ((hash * 17) & sizemask) | 1;
|
||||
do
|
||||
{
|
||||
nentries[index] = *p;
|
||||
break;
|
||||
index = (index + hash2) & sizemask;
|
||||
}
|
||||
|
||||
index = (index + hash2) & sizemask;
|
||||
while (nentries[index]);
|
||||
}
|
||||
nentries[index] = *p;
|
||||
}
|
||||
while (++p < limit);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user