1 instantiation of PooledSortedSet
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
52
() => new
PooledSortedSet
<T>(pool, comparer),
15 references to PooledSortedSet
Roslyn.Diagnostics.Analyzers (15)
src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (15)
21
private readonly ObjectPool<
PooledSortedSet
<T>>? _pool;
23
public PooledSortedSet(ObjectPool<
PooledSortedSet
<T>>? pool, IComparer<T>? comparer = null)
45
private static readonly ObjectPool<
PooledSortedSet
<T>> s_poolInstance = CreatePool();
46
private static readonly ConcurrentDictionary<IComparer<T>, ObjectPool<
PooledSortedSet
<T>>> s_poolInstancesByComparer = new();
48
private static ObjectPool<
PooledSortedSet
<T>> CreatePool(IComparer<T>? comparer = null)
50
ObjectPool<
PooledSortedSet
<T>>? pool = null;
51
pool = new ObjectPool<
PooledSortedSet
<T>>(
58
/// Gets a pooled instance of a <see cref="
PooledSortedSet
{T}"/> with an optional comparer.
61
/// <returns>An empty <see cref="
PooledSortedSet
{T}"/>.</returns>
62
public static
PooledSortedSet
<T> GetInstance(IComparer<T>? comparer = null)
67
var
instance = pool.Allocate();
73
/// Gets a pooled instance of a <see cref="
PooledSortedSet
{T}"/> with the given initializer and an optional comparer.
77
/// <returns>An empty <see cref="
PooledSortedSet
{T}"/>.</returns>
78
public static
PooledSortedSet
<T> GetInstance(IEnumerable<T> initializer, IComparer<T>? comparer = null)
80
var
instance = GetInstance(comparer);