[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: sorting of Collections

Kaffe CVS cvs-commits at kaffe.org
Tue Sep 28 22:12:05 PDT 2004


PatchSet 5233 
Date: 2004/09/29 05:08:19
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: sorting of Collections


2004-09-28  Dalibor Topic  <robilad at kaffe.org>

* libraries/javalib/java/util/Collections.java:
Resynced with GNU Classpath.

2004-09-27  Per Bothner  <per at bothner.com>

* java/util/Collections.java (sort):  Copy from array in forwards
order, rather than reverse order which may be much less
efficient.

Members: 
	ChangeLog:1.2787->1.2788 
	libraries/javalib/java/util/Collections.java:1.14->1.15 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2787 kaffe/ChangeLog:1.2788
--- kaffe/ChangeLog:1.2787	Wed Sep 29 04:49:19 2004
+++ kaffe/ChangeLog	Wed Sep 29 05:08:19 2004
@@ -5,6 +5,17 @@
 
 2004-09-28  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/util/Collections.java:
+	Resynced with GNU Classpath.
+	
+	2004-09-27  Per Bothner  <per at bothner.com>
+
+	* java/util/Collections.java (sort):  Copy from array in forwards
+	order, rather than reverse order which may be much less
+	efficient.
+
+2004-09-28  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/util/Calendar.java:
 	Resynced with GNU Classpath.
 	
Index: kaffe/libraries/javalib/java/util/Collections.java
diff -u kaffe/libraries/javalib/java/util/Collections.java:1.14 kaffe/libraries/javalib/java/util/Collections.java:1.15
--- kaffe/libraries/javalib/java/util/Collections.java:1.14	Sun Sep 26 16:27:34 2004
+++ kaffe/libraries/javalib/java/util/Collections.java	Wed Sep 29 05:08:21 2004
@@ -1713,11 +1713,11 @@
   {
     Object[] a = l.toArray();
     Arrays.sort(a, c);
-    ListIterator i = l.listIterator(a.length);
-    for (int pos = a.length; --pos >= 0; )
+    ListIterator i = l.listIterator();
+    for (int pos = 0, alen = a.length;  pos < alen;  pos++)
       {
-	i.previous();
-	i.set(a[pos]);
+        i.next();
+        i.set(a[pos]);
       }
   }
 




More information about the kaffe mailing list