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

◆ Capacity

virtual int System.Collections.ArrayList.Capacity
getset

Definition at line 2193 of file ArrayList.cs.

2194 {
2195 get
2196 {
2197 return _items.Length;
2198 }
2199 set
2200 {
2201 if (value < _size)
2202 {
2203 throw new ArgumentOutOfRangeException("value", SR.ArgumentOutOfRange_SmallCapacity);
2204 }
2205 if (value == _items.Length)
2206 {
2207 return;
2208 }
2209 if (value > 0)
2210 {
2211 object[] array = new object[value];
2212 if (_size > 0)
2213 {
2214 Array.Copy(_items, array, _size);
2215 }
2216 _items = array;
2217 }
2218 else
2219 {
2220 _items = new object[4];
2221 }
2222 }
2223 }

Referenced by System.Data.DataColumnCollection.EnsureAdditionalCapacity(), System.Collections.ArrayList.EnsureCapacity(), and System.Collections.ArrayList.TrimToSize().