8 instantiations of ImmutableSegmentedHashSet
Microsoft.CodeAnalysis.CodeStyle (8)
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (3)
67public static readonly ImmutableSegmentedHashSet<T> Empty = new(new SegmentedHashSet<T>()); 113return new ImmutableSegmentedHashSet<T>(set); 311return new ImmutableSegmentedHashSet<T>(new SegmentedHashSet<T>(self._set, equalityComparer));
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (4)
24return new ImmutableSegmentedHashSet<T>(set); 33return new ImmutableSegmentedHashSet<T>(set); 42return new ImmutableSegmentedHashSet<T>(set); 47=> set is not null ? new ImmutableSegmentedHashSet<T>(set) : default;
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
264_set = new ImmutableSegmentedHashSet<T>(ReadOnlySet);
127 references to ImmutableSegmentedHashSet
Microsoft.CodeAnalysis.CodeStyle (127)
src\Dependencies\Collections\ImmutableSegmentedHashSet.cs (30)
14public static ImmutableSegmentedHashSet<T> Create<T>() 15=> ImmutableSegmentedHashSet<T>.Empty; 18public static ImmutableSegmentedHashSet<T> Create<T>(T item) 19=> ImmutableSegmentedHashSet<T>.Empty.Add(item); 22public static ImmutableSegmentedHashSet<T> Create<T>(params T[] items) 23=> ImmutableSegmentedHashSet<T>.Empty.Union(items); 26public static ImmutableSegmentedHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer) 27=> ImmutableSegmentedHashSet<T>.Empty.WithComparer(equalityComparer); 30public static ImmutableSegmentedHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer, T item) 31=> ImmutableSegmentedHashSet<T>.Empty.WithComparer(equalityComparer).Add(item); 34public static ImmutableSegmentedHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer, params T[] items) 35=> ImmutableSegmentedHashSet<T>.Empty.WithComparer(equalityComparer).Union(items); 38public static ImmutableSegmentedHashSet<T>.Builder CreateBuilder<T>() 39=> ImmutableSegmentedHashSet<T>.Empty.ToBuilder(); 42public static ImmutableSegmentedHashSet<T>.Builder CreateBuilder<T>(IEqualityComparer<T>? equalityComparer) 43=> ImmutableSegmentedHashSet<T>.Empty.WithComparer(equalityComparer).ToBuilder(); 46public static ImmutableSegmentedHashSet<T> CreateRange<T>(IEnumerable<T> items) 48if (items is ImmutableSegmentedHashSet<T> existingSet) 51return ImmutableSegmentedHashSet<T>.Empty.Union(items); 55public static ImmutableSegmentedHashSet<T> CreateRange<T>(IEqualityComparer<T>? equalityComparer, IEnumerable<T> items) 57if (items is ImmutableSegmentedHashSet<T> existingSet) 60return ImmutableSegmentedHashSet<T>.Empty.WithComparer(equalityComparer).Union(items); 64public static ImmutableSegmentedHashSet<TSource> ToImmutableSegmentedHashSet<TSource>(this IEnumerable<TSource> source) 66if (source is ImmutableSegmentedHashSet<TSource> existingSet) 69return ImmutableSegmentedHashSet<TSource>.Empty.Union(source); 73public static ImmutableSegmentedHashSet<TSource> ToImmutableSegmentedHashSet<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource>? equalityComparer) 75if (source is ImmutableSegmentedHashSet<TSource> existingSet) 78return ImmutableSegmentedHashSet<TSource>.Empty.WithComparer(equalityComparer).Union(source); 82public static ImmutableSegmentedHashSet<TSource> ToImmutableSegmentedHashSet<TSource>(this ImmutableSegmentedHashSet<TSource>.Builder builder)
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (35)
17/// <para>There are different scenarios best for <see cref="ImmutableSegmentedHashSet{T}"/> and others 21/// <see cref="ImmutableSegmentedHashSet{T}"/>:</para> 26/// <description><see cref="ImmutableSegmentedHashSet{T}"/> Complexity</description> 64internal readonly partial struct ImmutableSegmentedHashSet<T> : IImmutableSet<T>, ISet<T>, ICollection, IEquatable<ImmutableSegmentedHashSet<T>> 67public static readonly ImmutableSegmentedHashSet<T> Empty = new(new SegmentedHashSet<T>()); 93public static bool operator ==(ImmutableSegmentedHashSet<T> left, ImmutableSegmentedHashSet<T> right) 96public static bool operator !=(ImmutableSegmentedHashSet<T> left, ImmutableSegmentedHashSet<T> right) 99public static bool operator ==(ImmutableSegmentedHashSet<T>? left, ImmutableSegmentedHashSet<T>? right) 102public static bool operator !=(ImmutableSegmentedHashSet<T>? left, ImmutableSegmentedHashSet<T>? right) 106public ImmutableSegmentedHashSet<T> Add(T value) 108var self = this; 129public ImmutableSegmentedHashSet<T> Clear() 131var self = this; 146public ImmutableSegmentedHashSet<T> Except(IEnumerable<T> other) 148var self = this; 150if (other is ImmutableSegmentedHashSet<T> { IsEmpty: true }) 178public ImmutableSegmentedHashSet<T> Intersect(IEnumerable<T> other) 180var self = this; 182if (self.IsEmpty || other is ImmutableSegmentedHashSet<T> { IsEmpty: true }) 216public ImmutableSegmentedHashSet<T> Remove(T value) 218var self = this; 238public ImmutableSegmentedHashSet<T> SymmetricExcept(IEnumerable<T> other) 240var self = this; 242if (other is ImmutableSegmentedHashSet<T> otherSet) 277public ImmutableSegmentedHashSet<T> Union(IEnumerable<T> other) 279var self = this; 281if (other is ImmutableSegmentedHashSet<T> otherSet) 303public ImmutableSegmentedHashSet<T> WithComparer(IEqualityComparer<T>? equalityComparer) 305var self = this; 318=> obj is ImmutableSegmentedHashSet<T> other && Equals(other); 320public bool Equals(ImmutableSegmentedHashSet<T> other)
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+Builder.cs (2)
21internal Builder(ImmutableSegmentedHashSet<T> set) 112public ImmutableSegmentedHashSet<T> ToImmutable()
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+PrivateMarshal.cs (12)
18internal static ImmutableSegmentedHashSet<T> VolatileRead(in ImmutableSegmentedHashSet<T> location) 27internal static ImmutableSegmentedHashSet<T> InterlockedExchange(ref ImmutableSegmentedHashSet<T> location, ImmutableSegmentedHashSet<T> value) 36internal static ImmutableSegmentedHashSet<T> InterlockedCompareExchange(ref ImmutableSegmentedHashSet<T> location, ImmutableSegmentedHashSet<T> value, ImmutableSegmentedHashSet<T> comparand) 46internal static ImmutableSegmentedHashSet<T> AsImmutableSegmentedHashSet(SegmentedHashSet<T>? set) 49/// <inheritdoc cref="SegmentedCollectionsMarshal.AsSegmentedHashSet{T}(ImmutableSegmentedHashSet{T})"/> 50internal static SegmentedHashSet<T>? AsSegmentedHashSet(ImmutableSegmentedHashSet<T> set)
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (6)
21private ImmutableSegmentedHashSet<T> _set; 29internal ValueBuilder(ImmutableSegmentedHashSet<T> set) 64var originalSet = RoslynImmutableInterlocked.InterlockedExchange(ref _set, default); 125else if (other is ImmutableSegmentedHashSet<T> otherSet) 235if (other is ImmutableSegmentedHashSet<T> { IsEmpty: true }) 262public ImmutableSegmentedHashSet<T> ToImmutable()
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (26)
151public static bool Update<T>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, ImmutableSegmentedHashSet<T>> transformer) 156var oldValue = ImmutableSegmentedHashSet<T>.PrivateMarshal.VolatileRead(in location); 159var newValue = transformer(oldValue); 166var interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue); 192public static bool Update<T, TArg>(ref ImmutableSegmentedHashSet<T> location, Func<ImmutableSegmentedHashSet<T>, TArg, ImmutableSegmentedHashSet<T>> transformer, TArg transformerArgument) 197var oldValue = ImmutableSegmentedHashSet<T>.PrivateMarshal.VolatileRead(in location); 200var newValue = transformer(oldValue, transformerArgument); 207var interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue); 223public static ImmutableSegmentedHashSet<T> InterlockedExchange<T>(ref ImmutableSegmentedHashSet<T> location, ImmutableSegmentedHashSet<T> value) 225return ImmutableSegmentedHashSet<T>.PrivateMarshal.InterlockedExchange(ref location, value); 237public static ImmutableSegmentedHashSet<T> InterlockedCompareExchange<T>(ref ImmutableSegmentedHashSet<T> location, ImmutableSegmentedHashSet<T> value, ImmutableSegmentedHashSet<T> comparand) 239return ImmutableSegmentedHashSet<T>.PrivateMarshal.InterlockedCompareExchange(ref location, value, comparand); 251public static bool InterlockedInitialize<T>(ref ImmutableSegmentedHashSet<T> location, ImmutableSegmentedHashSet<T> value) 253return InterlockedCompareExchange(ref location, value, default(ImmutableSegmentedHashSet<T>)).IsDefault;
src\Dependencies\Collections\SegmentedCollectionsMarshal.cs (16)
138/// Gets an <see cref="ImmutableSegmentedHashSet{T}"/> value wrapping the input <see cref="SegmentedHashSet{T}"/>. 141/// <param name="set">The input segmented hash set to wrap in the returned <see cref="ImmutableSegmentedHashSet{T}"/> value.</param> 142/// <returns>An <see cref="ImmutableSegmentedHashSet{T}"/> value wrapping <paramref name="set"/>.</returns> 146/// set, and that it won't be modified once the returned <see cref="ImmutableSegmentedHashSet{T}"/> value starts 148/// <see cref="ImmutableSegmentedHashSet{T}"/> values to change after its creation. 151/// If <paramref name="set"/> is <see langword="null"/>, the returned <see cref="ImmutableSegmentedHashSet{T}"/> 152/// value will be uninitialized (i.e. its <see cref="ImmutableSegmentedHashSet{T}.IsDefault"/> property will be 156public static ImmutableSegmentedHashSet<T> AsImmutableSegmentedHashSet<T>(SegmentedHashSet<T>? set) 157=> ImmutableSegmentedHashSet<T>.PrivateMarshal.AsImmutableSegmentedHashSet(set); 160/// Gets the underlying <see cref="SegmentedHashSet{T}"/> for an input <see cref="ImmutableSegmentedHashSet{T}"/> value. 162/// <typeparam name="T">The type of elements in the input <see cref="ImmutableSegmentedHashSet{T}"/> value.</typeparam> 163/// <param name="set">The input <see cref="ImmutableSegmentedHashSet{T}"/> value to get the underlying <see cref="SegmentedHashSet{T}"/> from.</param> 169/// don't expect the contents of the <see cref="ImmutableSegmentedHashSet{T}"/> value to change. 172/// If <paramref name="set"/> is uninitialized (i.e. its <see cref="ImmutableSegmentedHashSet{T}.IsDefault"/> 176public static SegmentedHashSet<T>? AsSegmentedHashSet<T>(ImmutableSegmentedHashSet<T> set) 177=> ImmutableSegmentedHashSet<T>.PrivateMarshal.AsSegmentedHashSet(set);