14 references to SpecializedCollections
Microsoft.CodeAnalysis.CodeStyle (14)
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
52
var spans =
SpecializedCollections
.SingletonEnumerable(span);
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (4)
85
return
SpecializedCollections
.EmptyBoxedImmutableArray<T>();
90
return array.IsDefaultOrEmpty ?
SpecializedCollections
.EmptyBoxedImmutableArray<T>() : (IReadOnlyList<T>)items;
95
return
SpecializedCollections
.EmptyBoxedImmutableArray<T>();
345
return
SpecializedCollections
.EmptyEnumerable<T>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (2)
90
=> _elements is null ?
SpecializedCollections
.EmptyEnumerator<T>() : ((IEnumerable<T>)_elements).GetEnumerator();
99
=> (IReadOnlySet<T>?)_set ??
SpecializedCollections
.EmptyReadOnlySet<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.cs (2)
37
var operations =
SpecializedCollections
.SingletonEnumerable(rootOperation);
51
var operations =
SpecializedCollections
.SingletonEnumerable(localFunctionOperation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
155
var operations =
SpecializedCollections
.SingletonEnumerable(basicBlock.BranchValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReadOnlyDictionaryExtensions.cs (1)
27
case T s: return
SpecializedCollections
.SingletonEnumerable(s);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (3)
187
public static readonly Task<IEnumerable<T>> EmptyEnumerable = Task.FromResult<IEnumerable<T>>(
SpecializedCollections
.EmptyEnumerable<T>());
189
public static readonly Task<IList<T>> EmptyList = Task.FromResult(
SpecializedCollections
.EmptyList<T>());
190
public static readonly Task<IReadOnlyList<T>> EmptyReadOnlyList = Task.FromResult(
SpecializedCollections
.EmptyReadOnlyList<T>());