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

◆ CheckUniqueAndUnfoundElements()

ElementCount System.Collections.Generic.SortedSet< T >.CheckUniqueAndUnfoundElements ( IEnumerable< T > other,
bool returnIfUnfound )
inlineprivateinherited

Definition at line 1821 of file SortedSet.cs.

1822 {
1823 Unsafe.SkipInit(out ElementCount result);
1824 if (Count == 0)
1825 {
1826 int num = 0;
1827 using (IEnumerator<T> enumerator = other.GetEnumerator())
1828 {
1829 if (enumerator.MoveNext())
1830 {
1831 T current = enumerator.Current;
1832 num++;
1833 }
1834 }
1836 result.UnfoundCount = num;
1837 return result;
1838 }
1839 int n = Count;
1841 Span<int> span = stackalloc int[100];
1842 System.Collections.Generic.BitHelper bitHelper = ((num2 <= 100) ? new System.Collections.Generic.BitHelper(span.Slice(0, num2), clear: true) : new System.Collections.Generic.BitHelper(new int[num2], clear: false));
1843 int num3 = 0;
1844 int num4 = 0;
1845 foreach (T item in other)
1846 {
1847 int num5 = InternalIndexOf(item);
1848 if (num5 >= 0)
1849 {
1850 if (!bitHelper.IsMarked(num5))
1851 {
1852 bitHelper.MarkBit(num5);
1853 num4++;
1854 }
1855 }
1856 else
1857 {
1858 num3++;
1859 if (returnIfUnfound)
1860 {
1861 break;
1862 }
1863 }
1864 }
1867 return result;
1868 }
virtual int InternalIndexOf(T item)

References System.Collections.Generic.SortedSet< T >.Count, System.Runtime.Serialization.Dictionary, System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.Collections.Generic.SortedSet< T >.InternalIndexOf(), System.item, System.other, and System.Collections.Generic.BitHelper.ToIntArrayLength().

Referenced by System.Collections.Generic.SortedSet< T >.IsProperSubsetOf(), System.Collections.Generic.SortedSet< T >.IsProperSupersetOf(), System.Collections.Generic.SortedSet< T >.IsSubsetOf(), and System.Collections.Generic.SortedSet< T >.SetEquals().