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

◆ HeapSort() [1/2]

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

Definition at line 195 of file ArraySortHelper.cs.

196 {
197 int length = keys.Length;
198 for (int num = length >> 1; num >= 1; num--)
199 {
201 }
202 for (int num2 = length; num2 > 1; num2--)
203 {
204 Swap(keys, 0, num2 - 1);
205 DownHeap(keys, 1, num2 - 1, comparer);
206 }
207 }
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, and System.Collections.Generic.ArraySortHelper< TKey, TValue >.Swap().

Referenced by System.Collections.Generic.ArraySortHelper< TKey, TValue >.IntroSort(), and System.Collections.Generic.ArraySortHelper< TKey, TValue >.IntroSort().