7 instantiations of SegmentedHashSet
Microsoft.CodeAnalysis.Collections.Package (7)
ImmutableSegmentedHashSet`1.cs (3)
67
public static readonly ImmutableSegmentedHashSet<T> Empty = new(new
SegmentedHashSet
<T>());
112
var set = new
SegmentedHashSet
<T>(self.KeyComparer) { value };
311
return new ImmutableSegmentedHashSet<T>(new
SegmentedHashSet
<T>(self._set, equalityComparer));
ImmutableSegmentedHashSet`1+ValueBuilder.cs (3)
48
_mutableSet = new
SegmentedHashSet
<T>(ReadOnlySet, value ?? EqualityComparer<T>.Default);
68
_mutableSet = new
SegmentedHashSet
<T>(originalSet._set, originalSet.KeyComparer);
90
_mutableSet = new
SegmentedHashSet
<T>(KeyComparer);
SegmentedHashSet`1.cs (1)
374
return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new
SegmentedHashSet
<T>()))!;
80 references to SegmentedHashSet
Microsoft.CodeAnalysis.Collections.Package (80)
ImmutableSegmentedHashSet`1.cs (3)
69
private readonly
SegmentedHashSet
<T> _set;
71
private ImmutableSegmentedHashSet(
SegmentedHashSet
<T> set)
112
var
set = new SegmentedHashSet<T>(self.KeyComparer) { value };
ImmutableSegmentedHashSet`1+Enumerator.cs (3)
16
private readonly
SegmentedHashSet
<T> _set;
17
private
SegmentedHashSet
<T>.Enumerator _enumerator;
19
internal Enumerator(
SegmentedHashSet
<T> set)
ImmutableSegmentedHashSet`1+PrivateMarshal.cs (3)
45
/// <inheritdoc cref="SegmentedCollectionsMarshal.AsImmutableSegmentedHashSet{T}(
SegmentedHashSet
{T}?)"/>
46
internal static ImmutableSegmentedHashSet<T> AsImmutableSegmentedHashSet(
SegmentedHashSet
<T>? set)
50
internal static
SegmentedHashSet
<T>? AsSegmentedHashSet(ImmutableSegmentedHashSet<T> set)
ImmutableSegmentedHashSet`1+ValueBuilder.cs (5)
27
private
SegmentedHashSet
<T>? _mutableSet;
56
internal readonly
SegmentedHashSet
<T> ReadOnlySet => _mutableSet ?? _set._set;
60
private
SegmentedHashSet
<T> GetOrCreateMutableSet()
147
SegmentedHashSet
<T>? mutableSet = null;
243
SegmentedHashSet
<T>? mutableSet = null;
Internal\SegmentedHashSetEqualityComparer`1.cs (5)
17
internal sealed class SegmentedHashSetEqualityComparer<T> : IEqualityComparer<
SegmentedHashSet
<T>?>
19
public bool Equals(
SegmentedHashSet
<T>? x,
SegmentedHashSet
<T>? y)
37
if (
SegmentedHashSet
<T>.EqualityComparersAreEqual(x, y))
65
public int GetHashCode(
SegmentedHashSet
<T>? obj)
SegmentedCollectionsMarshal.cs (7)
138
/// Gets an <see cref="ImmutableSegmentedHashSet{T}"/> value wrapping the input <see cref="
SegmentedHashSet
{T}"/>.
156
public static ImmutableSegmentedHashSet<T> AsImmutableSegmentedHashSet<T>(
SegmentedHashSet
<T>? set)
160
/// Gets the underlying <see cref="
SegmentedHashSet
{T}"/> for an input <see cref="ImmutableSegmentedHashSet{T}"/> value.
163
/// <param name="set">The input <see cref="ImmutableSegmentedHashSet{T}"/> value to get the underlying <see cref="
SegmentedHashSet
{T}"/> from.</param>
164
/// <returns>The underlying <see cref="
SegmentedHashSet
{T}"/> for <paramref name="set"/>, if present; otherwise, <see langword="null"/>.</returns>
173
/// property is <see langword="true"/>), the resulting <see cref="
SegmentedHashSet
{T}"/> will be <see langword="null"/>.
176
public static
SegmentedHashSet
<T>? AsSegmentedHashSet<T>(ImmutableSegmentedHashSet<T> set)
SegmentedHashSet`1.cs (54)
110
if (collection is
SegmentedHashSet
<T> otherAsHashSet && EqualityComparersAreEqual(this, otherAsHashSet))
150
private void ConstructFrom(
SegmentedHashSet
<T> source)
196
/// <summary>Removes all elements from the <see cref="
SegmentedHashSet
{T}"/> object.</summary>
213
/// <summary>Determines whether the <see cref="
SegmentedHashSet
{T}"/> contains the specified element.</summary>
214
/// <param name="item">The element to locate in the <see cref="
SegmentedHashSet
{T}"/> object.</param>
215
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object contains the specified element; otherwise, false.</returns>
381
/// <summary>Adds the specified element to the <see cref="
SegmentedHashSet
{T}"/>.</summary>
383
/// <returns>true if the element is added to the <see cref="
SegmentedHashSet
{T}"/> object; false if the element is already present.</returns>
412
/// <summary>Modifies the current <see cref="
SegmentedHashSet
{T}"/> object to contain all elements that are present in itself, the specified collection, or both.</summary>
413
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
427
/// <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>
428
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
454
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
464
/// <summary>Removes all elements in the specified collection from the current <see cref="
SegmentedHashSet
{T}"/> object.</summary>
465
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
493
/// <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>
494
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
521
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
531
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a subset of the specified collection.</summary>
532
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
533
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a subset of <paramref name="other"/>; otherwise, false.</returns>
550
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
567
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a proper subset of the specified collection.</summary>
568
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
569
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a proper subset of <paramref name="other"/>; otherwise, false.</returns>
598
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
615
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a proper superset of the specified collection.</summary>
616
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
617
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a superset of <paramref name="other"/>; otherwise, false.</returns>
641
if (other is
SegmentedHashSet
<T> otherAsSet &&
660
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object is a proper superset of the specified collection.</summary>
661
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
662
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is a proper superset of <paramref name="other"/>; otherwise, false.</returns>
686
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
703
/// <summary>Determines whether the current <see cref="
SegmentedHashSet
{T}"/> object and a specified collection share common elements.</summary>
704
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
705
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object and <paramref name="other"/> share at least one common element; otherwise, false.</returns>
735
/// <summary>Determines whether a <see cref="
SegmentedHashSet
{T}"/> object and the specified collection contain the same elements.</summary>
736
/// <param name="other">The collection to compare to the current <see cref="
SegmentedHashSet
{T}"/> object.</param>
737
/// <returns>true if the <see cref="
SegmentedHashSet
{T}"/> object is equal to <paramref name="other"/>; otherwise, false.</returns>
752
if (other is
SegmentedHashSet
<T> otherAsSet && EqualityComparersAreEqual(this, otherAsSet))
782
/// <summary>Copies the elements of a <see cref="
SegmentedHashSet
{T}"/> object to an array, starting at the specified array index.</summary>
831
/// <summary>Removes all elements that match the conditions defined by the specified predicate from a <see cref="
SegmentedHashSet
{T}"/> collection.</summary>
947
/// Sets the capacity of a <see cref="
SegmentedHashSet
{T}"/> object to the actual number of elements it contains,
989
/// <summary>Returns an <see cref="IEqualityComparer"/> object that can be used for equality testing of a <see cref="
SegmentedHashSet
{T}"/> object.</summary>
990
public static IEqualityComparer<
SegmentedHashSet
<T>> CreateSetComparer() => new SegmentedHashSetEqualityComparer<T>();
1014
/// <returns>true if the element is added to the <see cref="
SegmentedHashSet
{T}"/> object; false if the element is already present.</returns>
1128
internal bool IsSubsetOfHashSetWithSameComparer(
SegmentedHashSet
<T> other)
1145
private void IntersectWithHashSetWithSameComparer(
SegmentedHashSet
<T> other)
1212
private void SymmetricExceptWithUniqueHashSet(
SegmentedHashSet
<T> other)
1370
internal static bool EqualityComparersAreEqual(
SegmentedHashSet
<T> set1,
SegmentedHashSet
<T> set2) => set1.Comparer.Equals(set2.Comparer);
1388
private readonly
SegmentedHashSet
<T> _hashSet;
1393
internal Enumerator(
SegmentedHashSet
<T> hashSet)