From b1210ca233ff36fd6281236f08e79ca9cddca2de Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 5 May 2004 08:28:13 +0000 Subject: [PATCH] Reported by f.haeglsperger@gmx.de [classpath patch #2485] 2004-05-05 Mark Wielaard Reported by f.haeglsperger@gmx.de [classpath patch #2485] * java/util/HashMap.java (rehash): Add entry at start of bucket. From-SVN: r81512 --- libjava/ChangeLog | 5 +++++ libjava/java/util/HashMap.java | 13 ++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 45febe3d836..cdb04d0535c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-05-05 Mark Wielaard + + Reported by f.haeglsperger@gmx.de [classpath patch #2485] + * java/util/HashMap.java (rehash): Add entry at start of bucket. + 2004-05-05 Tom Tromey * java/io/BufferedReader.java (skip): Removed unused diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java index dc1b112302c..fe4c8b06022 100644 --- a/libjava/java/util/HashMap.java +++ b/libjava/java/util/HashMap.java @@ -743,18 +743,9 @@ public class HashMap extends AbstractMap { int idx = hash(e.key); HashEntry dest = buckets[idx]; - - if (dest != null) - { - while (dest.next != null) - dest = dest.next; - dest.next = e; - } - else - buckets[idx] = e; - HashEntry next = e.next; - e.next = null; + e.next = buckets[idx]; + buckets[idx] = e; e = next; } } -- 2.30.2