This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: java.util.HashMap merged


Hi list,


I just merged the attached patch to merge java.util.HashMap with 
classpath again.


Michael


2004-05-05  Mark Wielaard  <mark@klomp.org>

	Reported by f.haeglsperger@gmx.de [classpath patch #2485]
	* java/util/HashMap.java (rehash): Add entry at start of bucket.

Index: java/util/HashMap.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/HashMap.java,v
retrieving revision 1.17
diff -u -r1.17 HashMap.java
--- java/util/HashMap.java	23 Apr 2004 06:36:04 -0000	1.17
+++ java/util/HashMap.java	5 May 2004 08:27:48 -0000
@@ -743,18 +743,9 @@
           {
             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;
           }
       }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]