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

◆ AddOrInsert()

static T[] System.Runtime.CompilerServices.RuleCache< T >.AddOrInsert ( T[] rules,
T item )
inlinestaticprivate

Definition at line 61 of file RuleCache.cs.

62 {
63 if (rules.Length < 64)
64 {
65 return rules.AddLast(item);
66 }
67 int num = rules.Length + 1;
68 T[] array;
69 if (num > 128)
70 {
71 num = 128;
72 array = rules;
73 }
74 else
75 {
76 array = new T[num];
77 Array.Copy(rules, array, 64);
78 }
79 array[64] = item;
80 Array.Copy(rules, 64, array, 65, num - 64 - 1);
81 return array;
82 }

References System.array, System.Array.Copy(), and System.item.

Referenced by System.Runtime.CompilerServices.RuleCache< T >.AddRule().