diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-16 20:56:38 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-16 20:56:38 +0000 |
commit | f9d94b8d6d4ea29d68ca81cb6ec87de06fc29eb2 (patch) | |
tree | 766575f2d5a98bcf017b4e07c1e34401251f15b6 /libjava | |
parent | 7fac8b66f9661e7d1cd3340e587aa523d75e0abf (diff) | |
download | ppe42-gcc-f9d94b8d6d4ea29d68ca81cb6ec87de06fc29eb2.tar.gz ppe42-gcc-f9d94b8d6d4ea29d68ca81cb6ec87de06fc29eb2.zip |
* java/util/IdentityHashMap.java (IdentityHashMap): Removed
commented code.
(hash): Correctly compute initial value for `h'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/java/util/IdentityHashMap.java | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index ddb89b4ced8..3d33f0a3b97 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,9 @@ 2002-01-16 Tom Tromey <tromey@redhat.com> + * java/util/IdentityHashMap.java (IdentityHashMap): Removed + commented code. + (hash): Correctly compute initial value for `h'. + * java/awt/Label.java: Merged with Classpath. 2002-01-15 Tom Tromey <tromey@redhat.com> diff --git a/libjava/java/util/IdentityHashMap.java b/libjava/java/util/IdentityHashMap.java index d6a2f7c7c2d..9c571251d40 100644 --- a/libjava/java/util/IdentityHashMap.java +++ b/libjava/java/util/IdentityHashMap.java @@ -1,6 +1,6 @@ /* IdentityHashMap.java -- a class providing a hashtable data structure, mapping Object --> Object, which uses object identity for hashing. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -153,8 +153,6 @@ public class IdentityHashMap extends AbstractMap max = 2; table = new Object[2 * max]; Arrays.fill(table, emptyslot); - // This is automatically set. - // size = 0; threshold = max / 4 * 3; } @@ -633,7 +631,7 @@ public class IdentityHashMap extends AbstractMap // By requiring at least 2 key/value slots, and rehashing at 75% // capacity, we guarantee that there will always be either an emptyslot // or a tombstone somewhere in the table. - int h = 2 * Math.abs(System.identityHashCode(key) % table.length); + int h = 2 * Math.abs(System.identityHashCode(key) % (table.length / 2)); int del = -1; int save = h; |