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

◆ InsertionSort() [1/2]

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

Definition at line 229 of file ArraySortHelper.cs.

230 {
231 for (int i = 0; i < keys.Length - 1; i++)
232 {
233 T val = keys[i + 1];
234 int num = i;
235 while (num >= 0 && comparer(val, keys[num]) < 0)
236 {
237 keys[num + 1] = keys[num];
238 num--;
239 }
240 keys[num + 1] = val;
241 }
242 }

References System.comparer, and System.keys.

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