Commit 510e2832 by Tom Tromey Committed by Tom Tromey

IdentityHashMap.java (IdentityHashMap): Removed commented code.

	* java/util/IdentityHashMap.java (IdentityHashMap): Removed
	commented code.
	(hash): Correctly compute initial value for `h'.

From-SVN: r48925
parent 3cd87679
2002-01-16 Tom Tromey <tromey@redhat.com> 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. * java/awt/Label.java: Merged with Classpath.
2002-01-15 Tom Tromey <tromey@redhat.com> 2002-01-15 Tom Tromey <tromey@redhat.com>
......
/* IdentityHashMap.java -- a class providing a hashtable data structure, /* IdentityHashMap.java -- a class providing a hashtable data structure,
mapping Object --> Object, which uses object identity for hashing. 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. This file is part of GNU Classpath.
...@@ -153,8 +153,6 @@ public class IdentityHashMap extends AbstractMap ...@@ -153,8 +153,6 @@ public class IdentityHashMap extends AbstractMap
max = 2; max = 2;
table = new Object[2 * max]; table = new Object[2 * max];
Arrays.fill(table, emptyslot); Arrays.fill(table, emptyslot);
// This is automatically set.
// size = 0;
threshold = max / 4 * 3; threshold = max / 4 * 3;
} }
...@@ -633,7 +631,7 @@ public class IdentityHashMap extends AbstractMap ...@@ -633,7 +631,7 @@ public class IdentityHashMap extends AbstractMap
// By requiring at least 2 key/value slots, and rehashing at 75% // By requiring at least 2 key/value slots, and rehashing at 75%
// capacity, we guarantee that there will always be either an emptyslot // capacity, we guarantee that there will always be either an emptyslot
// or a tombstone somewhere in the table. // 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 del = -1;
int save = h; int save = h;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment