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

◆ SymmetricExceptWithEnumerable()

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

Definition at line 1081 of file HashSet.cs.

1082 {
1083 int count = _count;
1084 int num = BitHelper.ToIntArrayLength(count);
1085 Span<int> span = stackalloc int[50];
1086 BitHelper bitHelper = ((num <= 50) ? new BitHelper(span.Slice(0, num), clear: true) : new BitHelper(new int[num], clear: false));
1087 Span<int> span2 = stackalloc int[50];
1088 BitHelper bitHelper2 = ((num <= 50) ? new BitHelper(span2.Slice(0, num), clear: true) : new BitHelper(new int[num], clear: false));
1089 foreach (T item in other)
1090 {
1092 {
1093 bitHelper2.MarkBit(location);
1094 }
1095 else if (location < count && !bitHelper2.IsMarked(location))
1096 {
1097 bitHelper.MarkBit(location);
1098 }
1099 }
1100 for (int i = 0; i < count; i++)
1101 {
1102 if (bitHelper.IsMarked(i))
1103 {
1104 Remove(_entries[i].Value);
1105 }
1106 }
1107 }
bool AddIfNotPresent(T value, out int location)
Definition HashSet.cs:892

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

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