5 instantiations of ArrayBuilder
Microsoft.CodeAnalysis.CodeStyle (5)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (3)
319var builder = new ArrayBuilder<ParameterInfo>(); 660var builder = new ArrayBuilder<TypeInfo>(); 740var builder = new ArrayBuilder<IMethodSymbol>();
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
28_elements = new ArrayBuilder<T>();
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
495pool = new ObjectPool<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool!), size);
328 references to ArrayBuilder
Microsoft.CodeAnalysis.CodeStyle (328)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (2)
28private readonly ArrayBuilder<ISymbol> _hashedSymbols = ArrayBuilder<ISymbol>.GetInstance();
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (24)
158using var _2 = ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)>.GetInstance(out var sortedPragmasWithIds); 230ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds, 239using var _ = ArrayBuilder<string>.GetInstance(out var idsBuilder); 370using var _1 = ArrayBuilder<string>.GetInstance(out var idBuilder); 371using var _2 = ArrayBuilder<string>.GetInstance(out var categoryBuilder); 398using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var analyzersBuilder); 399using var _2 = ArrayBuilder<string>.GetInstance(out var unhandledIds); 450using var _3 = ArrayBuilder<Diagnostic>.GetInstance(out var reportedDiagnostics); 483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics) 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics) 610ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds, 616using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var diagnosticsBuilder); 630ArrayBuilder<Diagnostic> diagnosticsBuilder, 632ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds, 662ArrayBuilder<Diagnostic> diagnosticsBuilder, 679ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (2)
58using var _ = ArrayBuilder<(string name, IOperation value)>.GetInstance(out var builder);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (9)
448using var _2 = ArrayBuilder<string>.GetInstance(out var debuggerDisplayAttributeArguments); 593using var _ = ArrayBuilder<TDocumentationCommentTriviaSyntax>.GetInstance(out var documentationComments); 622using var _ = ArrayBuilder<TTypeDeclarationSyntax>.GetInstance(out var stack); 654SyntaxNode memberDeclaration, ArrayBuilder<TDocumentationCommentTriviaSyntax> documentationComments) 668private void AddDebuggerDisplayAttributeArguments(INamedTypeSymbol namedTypeSymbol, ArrayBuilder<string> builder) 687private void AddDebuggerDisplayAttributeArgumentsCore(ISymbol symbol, ArrayBuilder<string> builder)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (2)
98using var _ = ArrayBuilder<IMethodSymbol>.GetInstance(out var linqMethodSymbolsBuilder);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractObjectCreationExpressionAnalyzer.cs (6)
51protected abstract bool TryAddMatches(ArrayBuilder<TMatch> preMatches, ArrayBuilder<TMatch> postMatches, CancellationToken cancellationToken); 88using var _1 = ArrayBuilder<TMatch>.GetInstance(out var preMatches); 89using var _2 = ArrayBuilder<TMatch>.GetInstance(out var postMatches);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (4)
53ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken); 91ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (2)
70ArrayBuilder<Match<TExpressionSyntax, TStatementSyntax, TMemberAccessExpressionSyntax, TAssignmentStatementSyntax>> preMatches, 71ArrayBuilder<Match<TExpressionSyntax, TStatementSyntax, TMemberAccessExpressionSyntax, TAssignmentStatementSyntax>> postMatches,
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (24)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate) 51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg) 71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map) 91var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg) 131var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 151public static ImmutableArray<TResult> SelectAsArrayWithIndex<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, int, TArg, TResult> map, TArg arg) 171var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 181public static void AddOptional<T>(this ArrayBuilder<T> builder, T? item) 193public static void Push<T>(this ArrayBuilder<T> builder, T e) 198public static T Pop<T>(this ArrayBuilder<T> builder) 205public static bool TryPop<T>(this ArrayBuilder<T> builder, [MaybeNullWhen(false)] out T result) 217public static T Peek<T>(this ArrayBuilder<T> builder) 222public static ImmutableArray<T> ToImmutableOrEmptyAndFree<T>(this ArrayBuilder<T>? builder) 227public static void AddIfNotNull<T>(this ArrayBuilder<T> builder, T? value) 236public static void AddIfNotNull<T>(this ArrayBuilder<T> builder, T? value) 245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested) 275public static void RemoveWhere<TItem, TArg>(this ArrayBuilder<TItem> builder, Func<TItem, int, TArg, bool> filter, TArg arg)
src\Compilers\Core\Portable\Collections\DictionaryExtensions.cs (4)
79public static void AddPooled<K, V>(this IDictionary<K, ArrayBuilder<V>> dictionary, K key, V value) 82if (!dictionary.TryGetValue(key, out var values)) 84values = ArrayBuilder<V>.GetInstance(); 91public static ImmutableSegmentedDictionary<K, ImmutableArray<V>> ToImmutableSegmentedDictionaryAndFree<K, V>(this IReadOnlyDictionary<K, ArrayBuilder<V>> builder)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (30)
191var builder = ArrayBuilder<TResult>.GetInstance(items.Length); 217var builder = ArrayBuilder<TResult>.GetInstance(); 247var builder = ArrayBuilder<TResult>.GetInstance(); 272var builder = ArrayBuilder<TResult>.GetInstance(); 292var builder = ArrayBuilder<TResult>.GetInstance(); 313var builder = ArrayBuilder<TResult>.GetInstance(); 337var builder = ArrayBuilder<TResult>.GetInstance(); 399var builder = ArrayBuilder<TResult>.GetInstance(); 453var builder = ArrayBuilder<TResult>.GetInstance(self.Length); 482ArrayBuilder<T>? builder = null; 502builder = ArrayBuilder<T>.GetInstance(); 520builder = ArrayBuilder<T>.GetInstance(); 753var builder = ArrayBuilder<T>.GetInstance(); 795var builder = ArrayBuilder<TValue>.GetInstance(); 1081if (existingValueOrArray is ArrayBuilder<T> arrayBuilder) 1088arrayBuilder = ArrayBuilder<T>.GetInstance(capacity: 2); 1116if (value is ArrayBuilder<TNamespaceOrTypeSymbol> builder) 1182var builder = ArrayBuilder<TNamedTypeSymbol>.GetInstance(count);
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (16)
186/// Each value is either a single V or an <see cref="ArrayBuilder{V}"/>. 196internal ValueSet(ArrayBuilder<V> values) 203var arrayBuilder = _value as ArrayBuilder<V>; 213var arrayBuilder = _value as ArrayBuilder<V>; 235var arrayBuilder = _value as ArrayBuilder<V>; 264var arrayBuilder = _value as ArrayBuilder<V>; 276var arrayBuilder = _value as ArrayBuilder<V>; 290internal int Count => (_value as ArrayBuilder<V>)?.Count ?? 1; 311var arrayBuilder = _value as ArrayBuilder<V>; 321arrayBuilder = ArrayBuilder<V>.GetInstance(capacity: 2);
src\Compilers\Core\Portable\Collections\TemporaryArray`1.cs (5)
80private ArrayBuilder<T>? _builder; 98_builder = ArrayBuilder<T>.GetInstance(capacity) 327/// <see cref="ArrayBuilder{T}"/> instance is taken from the shared pool, and all elements currently in inline 335var builder = ArrayBuilder<T>.GetInstance();
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (5)
82var results = ArrayBuilder<ISymbol>.GetInstance(); 319var builder = new ArrayBuilder<ParameterInfo>(); 660var builder = new ArrayBuilder<TypeInfo>(); 740var builder = new ArrayBuilder<IMethodSymbol>();
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
857var resolvedParts = ArrayBuilder<string>.GetInstance();
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (20)
361var builder = ArrayBuilder<TResult>.GetInstance(); 372var builder = ArrayBuilder<TResult>.GetInstance(); 405var builder = ArrayBuilder<TResult>.GetInstance(); 417var builder = ArrayBuilder<TResult>.GetInstance(); 430var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 443var builder = ArrayBuilder<TResult>.GetInstance(source.Count); 455var builder = ArrayBuilder<TResult>.GetInstance(); 470var builder = ArrayBuilder<TResult>.GetInstance(); 485var builder = ArrayBuilder<TResult>.GetInstance(); 497var builder = ArrayBuilder<TResult>.GetInstance();
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
98public void AddRangeTo(ArrayBuilder<T> builder)
src\Compilers\Core\Portable\InternalUtilities\SetWithInsertionOrder.cs (1)
21private ArrayBuilder<T>? _elements = null;
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (5)
130var builder = ArrayBuilder<TextChangeRange>.GetInstance(); 370static void addAndAdjustOldDelta(ArrayBuilder<TextChangeRange> builder, ref int oldDelta, TextChangeRange oldChange) 377static void adjustAndAddNewChange(ArrayBuilder<TextChangeRange> builder, int oldDelta, UnadjustedNewChange newChange) 383static void add(ArrayBuilder<TextChangeRange> builder, TextChangeRange change)
src\Dependencies\PooledObjects\ArrayBuilder.cs (27)
17[DebuggerTypeProxy(typeof(ArrayBuilder<>.DebuggerProxy))] 29private readonly ArrayBuilder<T> _builder; 31public DebuggerProxy(ArrayBuilder<T> builder) 56private readonly ObjectPool<ArrayBuilder<T>>? _pool; 67private ArrayBuilder(ObjectPool<ArrayBuilder<T>> pool) 374var tmp = ArrayBuilder<U>.GetInstance(Count); 459private static readonly ObjectPool<ArrayBuilder<T>> s_poolInstance = CreatePool(); 460public static ArrayBuilder<T> GetInstance() 462var builder = s_poolInstance.Allocate(); 467public static ArrayBuilder<T> GetInstance(int capacity) 469var builder = GetInstance(); 474public static ArrayBuilder<T> GetInstance(int capacity, T fillWithValue) 476var builder = GetInstance(); 487public static ObjectPool<ArrayBuilder<T>> CreatePool() 492public static ObjectPool<ArrayBuilder<T>> CreatePool(int size) 494ObjectPool<ArrayBuilder<T>>? pool = null; 495pool = new ObjectPool<ArrayBuilder<T>>(() => new ArrayBuilder<T>(pool!), size); 534var accumulator = new Dictionary<K, ArrayBuilder<T>>(Count, comparer); 539if (!accumulator.TryGetValue(key, out var bucket)) 541bucket = ArrayBuilder<T>.GetInstance(); 559public void AddRange(ArrayBuilder<T> items) 564public void AddRange<U>(ArrayBuilder<U> items, Func<U, T> selector) 572public void AddRange<U>(ArrayBuilder<U> items) where U : T 577public void AddRange<U>(ArrayBuilder<U> items, int start, int length) where U : T 708var result = ArrayBuilder<S>.GetInstance(Count);
src\Dependencies\PooledObjects\ArrayBuilder.Enumerator.cs (2)
14private readonly ArrayBuilder<T> _builder; 17public Enumerator(ArrayBuilder<T> builder)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\NamingStyles\NamingStyleOptionAccumulator.cs (2)
16private ArrayBuilder<NamingStyleOption>? _rules; 33_rules ??= ArrayBuilder<NamingStyleOption>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (4)
55using var _1 = ArrayBuilder<(int minValue, int maxValue)>.GetInstance(out var numberRangePairs); 71ArrayBuilder<(int minValue, int maxValue)> numberRangePairs) 240ArrayBuilder<(int, int)> numberRangePairs)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICollectionExtensions.cs (2)
16using var _ = ArrayBuilder<T>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ICompilationExtensions.cs (4)
25var builder = ArrayBuilder<Compilation>.GetInstance(); 60var builder = ArrayBuilder<IAssemblySymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
407using var _ = ArrayBuilder<ISymbol>.GetInstance(out var results);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (2)
93using var _ = ArrayBuilder<INamespaceOrTypeSymbol>.GetInstance(out var stack);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (4)
376var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance(); 397var results = ArrayBuilder<ITypeSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ListExtensions.cs (1)
62public static void RemoveOrTransformAll<T, TArg>(this ArrayBuilder<T> list, Func<T, TArg, T?> transform, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (4)
214using var _1 = ArrayBuilder<SyntaxNode>.GetInstance(out var commonAncestorsStack); 915using var _ = ArrayBuilder<TDirectiveTriviaSyntax>.GetInstance(out var condDirectivesBuilder);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (3)
39var unreachableBlocksToVisit = ArrayBuilder<BasicBlock>.GetInstance(); 73ArrayBuilder<BasicBlock> unreachableBlocksToVisit,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
30private readonly ArrayBuilder<BasicBlockAnalysisData> _allocatedBasicBlockAnalysisDatas; 39_allocatedBasicBlockAnalysisDatas = ArrayBuilder<BasicBlockAnalysisData>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (6)
127using var _ = ArrayBuilder<SuppressOperation>.GetInstance(out var result); 137SyntaxToken startToken, SyntaxToken endToken, SuppressOption mask, ArrayBuilder<SuppressOperation> result) 143private void AddInitialSuppressOperations(SyntaxToken token, SuppressOption mask, ArrayBuilder<SuppressOperation> result) 150using var _ = ArrayBuilder<SuppressOperation>.GetInstance(out var buffer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (4)
163using var _ = ArrayBuilder<SuppressOperation>.GetInstance(out var suppressOperationScratch); 203private static void AddOperations<T>(SegmentedList<T> operations, ArrayBuilder<T> scratch, SyntaxNode node, Action<ArrayBuilder<T>, SyntaxNode> addOperations)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\ChainedFormattingRules.cs (1)
47public void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode currentNode)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\AbstractFormattingRule.cs (1)
23public virtual void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\CompatAbstractFormattingRule.cs (2)
17public sealed override void AddSuppressOperations(ArrayBuilder<SuppressOperation> list, SyntaxNode node, in NextSuppressOperationAction nextOperation) 72public virtual void AddSuppressOperationsSlow(ArrayBuilder<SuppressOperation> list, SyntaxNode node, ref NextSuppressOperationAction nextOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\NextSuppressOperationAction.cs (1)
17ArrayBuilder<SuppressOperation> list)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (21)
41private delegate LineColumnDelta Formatter<T>(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<T> changes, CancellationToken cancellationToken); 46private delegate void WhitespaceAppender<T>(LineColumn lineColumn, LineColumnDelta delta, TextSpan span, ArrayBuilder<T> changes); 185protected abstract LineColumnDelta Format(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<SyntaxTrivia> changes, CancellationToken cancellationToken); 190protected abstract LineColumnDelta Format(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<TextChange> changes, CancellationToken cancellationToken); 240using var _ = ArrayBuilder<SyntaxTrivia>.GetInstance(out var triviaList); 260private static void AddRange(ArrayBuilder<SyntaxTrivia> result, SyntaxTriviaList triviaList) 268using var _ = ArrayBuilder<TextChange>.GetInstance(out var changes); 284private LineColumn FormatTrivia<T>(Formatter<T> formatter, WhitespaceAppender<T> whitespaceAdder, ArrayBuilder<T> changes, CancellationToken cancellationToken) 378ArrayBuilder<T> changes, 625private void AddExtraLines(int linesBetweenTokens, ArrayBuilder<SyntaxTrivia> changes) 629using var _ = ArrayBuilder<SyntaxTrivia>.GetInstance(out var lineBreaks); 642private int GetInsertionIndex(ArrayBuilder<SyntaxTrivia> changes) 675private void AddExtraLines(int linesBetweenTokens, ArrayBuilder<TextChange> changes) 713private bool TryGetMatchingChangeIndex(ArrayBuilder<TextChange> changes, out int index) 731private TextSpan GetInsertionSpan(ArrayBuilder<TextChange> changes) 758ArrayBuilder<SyntaxTrivia> changes) 767ArrayBuilder<SyntaxTrivia> changes) 826private void AddWhitespaceTextChange(LineColumn lineColumn, LineColumnDelta delta, TextSpan span, ArrayBuilder<TextChange> changes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\TriviaHelpers.cs (2)
19using var _ = ArrayBuilder<SyntaxTrivia>.GetInstance(out var builder);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (6)
22var symbolSpecifications = ArrayBuilder<SymbolSpecification>.GetInstance(); 23var namingStyles = ArrayBuilder<NamingStyle>.GetInstance(); 24var namingRules = ArrayBuilder<SerializableNamingRule>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (6)
153var builder = ArrayBuilder<SymbolKindOrTypeKind>.GetInstance(); 246var builder = ArrayBuilder<Accessibility>.GetInstance(); 316var builder = ArrayBuilder<ModifierKind>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (4)
213using var _ = ArrayBuilder<string>.GetInstance(out var violations); 255using var _ = ArrayBuilder<string>.GetInstance(out var violations);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
292var applicableSymbolKindList = ArrayBuilder<SymbolKindOrTypeKind>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\ArrayBuilder.cs (9)
9public static PooledDisposer<ArrayBuilder<T>> GetInstance(out ArrayBuilder<T> instance) 12return new PooledDisposer<ArrayBuilder<T>>(instance); 15public static PooledDisposer<ArrayBuilder<T>> GetInstance(int capacity, out ArrayBuilder<T> instance) 18return new PooledDisposer<ArrayBuilder<T>>(instance); 21public static PooledDisposer<ArrayBuilder<T>> GetInstance(int capacity, T fillWithValue, out ArrayBuilder<T> instance) 24return new PooledDisposer<ArrayBuilder<T>>(instance);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SelectedMembers\AbstractSelectedMembers.cs (2)
88using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var selectedMembers);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (2)
25using var _ = ArrayBuilder<Location>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (2)
55using var _ = ArrayBuilder<string>.GetInstance(out var builder);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PooledArrayBuilder.cs (5)
15public readonly ArrayBuilder<T> Builder; 17private PooledArrayBuilder(ArrayBuilder<T> builder) 36public ArrayBuilder<T>.Enumerator GetEnumerator() => Builder.GetEnumerator(); 39=> new(ArrayBuilder<T>.GetInstance()); 42=> new(ArrayBuilder<T>.GetInstance(capacity));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (6)
26using var _1 = ArrayBuilder<string?>.GetInstance(out var friendlyNames); 27using var _2 = ArrayBuilder<Location>.GetInstance(out var locations); 41using var _3 = ArrayBuilder<ISymbol>.GetInstance(out var elementTypes);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\FixedSizeArrayBuilder.cs (2)
37/// cref="ArrayBuilder{T}.GetInstance(int, T)"/> should be used instead. 71public void AddRange(ArrayBuilder<T> values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
38using var _ = ArrayBuilder<T>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ICollectionExtensions.cs (1)
30public static void AddRange<T>(this ICollection<T> collection, ArrayBuilder<T>? values)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (6)
76public static void MultiAdd<TKey, TValue>(this IDictionary<TKey, ArrayBuilder<TValue>> dictionary, TKey key, TValue value) 79if (!dictionary.TryGetValue(key, out var builder)) 81builder = ArrayBuilder<TValue>.GetInstance(); 88public static void MultiAddRange<TKey, TValue>(this IDictionary<TKey, ArrayBuilder<TValue>> dictionary, TKey key, IEnumerable<TValue> values) 91if (!dictionary.TryGetValue(key, out var builder)) 93builder = ArrayBuilder<TValue>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (10)
29public static Dictionary<K, ImmutableArray<V>> ToMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders) 43public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders) 57public static void FreeValues<K, V>(this IReadOnlyDictionary<K, ArrayBuilder<V>> builders) 66public static ImmutableArray<T> ToFlattenedImmutableArrayAndFree<T>(this ArrayBuilder<ArrayBuilder<T>> builders) 80var result = ArrayBuilder<T>.GetInstance(builders.Sum(b => b.Count)); 82foreach (var builder in builders) 96public static bool HasDuplicates<T>(this ArrayBuilder<T> builder) 99public static bool HasDuplicates<T, U>(this ArrayBuilder<T> builder, Func<T, U> selector)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (2)
46using var _ = ArrayBuilder<TItem>.GetInstance(out var items);