8 instantiations of SegmentedHashSet
Microsoft.CodeAnalysis.Threading.Package (8)
AsyncBatchingWorkQueue`2.cs (1)
119
_uniqueItems = new
SegmentedHashSet
<TItem>(equalityComparer);
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (3)
69
public static readonly ImmutableSegmentedHashSet<T> Empty = new(new
SegmentedHashSet
<T>());
114
var set = new
SegmentedHashSet
<T>(self.KeyComparer) { value };
313
return new ImmutableSegmentedHashSet<T>(new
SegmentedHashSet
<T>(self._set, equalityComparer));
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (3)
50
_mutableSet = new
SegmentedHashSet
<T>(ReadOnlySet, value ?? EqualityComparer<T>.Default);
70
_mutableSet = new
SegmentedHashSet
<T>(originalSet._set, originalSet.KeyComparer);
92
_mutableSet = new
SegmentedHashSet
<T>(KeyComparer);
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (1)
376
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedHashSet
<T>()))!;
84 references to SegmentedHashSet
Microsoft.CodeAnalysis.Threading.Package (84)
AsyncBatchingWorkQueue`2.cs (1)
87
private readonly
SegmentedHashSet
<TItem> _uniqueItems;
src\Dependencies\Collections\Internal\SegmentedHashSetEqualityComparer`1.cs (5)
19
internal sealed class SegmentedHashSetEqualityComparer<T> : IEqualityComparer<
SegmentedHashSet
<T>?>
21
public bool Equals(
SegmentedHashSet
<T>? x,
SegmentedHashSet
<T>? y)
39
if (
SegmentedHashSet
<T>.EqualityComparersAreEqual(x, y))
67
public int GetHashCode(
SegmentedHashSet
<T>? obj)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (3)
71
private readonly
SegmentedHashSet
<T> _set;
73
private ImmutableSegmentedHashSet(
SegmentedHashSet
<T> set)
114
var
set = new SegmentedHashSet<T>(self.KeyComparer) { value };
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+Enumerator.cs (3)
18
private readonly
SegmentedHashSet
<T> _set;
19
private
SegmentedHashSet
<T>.Enumerator _enumerator;
21
internal Enumerator(
SegmentedHashSet
<T> set)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (6)
22
var
set = Volatile.Read(ref Unsafe.AsRef(in location._set));
31
var
set = Interlocked.Exchange(ref Unsafe.AsRef(in location._set), value._set);
40
var
set = Interlocked.CompareExchange(ref Unsafe.AsRef(in location._set), value._set, comparand._set);
47
/// <inheritdoc cref="SegmentedCollectionsMarshal.AsImmutableSegmentedHashSet{T}(
SegmentedHashSet
{T}?)"/>
48
internal static ImmutableSegmentedHashSet<T> AsImmutableSegmentedHashSet(
SegmentedHashSet
<T>? set)
52
internal static
SegmentedHashSet
<T>? AsSegmentedHashSet(ImmutableSegmentedHashSet<T> set)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (5)
29
private
SegmentedHashSet
<T>? _mutableSet;
58
internal readonly
SegmentedHashSet
<T> ReadOnlySet => _mutableSet ?? _set._set;
62
private
SegmentedHashSet
<T> GetOrCreateMutableSet()
149
SegmentedHashSet
<T>? mutableSet = null;
245
SegmentedHashSet
<T>? mutableSet = null;
src\Dependencies\Collections\Segmented\SegmentedCollectionsMarshal.cs (7)
140
/// Gets an <see cref="ImmutableSegmentedHashSet{T}"/> value wrapping the input <see cref="
SegmentedHashSet
{T}"/>.
158
public static ImmutableSegmentedHashSet<T> AsImmutableSegmentedHashSet<T>(
SegmentedHashSet
<T>? set)
162
/// Gets the underlying <see cref="
SegmentedHashSet
{T}"/> for an input <see cref="ImmutableSegmentedHashSet{T}"/> value.
165
/// <param name="set">The input <see cref="ImmutableSegmentedHashSet{T}"/> value to get the underlying <see cref="
SegmentedHashSet
{T}"/> from.</param>
166
/// <returns>The underlying <see cref="
SegmentedHashSet
{T}"/> for <paramref name="set"/>, if present; otherwise, <see langword="null"/>.</returns>
175
/// property is <see langword="true"/>), the resulting <see cref="
SegmentedHashSet
{T}"/> will be <see langword="null"/>.
178
public static
SegmentedHashSet
<T>? AsSegmentedHashSet<T>(ImmutableSegmentedHashSet<T> set)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (54)
112
if (collection is
SegmentedHashSet
<T> otherAsHashSet && EqualityComparersAreEqual(this, otherAsHashSet))
152
private void ConstructFrom(
SegmentedHashSet
<T> source)
198
/// <summary>Removes all elements from the <see cref="
SegmentedHashSet
{T}"/> object.</summary>
215
/// <summary>Determines whether the <see cref="
SegmentedHashSet
{T}"/> contains the specified element.</summary>
216
/// <param name="item">The element to locate in the <see cref="
SegmentedHashSet
{T}"/> object.</param>
217
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object contains the specified element; otherwise, false.</returns>
383
/// <summary>Adds the specified element to the <see cref="
SegmentedHashSet
{T}"/>.</summary>
385
/// <returns>true if the element is added to the <see cref="
SegmentedHashSet
{T}"/> object; false if the element is already present.</returns>
414
/// <summary>Modifies the current <see cref="
SegmentedHashSet
{T}"/> object to contain all elements that are present in itself, the specified collection, or both.</summary>
415
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
429
/// <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>
430
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
456
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
466
/// <summary>Removes all elements in the specified collection from the current <see cref="
SegmentedHashSet
{T}"/> object.</summary>
467
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
495
/// <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>
496
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
523
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
533
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a subset of the specified collection.</summary>
534
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
535
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a subset of <paramref name="other"/>; otherwise, false.</returns>
552
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
569
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a proper subset of the specified collection.</summary>
570
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
571
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a proper subset of <paramref name="other"/>; otherwise, false.</returns>
600
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
617
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a proper superset of the specified collection.</summary>
618
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
619
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a superset of <paramref name="other"/>; otherwise, false.</returns>
643
if (other is
SegmentedHashSet
<T> otherAsSet &&
662
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a proper superset of the specified collection.</summary>
663
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
664
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a proper superset of <paramref name="other"/>; otherwise, false.</returns>
688
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
705
/// <summary>Determines whether the current <see cref="
SegmentedHashSet
{T}"/> object and a specified collection share common elements.</summary>
706
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
707
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object and <paramref name="other"/> share at least one common element; otherwise, false.</returns>
737
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object and the specified collection contain the same elements.</summary>
738
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
739
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is equal to <paramref name="other"/>; otherwise, false.</returns>
754
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
784
/// <summary>Copies the elements of a <see cref="
SegmentedHashSet
{T}"/> object to an array, starting at the specified array index.</summary>
833
/// <summary>Removes all elements that match the conditions defined by the specified predicate from a <see cref="
SegmentedHashSet
{T}"/> collection.</summary>
949
/// Sets the capacity of a <see cref="
SegmentedHashSet
{T}"/> object to the actual number of elements it contains,
991
/// <summary>Returns an <see cref="IEqualityComparer"/> object that can be used for equality testing of a <see cref="
SegmentedHashSet
{T}"/> object.</summary>
992
public static IEqualityComparer<
SegmentedHashSet
<T>> CreateSetComparer() => new SegmentedHashSetEqualityComparer<T>();
1016
/// <returns>true if the element is added to the <see cref="
SegmentedHashSet
{T}"/> object; false if the element is already present.</returns>
1130
internal bool IsSubsetOfHashSetWithSameComparer(
SegmentedHashSet
<T> other)
1147
private void IntersectWithHashSetWithSameComparer(
SegmentedHashSet
<T> other)
1214
private void SymmetricExceptWithUniqueHashSet(
SegmentedHashSet
<T> other)
1372
internal static bool EqualityComparersAreEqual(
SegmentedHashSet
<T> set1,
SegmentedHashSet
<T> set2) => set1.Comparer.Equals(set2.Comparer);
1390
private readonly
SegmentedHashSet
<T> _hashSet;
1395
internal Enumerator(
SegmentedHashSet
<T> hashSet)