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

◆ IntersectWithEnumerable()

void System.Collections.Generic.HashSet< T >.IntersectWithEnumerable ( IEnumerable< T > other)
inlineprivate

Definition at line 1046 of file HashSet.cs.

1047 {
1048 int count = _count;
1049 int num = BitHelper.ToIntArrayLength(count);
1050 Span<int> span = stackalloc int[100];
1051 BitHelper bitHelper = ((num <= 100) ? new BitHelper(span.Slice(0, num), clear: true) : new BitHelper(new int[num], clear: false));
1052 foreach (T item in other)
1053 {
1054 int num2 = FindItemIndex(item);
1055 if (num2 >= 0)
1056 {
1057 bitHelper.MarkBit(num2);
1058 }
1059 }
1060 for (int i = 0; i < count; i++)
1061 {
1063 if (reference.Next >= -1 && !bitHelper.IsMarked(i))
1064 {
1065 Remove(reference.Value);
1066 }
1067 }
1068 }

References System.Collections.Generic.HashSet< T >._count, System.Collections.Generic.HashSet< T >._entries, System.count, System.Runtime.Serialization.Dictionary, System.Collections.Generic.HashSet< T >.FindItemIndex(), System.item, System.other, System.Collections.Generic.HashSet< T >.Remove(), and System.Collections.Generic.BitHelper.ToIntArrayLength().

Referenced by System.Collections.Generic.HashSet< T >.IntersectWith().