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

◆ Capacity

virtual int System.Collections.SortedList.Capacity
getset

Definition at line 572 of file SortedList.cs.

573 {
574 get
575 {
576 return keys.Length;
577 }
578 set
579 {
580 if (value < Count)
581 {
582 throw new ArgumentOutOfRangeException("value", System.SR.ArgumentOutOfRange_SmallCapacity);
583 }
584 if (value == keys.Length)
585 {
586 return;
587 }
588 if (value > 0)
589 {
590 object[] destinationArray = new object[value];
591 object[] destinationArray2 = new object[value];
592 if (_size > 0)
593 {
595 Array.Copy(values, destinationArray2, _size);
596 }
598 values = destinationArray2;
599 }
600 else
601 {
602 keys = Array.Empty<object>();
603 values = Array.Empty<object>();
604 }
605 }
606 }
static string ArgumentOutOfRange_SmallCapacity
Definition SR.cs:34
Definition SR.cs:7

Referenced by System.Collections.SortedList.SortedList(), System.Collections.SortedList.EnsureCapacity(), and System.Collections.SortedList.TrimToSize().