summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-28 14:31:22 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-28 14:31:22 +0000
commita2106b77aba1d8f9fc4251ff5c50d2f8102830b6 (patch)
tree5e92a057d6e4b4ef2e07748c2c3c2a8276f1f158 /libjava
parent1e639cb03bf317a5430c677006ab73a60eaf4d27 (diff)
downloadgcc-a2106b77aba1d8f9fc4251ff5c50d2f8102830b6.tar.gz
2005-06-28 Robin Green <greenrd@greenrd.org>
PR java/22189 * gnu/gcj/runtime/PersistentByteMap.java (init): Fix rounding error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101382 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/gnu/gcj/runtime/PersistentByteMap.java6
2 files changed, 9 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 0a400b1f374..2705cee3344 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2005-06-28 Robin Green <greenrd@greenrd.org>
+
+ PR java/22189
+ * gnu/gcj/runtime/PersistentByteMap.java (init): Fix rounding
+ error.
+
2005-06-27 Tom Tromey <tromey@redhat.com>
PR java/21540, PR java/13788:
diff --git a/libjava/gnu/gcj/runtime/PersistentByteMap.java b/libjava/gnu/gcj/runtime/PersistentByteMap.java
index a2b91da84fa..fec30806f81 100644
--- a/libjava/gnu/gcj/runtime/PersistentByteMap.java
+++ b/libjava/gnu/gcj/runtime/PersistentByteMap.java
@@ -175,10 +175,10 @@ public class PersistentByteMap
// We're going to make that size prime. This isn't
// strictly necessary but it can't hurt.
//
- // We expand the size by 3/2 because the hash table is
- // intolerably slow when more than 2/3 full.
+ // We expand the size by 3/2 and round the result because the
+ // hash table is intolerably slow when more than 2/3 full.
- BigInteger size = new BigInteger(Integer.toString(capacity * 3/2));
+ BigInteger size = new BigInteger(Integer.toString(((capacity*3)+1)/2));
BigInteger two = BigInteger.ONE.add(BigInteger.ONE);
if (size.getLowestSetBit() != 0) // A hard way to say isEven()