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

◆ InsertionSort()

void System.Array.SorterObjectArray.InsertionSort ( int lo,
int hi )
inlineprivate

Definition at line 201 of file Array.cs.

202 {
203 for (int i = lo; i < hi; i++)
204 {
205 int num = i;
206 object obj = keys[i + 1];
207 object[] array = items;
208 object obj2 = ((array != null) ? array[i + 1] : null);
209 while (num >= lo && comparer.Compare(obj, keys[num]) < 0)
210 {
211 keys[num + 1] = keys[num];
212 if (items != null)
213 {
214 items[num + 1] = items[num];
215 }
216 num--;
217 }
218 keys[num + 1] = obj;
219 if (items != null)
220 {
221 items[num + 1] = obj2;
222 }
223 }
224 }
readonly object[] items
Definition Array.cs:26
readonly object[] keys
Definition Array.cs:24
readonly IComparer comparer
Definition Array.cs:28

References System.array, System.Collections.Generic.IComparer< in T >.Compare(), System.Array.SorterObjectArray.comparer, System.Array.SorterObjectArray.items, System.Array.SorterObjectArray.keys, and System.obj.

Referenced by System.Array.SorterObjectArray.IntroSort().