Make LINQ sort work with Full AOT.
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 8 Nov 2012 22:32:09 +0000 (17:32 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 9 Nov 2012 18:09:14 +0000 (13:09 -0500)
mcs/class/System.Core/System.Linq/QuickSort.cs

index 553b94b452c745ebfd1a84c3889b070412a38333..729c080c639447ba50ff0a17a0f97152907dcda0 100644 (file)
@@ -65,7 +65,7 @@ namespace System.Linq {
 
                        // Then sorts the elements according to the collected
                        // key values and the selected ordering
-                       Array.Sort<int, TElement> (indexes, elements, context);
+                       Array.Sort<int> (indexes, context);
                }
 
                public static IEnumerable<TElement> Sort (IEnumerable<TElement> source, SortContext<TElement> context)
@@ -75,7 +75,7 @@ namespace System.Linq {
                        sorter.PerformSort ();
 
                        for (int i = 0; i < sorter.elements.Length; i++)
-                               yield return sorter.elements [i];
+                               yield return sorter.elements [sorter.indexes [i]];
                }
        }
 }