summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2003-03-12 17:28:10 +0000
committerDJ Delorie <dj@delorie.com>2003-03-12 17:28:10 +0000
commit2d5c66d21e9bec2b5aa610a02eedab60fb5f0aa7 (patch)
treea0aa4c159884d7d474d18edb4e5c4d7d92d31d0a
parent902028261479e29e316d1b0578648188364e5899 (diff)
downloadgdb-2d5c66d21e9bec2b5aa610a02eedab60fb5f0aa7.tar.gz
merge from gcc
-rw-r--r--libiberty/ChangeLog8
-rw-r--r--libiberty/hashtab.c4
2 files changed, 10 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 99ac6ec2903..a45e537f4e2 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,5 +1,13 @@
2003-12-03 Jan Hubicka <jh@suse.cz>
+ * hashtab.c (htab_expand): Fix warning.
+
+ * hashtab.c (htab_expand): Compute the size of hashtable based
+ on the number of elements actually used.
+ (htab_traverse): Call htab_expand when table is too empty.
+
+2003-12-03 Jan Hubicka <jh@suse.cz>
+
* hashtab.c (htab_expand): Compute the size of hashtable based
on the number of elements actually used.
(htab_traverse): Call htab_expand when table is too empty.
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index a0cb5a75820..ebaa43b2c50 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -376,8 +376,8 @@ htab_expand (htab)
/* Resize only when table after removal of unused elements is either
too full or too empty. */
if ((htab->n_elements - htab->n_deleted) * 2 > htab->size
- || (htab->n_elements - htab->n_deleted) * 8 < htab->size
- && htab->size > 32)
+ || ((htab->n_elements - htab->n_deleted) * 8 < htab->size
+ && htab->size > 32))
nsize = higher_prime_number ((htab->n_elements - htab->n_deleted) * 2);
else
nsize = htab->size;