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

◆ Capacity

Definition at line 79 of file ReadOnlyCollectionBuilder.cs.

80 {
81 get
82 {
83 return _items.Length;
84 }
85 set
86 {
87 if (value < _size)
88 {
89 throw new ArgumentOutOfRangeException("value");
90 }
91 if (value == _items.Length)
92 {
93 return;
94 }
95 if (value > 0)
96 {
97 T[] array = new T[value];
98 if (_size > 0)
99 {
100 Array.Copy(_items, array, _size);
101 }
102 _items = array;
103 }
104 else
105 {
106 _items = Array.Empty<T>();
107 }
108 }
109 }

Referenced by System.Runtime.CompilerServices.ReadOnlyCollectionBuilder< T >.EnsureCapacity().