Implemented interface members:
5 writes to Count
Microsoft.CodeAnalysis (5)
Collections\ArrayBuilderExtensions.cs (1)
290builder.Count = writeIndex;
Collections\TemporaryArray`1.cs (1)
239_builder.Count--;
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (1)
230Regions.Count = replaceWithCount - 1 + originalCount;
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
228localAliases.Count = localAliasCount;
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
266flagsBuilder.Count = flagCount;
239 references to Count
Microsoft.CodeAnalysis (239)
CodeGen\ILBuilder.cs (6)
264while (reachableBlocks.Count != 0) 1000seqPoints[seqPoints.Count - 1] = seqPoint; 1005if (seqPoints.Count > 0) 1030Debug.Assert(this.SeqPointsOpt.Count == 0); 1243int marker = _allocatedILMarkers.Count; 1261Debug.Assert(ilMarker >= 0 && ilMarker < _allocatedILMarkers.Count, "Wrong builder?");
CodeGen\ItemTokenMap.cs (1)
49token = (uint)_items.Count;
CodeGen\LocalScopeManager.cs (3)
129if (result.Count > 0 && result[result.Count - 1].Length != expectedRootScopeLength) 508while (result.Count <= slotIndex)
CodeGen\LocalSlotManager.cs (1)
231slot: _lazyAllLocals.Count,
CodeGen\SequencePointList.cs (2)
49if (seqPointBuilder.Count == 0) 55int totalPoints = seqPointBuilder.Count;
Collections\ArrayBuilderExtensions.cs (12)
73switch (items.Count) 91var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 113switch (items.Count) 131var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 153switch (items.Count) 171var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 174builder.Add(map(item, builder.Count, arg)); 201builder.RemoveAt(builder.Count - 1); 207if (builder.Count > 0) 219return builder[builder.Count - 1]; 261if (builder.Count == 1) 278for (var i = 0; i < builder.Count; i++)
Collections\ImmutableArrayExtensions.cs (4)
833var result = (builder.Count == array.Length) ? array : builder.ToImmutable(); 873if (comparer != null && builder.Count > 1) 1189Debug.Assert(builder.Count > 1); 1260Debug.Assert(builder.Count == count);
Collections\OrderedSet.cs (1)
51return _list.Count;
Collections\OrderPreservingMultiDictionary.cs (1)
290internal int Count => (_value as ArrayBuilder<V>)?.Count ?? 1;
Collections\TemporaryArray`1.cs (1)
104public readonly int Count => _builder?.Count ?? _count;
Collections\TopologicalSort.cs (3)
64while (ready.Count != 0) 85bool hadCycle = predecessorCounts.Count != resultBuilder.Count; 108while (toCount.Count != 0)
CommandLine\AnalyzerConfigSet.cs (3)
154Debug.Assert(builder.Count == config.NamedSections.Length); 159Debug.Assert(allMatchers.Count == _analyzerConfigs.Length); 457for (int i = 0; i < analyzerConfigs.Count; i++)
CommandLine\CommandLineParser.cs (7)
216if (parts.Count == 0 || parts[0].Length == 0) 232if (parts.Count > 1 && parts[1].Length > 0) 249if (parts.Count > 2) 504var argsIndex = args.Count - 1; 652if (argsIndex < args.Count) 836int length = parts.Count; 1040for (var i = 0; i < builder.Count; i++)
DiagnosticAnalyzer\AnalyzerDriver.cs (4)
1467while (kind >= actionsByKindBuilder.Count) 1868Debug.Assert(completedAnalyzers.Count < analysisScope.Analyzers.Length); 2629var filteredNodesToAnalyze = ArrayBuilder<SyntaxNode>.GetInstance(nodesToAnalyze.Count); 2986Debug.Assert(operationsToAnalyze.ToImmutableHashSet().Count == operationsToAnalyze.Count);
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
659for (var i = builder.Count - 1; i >= 0; i--)
Emit\EditAndContinue\DeltaMetadataWriter.cs (4)
510if (deletedMethodDefs?.Count > 0) 1026int previousCustomAttributeRowIdsCount = _customAttributeRowIds.Count; 1036if (_customAttributeRowIds.Count > previousCustomAttributeRowIdsCount) 1326Debug.Assert(debugTokens.Distinct().Count() == debugTokens.Count);
Emit\EditAndContinueMethodDebugInformation.cs (2)
233var closureId = new DebugId(closuresBuilder.Count, generation: 0); 247var lambdaId = new DebugId(lambdasBuilder.Count, generation: 0);
FileSystem\PathUtilities.cs (1)
865else if (resolvedParts.Count > 0)
InternalUtilities\EnumField.cs (1)
42int end = sortedFields.Count;
InternalUtilities\SetWithInsertionOrder.cs (1)
85public int Count => _elements?.Count ?? 0;
NativePdbWriter\PdbWriter.cs (3)
405for (int i = nestedNamesReversed.Count - 1; i >= 0; i--) 474while (scopeStack.Count > 0) 493for (int i = scopeStack.Count - 1; i >= 0; i--)
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (1)
44public bool HasStatements => _statements?.Count > 0;
Operations\ControlFlowGraphBuilder.cs (49)
162Debug.Assert(builder._evalStack.Count == 0); 174var builder = ArrayBuilder<BasicBlock>.GetInstance(blockBuilders.Count); 230MarkReachableBlocks(blocks, firstBlockOrdinal: 0, lastBlockOrdinal: blocks.Count - 1, 308while (toVisit.Count != 0); 522for (int i = region.Regions.Count - 1; i >= 0; i--) 550if (region.Regions?.Count == 1) 569for (int i = region.Regions.Count - 1; i >= 0; i--) 687int count = blocks.Count - 1; 760Debug.Assert(tryAndFinally.Regions!.Count == 2); 1130if ((fromPredecessor.Count - lastLeftRegionOnTheWayFromPredecessorToCurrentBlock + 1131fromCurrent.Count - lastLeftRegionOnTheWayFromCurrentToDestination) != 1132(fromPredecessor.Count - lastLeftRegionOnTheWayFromPredecessorToDestination)) 1154else if (builder.Count != 0) 1174while (mismatch < from.Count && mismatch < to.Count && from[mismatch] == to[mismatch]) 1236int stackDepth = _evalStack.Count; 1251Debug.Assert(_evalStack.Count == stackDepth); 1315block.Ordinal = _blocks.Count; 1329Debug.Assert(_evalStack.Count == _startSpillingAt); 1396Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1405Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1686Debug.Assert(_startSpillingAt == _evalStack.Count); 1732int stackDepth = _evalStack.Count; 1815Debug.Assert(_startSpillingAt <= _evalStack.Count); 1832for (int i = _startSpillingAt; i < _evalStack.Count; i++) 1870for (int j = currentFrameIndex + 1; j < _evalStack.Count; j++) 1928_startSpillingAt = _evalStack.Count; 1952Debug.Assert(_evalStack.Count != 0); 1955Debug.Assert(_startSpillingAt <= _evalStack.Count); 1962int stackDepth = _evalStack.Count; 1979Debug.Assert(_startSpillingAt <= _evalStack.Count); 2022int stackSizeBefore = _evalStack.Count; 2029Debug.Assert(stackSizeBefore == _evalStack.Count); 2065startingStackDepth: _evalStack.Count - (instancePushed ? 1 : 0), 2235while (stack.Count != 0); 2783Debug.Assert(_startSpillingAt == _evalStack.Count); 2831else if (stack.Count == 0 && ReferenceEquals(dest, top.dest)) 2844while (stack.Count != 0); 2984Debug.Assert(_startSpillingAt >= _evalStack.Count - 1); 3471Debug.Assert(_currentConditionalAccessTracker.Operations.Count == 0); 3521Debug.Assert(!_currentConditionalAccessTracker.IsDefault && _currentConditionalAccessTracker.Operations.Count > 0); 4010if (resourceQueueOpt == null || resourceQueueOpt.Count == 0) 6411for (int i = 0; i < initializerBuilder.Count; i++) 6776int maxStackDepth = _evalStack.Count - 2; 6852int appendCallsLength = appendCalls.Count; 7013Debug.Assert(_evalStack.Count > _currentInterpolatedStringHandlerCreationContext.MaximumStackDepth); 7016|| targetStackDepth >= _evalStack.Count) 7448if (children.Count != 0 && children.Last().Kind == OperationKind.ObjectOrCollectionInitializer) 7465for (int i = children.Count - 1; i >= 0; i--)
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (16)
53public bool HasRegions => Regions?.Count > 0; 55public bool HasLocalFunctions => LocalFunctions?.Count > 0; 57public bool HasCaptureIds => CaptureIds?.Count > 0; 146Debug.Assert(Regions.Count <= 2); 147Debug.Assert(lastKind == (Regions.Count < 2 ? ControlFlowRegionKind.Filter : ControlFlowRegionKind.Catch)); 151if (Regions.Count == 1) 162Debug.Assert(Regions.Count <= 2); 163if (Regions.Count == 1) 188if (Regions.Count == 1) 210if (Regions.Count == 1) 220int replaceWithCount = replaceWith.Count; 229int originalCount = Regions.Count; 232for (int i = originalCount - 1, j = Regions.Count - 1; i > insertAt; i--, j--) 269Debug.Assert(Regions.Count == 1 && Regions.First().LastBlock == block); 307int localFunctionsBefore = localFunctions.Count; 321var builder = ArrayBuilder<ControlFlowRegion>.GetInstance(Regions.Count);
PEWriter\MetadataWriter.cs (1)
3916consolidatedTypeArguments.Count,
PEWriter\MetadataWriter.PortablePdb.cs (1)
545int lastNonZero = builder.Count - 1;
PEWriter\TypeNameSerializer.cs (1)
290for (int i = namesReversed.Count - 1; i >= 0; i--)
ReferenceManager\CommonReferenceManager.Binding.cs (15)
159Debug.Assert(referenceBindings.Count == allAssemblies.Length); 171var boundInputs = new BoundInputAssembly[referenceBindings.Count]; 172for (int i = 0; i < referenceBindings.Count; i++) 226Debug.Assert(referenceBindings.Count == explicitAssemblies.Length); 253while (referenceBindingsToProcess.Count > 0) 292int index = explicitAssemblyCount - 1 + metadataReferencesBuilder.Count; 318if (implicitAssemblies.Count == 0) 334implicitAssembliesMap.EnsureCapacity(implicitAssemblies.Count); 336for (int i = 0; i < implicitAssemblies.Count; i++) 343for (int bindingsIndex = 0; bindingsIndex < referenceBindings.Count; bindingsIndex++) 397Debug.Assert(result.Count == 0); 435Debug.Assert(result.Count == explicitModules.Length + totalReferencedAssemblyCount); 480var bindingsOfAssemblyBeingBuilt = ArrayBuilder<AssemblyReferenceBinding>.GetInstance(referenceBindingsOfAssemblyBeingBuilt.Length + implicitAssemblies.Count); 486for (int i = 0; i < implicitAssemblies.Count; i++) 1032if (corLibraryCandidates.Count == 1)
ReferenceManager\CommonReferenceManager.Resolution.cs (6)
291-assembliesBuilder.Count - 1, 339-assembliesBuilder.Count - 1, 416int count = (referenceMap[i].Kind == MetadataImageKind.Assembly) ? assembliesBuilder.Count : lazyModulesBuilder?.Count ?? 0; 639referenceMap[referenceIndex] = new ResolvedReference(assemblies.Count, MetadataImageKind.Assembly); 653referenceMap[referenceIndex] = new ResolvedReference(modules.Count, MetadataImageKind.Module);
ReferenceManager\CommonReferenceManager.State.cs (5)
496Debug.Assert(aliasesOfReferencedAssembliesBuilder.Count == assemblyIndex); 622Debug.Assert(bindingResult.Length == aliasesOfReferencedAssembliesBuilder.Count + 1); 633Debug.Assert(assemblyIndicesToProcess.Count == 0); 636while (assemblyIndicesToProcess.Count > 0) 664for (int i = 0; i < aliasesOfReferencedAssembliesBuilder.Count; i++)
ReferenceManager\MergedAliases.cs (2)
69if (aliases.Count == 0 ^ newAliases.IsEmpty) 100int originalCount = builder.Count;
SourceGeneration\AdditionalSourcesCollection.cs (3)
92for (int i = 0; i < _sourcesAdded.Count; i++) 105for (int i = 0; i < _sourcesAdded.Count; i++) 119if (asc._sourcesAdded.Count == 0)
SourceGeneration\GeneratorDriver.cs (1)
303if (constantSourcesBuilder.Count > 0)
SourceGeneration\Nodes\BatchNode.cs (1)
106Debug.Assert(builder.Count == entryCount);
SourceGeneration\Nodes\NodeStateTable.cs (15)
171Debug.Assert(compacted.Count == nonRemovedCount); 266public int Count => _states.Count; 468var previousTableEntryIndex = _states.Count - _insertedCount; 481Debug.Assert(_steps.Count + 1 == _states.Count); 520Debug.Assert(!TrackIncrementalSteps || _states.Count == _steps.Count); 522if (_states.Count == 0) 532Debug.Assert(_requestedTableCapacity == null || _states.Count <= _requestedTableCapacity); 538if (_states.Count == _previous.Count && _states.SequenceEqual(_previous._states, (e1, e2) => e1.Matches(e2, _equalityComparer))) 650Debug.Assert(itemBuilder.Count < this.Count); 751for (int i = 0, n = _items.Count - 1; i < n; i++) 762Debug.Assert(_items.Count >= 1, "Created a builder with no values?"); 764Debug.Assert(_items.Count == _requestedCapacity); 765Debug.Assert(_states == null || _states.Count == _requestedCapacity);
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
222var localAliasCount = localAliases.Count;
SourceGeneration\SyntaxStore.cs (2)
78if (syntaxInputBuilders.Count > 0) 91for (int i = 0; i < syntaxInputBuilders.Count; i++)
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (3)
255Debug.Assert(flagsBuilder.Count == 0); 264if (flagCount < flagsBuilder.Count) 450Debug.Assert(groupBuilder.Count == 0);
src\Dependencies\PooledObjects\ArrayBuilder.cs (28)
41var result = new T[_builder.Count]; 87if (Count == 0) 91else if (_builder.Capacity == Count) 146=> Count == 0; 213=> FindIndex(0, this.Count, match); 216=> FindIndex(startIndex, this.Count - startIndex, match); 233=> FindIndex(0, Count, match, arg); 236=> FindIndex(startIndex, Count - startIndex, match, arg); 313if (this.Count <= 1) 338=> Count == 0 ? default : Last(); 355if (Count == 0) 369if (Count == 0) 374var tmp = ArrayBuilder<U>.GetInstance(Count); 398if (Count == 0) 402else if (_builder.Capacity == Count) 442if (this.Count != 0) 463Debug.Assert(builder.Count == 0); 519if (this.Count == 1) 527if (this.Count == 0) 534var accumulator = new Dictionary<K, ArrayBuilder<T>>(Count, comparer); 535for (var i = 0; i < Count; i++) 580Debug.Assert(start + length <= items.Count); 646Debug.Assert(limit <= Count); 658EnsureCapacity(Count + count); 671for (var i = 0; i < Count; i++) 686if (Count <= 1) 694for (int i = 1; i < Count; i++) 708var result = ArrayBuilder<S>.GetInstance(Count);
src\Dependencies\PooledObjects\ArrayBuilder.Enumerator.cs (1)
34return _index < _builder.Count;
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (3)
269if (result == 0 && usedFieldsAndValues.Count > 0) 272for (int i = usedFieldsAndValues.Count - 1; i >= 0; i--) 274if (i != (usedFieldsAndValues.Count - 1))
SymbolDisplay\SymbolDisplayExtensions.cs (2)
63if (parts.Count == 0) 68if (parts.Count == 1)
Syntax\GreenNode.cs (1)
647while (stack.Count > 0)
Syntax\GreenNodeExtensions.cs (3)
25if (newAnnotations.Count == 0) 64if (newAnnotations.Count == existingAnnotations.Length) 88if (removalAnnotations.Count == 0)
Syntax\LineDirectiveMap.cs (1)
158for (int i = 0; i < entries.Count - 1; ++i)
Syntax\SyntaxNode.cs (1)
461while (stack.Count > 0)
Syntax\SyntaxNode.Iterators.cs (2)
214public bool IsNotEmpty { get { return _discriminatorStack?.Count > 0; } } 309public bool IsNotEmpty { get { return _discriminatorStack?.Count > 0; } }
Text\CompositeText.cs (10)
192if (segments.Count == 0) 196else if (segments.Count == 1) 208if (segments.Count > 1) 214for (int i = 1; i < segments.Count; i++) 248if (segments.Count > MAXIMUM_SEGMENT_COUNT_BEFORE_REDUCTION) 291for (int i = 0; i < segments.Count - 1; i++) 297for (int j = i + 1; j < segments.Count; j++) 316return segments.Count - numberOfSegmentsReduced; 324for (int i = 0; i < segments.Count - 1; i++) 332for (int j = i + 1; j < segments.Count; j++)
Text\SourceText.cs (1)
814if (position == 0 && segments.Count == 0)
Text\TextChangeRangeExtensions.cs (1)
385if (builder.Count > 0)