IdentityHashMap.java (IdentityHashMap): Removed commented code.
authorTom Tromey <tromey@redhat.com>
Wed, 16 Jan 2002 20:56:38 +0000 (20:56 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 16 Jan 2002 20:56:38 +0000 (20:56 +0000)
* java/util/IdentityHashMap.java (IdentityHashMap): Removed
commented code.
(hash): Correctly compute initial value for `h'.

From-SVN: r48925

libjava/ChangeLog
libjava/java/util/IdentityHashMap.java

index ddb89b4ced8a5996afc2d19d6bdff7ed2b0b35ec..3d33f0a3b97f9425f3760450234bbc08cf796f3f 100644 (file)
@@ -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>
index d6a2f7c7c2d6ee159d8ab405b0e17356e8b96568..9c571251d40120d51c5475f6e28f9678b861d56b 100644 (file)
@@ -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;