Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OrderBy< T >()

static IEnumerable< T > System.Reflection.Internal.EnumerableExtensions.OrderBy< T > ( this List< T > source,
Comparison< T > comparison )
inlinestatic

Definition at line 35 of file EnumerableExtensions.cs.

36 {
39 int[] array = new int[source2.Count];
40 for (int i = 0; i < array.Length; i++)
41 {
42 array[i] = i;
43 }
44 Array.Sort(array, delegate(int left, int right)
45 {
46 if (left == right)
47 {
48 return 0;
49 }
50 int num = comparison2(source2[left], source2[right]);
51 return (num == 0) ? (left - right) : num;
52 });
53 int[] array2 = array;
54 foreach (int index in array2)
55 {
56 yield return source2[index];
57 }
58 }

References System.array, System.comparison, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.index, System.Array.Sort(), and System.source.