Implemented interface members:
10 writes to Count
Microsoft.CodeAnalysis (5)
CodeGen\LocalSlotManager.cs (1)
297_addressedLocals.Count = countBefore;
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)
267flagsBuilder.Count = flagCount;
src\Dependencies\Collections\TemporaryArray`1.cs (1)
242_builder.Count--;
Microsoft.CodeAnalysis.CSharp (5)
Binder\Binder_Attributes.cs (1)
381constructorArgumentSourceIndices.Count = lengthAfterRewriting;
Binder\Binder_Invocation.cs (1)
1273analyzedArguments.RefKinds.Count = analyzedArguments.Arguments.Count;
CodeGen\EmitExpression.cs (1)
3044_expressionTemps.Count = exprTempsBefore;
Lowering\LocalRewriter\LocalRewriter.cs (1)
810statements.Count = remaining; // trim any trailing nulls
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2979ownedParams.Count = _arity;
891 references to Count
Microsoft.CodeAnalysis (241)
CodeGen\ILBuilder.cs (6)
274while (reachableBlocks.Count != 0) 1012seqPoints[seqPoints.Count - 1] = seqPoint; 1017if (seqPoints.Count > 0) 1042Debug.Assert(this.SeqPointsOpt.Count == 0); 1255int marker = _allocatedILMarkers.Count; 1273Debug.Assert(ilMarker >= 0 && ilMarker < _allocatedILMarkers.Count, "Wrong builder?");
CodeGen\ItemTokenMap.cs (1)
48token = (uint)_items.Count;
CodeGen\LocalScopeManager.cs (3)
129if (result.Count > 0 && result[result.Count - 1].Length != expectedRootScopeLength) 508while (result.Count <= slotIndex)
CodeGen\LocalSlotManager.cs (4)
238slot: _lazyAllLocals.Count, 268return _addressedLocals.Count; 285if (markAsNotReusable && countBefore < _addressedLocals.Count) 288for (var i = countBefore; i < _addressedLocals.Count; i++)
CodeGen\SequencePointList.cs (2)
49if (seqPointBuilder.Count == 0) 55int totalPoints = seqPointBuilder.Count;
CodeGen\StringTokenMap.cs (1)
48token = (uint)_uniqueValues.Count;
Collections\ArrayBuilderExtensions.cs (1)
18if (builder.Count == 1)
Collections\OrderedSet.cs (1)
51return _list.Count;
Collections\OrderPreservingMultiDictionary.cs (1)
290internal int Count => (_value as ArrayBuilder<V>)?.Count ?? 1;
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 (5)
227if (parts.Count == 0 || parts[0].Length == 0) 243if (parts.Count > 1 && parts[1].Length > 0) 260if (parts.Count > 2) 840int length = parts.Count; 1070for (var i = 0; i < builder.Count; i++)
DiagnosticAnalyzer\AnalyzerDriver.cs (4)
1465while (kind >= actionsByKindBuilder.Count) 1866Debug.Assert(completedAnalyzers.Count < analysisScope.Analyzers.Length); 2643var filteredNodesToAnalyze = ArrayBuilder<SyntaxNode>.GetInstance(nodesToAnalyze.Count); 3002Debug.Assert(operationsToAnalyze.ToImmutableHashSet().Count == operationsToAnalyze.Count);
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
662for (var i = builder.Count - 1; i >= 0; i--)
Emit\EditAndContinue\DeltaMetadataWriter.cs (4)
522if (deletedMethodDefs?.Count > 0) 1038int previousCustomAttributeRowIdsCount = _customAttributeRowIds.Count; 1048if (_customAttributeRowIds.Count > previousCustomAttributeRowIdsCount) 1338Debug.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)
404for (int i = nestedNamesReversed.Count - 1; i >= 0; i--) 473while (scopeStack.Count > 0) 492for (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)
3928consolidatedTypeArguments.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)
292-assembliesBuilder.Count - 1, 340-assembliesBuilder.Count - 1, 417int count = (referenceMap[i].Kind == MetadataImageKind.Assembly) ? assembliesBuilder.Count : lazyModulesBuilder?.Count ?? 0; 640referenceMap[referenceIndex] = new ResolvedReference(assemblies.Count, MetadataImageKind.Assembly); 654referenceMap[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)
172Debug.Assert(compacted.Count == nonRemovedCount); 267public int Count => _states.Count; 469var previousTableEntryIndex = _states.Count - _insertedCount; 482Debug.Assert(_steps.Count + 1 == _states.Count); 521Debug.Assert(!TrackIncrementalSteps || _states.Count == _steps.Count); 523if (_states.Count == 0) 533Debug.Assert(_requestedTableCapacity == null || _states.Count <= _requestedTableCapacity); 539if (_states.Count == _previous.Count && _states.SequenceEqual(_previous._states, (e1, e2) => e1.Matches(e2, _equalityComparer))) 651Debug.Assert(itemBuilder.Count < this.Count); 752for (int i = 0, n = _items.Count - 1; i < n; i++) 763Debug.Assert(_items.Count >= 1, "Created a builder with no values?"); 765Debug.Assert(_items.Count == _requestedCapacity); 766Debug.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)
256Debug.Assert(flagsBuilder.Count == 0); 265if (flagCount < flagsBuilder.Count) 451Debug.Assert(groupBuilder.Count == 0);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
93ThrowIfTrue(_index + values.Count > _values.Length);
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (4)
773if (comparer != null && builder.Count > 1) 900Debug.Assert(builder.Count > 1); 971Debug.Assert(builder.Count == count); 1296var result = (builder.Count == array.Length) ? array : builder.ToImmutable();
src\Dependencies\Collections\TemporaryArray`1.cs (1)
107public readonly int Count => _builder?.Count ?? _count;
src\Dependencies\PooledObjects\ArrayBuilder.cs (38)
43var result = new T[_builder.Count]; 89if (Count == 0) 93else if (_builder.Capacity == Count) 148=> Count == 0; 215=> FindIndex(0, this.Count, match); 218=> FindIndex(startIndex, this.Count - startIndex, match); 235=> FindIndex(0, Count, match, arg); 238=> FindIndex(startIndex, Count - startIndex, match, arg); 334if (this.Count <= 1) 359=> Count == 0 ? default : Last(); 376if (Count == 0) 390if (Count == 0) 395var tmp = ArrayBuilder<U>.GetInstance(Count); 419if (Count == 0) 423else if (_builder.Capacity == Count) 472if (this.Count != 0) 493Debug.Assert(builder.Count == 0); 549if (this.Count == 1) 557if (this.Count == 0) 564var accumulator = new Dictionary<K, ArrayBuilder<T>>(Count, comparer); 565for (var i = 0; i < Count; i++) 610Debug.Assert(start + length <= items.Count); 669Debug.Assert(limit <= Count); 681EnsureCapacity(Count + count); 694for (var i = 0; i < Count; i++) 709if (Count <= 1) 719for (int i = 1; i < Count; i++) 733var result = ArrayBuilder<S>.GetInstance(Count); 805switch (Count) 823var builder = ArrayBuilder<TResult>.GetInstance(Count); 843switch (Count) 861var builder = ArrayBuilder<TResult>.GetInstance(Count); 881switch (Count) 899var builder = ArrayBuilder<TResult>.GetInstance(Count); 902builder.Add(map(item, builder.Count, arg)); 918RemoveAt(Count - 1); 924if (Count > 0) 935=> this[Count - 1];
src\Dependencies\PooledObjects\ArrayBuilder.Enumerator.cs (1)
36return _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)
648while (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)
462while (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)
Microsoft.CodeAnalysis.CSharp (614)
Binder\Binder.CapturedParametersFinder.cs (1)
70if (captured.Count == 0)
Binder\Binder.IdentifierUsedAsValueFinder.cs (1)
277Debug.Assert(members.Count > 0);
Binder\Binder_Constraints.cs (3)
393Debug.Assert(typeParameters.Length == constraintClauses.Count); 435if (constraintTypeBuilder.Count < n) 511if (constraintTypes.Count > 0)
Binder\Binder_Conversions.cs (1)
1576Debug.Assert(methodGroup.Methods.Count > 0);
Binder\Binder_Crefs.cs (3)
361if (sortedSymbolsBuilder.Count > 1) 647if (builder.Count > 1) 1047if (viable.Count > 1)
Binder\Binder_Deconstruct.cs (10)
262if (variables.Count != tupleOrDeconstructedTypes.Length) 264Error(diagnostics, ErrorCode.ERR_DeconstructWrongCardinality, syntax, tupleOrDeconstructedTypes.Length, variables.Count); 270if (variables.Count < 2) 277BoundExpression deconstructInvocation = MakeDeconstructInvocationExpression(variables.Count, 294int count = variables.Count; 351var matchCount = Math.Min(variables.Count, foundTypes.Length); 393int count = variables.Count; 462return $"Nested variables ({NestedVariables.Count})"; 473int leftLength = lhsVariables.Count; 548int count = variables.Count;
Binder\Binder_Expressions.cs (69)
1150Debug.Assert(elementNames.Count == inferredElementNames.Count); 1151var builder = ArrayBuilder<bool>.GetInstance(elementNames.Count); 1152for (int i = 0; i < elementNames.Count; i++) 1189for (int i = 0; i < inferredElementNames.Count; i++) 1492Debug.Assert(!result || lookupResult.Symbols.Count > 0); 1646Debug.Assert(members.Count > 0); 1937Debug.Assert(members.Count > 0); 3115if (!hadError && isDelegateCreation && origRefKind != RefKind.None && result.Arguments.Count == 1) 3350int argCount = result.Arguments.Count; 3371int argCount = result.Arguments.Count; 3443for (int arg = 0; arg < arguments.Count; ++arg) 3477Debug.Assert(analyzedArguments.RefKinds.Count == 0 || analyzedArguments.RefKinds.Count == arguments.Count); 3478Debug.Assert(analyzedArguments.Names.Count == 0 || analyzedArguments.Names.Count == arguments.Count); 3479Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Count); 3560if (arg + 1 == arguments.Count || result.ParameterFromArgument(arg + 1) != paramsIndex) 3593for (int i = 0; i < paramsArgsBuilder.Count; i++) 3612Debug.Assert(collectionArgs.Length == 1 || firstParamsArgument + collectionArgs.Length == arguments.Count); 3628if (analyzedArguments.RefKinds is { Count: > 0 } refKindsBuilder) 3633if (analyzedArguments.Names is { Count: > 0 } namesBuilder) 3737if (result.ArgsToParamsOpt.IsDefault && arguments.Count == parameters.Length) 3757for (int argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 4334knownSizes[dimension - 1] = initializers.Count; 4336else if (knownSizeOpt != initializers.Count) 5039for (int i = 0; i < analyzedArguments.Arguments.Count; i++) 5361else if (analyzedArguments.Arguments.Count == 0) 5366else if (analyzedArguments.Names.Count != 0 || analyzedArguments.RefKinds.Count != 0 || analyzedArguments.Arguments.Count != 1) 5371var end = analyzedArguments.Arguments[analyzedArguments.Arguments.Count - 1].Syntax.Span.End; 5386BoundExpression argument = analyzedArguments.Arguments.Count >= 1 ? BindToNaturalType(analyzedArguments.Arguments[0], diagnostics) : null; 7071if (analyzedArguments.Arguments.Count > 0) 7073diagnostics.Add(ErrorCode.ERR_BadCtorArgCount, typeNode.Location, interfaceType, analyzedArguments.Arguments.Count); 7115if (analyzedArguments.Arguments.Count > 0) 7862Debug.Assert(symbols.Count > 0); 8359Debug.Assert(extensionMethodArguments.Arguments.Count == 0); 8360Debug.Assert(extensionMethodArguments.Names.Count == 0); 8361Debug.Assert(extensionMethodArguments.RefKinds.Count == 0); 8371if (originalArguments?.Names.Count > 0) 8377if (originalArguments?.RefKinds.Count > 0) 8389Debug.Assert(extensionPropertyArguments.Arguments.Count == 0); 8390Debug.Assert(extensionPropertyArguments.Names.Count == 0); 8391Debug.Assert(extensionPropertyArguments.RefKinds.Count == 0); 8427Debug.Assert(members.Count > 0); 8734for (int i = methodGroup.Methods.Count - 1; i >= 0; i--) 8758if (methodGroup.Methods.Count != 0) 8764if (methodGroup.Methods.Count == 0) 9209if (methodOrPropertyGroup.Count > 0) 9247if ((methodOrPropertyGroup.Count > 0) && 9275Debug.Assert(members.Count > 0); 9368if (analyzedArguments.Arguments.Count == 1 && 9449if (analyzedArguments.Names.Count > 0) 9662if (arguments.Names.Count > 0) 9677if (arguments.Arguments.Count != rank) 9684BoundExpression[] convertedArguments = new BoundExpression[arguments.Arguments.Count]; 9686for (int i = 0; i < arguments.Arguments.Count; ++i) 9869if (analyzedArguments.Names.Count > 0) 9884if (arguments.Count != 1) 9908int numArguments = analyzedArguments.Arguments.Count; 10240if (arguments.Arguments.Count != 1) 10289if (arguments.Names.Count > 0) 10839var seenAnyApplicableCandidates = methods.Count != 0; 10896if (methods.Count == 0) 10909Debug.Assert(methods.Count != 0); 11080var methods = ArrayBuilder<MethodSymbol>.GetInstance(capacity: singleLookupResults.Count);
Binder\Binder_InterpolatedString.cs (3)
484Debug.Assert(partsArrayBuilder.Count >= 2); 964if (parameterNamesAndLocationsBuilder.Count > 1) 970Debug.Assert(parameterNamesAndLocationsBuilder.Count == 0 || parameterNamesAndLocationsBuilder[0] == null);
Binder\Binder_Invocation.cs (40)
270for (int i = 0; i < analyzedArguments.Arguments.Count; ++i) 500if (arguments.Names.Count == 0) 511for (int i = 0; i < arguments.Names.Count; i++) 527var builder = ArrayBuilder<BoundExpression>.GetInstance(arguments.Arguments.Count); 529for (int i = 0, n = builder.Count; i < n; i++) 881for (int i = 0; i < arguments.Count; ++i) 1000for (int i = 0, n = overloadResolutionResult.ResultsBuilder.Count; i < n; i++) 1037if (finalCandidates.Count == 0) 1137Debug.Assert(methodGroup.Methods.Count > 0); 1138Debug.Assert(((object)delegateTypeOpt == null) || (methodGroup.Methods.Count == 1)); 1194return CreateBadCall(node, methodGroup.Name, invokedAsExtensionMethod && analyzedArguments.Arguments.Count > 0 && (object)methodGroup.Receiver == (object)analyzedArguments.Arguments[0] ? null : methodGroup.Receiver, 1213if (analyzedArguments.Names is { Count: > 0 }) 1218if (analyzedArguments.RefKinds is { Count: > 0 }) 1271if (analyzedArguments.RefKinds.Count == 0) 1273analyzedArguments.RefKinds.Count = analyzedArguments.Arguments.Count; 1536for (var i = 0; i < argumentsBuilder.Count; i++) 1547Debug.Assert(i + 1 == argumentsBuilder.Count || 1563Debug.Assert(argumentsBuilder.Count >= parameters.Length); // Accounting for arglist cases 1564Debug.Assert(argumentRefKindsBuilder is null || argumentRefKindsBuilder.Count == 0 || argumentRefKindsBuilder.Count == argumentsBuilder.Count); 1565Debug.Assert(namesBuilder is null || namesBuilder.Count == 0 || namesBuilder.Count == argumentsBuilder.Count); 1566Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == argumentsBuilder.Count); 1597var argumentsCount = argumentsBuilder.Count; 1605defaultArguments[argumentsBuilder.Count] = true; 1608if (argumentRefKindsBuilder is { Count: > 0 }) 1614if (namesBuilder?.Count > 0) 1633if (argumentRefKindsBuilder is { Count: > 0 }) 1638if (namesBuilder is { Count: > 0 }) 1644Debug.Assert(argumentsBuilder.Count == parameters.Length); 1645Debug.Assert(argumentRefKindsBuilder is null || argumentRefKindsBuilder.Count == 0 || argumentRefKindsBuilder.Count == parameters.Length); 1646Debug.Assert(namesBuilder is null || namesBuilder.Count == 0 || namesBuilder.Count == parameters.Length); 1647Debug.Assert(argsToParamsBuilder is null || argsToParamsBuilder.Count == parameters.Length); 2055if (parameterListList.Count == MaxParameterListsForErrorRecovery) 2076if (parameterListList.Count == MaxParameterListsForErrorRecovery) 2090int argumentCount = analyzedArguments.Arguments.Count;
Binder\Binder_Lookup.cs (7)
423if (submissionSymbols.Symbols.Count > 0 && submissionSymbols.Symbols.First().Kind != lookingForOverloadsOfKind.Value) 438if (result.Symbols.Count == 0) 645switch (symbols.Count) 668Debug.Assert(symbols.Count >= 2); 672for (int i = 0; i < symbols.Count; i++) 1298var hidingCount = hidingSymbols.Count; 1300var hiddenCount = hiddenSymbols.Count;
Binder\Binder_Operators.cs (8)
439Debug.Assert(analyzedArguments.RefKinds.Count == 0); 890while (syntaxNodes.Count > 0) 1225Debug.Assert(stack.Count > 0 && stack.Peek().Left is BoundUnconvertedInterpolatedString); 1243Debug.Assert(stack.Count == 0); 1909for (var i = 0; i < operators.Count; i++) 3399Debug.Assert(analyzedArguments.RefKinds.Count == 0); 3622methods = ArrayBuilder<MethodSymbol>.GetInstance(lookupResult.Symbols.Count); 3635methods = ArrayBuilder<MethodSymbol>.GetInstance(lookupResult.Symbols.Count);
Binder\Binder_Patterns.cs (4)
1750Debug.Assert(binaryPatternStack.Count > 0); 1800Debug.Assert(candidates.Count >= 2); 1804for (int i = 1, n = candidates.Count; i < n; i++) 1810for (int i = 0, n = candidates.Count; i < n; i++)
Binder\Binder_Query.cs (1)
703x2m[x2m.Count - 1] = x2.Name;
Binder\Binder_Statements.cs (1)
480var symbol = result.Symbols.Count > 0 && result.IsMultiViable ?
Binder\Binder_Symbols.cs (7)
1443Debug.Assert(members.Count > 0); 1998if (symbols.Count > 1) 2005for (int i = 0; i < symbols.Count; i++) 2367Debug.Assert(symbols.Count > 0); 2372for (int i = 0; i < symbols.Count; i++) 2386if ((symbols.Count > 1) || (symbols[0] is NamespaceOrTypeSymbol || symbols[0] is AliasSymbol) || 2528for (int i = 0; i < symbols.Count; i++)
Binder\DecisionDagBuilder.cs (8)
1785&& arrayBuilder.Count < ArrayBuilder<T>.PooledArrayLengthLimitExclusive 1786&& arrayBuilder.Capacity >= arrayBuilder.Count * 2) 1798arrayBuilder.Capacity = arrayBuilder.Count; 1814public int Count => _arrayBuilder.Count; 2399for (int i = remainingTests.Count - 1; i >= 0; i--) 2417var result = remainingTests.Count switch 2479for (int i = remainingTests.Count - 1; i >= 0; i--) 2497var result = remainingTests.Count switch
Binder\ExpressionVariableFinder.cs (1)
334while (operands.Count > 0)
Binder\ForEachLoopBinder.cs (1)
1491Debug.Assert(analyzedArguments.Arguments.Count == 0);
Binder\Imports.cs (1)
137for (int i = nameParts.Count - 1; i >= 0; i--)
Binder\LookupResult.cs (3)
87return _kind == LookupResultKind.Empty && _error == null && _symbolList.Count == 0; 113return (_symbolList.Count == 1) ? _symbolList[0] : null; 151return Kind == LookupResultKind.Viable && _symbolList.Count == 1;
Binder\MethodGroupResolution.cs (2)
47Debug.Assert((methodGroup == null) || (methodGroup.Methods.Count > 0)); 103MethodGroup?.Methods.Count == 1 && // Local functions cannot be overloaded
Binder\PatternExplainer.cs (1)
489return "(" + string.Join(", ", subpatterns) + ")" + (subpatterns.Count == 1 ? " { }" : null);
Binder\RefSafetyAnalysis.cs (1)
1014int n = variables.Count;
Binder\Semantics\AccessCheck.cs (1)
604while (baseInterfaces.Count != 0)
Binder\Semantics\BestTypeInferrer.cs (3)
167hadMultipleCandidates = candidateTypes.Count > 1; 189switch (types.Count) 199for (int i = 0; i < types.Count; i++)
Binder\Semantics\Conversions\ConversionsBase.cs (5)
3171Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 3172Debug.Assert(typeParameters.Count == destinationTypeArguments.Count); 3174for (int paramIndex = 0; paramIndex < typeParameters.Count; ++paramIndex)
Binder\Semantics\Conversions\UserDefinedConversions.cs (1)
90bool excludeExisting = result.Count > 0;
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (2)
115if (u.Count == 0 && haveInterfaces) 234var originalOperatorCount = operators.Count;
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (1)
268if (u.Count == 0 && haveInterfaces)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (17)
33if (result.Results.Count > 0) 45Debug.Assert(result.Results.Count == 0); 69Debug.Assert(result.Results.Count == 0); 131Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 204Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 227Debug.Assert(candidates.Count == 0); 732Debug.Assert(operators.Count == 1); 830int initialCount = result.Count; 875Debug.Assert(results.Count == 0); 955Debug.Assert(operators.Count == 0); 967if (operators.Count != 0) 969for (int i = operators2.Count - 1; i >= 0; i--) 1014for (int i = operators.Count - 1; i >= 0; i--) 1122for (int index = 0; index < candidates.Count; ++index) 1133for (int i = 1; i < candidates.Count; ++i) 1168for (int index = 0; index < candidates.Count; index++) 1512for (int i = operators.Count - 1; i >= 0; i--)
Binder\Semantics\Operators\BinaryOperatorOverloadResolutionResult.cs (2)
79if (Results.Count == 0) 110for (int i = 0, n = this.Results.Count; i < n; i++)
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (10)
34Debug.Assert(result.Results.Count == 0); 38if (result.Results.Count > 0) 161for (int i = operators.Count - 1; i >= 0; i--) 326for (int index = 0; index < candidates.Count; ++index) 337for (int i = 1; i < candidates.Count; ++i) 371for (int index = 0; index < candidates.Count; index++) 751Debug.Assert(operators.Count == 0); 763if (operators.Count != 0) 765for (int i = operators2.Count - 1; i >= 0; i--) 824for (int i = operators.Count - 1; i >= 0; i--)
Binder\Semantics\Operators\UnaryOperatorOverloadResolutionResult.cs (2)
79if (Results.Count == 0) 110for (int i = 0, n = this.Results.Count; i < n; i++)
Binder\Semantics\OverloadResolution\AnalyzedArguments.cs (7)
49if (Names.Count == 0) 60int count = this.Names.Count; 67var builder = ArrayBuilder<string?>.GetInstance(this.Names.Count); 68for (int i = 0; i < this.Names.Count; ++i) 78return RefKinds.Count > 0 ? RefKinds[i] : Microsoft.CodeAnalysis.RefKind.None; 95bool hasRefKinds = RefKinds.Count > 0; 96for (int i = 0; i < Arguments.Count; i++)
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (1)
453for (int i = 0; i < builder.Count; i++)
Binder\Semantics\OverloadResolution\MethodGroup.cs (3)
104return this.Methods.Count > 0 ? this.Methods[0].Name : null; 130Debug.Assert(this.Methods.Count == 0); 131Debug.Assert(this.TypeArguments.Count == 0);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (14)
1952Debug.Assert(sourceTypeArguments.Count == targetTypeArguments.Count); 1954for (int arg = 0; arg < sourceTypeArguments.Count; ++arg) 2396Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 2397Debug.Assert(typeParameters.Count == targetTypeArguments.Count); 2399for (int arg = 0; arg < sourceTypeArguments.Count; ++arg) 2746Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 2747Debug.Assert(typeParameters.Count == targetTypeArguments.Count); 2749for (int arg = 0; arg < sourceTypeArguments.Count; ++arg) 3363builder.EnsureCapacity(builder.Count + candidates.Count);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (59)
230if (methods.Count == 0) 249unreducedMethods = ArrayBuilder<MethodSymbol>.GetInstance(methods.Count); 287if (applicableMethods.Length != methods.Count) 295var applicableMethods = ArrayBuilder<MethodSymbol>.GetInstance(methods.Count); 304if (applicableMethods.Count != methods.Count) 371if (checkOverriddenOrHidden && members.Count > 50) // TODO: fine-tune this value 377for (int i = 0; i < members.Count; i++) 499for (int f = 0; f < results.Count; ++f) 522for (int f = 0; f < results.Count; ++f) 562Debug.Assert(funcPtrBuilder.Count == 1); 610for (int f = 0; f < results.Count; ++f) 631for (int f = 0; f < results.Count; f++) 647for (int f = 0; f < results.Count; ++f) 683for (int i = 0; i < results.Count; i++) 860for (int f = 0; f < results.Count; ++f) 903for (int i = 0; i < members.Count; i++) 985arguments.Arguments.Count, 1029arguments.Arguments.Count, 1103if (members.Count < 2) 1171Debug.Assert(typeArguments.Count == 0 || typeArguments.Count == member.GetMemberArityIncludingExtension()); 1425for (var i = 0; i < members.Count; ++i) 1473for (int f = 0; f < results.Count; ++f) 1585for (int f = 0; f < results.Count; ++f) 1622for (int f = 0; f < results.Count; ++f) 1697for (int f = 0; f < results.Count; f++) 1718for (int f = 0; f < results.Count; f++) 1793for (int index = 0; index < results.Count; index++) 1863if (results.Count < 2) 1975for (int index = 0; index < results.Count; index++) 1990var worse = ArrayBuilder<int>.GetInstance(results.Count, unknown); 1995for (int c1Idx = 0; c1Idx < results.Count; c1Idx++) 2005for (int c2Idx = 0; c2Idx < results.Count; c2Idx++) 2036for (int i = 0; i < worse.Count; ++i) 2047for (int i = 0; i < worse.Count; ++i) 2069for (int i = 0; i < worse.Count; ++i) 2164for (i = 0; i < arguments.Count; ++i) 2172Debug.Assert(i == arguments.Count - 1); 2306for (i = i + 1; i < arguments.Count; ++i) 2314Debug.Assert(i == arguments.Count - 1); 2375if (m1ParametersUsedIncludingExpansionAndOptional == arguments.Count) 2379else if (m2ParametersUsedIncludingExpansionAndOptional == arguments.Count) 2442bool hasAll1 = m1.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm || m1ParameterCount == arguments.Count; 2443bool hasAll2 = m2.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm || m2ParameterCount == arguments.Count; 2468for (i = 0; i < arguments.Count; ++i) 2474Debug.Assert(i == arguments.Count - 1); 2537for (i = 0; i < arguments.Count; ++i) 2549if (i == arguments.Count) 2616for (int i = 0; i < arguments.Count; ++i) 2704if (arguments.Count < declaredParameterCount) 2721parametersUsedIncludingExpansionAndOptional = arguments.Count; 4060firstParamsElementIndex = types.Count; 4131arguments.Arguments.Count, 4200arguments.Arguments.Count, 4257if (typeArgumentsBuilder.Count == 0 && arguments.HasDynamicArgument && !inferWithDynamic) 4273if (typeArgumentsBuilder.Count > 0) 4513if (arguments.Arguments.Count < paramCount) 4518paramCount = arguments.Arguments.Count;
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (7)
78if (!expanded && arguments.Names.Count == 0) 85int argumentCount = arguments.Arguments.Count; 213int length = arguments.Arguments.Count; 269isNamedArgument = arguments.Names.Count > argumentPosition && arguments.Names[argumentPosition] != null; 355Debug.Assert(arguments.Names.Count == 0); 359int argumentCount = arguments.Arguments.Count; 501for (int i = 0; i < arguments.Names.Count; ++i)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (6)
769Debug.Assert(arguments.Arguments.Count > 0); 797Debug.Assert(arguments.Names.Count > badArg); 817Debug.Assert(arguments.Names.Count > badArg); 857Debug.Assert(arguments.Names.Count > badArg); 948int argCount = arguments.Arguments.Count; 1551if (ResultsBuilder.Count == 0)
Binder\WithUsingNamespacesAndTypesBinder.cs (8)
81Debug.Assert(methods.Count == 0); 96var count = methods.Count; 100if (methods.Count != count) 111var count = methods.Count; 115if (methods.Count != count) 134Debug.Assert(extensions.Count == 0); 143var count = extensions.Count; 147if (extensions.Count != count)
BoundTree\BoundNodeExtensions.cs (1)
150Debug.Assert(stack.Count == 0);
BoundTree\BoundTreeRewriter.cs (3)
284while (stack.Count > 0); 332while (stack.Count > 0); 377while (stack.Count > 0);
BoundTree\NullabilityRewriter.cs (2)
87Debug.Assert(stack.Count > 0); 131while (stack.Count > 0);
BoundTree\UnboundLambda.cs (3)
229int numExpressions = types.Count; 253int n = returns.Count; 984returnType = (forErrorRecovery && returnTypes.Count == 0)
CodeGen\CodeGenerator.cs (5)
243int n = yieldPoints.Count; 302Debug.Assert(!(_expressionTemps?.Count > 0), "leaking expression temps?"); 428for (int i = sequencePoints.Count - 1; i >= 0; i--) 526if (_expressionTemps?.Count > 0) 529for (int i = _expressionTemps.Count - 1; i >= 0; i--)
CodeGen\EmitArrayInitializer.cs (1)
195Debug.Assert(indices.Count == arrayType.Rank - 1);
CodeGen\EmitExpression.cs (3)
1717while (calls.Count != 0) 3017int exprTempsBefore = _expressionTemps?.Count ?? 0; 3029var exprTempsAfter = _expressionTemps?.Count ?? 0;
CodeGen\EmitOperators.cs (1)
151while (stack.Count > 0);
CodeGen\EmitStatement.cs (6)
151Debug.Assert(_asyncYieldPoints.Count == _asyncResumePoints.Count); 159Debug.Assert(_asyncYieldPoints.Count == _asyncResumePoints.Count); 470else if (stack.Count == 0 && ReferenceEquals(destBox, top.destBox)) 484while (stack.Count != 0);
CodeGen\Optimizer.cs (9)
131var defs = ArrayBuilder<LocalDefUseSpan>.GetInstance(dummies.Count); 144var dummyCnt = defs.Count; 172var cnt = defs.Count; 547return _evalStack.Count; 562SetStackDepth(_evalStack.Count - 1); 1538if (stack.Count == 0) 1909if (defs.Count == 0) 1933var last = defs.Count - 1; 2113if (stack.Count == 0)
Compilation\CSharpCompilation.cs (11)
1330assemblies.EnsureCapacity(assemblies.Count + length); 2052if (viableEntryPoints.Count == 0) 2064else if (LanguageVersion >= MessageID.IDS_FeatureAsyncMain.RequiredVersion() && taskEntryPoints.Count > 0) 2086if (viableEntryPoints.Count == 0) 2111if (viableEntryPoints.Count == 0) 2134if (viableEntryPoints.Count > 1) 4972spine.RemoveAt(spine.Count - 1); 4995spine.RemoveAt(spine.Count - 1); 5000if (spine.Count == 0) 5005var symbol = GetCachedSymbol(spine[spine.Count - 1]); 5012for (var i = 1; i < spine.Count; i++)
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
77if (boundUsings.Count == 0 && diagnostics is null)
Compilation\CSharpSemanticModel.cs (6)
4108if (symbols.Count == 0) 4547if (symbols.Count == 0) 4737Debug.Assert(members.Count > 0); 4744Debug.Assert((members.Count == 0) == (resultKind == LookupResultKind.Empty)); 4745Debug.Assert(members.Count == filteredMembers.Count);
Compilation\MemberSemanticModel.NodeMapBuilder.cs (1)
216while (stack.Count > 0)
Compiler\DocumentationCommentCompiler.cs (1)
467Debug.Assert(paramTags.Count > 0);
Compiler\MethodBodySynthesizer.Lowered.cs (1)
404Debug.Assert(fields.Count > 0);
Compiler\MethodCompiler.cs (4)
1784while (index >= awaiters.Count) 1795while (index >= hoistedVariables.Count) 1809while (awaiters.Count < previousAwaiterCount) 1815while (hoistedVariables.Count < previousAwaiterSlotCount)
Emitter\Model\MostCommonNullableValueBuilder.cs (1)
88int n = builder.Count;
Emitter\Model\PEModuleBuilder.cs (10)
224while (namespacesAndTopLevelTypesToProcess.Count > 0) 252Debug.Assert(debugDocuments.Count == 0); 254Debug.Assert(typesToProcess.Count == 0); 279if (debugDocuments.Count > 0) 309while (typesToProcess.Count > 0) 592index = builder.Count; 767Debug.Assert(stack.Count == 0); 770while (stack.Count > 0) 785int index = builder.Count; 1656if (builder.Count == 1 && builder[0])
FlowAnalysis\AbstractFlowPass.cs (5)
2460Debug.Assert(stack.Count > 0); 2514if (stack.Count == 0) 2626if (stack.Count == 0) 2644if (stack.Count == 0) 2726Debug.Assert(parts.Count >= 2);
FlowAnalysis\AbstractFlowPass.PendingBranchesCollection.cs (1)
65if (_unlabeledBranches.Count == 0)
FlowAnalysis\AlwaysAssignedWalker.cs (1)
57if (i >= variableBySlot.Count)
FlowAnalysis\ControlFlowPass.cs (1)
401var initialUsingCount = _usingDeclarations.Count;
FlowAnalysis\DefiniteAssignment.cs (4)
277int slot = variableBySlot.Count; 1045int n = variableBySlot.Count; 1213_alreadyReported.EnsureCapacity(variableBySlot.Count); 1884var result = new LocalState(BitVector.AllSet(variableBySlot.Count));
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (2)
32new LocalState(BitVector.AllSet(variableBySlot.Count), normalizeToBottom: true), 128int n = variableBySlot.Count;
FlowAnalysis\DefinitelyAssignedWalker.cs (1)
93if (slot < variableBySlot.Count &&
FlowAnalysis\NullableWalker.cs (15)
3249var unvisitedLocalFuncs = localFuncs.Count; 3260for (int i = 0; unvisitedLocalFuncs != 0 && i < localFuncs.Count; i++) 3285for (int i = 0; i < localFuncs.Count; i++) 4792int n = expressions.Count; 4944int n = returns.Count; 5156if (stack.Count == 0) 5176if (stack.Count == 0) 5563if (slotBuilder.Count != 0) 7488Debug.Assert(argumentsBuilder.Count == arguments.Length + elements.Length - 1); 9793if (previousArgumentConversionResults.Count > placeholder.ArgumentIndex) 9811if (placeholder.ArgumentIndex < previousArgumentConversionResults.Count && placeholder.ArgumentIndex is >= 0 or BoundInterpolatedStringArgumentPlaceholder.ExtensionReceiver) 10696int n = variables.Count; 10780int n = variables.Count; 12088Debug.Assert(stack.Count > 0); 12123if (stack.Count == 0)
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
172Debug.Assert(_symbolToSlot.Count == _walkerStates.Count);
FlowAnalysis\NullableWalker.Variables.cs (3)
166Debug.Assert(_variableBySlot.Count == 1); 320internal int NextAvailableIndex => _variableBySlot.Count; 333for (index++; index < variableBySlot.Count; index++)
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (2)
148if (function.CapturedEnvironments.Count > 0) 555closureId = new DebugId(closureDebugInfo.Count, _compilationState.ModuleBuilderOpt.CurrentGenerationOrdinal);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
407Debug.Assert(_labelsInScope.Count == 1);
Lowering\ClosureConversion\ClosureConversion.cs (7)
439else if ((nestedFunction.CapturedEnvironments.Count == 0 && 920var refkindsBuilder = ArrayBuilder<RefKind>.GetInstance(argumentsBuilder.Count); 1175if (prologue.Count > 0) 1247if (prologue.Count > 0) 1257else if (prologue.Count > 0) 1260var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(prologue.Count); 1500lambdaId = new DebugId(_lambdaDebugInfoBuilder.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
207if (fileIndices.Count == 1) 506int spansIndex = _spansBuilder.Count;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
107if (_lazyPreviousContextVariables is { Count: > 0 })
Lowering\LocalRewriter\LocalRewriter.cs (4)
725if (statement is null || previousLocals is { } || _additionalLocals!.Count == 0) 764for (int i = 0; i < statements.Count; i++) 780if (optimizedInitializers == statements.Count) 790for (int i = 0; i < statements.Count; i++)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (2)
1088Debug.Assert(whenNodes.Count > 1); 1141&& whenExpressionInfo.WhenNodes.Count > 1;
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
147Debug.Assert(stack.Count >= 1); 155while (stack.Count > 0) 160applyParentUnaryOperator: (stack.Count == 0) ? applyParentUnaryOperator : null);
Lowering\LocalRewriter\LocalRewriter_Call.cs (9)
173var netArity = typeArgumentsBuilder.Count; 769Debug.Assert(saveTempsOpt is object || tempsOpt?.Count is null or > 0); 1323Debug.Assert(refKinds.Count == arguments.Length); 1324Debug.Assert(storesToTemps.Count == 0); 1472if (storesToTemps.Count > 0) 1500int tempsRemainedInUse = tempStores.Count; 1538Debug.Assert(firstUnclaimedStore == tempStores.Count, "not all side-effects were claimed"); 1551for (int i = firstUnclaimedStore; i < tempStores.Count; i++) 1620Debug.Assert(argsRefKindsBuilder.Count == parameters.Length);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
1275Debug.Assert(rewrittenExpressions.Count >= numberIncludingLastSpread);
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (2)
166BoundExpression result = (temps.Count == 0 && stores.Count == 0) ?
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
151length = builder.Count; 158ImmutableArray.Create<BoundExpression>(_factory.Literal(builder.Count)), 174while (stack.Count != 0)
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (5)
224Debug.Assert(leftTargets.Count == rightParts.Length && leftTargets.Count == deconstructConversionInfo.Length); 226var builder = isUsed ? ArrayBuilder<BoundExpression>.GetInstance(leftTargets.Count) : null; 227for (int i = 0; i < leftTargets.Count; i++) 504if (init.Count == 0)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
53Debug.Assert(statementBuilder.Count == numFixedLocals + 1 + 1);
Lowering\LocalRewriter\LocalRewriter_FunctionPointerInvocation.cs (1)
54if (temps.Count == 0)
Lowering\LocalRewriter\LocalRewriter_IfStatement.cs (1)
43stack.Push((node, afterif, builder.Count));
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (2)
182if (temps.Count == 0) 271if (sideEffectsBuilder.Count != 0)
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (5)
124if (_statements.Count != 0) 179if (_sideEffectBuilder.Count != 0) 302if (_sideEffectBuilder.Count > 0 || _conjunctBuilder.Count == 0) 307Debug.Assert(_sideEffectBuilder.Count == 0);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (2)
62return (temps.Count == 0 && stores.Count == 0) ?
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (2)
275int dynamicSiteCount = dynamicSiteInitializers?.Count ?? 0; 276var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(1 + dynamicSiteCount + loweredInitializers.Count);
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
108if (result.Count == 0)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (8)
132switch (concatKind, visitedArguments.Count) 145var concatMember = visitedArguments.Count switch 172concatMember = visitedArguments.Count switch 178_ => throw ExceptionUtilities.UnexpectedValue(visitedArguments.Count), 181for (int i = 0; i < visitedArguments.Count; i++) 320if (finalArguments.Count > 0 && finalArguments[^1].ConstantValueOpt is { IsString: true } or { IsChar: true }) 471for (int i = 0; i < args.Count; i++) 549Debug.Assert(stack.Count > 0);
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
124else if (appendShouldProceedLocal is not null && resultExpressions.Count > 0)
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (4)
55underlyingTupleTypeChain.Count * (NamedTypeSymbol.ValueTupleRestPosition - 1), 71if (underlyingTupleTypeChain.Count > 0) 89(underlyingTupleTypeChain.Count - 1) * (NamedTypeSymbol.ValueTupleRestPosition - 1), 96while (underlyingTupleTypeChain.Count > 0);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
153for (int i = 0; i < variableBySlot.Count; i++)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (6)
380if (variableCleanup.Count != 0) 390if (hoistedLocalsWithDebugScopes.Count != 0) 465if (_lazyAvailableReusableHoistedFields != null && _lazyAvailableReusableHoistedFields.TryGetValue(type, out fields) && fields.Count > 0) 570if (sideEffects.Count == 0) 781if (hoistedLocalsWithDebugScopes.Count != 0) 785if (newLocalsBuilder.Count == 0)
Lowering\SyntheticBoundNodeFactory.cs (1)
1026if (locals.IsDefaultOrEmpty && builder.Count == 0)
Operations\CSharpOperationFactory.cs (2)
1464Debug.Assert(stack.Count > 0); 1479Debug.Assert(left is not null && stack.Count == 0);
Parser\LanguageParser.cs (2)
11360while (stack.Count > 0) 14281while (stack.Count > 0)
Parser\LanguageParser_InterpolatedString.cs (2)
102for (var i = 0; i < interpolations.Count; i++) 125indentationWhitespace, content, isFirst: interpolations.Count == 0, isLast: true,
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
800(!Format.CompilerInternalOptions.IncludesOption(SymbolDisplayCompilerInternalOptions.ExcludeParameterNameIfStandalone) && Builder.Count == 0));
Symbols\AbstractTypeMap.cs (2)
166Debug.Assert(builder.Count == customModifiers.Length); 374map.Add(substituted.Type, result.Count);
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (3)
556if (anonymousTypes.Count > 0 && !ReportMissingOrErroneousSymbols(diagnostics)) 584if (anonymousDelegatesWithIndexedNames.Count > 0 || anonymousDelegates.Count > 0)
Symbols\AssemblySymbol.cs (1)
802int i = nestedTypes.Count - 1;
Symbols\Compilation_UsedAssemblies.cs (1)
156while (stack.Count != 0)
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (1)
137Debug.Assert(parameters.Count == ParameterCount);
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
133for (int i = 0; i < allTypeArguments.Count; i++)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (7)
1242count += eventFields.Count; 1261Debug.Assert(result.Count == count); 1598int membersCount = members.Count; 1628int originalCount = members.Count; 1631membersCount += members.Count; // account for added tuple error fields 2366if (symbols.Count == 0) 2980for (int i = 0; i < ownedParams.Count; i++)
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
199if (symbolsBuilder.Count == 0)
Symbols\NamedTypeSymbol.cs (2)
950for (int i = 0; i < allTypeArguments.Count; i++) 983for (int i = 0; i < allTypeArguments.Count; i++)
Symbols\ReducedExtensionMethodSymbol.cs (1)
214if (useSiteDiagnosticsBuilder != null && useSiteDiagnosticsBuilder.Count > 0)
Symbols\ReferenceManager.cs (2)
598if (linkedReferencedAssembliesBuilder.Count > 0) 1128Debug.Assert(result.Count == builderSize);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (9)
524startOfNonInterfaceArguments = oldArguments.Count; 534var newArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(oldArguments.Count); 565ArrayBuilder<TypeParameterSymbol> newParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(newArguments.Count); 578Debug.Assert(newParameters.Count == newArguments.Count); 601for (int i = startOfNonInterfaceArguments; i < oldArguments.Count; i++) 614for (int i = startOfNonInterfaceArguments; i < oldArguments.Count; i++) 627for (int i = startOfNonInterfaceArguments; i < newArguments.Count; i++) 741Debug.Assert(newModifiers == null || newModifiers.Count == oldModifiers.Length);
Symbols\Source\ConstantEvaluationHelpers.cs (4)
57Debug.Assert(order.Count == 0); 108while (pending.Count > 0) 183if (set.Count > 0) 302while (stack.Count > 0)
Symbols\Source\CustomModifierUtils.cs (1)
103int length = flagsBuilder.Count;
Symbols\Source\SourceAssemblySymbol.cs (2)
139moduleBuilder.Add(new PEModuleSymbol(this, netModule, importOptions, moduleBuilder.Count)); 1083for (int i = 0; i < topLevelTypesFromModules.Count - 1; i++)
Symbols\Source\SourceMemberContainerSymbol.cs (21)
1378return symbols.Count > 0 ? 3389Debug.Assert(InstanceInitializersForPositionalMembers.Count != 0); 3426Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.SyntaxTree == declaredInitializers[0].Syntax.SyntaxTree); 3427Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.Span.Start < declaredInitializers[0].Syntax.Span.Start); 3436Debug.Assert(groupsBuilder.Count == groupCount); 3446Debug.Assert(groupsBuilder.Count == groupCount + 1); 3502if (initializers.Count == 0) 3508var builder = ArrayBuilder<ImmutableArray<FieldOrPropertyInitializer>>.GetInstance(initializers.Count); 4384for (int i = 0; i < symbols.Count; i++) 4592else if (initializers.Count != 0) 4948members.Add(new SynthesizedRecordDeconstruct(this, ctor, positionalMembers, memberOffset: members.Count)); 4996var copyCtor = new SynthesizedRecordCopyCtor(this, memberOffset: members.Count); 5022members.Add(new SynthesizedRecordClone(this, memberOffset: members.Count)); 5049printMembersMethod = new SynthesizedRecordPrintMembers(this, userDefinedMembers, memberOffset: members.Count); 5123memberOffset: members.Count); 5256members.Add(new SynthesizedRecordObjEquals(this, thisEquals, memberOffset: members.Count)); 5279getHashCode = new SynthesizedRecordGetHashCode(this, equalityContract, memberOffset: members.Count); 5378thisEquals = new SynthesizedRecordEquals(this, equalityContract, memberOffset: members.Count); 5420members.Add(new SynthesizedRecordBaseEquals(this, memberOffset: members.Count)); 5426members.Add(new SynthesizedRecordEqualityOperator(this, memberOffset: members.Count, diagnostics)); 5427members.Add(new SynthesizedRecordInequalityOperator(this, memberOffset: members.Count, diagnostics));
Symbols\Source\SourceMethodSymbolWithAttributes.cs (4)
1118if (namespaceSegments.Length > thisNamespaceNames.Count) 1136if (namespaceNames.Count == 0) 1318if (namespaceSegments.Length > thisNamespaceNames.Count) 1336if (namespaceNames.Count == 0)
Symbols\Source\SourceModuleSymbol.cs (1)
382while (toVisit.Count > 0)
Symbols\Source\SourceNamedTypeSymbol.cs (1)
536Debug.Assert(originalConstraintTypes.Length == mergedConstraintTypes.Count);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
622if (this.SpecialType == SpecialType.System_Object && ((object)localBase != null || localInterfaces.Count != 0))
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (4)
171for (int i = 0; i < typeConstraintStrings.Count; i++) 277if (typeArguments.Count > 0) 280for (int i = 0; i < typeArguments.Count; i++) 838for (int i = 0; i < attributesBuilder.Count; i++)
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
323if (mergedNamespacesOrTypes.Count == 0)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
1174for (int i = 0; i < result.Count; i++)
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
791parameters.Add(new SynthesizedPropertyAccessorValueParameterSymbol(this, parameters.Count));
Symbols\SubstitutedTypeParameterSymbol.cs (2)
107for (int i = constraintTypes.Count - 1; i >= 0; i--) 122if (constraintTypes.Count == 0)
Symbols\Symbol_Attributes.cs (1)
484if (builder.Count != 0)
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (1)
147if (fields.Count > 0 && !foundBadField)
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
65(Method: this, ParameterCount: parameterDescriptions.Count));
Symbols\Tuples\TupleTypeSymbol.cs (1)
730for (int i = 0; i < elementsMatchedByFields.Count; i++)
Symbols\TypeSymbol.cs (5)
1296for (int i = 0; i < implementations.Count; i++) 1312Debug.Assert(implementations.Count == 1); 1330if (implementations.Count != 0) 1334for (int i = implementations.Count - 1; i >= 0; i--) 1353switch (implementations.Count)
Symbols\TypeSymbolExtensions.cs (1)
1974for (int i = 0; i < typeArgumentsBuilder.Count; i++)
Syntax\CSharpPragmaWarningStateMap.cs (2)
82var entries = new WarningStateMapEntry[directiveList.Count + 1]; 94while (index < directiveList.Count)
Syntax\SyntaxExtensions.cs (1)
407while (stack.Count > 0)
Syntax\SyntaxFacts.cs (1)
580while (stack.Count > 0)
Syntax\SyntaxNormalizer.cs (8)
177for (int i = _indentations.Count; i <= count; i++) 1053(currentTriviaList.Count > 0 && NeedsSeparatorBetween(currentTriviaList.Last())) || 1054(currentTriviaList.Count == 0 && isTrailing); 1057|| (currentTriviaList.Count > 0 && NeedsLineBreakBetween(currentTriviaList.Last(), trivia, isTrailing)); 1097&& (currentTriviaList.Count == 0 || !EndsInLineBreak(currentTriviaList.Last()))) 1107if (currentTriviaList.Count > 0 1132if (currentTriviaList.Count == 0) 1136else if (currentTriviaList.Count == 1)
Utilities\ValueSetFactory.NumericValueSet.cs (2)
214Debug.Assert(builder.Count == 0 || tc.Related(LessThanOrEqual, builder.Last().first, first)); 215if (builder.Count > 0 && (tc.Related(Equal, tc.MinValue, first) || tc.Related(GreaterThanOrEqual, builder.Last().last, tc.Prev(first))))
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Diagnostics\CompilationEventTests.cs (1)
58if (unexpected || expected.Count != 0 || expectedEvents.Length != actual.Count)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1832for (int i = 0; i < builder.Count; i++)
Semantics\PatternMatchingTests3.cs (2)
4977for (int i = 0; i < cases.Count; i++) 4979int o = random.Next(i, cases.Count);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Retargeting\RetargetingTests.cs (1)
60for (int i = 0; i < sourceMethods.Count; i++)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (9)
DynamicFlagsCustomTypeInfo.cs (1)
19int numFlags = dynamicFlags.Count - startIndex;
ExpressionCompiler.cs (1)
72Debug.Assert((builder.Count == 0) == (assembly.Count == 0));
InstructionDecoder.cs (1)
75var includeArgumentValues = argumentValues != null && parameters.Length == argumentValues.Count;
MetadataUtilities.cs (5)
271Debug.Assert(modules.Count == identities.Count); 277int n = identities.Count; 310Debug.Assert(referencedIndices.Count <= modules.Count); 311Debug.Assert(referencedIndices.Count <= referencedModules.Count);
PDB\MethodDebugInfo.Portable.cs (1)
300Debug.Assert(importGroupBuilder.Count == 0);
Microsoft.CodeAnalysis.Scripting (4)
Hosting\ObjectFormatter\CommonTypeNameFormatter.cs (1)
260for (int i = nestedTypes.Count - 1; i >= 0; i--)
Script.cs (2)
433var executors = ArrayBuilder<Func<object[], Task>>.GetInstance(scriptsReversed.Count); 437for (int i = scriptsReversed.Count - 1; i >= 0; i--)
Utilities\ParameterValidationHelpers.cs (1)
61throw new ArgumentNullException($"{parameterName}[{builder.Count}]");
Microsoft.CodeAnalysis.Test.Utilities (10)
Compilation\ControlFlowGraphVerifier.cs (3)
471if (block.ConditionalSuccessor != null && block.ConditionalSuccessor.LeavingRegions.Length > regions.Count) 477if (block.FallThroughSuccessor.LeavingRegions.Length > regions.Count) 483if (regions.Count > 0)
Compilation\TestOperationVisitor.cs (1)
74Assert.Equal(count, builder?.Count ?? 0);
CompilationVerifier.cs (1)
690for (int i = 0; i < expected.Count; i++)
Diagnostics\DiagnosticDescription.cs (1)
626int n = lines.Count;
Diagnostics\DiagnosticExtensions.cs (1)
96if (unmatchedActualDescription.Count > 0 || unmatchedExpected.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (3)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 102for (index = 0; index < unreachableBlocksToVisit.Count; index++) 197while (toVisit.Count != 0 || unreachableBlocksToVisit.Count != 0);
Microsoft.CodeAnalysis.UnitTests (4)
Analyzers\AnalyzerConfigTests.cs (2)
1662Assert.Equal(2, configs.Count); 1684Assert.Equal(2, configs.Count);
Text\TextChangeTests.cs (2)
1009if (oldChangesBuilder.Count == 5) break; 1028if (newChangesBuilder.Count == 5) break;
Roslyn.Test.PdbUtilities (4)
Reader\MethodDebugInfoBytes.cs (4)
79if ((_bytesBuilder.Count % 4) != 0) 84Assert.Equal(0, _bytesBuilder.Count % 4); 111Assert.Equal(0, _bytesBuilder.Count % 4); 124Assert.Equal(0, _bytesBuilder.Count % 4);