Collections.java (sort): Copy from array in forwards order...
* java/util/Collections.java (sort): Copy from array in forwards order, rather than reverse order which may be much less efficient. From-SVN: r88146
This commit is contained in:
parent
87c476a22c
commit
a22478ced1
@ -1,3 +1,8 @@
|
||||
2004-09-26 Per Bothner <per@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-26 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* java/lang/System.java (properties): Make package private.
|
||||
|
@ -1713,11 +1713,11 @@ public class Collections
|
||||
{
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user