7 instantiations of SegmentedHashSet
Microsoft.CodeAnalysis.Workspaces (7)
ImmutableSegmentedHashSet`1.cs (3)
16public static readonly ImmutableSegmentedHashSet<T> Empty = new(new SegmentedHashSet<T>()); 61var set = new SegmentedHashSet<T>(self.KeyComparer) { value }; 263return new ImmutableSegmentedHashSet<T>(new SegmentedHashSet<T>(self._set, equalityComparer));
ImmutableSegmentedHashSet`1+Builder.cs (3)
47_mutableSet = new SegmentedHashSet<T>(ReadOnlySet, value ?? EqualityComparer<T>.Default); 67_mutableSet = new SegmentedHashSet<T>(originalSet._set, originalSet.KeyComparer); 89_mutableSet = new SegmentedHashSet<T>(KeyComparer);
Shared\Utilities\AsyncBatchingWorkQueue`2.cs (1)
114_uniqueItems = new SegmentedHashSet<TItem>(equalityComparer);
74 references to SegmentedHashSet
Microsoft.CodeAnalysis.Workspaces (74)
ImmutableSegmentedHashSet`1.cs (3)
18private readonly SegmentedHashSet<T> _set; 20private ImmutableSegmentedHashSet(SegmentedHashSet<T> set) 61var set = new SegmentedHashSet<T>(self.KeyComparer) { value };
ImmutableSegmentedHashSet`1+Builder.cs (5)
26private SegmentedHashSet<T>? _mutableSet; 55private SegmentedHashSet<T> ReadOnlySet => _mutableSet ?? _set._set; 59private SegmentedHashSet<T> GetOrCreateMutableSet() 142SegmentedHashSet<T>? mutableSet = null; 238SegmentedHashSet<T>? mutableSet = null;
ImmutableSegmentedHashSet`1+Enumerator.cs (3)
16private readonly SegmentedHashSet<T> _set; 17private SegmentedHashSet<T>.Enumerator _enumerator; 19internal Enumerator(SegmentedHashSet<T> set)
ImmutableSegmentedHashSet`1+PrivateInterlocked.cs (3)
19var set = Volatile.Read(ref Unsafe.AsRef(in location._set)); 28var set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set); 37var set = Interlocked.CompareExchange(ref Unsafe.AsRef(in location._set), value._set, comparand._set);
SegmentedHashSet`1.cs (54)
95if (collection is SegmentedHashSet<T> otherAsHashSet && EqualityComparersAreEqual(this, otherAsHashSet)) 135private void ConstructFrom(SegmentedHashSet<T> source) 181/// <summary>Removes all elements from the <see cref="SegmentedHashSet{T}"/> object.</summary> 198/// <summary>Determines whether the <see cref="SegmentedHashSet{T}"/> contains the specified element.</summary> 199/// <param name="item">The element to locate in the <see cref="SegmentedHashSet{T}"/> object.</param> 200/// <returns>true if the <see cref="SegmentedHashSet{T}"/> object contains the specified element; otherwise, false.</returns> 376/// <summary>Adds the specified element to the <see cref="SegmentedHashSet{T}"/>.</summary> 378/// <returns>true if the element is added to the <see cref="SegmentedHashSet{T}"/> object; false if the element is already present.</returns> 407/// <summary>Modifies the current <see cref="SegmentedHashSet{T}"/> object to contain all elements that are present in itself, the specified collection, or both.</summary> 408/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 422/// <summary>Modifies the current <see cref="SegmentedHashSet{T}"/> object to contain only elements that are present in that object and in the specified collection.</summary> 423/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 449if (other is SegmentedHashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 459/// <summary>Removes all elements in the specified collection from the current <see cref="SegmentedHashSet{T}"/> object.</summary> 460/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 488/// <summary>Modifies the current <see cref="SegmentedHashSet{T}"/> object to contain only elements that are present either in that object or in the specified collection, but not both.</summary> 489/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 516if (other is SegmentedHashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 526/// <summary>Determines whether a <see cref="SegmentedHashSet{T}"/> object is a subset of the specified collection.</summary> 527/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 528/// <returns>true if the <see cref="SegmentedHashSet{T}"/> object is a subset of <paramref name="other"/>; otherwise, false.</returns> 545if (other is SegmentedHashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 562/// <summary>Determines whether a <see cref="SegmentedHashSet{T}"/> object is a proper subset of the specified collection.</summary> 563/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 564/// <returns>true if the <see cref="SegmentedHashSet{T}"/> object is a proper subset of <paramref name="other"/>; otherwise, false.</returns> 593if (other is SegmentedHashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 610/// <summary>Determines whether a <see cref="SegmentedHashSet{T}"/> object is a proper superset of the specified collection.</summary> 611/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 612/// <returns>true if the <see cref="SegmentedHashSet{T}"/> object is a superset of <paramref name="other"/>; otherwise, false.</returns> 636if (other is SegmentedHashSet<T> otherAsSet && 647/// <summary>Determines whether a <see cref="SegmentedHashSet{T}"/> object is a proper superset of the specified collection.</summary> 648/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 649/// <returns>true if the <see cref="SegmentedHashSet{T}"/> object is a proper superset of <paramref name="other"/>; otherwise, false.</returns> 673if (other is SegmentedHashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 690/// <summary>Determines whether the current <see cref="SegmentedHashSet{T}"/> object and a specified collection share common elements.</summary> 691/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 692/// <returns>true if the <see cref="SegmentedHashSet{T}"/> object and <paramref name="other"/> share at least one common element; otherwise, false.</returns> 722/// <summary>Determines whether a <see cref="SegmentedHashSet{T}"/> object and the specified collection contain the same elements.</summary> 723/// <param name="other">The collection to compare to the current <see cref="SegmentedHashSet{T}"/> object.</param> 724/// <returns>true if the <see cref="SegmentedHashSet{T}"/> object is equal to <paramref name="other"/>; otherwise, false.</returns> 739if (other is SegmentedHashSet<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet)) 769/// <summary>Copies the elements of a <see cref="SegmentedHashSet{T}"/> object to an array, starting at the specified array index.</summary> 813/// <summary>Removes all elements that match the conditions defined by the specified predicate from a <see cref="SegmentedHashSet{T}"/> collection.</summary> 907/// Sets the capacity of a <see cref="SegmentedHashSet{T}"/> object to the actual number of elements it contains, 949/// <summary>Returns an <see cref="IEqualityComparer"/> object that can be used for equality testing of a <see cref="SegmentedHashSet{T}"/> object.</summary> 950public static IEqualityComparer<SegmentedHashSet<T>> CreateSetComparer() => new SegmentedHashSetEqualityComparer<T>(); 974/// <returns>true if the element is added to the <see cref="SegmentedHashSet{T}"/> object; false if the element is already present.</returns> 1128internal bool IsSubsetOfHashSetWithSameComparer(SegmentedHashSet<T> other) 1145private void IntersectWithHashSetWithSameComparer(SegmentedHashSet<T> other) 1212private void SymmetricExceptWithUniqueHashSet(SegmentedHashSet<T> other) 1370internal static bool EqualityComparersAreEqual(SegmentedHashSet<T> set1, SegmentedHashSet<T> set2) => set1.Comparer.Equals(set2.Comparer); 1388private readonly SegmentedHashSet<T> _hashSet; 1393internal Enumerator(SegmentedHashSet<T> hashSet)
SegmentedHashSetEqualityComparer`1.cs (5)
16internal sealed class SegmentedHashSetEqualityComparer<T> : IEqualityComparer<SegmentedHashSet<T>?> 18public bool Equals(SegmentedHashSet<T>? x, SegmentedHashSet<T>? y) 36if (SegmentedHashSet<T>.EqualityComparersAreEqual(x, y)) 64public int GetHashCode(SegmentedHashSet<T>? obj)
Shared\Utilities\AsyncBatchingWorkQueue`2.cs (1)
84private readonly SegmentedHashSet<TItem> _uniqueItems;