diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-17 09:15:51 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-12-17 09:15:51 +0000 |
commit | dbf5e16009d3ebcc6cccf20ab023d041f1cd9dd6 (patch) | |
tree | 6f1bdcd4144f68f8a537512910f98f6c7141a4bb /libjava | |
parent | 80fb1f79b8c36dde3f8f4e97d0664145058636c1 (diff) | |
download | gcc-dbf5e16009d3ebcc6cccf20ab023d041f1cd9dd6.tar.gz |
2000-12-17 Jeff Sturm <jeff.sturm@commerceone.com>
* java/util/Hashtable.java (put): Remove `last' variable.
Link new entry to head of list.
* java/util/HashMap.java (put): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/java/util/HashMap.java | 16 | ||||
-rw-r--r-- | libjava/java/util/Hashtable.java | 20 |
3 files changed, 20 insertions, 22 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index cd641e301a6..7d601646d35 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2000-12-17 Jeff Sturm <jeff.sturm@commerceone.com> + + * java/util/Hashtable.java (put): Remove `last' variable. + Link new entry to head of list. + * java/util/HashMap.java (put): Ditto. + 2000-12-15 Tom Tromey <tromey@redhat.com> * java/util/ResourceBundle.java (trySomeGetBundle): Pass class diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java index 6e5c4345564..9acbadb6da9 100644 --- a/libjava/java/util/HashMap.java +++ b/libjava/java/util/HashMap.java @@ -60,8 +60,8 @@ import java.io.ObjectOutputStream; * @author Jon Zeppieri * @author Jochen Hoenicke * @author Bryce McKinlay - * @version $Revision: 1.8 $ - * @modified $Id: HashMap.java,v 1.8 2000/10/26 10:19:00 bryce Exp $ + * @version $Revision: 1.2 $ + * @modified $Id: HashMap.java,v 1.2 2000/12/11 03:47:47 bryce Exp $ */ public class HashMap extends AbstractMap implements Map, Cloneable, Serializable @@ -297,7 +297,6 @@ public class HashMap extends AbstractMap modCount++; int idx = hash(key); Entry e = buckets[idx]; - Entry last = e; // Final entry in bucket's linked list, if any. while (e != null) { @@ -309,7 +308,6 @@ public class HashMap extends AbstractMap } else { - last = e; e = e.next; } } @@ -324,10 +322,8 @@ public class HashMap extends AbstractMap e = new Entry(key, value); - if (last != null) - last.next = e; - else - buckets[idx] = e; + e.next = buckets[idx]; + buckets[idx] = e; return null; } @@ -664,8 +660,8 @@ public class HashMap extends AbstractMap * as per the Javasoft spec. * * @author Jon Zeppieri - * @version $Revision: 1.8 $ - * @modified $Id: HashMap.java,v 1.8 2000/10/26 10:19:00 bryce Exp $ + * @version $Revision: 1.2 $ + * @modified $Id: HashMap.java,v 1.2 2000/12/11 03:47:47 bryce Exp $ */ class HashIterator implements Iterator { diff --git a/libjava/java/util/Hashtable.java b/libjava/java/util/Hashtable.java index 3a263b7a94a..c30c9adf991 100644 --- a/libjava/java/util/Hashtable.java +++ b/libjava/java/util/Hashtable.java @@ -64,8 +64,8 @@ import java.io.ObjectOutputStream; * @author Jon Zeppieri * @author Warren Levy * @author Bryce McKinlay - * @version $Revision: 1.7 $ - * @modified $Id: Hashtable.java,v 1.7 2000/12/11 03:47:47 bryce Exp $ + * @version $Revision: 1.8 $ + * @modified $Id: Hashtable.java,v 1.8 2000/12/11 04:54:55 bryce Exp $ */ public class Hashtable extends Dictionary implements Map, Cloneable, Serializable @@ -295,7 +295,6 @@ public class Hashtable extends Dictionary modCount++; int idx = hash(key); HashMap.Entry e = buckets[idx]; - HashMap.Entry last = e; // Final entry in bucket's linked list, if any. // Hashtable does not accept null values. This method doesn't dereference // `value' anywhere, so check for it explicitly. @@ -312,7 +311,6 @@ public class Hashtable extends Dictionary } else { - last = e; e = e.next; } } @@ -327,10 +325,8 @@ public class Hashtable extends Dictionary e = new Entry(key, value); - if (last != null) - last.next = e; - else - buckets[idx] = e; + e.next = buckets[idx]; + buckets[idx] = e; return null; } @@ -724,8 +720,8 @@ public class Hashtable extends Dictionary * as per the Javasoft spec. * * @author Jon Zeppieri - * @version $Revision: 1.7 $ - * @modified $Id: Hashtable.java,v 1.7 2000/12/11 03:47:47 bryce Exp $ + * @version $Revision: 1.8 $ + * @modified $Id: Hashtable.java,v 1.8 2000/12/11 04:54:55 bryce Exp $ */ class HashIterator implements Iterator { @@ -829,8 +825,8 @@ public class Hashtable extends Dictionary * hashtable during enumeration causes indeterminate results. Don't do it! * * @author Jon Zeppieri - * @version $Revision: 1.7 $ - * @modified $Id: Hashtable.java,v 1.7 2000/12/11 03:47:47 bryce Exp $ */ + * @version $Revision: 1.8 $ + * @modified $Id: Hashtable.java,v 1.8 2000/12/11 04:54:55 bryce Exp $ */ class Enumerator implements Enumeration { static final int KEYS = 0; |