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

◆ SortedSet() [4/5]

System.Collections.Generic.SortedSet< T >.SortedSet ( IEnumerable< T > collection,
IComparer< T >? comparer )
inline

Definition at line 763 of file SortedSet.cs.

764 : this(comparer)
765 {
766 if (collection == null)
767 {
768 throw new ArgumentNullException("collection");
769 }
771 {
772 if (sortedSet.Count > 0)
773 {
774 count = sortedSet.count;
776 }
777 return;
778 }
779 int length;
781 if (length <= 0)
782 {
783 return;
784 }
785 comparer = this.comparer;
786 Array.Sort(array, 0, length, comparer);
787 int num = 1;
788 for (int i = 1; i < length; i++)
789 {
790 if (comparer.Compare(array[i], array[i - 1]) != 0)
791 {
792 array[num++] = array[i];
793 }
794 }
795 length = num;
797 count = length;
798 }
static Node ConstructRootFromSortedArray(T[] arr, int startIndex, int endIndex, Node redNode)
bool HasEqualComparer(SortedSet< T > other)

References System.array, System.collection, System.Collections.Generic.IComparer< in T >.Compare(), System.Collections.Generic.SortedSet< T >.comparer, System.Collections.Generic.SortedSet< T >.ConstructRootFromSortedArray(), System.Collections.Generic.SortedSet< T >.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Collections.Generic.SortedSet< T >.HasEqualComparer(), System.length, System.Collections.Generic.SortedSet< T >.root, and System.Array.Sort().