aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/util/IdentityHashMap.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-01-16 20:56:38 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-01-16 20:56:38 +0000
commit510e2832560e4d2041507ed79d2dad6975632be8 (patch)
tree766575f2d5a98bcf017b4e07c1e34401251f15b6 /libjava/java/util/IdentityHashMap.java
parent3cd876794aa6872486bc6bffe72b5e5bd3743a86 (diff)
downloadgcc-510e2832560e4d2041507ed79d2dad6975632be8.zip
gcc-510e2832560e4d2041507ed79d2dad6975632be8.tar.gz
gcc-510e2832560e4d2041507ed79d2dad6975632be8.tar.bz2
IdentityHashMap.java (IdentityHashMap): Removed commented code.
* java/util/IdentityHashMap.java (IdentityHashMap): Removed commented code. (hash): Correctly compute initial value for `h'. From-SVN: r48925
Diffstat (limited to 'libjava/java/util/IdentityHashMap.java')
-rw-r--r--libjava/java/util/IdentityHashMap.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/libjava/java/util/IdentityHashMap.java b/libjava/java/util/IdentityHashMap.java
index d6a2f7c..9c57125 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;