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

◆ HeapSort() [2/2]

static void System.Collections.Generic.ArraySortHelper< TKey, TValue >.HeapSort ( Span< TKey > keys,
Span< TValue > values,
IComparer< TKey > comparer )
inlinestaticprivate

Definition at line 379 of file ArraySortHelper.cs.

380 {
381 int length = keys.Length;
382 for (int num = length >> 1; num >= 1; num--)
383 {
385 }
386 for (int num2 = length; num2 > 1; num2--)
387 {
388 Swap(keys, values, 0, num2 - 1);
389 DownHeap(keys, values, 1, num2 - 1, comparer);
390 }
391 }
static void Swap(Span< T > a, int i, int j)
static void DownHeap(Span< T > keys, int i, int n, Comparison< T > comparer)

References System.comparer, System.Collections.Generic.ArraySortHelper< TKey, TValue >.DownHeap(), System.keys, System.length, System.Collections.Generic.ArraySortHelper< TKey, TValue >.Swap(), and System.values.