27670 references to Length
AnalyzerRunner (4)
CodeRefactoringRunner.cs (2)
105if (projectChanges.Length != 1 || projectChanges[0].ProjectId != document.Project.Id) 111if (documentChanges.Length != 1 || documentChanges[0] != document.Id)
Options.cs (2)
138while (i < args.Length) 141string ReadValue() => (i < args.Length) ? args[i++] : throw new InvalidDataException($"Missing value for option {arg}");
ApplicationModelWebSite (1)
Conventions\MultipleAreasControllerConvention.cs (1)
18for (var i = 1; i < areaNames?.Length; i++)
Aspire.Azure.Security.KeyVault.Tests (2)
AspireKeyVaultExtensionsTests.cs (1)
157response.AddHeader(new HttpHeader("Content-Length", buffer.Length.ToString(CultureInfo.InvariantCulture)));
MockTransport.cs (1)
158ContentStream = new MemoryStream(content, 0, content.Length, false, true);
Aspire.Components.Common.Tests (1)
RequiresToolsAttribute.cs (1)
14if (executablesOnPath.Length == 0)
Aspire.Dashboard (29)
Components\Controls\Chart\ChartBase.cs (7)
248currentBucketCounts = new ulong[histogramValue.Values.Length]; 250else if (currentBucketCounts.Length != histogramValue.Values.Length) 255for (var valuesIndex = 0; valuesIndex < histogramValue.Values.Length; valuesIndex++) 337for (var i = 0; i < histogramValue.Values.Length; i++) 360for (var i = 0; i < explicitBounds.Length; i++) 371return explicitBounds[explicitBounds.Length - 1];
Configuration\DashboardOptions.cs (1)
188var addresses = new List<BindingAddress>(parts.Length);
ConsoleLogs\AnsiParser.cs (2)
159for (var i = 0; i < parameters.Length; i++) 164if (parameter is XtermForegroundSequenceCode or XtermBackgroundSequenceCode && i + 2 < parameters.Length)
Extensions\CollectionExtensions.cs (2)
10if (array.Length != other.Length)
Extensions\TelemetryFilterFormatter.cs (1)
37if (parts.Length != 3)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
46if (parts.Length == 2)
Otlp\Model\OtlpApplication.cs (4)
219if (x.Length != y.Length) 224for (var i = 0; i < x.Length; i++) 242for (var i = 0; i < obj.Length; i++)
Otlp\Model\OtlpHelpers.cs (8)
181if (values.Length == copyCount) 250copyCount = Math.Min(parentAttributes.Length + attributes.Count, context.Options.MaxAttributeCount); 253if (copyCount == parentAttributes.Length) 259if (copiedAttributes is null || copiedAttributes.Length < copyCount) 272CopyKeyValues(attributes, copiedAttributes, parentAttributes.Length, context, out var newCopyCount); 273copyCount = parentAttributes.Length + newCopyCount; 325for (var i = 0; i < values.Length; i++) 368for (var i = 0; i < values.Length; i++)
ResourceService\DashboardClient.cs (1)
497for (var i = 0; i < logLines.Length; i++)
src\Shared\CircularBuffer.cs (1)
223if (array.Length - arrayIndex < Count)
src\Shared\StringUtils.cs (1)
13&& input.Split(delimiter) is { Length: > 0 } splitInput
Aspire.Dashboard.Tests (4)
Integration\StartupTests.cs (1)
438Assert.Equal(16, Convert.FromHexString(app.DashboardOptionsMonitor.CurrentValue.Frontend.BrowserToken!).Length);
TelemetryRepositoryTests\MetricsTests.cs (1)
386var dimension = instrumentData.Dimensions.Single(d => d.Attributes.Length == 0);
TelemetryRepositoryTests\TraceTests.cs (2)
852Assert.Equal(5, trace.FirstSpan.Events[0].Attributes.Length); 1482var views = application.GetViews().OrderBy(v => v.Properties.Length).ToList();
Aspire.Hosting (6)
ApplicationModel\ResourceLoggerService.cs (2)
51if (resourceNames.Length > 1) 393if (backlogSnapshot.Length > 0)
Publishing\ManifestPublishingContext.cs (2)
558if (buildArgs?.ToArray() is { Length: > 0 } args) 562for (var i = 0; i < args.Length; i++)
src\Shared\CircularBuffer.cs (1)
223if (array.Length - arrayIndex < Count)
src\Shared\StringUtils.cs (1)
13&& input.Split(delimiter) is { Length: > 0 } splitInput
Aspire.Hosting.Analyzers (5)
AppHostAnalyzer.cs (2)
85&& parameterData.ModelTypes.Length > 0) 88if (candidateParameters.Length > 0)
AppHostAnalyzer.DetectInvalidModelNames.cs (1)
26if (modelName is not null && modelTypes.Length > 0)
Infrastructure\WellKnownTypes.cs (2)
28for (var i = 0; i < WellKnownTypeData.WellKnownTypeNames.Length; i++) 49_lazyWellKnownTypes = new INamedTypeSymbol?[WellKnownTypeData.WellKnownTypeNames.Length];
Aspire.Hosting.Azure.AppContainers (4)
AzureContainerAppsInfrastructure.cs (4)
263if (unsupportedEndpoints.Length > 0) 386var httpIngress = httpOnlyEndpoints.Length == 1 ? httpOnlyEndpoints[0] : null; 393if (externalHttp.Length == 1) 397else if (httpOnlyEndpoints.Length > 0)
Aspire.Hosting.NodeJs (1)
NodeExtensions.cs (1)
58string[] allArgs = args is { Length: > 0 }
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
90if (parameters.Length == 0)
Aspire.Hosting.Testing.Tests (5)
TestingBuilderTests.cs (3)
25if (unexpectedAppHostFiles.Length > 0) 154Assert.True(result1.Length > 0); 207Assert.True(result.Length > 0);
TestingFactoryTests.cs (2)
54Assert.True(result1.Length > 0); 82Assert.True(result.Length > 0);
Aspire.Hosting.Tests (5)
Dcp\ApplicationExecutorTests.cs (1)
519() => loggerState.GetBacklogSnapshot().Length == 0,
DistributedApplicationTests.cs (1)
425Assert.Equal(16, keyBytes.Length);
ManifestGenerationTests.cs (3)
178if (withArgsArgs.Length > 0) 193Assert.Equal(addExecutableArgs.Length + withArgsArgs.Length, args.GetArrayLength());
Aspire.Milvus.Client.Tests (1)
ConformanceTests.cs (1)
66if (keyValue.Length == 2 && keyValue[0].Equals(configKey, StringComparison.OrdinalIgnoreCase))
Aspire.Playground.Tests (1)
tests\Aspire.Components.Common.Tests\RequiresToolsAttribute.cs (1)
14if (executablesOnPath.Length == 0)
Aspire.Workload.Tests (5)
StarterTemplateRunTestsBase.cs (1)
78Assert.Equal(5, response.Length);
WorkloadTestsBase.cs (4)
212if (expectedEndpoints.Length != endpointsFound.Count) 219AssertEqual(expectedEndpoints.Length, endpointsFound.Count, $"#endpoints for {resourceName}"); 226if (matchedEndpoints.Length == 0) 233AssertEqual(expectedEndpoints.Length, matchingEndpoints, $"Expected number of endpoints for {resourceName}");
AzureFunctionsEndToEnd.Functions (1)
MyEventHubTrigger.cs (1)
11logger.LogInformation("C# EventHub trigger function processed: {Count} messages", input.Length);
BasicTestApp (5)
artifacts\obj\BasicTestApp\Release\net10.0\BasicTestApp.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
InteropTest\DotNetStreamReferenceInterop.cs (1)
14for (var i = 0; i < data.Length; i++)
InteropTest\JSStreamReferenceInterop.cs (3)
42for (var i = 0; i < buffer.Length; i++) 51if (buffer.Length != 100_000) 53return $"Failure, got a stream of length {buffer.Length}, expected a length of 100,000.";
Benchmarks (2)
StartupUsingEndpointRouting.cs (1)
30var payloadLength = _helloWorldPayload.Length;
StartupUsingRouter.cs (1)
24var payloadLength = _helloWorldPayload.Length;
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
32while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) > 0)
BlazorServerApp (1)
Data\WeatherForecastService.cs (1)
19Summary = Summaries[Random.Shared.Next(Summaries.Length)]
BlazorUnitedApp (1)
Data\WeatherForecastService.cs (1)
19Summary = Summaries[Random.Shared.Next(Summaries.Length)]
BoundTreeGenerator (8)
BoundNodeClassWriter.cs (7)
1243if (allFields.Length > 0) 1247for (int i = 0; i < allFields.Length; ++i) 1266if (i != allFields.Length - 1) 1270if (allFields.Length != 0) 1316if (allFields.Length > 0) 1320for (int i = 0; i < allFields.Length; ++i) 1330if (i == allFields.Length - 1)
Program.cs (1)
25if (args.Length != 3)
BuildActionTelemetryTable (5)
Program.cs (3)
454if (paths.Length == 0) 600var startIndex = Math.Max(0, descriptionParts.Length - 2); 605for (int index = startIndex; index < descriptionParts.Length; index++)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
97var maxSize = Math.Min(maxItemsToHash, values.Length); 206for (int i = 0; i < data.Length; i++)
ClientSample (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
CodeGenerator (30)
HttpUtilities\CombinationsWithoutRepetition.cs (3)
18ArgumentOutOfRangeException.ThrowIfGreaterThan(p, nElements.Length); 79pointers[_p + 1] = nElements.Length; 91Array.Clear(Current, 0, Current.Length);
HttpUtilities\HttpUtilities.cs (3)
34var maskLength = (byte)Math.Ceiling(Math.Log(httpMethods.Length, 2)); 59int methodNamesArrayLength = httpMethods.Length; 203if (shifts.Length > 0)
HttpUtilities\HttpUtilitiesGeneratorHelpers.cs (4)
79int arrayLength = values.Length; 89for (int i = 0; i < bitsCombination.Length; i++) 175for (; i < array.Length - 1; i++) 181if (array.Length > 0)
Program.cs (5)
10if (args.Length < 1) 15else if (args.Length < 2) 20else if (args.Length < 3) 25else if (args.Length < 4) 30else if (args.Length < 5)
src\Servers\Kestrel\shared\KnownHeaders.cs (8)
773Debug.Assert(requestHeaders.Length <= 64); 778Debug.Assert(responseHeaders.Length <= 63); 816header.BytesCount += header.Bytes.Length; 1403{(!loop.ClassName.Contains("Trailers") ? $@"case {loop.Headers.Length - 1}: // Header: ""Content-Length"" 1428{(!loop.ClassName.Contains("Trailers") ? $@"_next = _collection._contentLength.HasValue ? {loop.Headers.Length - 1} : -1;" : "_next = -1;")} 1439? {loop.Headers.Length - 1} 1451return @$"private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>({DefinedHeaderNames.Length}, StringComparer.OrdinalIgnoreCase) 1476if (values.Count == 1 && values[0].Field.Value.Length == 0)
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\Shared\runtime\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
CodeStyleConfigFileGenerator (2)
Program.cs (2)
31if (args.Length != ExpectedArguments) 33Console.Error.WriteLine($"Excepted {ExpectedArguments} arguments, found {args.Length}: {string.Join(';', args)}");
ConfigurationSchemaGenerator (2)
RuntimeSource\SourceGenerators\ImmutableEquatableArray.cs (2)
22public int Count => _values.Length; 63if ((uint)newIndex < (uint)_values.Length)
Contract.Fault.IntegrationTests (4)
FaultExceptionTests.4.0.0.cs (4)
251Assert.True(input.Length == response.Length, String.Format("Expected {0} response items but actual was {1}", input.Length, response.Length));
Contract.Message.IntegrationTests (7)
MessageContractTests.4.4.0.cs (5)
74Assert.True(array1.Length == array2.Length, 76elementName, array1.Length, array2.Length)); 78for (int i = 0; i < array1.Length; ++i)
MessageTests.4.0.0.cs (2)
157object[] newParams = new object[parameters.Length]; 158for (int i = 0; i < parameters.Length; i++)
csc (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
329responseBuffer.Length,
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
160_loggingStream.Write(bytes, 0, bytes.Length);
CSharpErrorFactsGenerator (1)
Program.cs (1)
19if (args.Length != 2)
CustomResources.AppHost (2)
TestResource.cs (2)
58var randomState = states[Random.Shared.Next(0, states.Length)]; 59var randomStyle = stateStyles[Random.Shared.Next(0, stateStyles.Length)];
DaprServiceB (1)
Program.cs (1)
31summaries[Random.Shared.Next(summaries.Length)]
Diagnostics.EFCore.FunctionalTests (1)
Helpers\StringHelpers.cs (1)
14if (parameters.Length > 0)
Diagnostics.FunctionalTests (1)
WelcomePageSampleTest.cs (1)
26Assert.True(bytes.Length > 1);
DnnAnalyzer (2)
DnnAnalyzer.cs (2)
16if (args == null || args.Length != 1) 24var inputsString = inputs.Length == 0 ? "" : $", input nodes: {string.Join(", ", inputs)}";
dotnet-dev-certs (16)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-getdocument (6)
artifacts\obj\dotnet-getdocument\Release\netcoreapp2.1\Microsoft.Extensions.ApiDescription.Tool.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-openapi (12)
Commands\BaseCommand.cs (6)
110if (projects.Length == 0) 114if (projects.Length > 1) 396var domain = parts.Length switch 536var sameHashes = downloadHash.Length == destinationHash.Length; 537for (var i = 0; sameHashes && i < downloadHash.Length; i++)
DebugMode.cs (1)
15if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-razorpagegenerator (3)
Program.cs (3)
18if (args == null || args.Length < 1) 36var targetProjectDirectory = args.Length > 1 ? args[1] : Directory.GetCurrentDirectory(); 39var physicalPathPrefix = args.Length > 2 ? args[2] : string.Empty;
dotnet-sql-cache (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-svcutil.xmlserializer (5)
Microsoft\Tools\ServiceModel\SvcUtil\CommandLineParser.cs (1)
161arguments = new ArgumentDictionary(cmd.Length);
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (2)
179if (files.Length == 0) 247if (types.Length == 0)
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (1)
269if (parts == null || parts.Length != 2)
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (1)
212for (int i = 0; i < chars.Length; i++)
dotnet-svcutil-lib (1531)
CodeDomFixup\ArrayOfXElementTypeHelper.cs (2)
122CodeTypeReference[] typeRefArgs = new CodeTypeReference[typeArguments.Length]; 123for (int i = 0; i < typeArguments.Length; i++)
CodeDomFixup\CodeDomHelpers.cs (4)
179for (int i = 0; i < types.Length; i++) 189for (int i = 0; i < types.Length; i++) 199if (args1.Count != args2.Length) 202for (int i = 0; i < args2.Length; i++)
CodeDomFixup\CodeDomVisitors\AttributeFixer.cs (2)
100for (int i = 0; i < propsToRemove.Length; i++) 110for (int i = 0; i < s_attrsToRemove.Length; i++)
CodeDomFixup\CodeDomVisitors\CodeDomVisitor.cs (2)
46for (int i = 0; i < _visitors.Length; i++) 54for (int i = 0; i < _visitors.Length; i++)
CodeDomFixup\CodeDomVisitors\ConstructorFixer.cs (1)
43for (int i = 0; i < validCtors.Length; i++)
CodeDomFixup\WcfCodeGenerationExtension.cs (1)
116for (int i = 0; i < fixups.Length; i++)
CommandLineParser.cs (2)
129for (int i = 0; i < cmd.Length; i++) 147var argValue = cmd.Length > i + 1 ? cmd[i + 1] : null;
CommandProcessorOptions.cs (3)
337if (projects.Length == 1) 341else if (projects.Length == 0) 348else if (projects.Length > 1)
FrameworkFork\Microsoft.CodeDom\Compiler\CodeCompiler.cs (8)
258string[] filenames = new string[ea.Length]; 262for (int i = 0; i < ea.Length; i++) 375string[] filenames = new string[sources.Length]; 378for (int i = 0; i < sources.Length; i++) 406if (sa == null || sa.Length == 0) 409if (sa.Length == 1) 415for (int i = 0; i < sa.Length - 1; i++) 423sb.Append(sa[sa.Length - 1]);
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerErrorCollection.cs (1)
83for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerInfo.cs (4)
159String[] compilerLanguages = new String[_compilerLanguages.Length]; 160Array.Copy(_compilerLanguages, compilerLanguages, _compilerLanguages.Length); 166String[] compilerExtensions = new String[_compilerExtensions.Length]; 167Array.Copy(_compilerExtensions, compilerExtensions, _compilerExtensions.Length);
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (12)
3269Debug.Assert(names.Length > 0); 3271for (int i = 1; i < names.Length; i++) 4166string[] filenames = new string[ea.Length]; 4170for (int i = 0; i < ea.Length; i++) 4232string[] filenames = new string[sources.Length]; 4235for (int i = 0; i < sources.Length; i++) 4262if (sa == null || sa.Length == 0) 4265if (sa.Length == 1) 4271for (int i = 0; i < sa.Length - 1; i++) 4279sb.Append(sa[sa.Length - 1]); 4632for (int i = 0; i < names.Length; i++) 4661for (int i = 0; i < modifiers.Length; i++)
FrameworkFork\Microsoft.CodeDom\System\CodeAttributeArgumentCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeAttributeDeclarationCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeCatchClauseCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeCommentStatementCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeDirectiveCollection.cs (1)
56for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeExpressionCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\codemethodreferenceexpression.cs (1)
56if (typeParameters != null && typeParameters.Length > 0)
FrameworkFork\Microsoft.CodeDom\System\CodeNamespaceCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeParameterDeclarationExpressionCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeStatementCollection.cs (1)
95for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeTypeDeclarationCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeTypeMemberCollection.cs (1)
86for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeTypeParameterCollection.cs (1)
60for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReference.cs (2)
120for (int i = 0; i < genericArgs.Length; i++) 291if (typeArguments != null && typeArguments.Length > 0)
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReferenceCollection.cs (1)
102for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
FrameworkFork\Microsoft.CodeDom\System\FixedStringLookup.cs (4)
25if (length <= 0 || length - 1 >= lookupTable.Length) 41for (int i = 0; i < lookupTable.Length; i++) { 45for (int j = 0; j < subArray.Length; j++) { 67int max = array.Length;
FrameworkFork\Microsoft.Xml\Xml\Base64Decoder.cs (3)
64if (chars.Length - startPos < len) 131Debug.Assert(buffer.Length - index >= count); 146for (int i = 0; i < mapBase64.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Base64Encoder.cs (1)
44if (count > buffer.Length - index)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\SqlUtils.cs (2)
143Debug.Assert(rguiData.Length == 4); 168Debug.Assert(rgulU.Length == s_cNumeMax);
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (14)
1910if (symNum == symtable.Length) 1926if (qnameNum == qnametable.Length) 1973Array.Clear(_symbolTables.symtable, 1, _symbolTables.symtable.Length - 1); 1974Array.Clear(_symbolTables.qnametable, 0, _symbolTables.qnametable.Length); 2018if (cbKeep > 7 * (data.Length / 8)) 2021byte[] newdata = new byte[checked(data.Length * 2)]; 2051int cbFill = data.Length - end; 2431int newcount = _elementStack.Length * 2; 2434System.Array.Copy(_elementStack, 0, n, 0, _elementStack.Length); 2440int newcount = _attributes.Length * 2; 2517if (_attrCount == _attributes.Length) 2624if (_attrCount == _attributes.Length) 2732if (_attrHashTbl.Length < tblSize) 3065if (_elemDepth == _elementStack.Length)
FrameworkFork\Microsoft.Xml\Xml\BinHexDecoder.cs (5)
57if (chars.Length - startPos < len) 126Debug.Assert(buffer.Length - index >= count); 145int len = chars.Length; 160Decode(pChars, pChars + len, pBytes, pBytes + bytes.Length, ref hasHalfByteCached, ref cachedHalfByte, out charsDecoded, out bytesDecoded); 169if (bytesDecoded < bytes.Length)
FrameworkFork\Microsoft.Xml\Xml\BinHexEncoder.cs (3)
29if (count > buffer.Length - index) 60if (count > inArray.Length - offsetIn) 74int lengthOut = outArray.Length;
FrameworkFork\Microsoft.Xml\Xml\BitStack.cs (1)
103len = _bitStack.Length;
FrameworkFork\Microsoft.Xml\Xml\BufferBuilder.cs (16)
158if (_lastBufferIndex == _lastBuffer.Length) 191if (count < 0 || start + count > value.Length) 335_stringBuilder.Append(buf, 0, buf.Length); 336charsLeft -= buf.Length; 405if (startIndex < _buffers[i].buffer.Length) 409startIndex -= _buffers[i].buffer.Length; 417int copyCount = (buf.Length < charsLeft) ? buf.Length : charsLeft; 456if (_lastBufferIndex >= _lastBuffer.Length) 462int free = _lastBuffer.Length - _lastBufferIndex; 484if (_buffersCount + 1 == _buffers.Length) 486Buffer[] newBuffers = new Buffer[_buffers.Length * 2]; 487Array.Copy(_buffers, 0, newBuffers, 0, _buffers.Length); 522for (int i = 0; i < buf.buffer.Length; i++) 549if (newLastIndex < _buffers[i].buffer.Length) 553newLastIndex -= _buffers[i].buffer.Length;
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentBuilder.cs (1)
818if (++_pageInfo.NodeCount >= _page.Length)
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeHelper.cs (2)
351idxPrec = pagePrec.Length - 1; 752if (++idxNode >= pageNode.Length)
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeInfoAtom.cs (6)
436infoNew = _hashTable[info.GetHashCode() & (_hashTable.Length - 1)]; 450if (_sizeTable >= _hashTable.Length) 453_hashTable = new XPathNodeInfoAtom[oldTable.Length * 2]; 455for (int i = 0; i < oldTable.Length; i++) 479int idx = info.GetHashCode() & (_hashTable.Length - 1); 493for (int i = 0; i < _hashTable.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Core\HtmlEncodedRawTextWriter.cs (1)
442Debug.Assert(count >= 0 && index + count <= buffer.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\HtmlUtf8RawTextWriter.cs (1)
441Debug.Assert(count >= 0 && index + count <= buffer.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\IncrementalReadDecoders.cs (2)
73Debug.Assert(chars.Length - startPos >= len); 117Debug.Assert(buffer.Length - index >= count);
FrameworkFork\Microsoft.Xml\Xml\Core\ReadContentAsBinaryHelper.cs (4)
82if (buffer.Length - index < count) 138if (buffer.Length - index < count) 194if (buffer.Length - index < count) 250if (buffer.Length - index < count)
FrameworkFork\Microsoft.Xml\Xml\Core\ReadContentAsBinaryHelperAsync.cs (4)
32if (buffer.Length - index < count) 88if (buffer.Length - index < count) 144if (buffer.Length - index < count) 200if (buffer.Length - index < count)
FrameworkFork\Microsoft.Xml\Xml\Core\SecureStringHasher.cs (2)
97if (paramTypes.Length == 1 && paramTypes[0].ParameterType == typeof(string)) 101else if (paramTypes.Length == 3 && paramTypes[0].ParameterType == typeof(string) && paramTypes[1].ParameterType == typeof(int) && paramTypes[2].ParameterType == typeof(long))
FrameworkFork\Microsoft.Xml\Xml\Core\util\TernaryTreeGenerator.cs (2)
161_numHtmlElements = s_htmlElements.Length; 162_numHtmlAttributes = s_htmlAttributes.Length;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingReader.cs (2)
506if (buffer.Length - index < count) 567if (buffer.Length - index < count)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingReaderAsync.cs (2)
322if (buffer.Length - index < count) 383if (buffer.Length - index < count)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingWriter.cs (1)
299if (count > buffer.Length - index)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEncodedRawTextWriter.cs (12)
161bufBytes = new byte[bufChars.Length]; 179if (bom.Length != 0) 181this.stream.Write(bom, 0, bom.Length); 658Debug.Assert(count >= 0 && index + count <= buffer.Length); 682Debug.Assert(count >= 0 && index + count <= buffer.Length); 860encoder.Convert(bufChars, startOffset, endOffset - startOffset, bufBytes, bufBytesUsed, bufBytes.Length - bufBytesUsed, false, out chEnc, out bEnc, out completed); 863if (bufBytesUsed >= (bufBytes.Length - 16)) 885encoder.Convert(bufChars, 1, 0, bufBytes, 0, bufBytes.Length, true, out chEnc, out bEnc, out completed); 1569if (_lastMarkPos + 1 == _textContentMarks.Length) 1578Debug.Assert(_lastMarkPos + 1 == _textContentMarks.Length); 1579int[] newTextContentMarks = new int[_textContentMarks.Length * 2]; 1580Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEventCache.cs (8)
122for (idxEvent = 0; idxEvent < page.Length; idxEvent++) 186writer.WriteBase64(bytes, 0, bytes.Length); 191writer.WriteBinHex(bytes, 0, bytes.Length); 280for (idxEvent = 0; idxEvent < page.Length; idxEvent++) 556else if (_pageSize >= _pageCurr.Length) 572if (index != 0 || count != buffer.Length) 574if (buffer.Length - index > count) 575count = buffer.Length - index;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReader.cs (2)
1901while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0) { 1918read = input.Read(bytes, byteCount, bytes.Length - byteCount);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReader.cs (3)
1299if (index == _nsAttributes.Length) 1301NodeData[] newNsAttrs = new NodeData[_nsAttributes.Length * 2]; 1575if (buffer.Length - index < count)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextEncoder.cs (3)
136if (count > array.Length - offset) 499if (count > array.Length - offset) 555int bufferSize = helperBuffer.Length;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (39)
1614if (buffer.Length - index < count) 1674if (buffer.Length - index < count) 1733if (buffer.Length - index < count) 1793if (buffer.Length - index < count) 1866if (buffer.Length - index < count) 2912bufferSize = _ps.bytes.Length; 2927if (_ps.bytes == null || _ps.bytes.Length < bufferSize) 2934if (_ps.chars == null || _ps.chars.Length < bufferSize + 1) 2941while (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0) 2943int read = stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed); 2961int preambleLen = preamble.Length; 3407if (_ps.charsUsed == _ps.chars.Length - 1) 3415char[] newChars = new char[_ps.chars.Length * 2]; 3416BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3425if (_ps.bytes.Length - _ps.bytesUsed < MaxByteSequenceLen) 3427byte[] newBytes = new byte[_ps.bytes.Length * 2]; 3434charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3442int charsLen = _ps.chars.Length; 3465char[] newChars = new char[_ps.chars.Length * 2]; 3466BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3489charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3497if (_ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0) 3499int read = _ps.stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed); 3521charsRead = _ps.textReader.Read(_ps.chars, _ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1); 3533Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3544Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 5131if (_attrDuplSortingArray == null || _attrDuplSortingArray.Length < _attrCount) 7771Debug.Assert(nodeIndex < _nodes.Length); 7772Debug.Assert(_nodes[_nodes.Length - 1] == null); 7785Debug.Assert(nodeIndex < _nodes.Length); 7786if (nodeIndex >= _nodes.Length - 1) 7788NodeData[] newNodes = new NodeData[_nodes.Length * 2]; 7789Array.Copy(_nodes, 0, newNodes, 0, _nodes.Length); 7792Debug.Assert(nodeIndex < _nodes.Length); 8245else if (_parsingStatesStackTop + 1 == _parsingStatesStack.Length) 8247ParsingState[] newParsingStateStack = new ParsingState[_parsingStatesStack.Length * 2]; 8248Array.Copy(_parsingStatesStack, 0, newParsingStateStack, 0, _parsingStatesStack.Length); 8293if (array.Length - index < count) 9689Debug.Assert(endPos < chars.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextWriter.cs (3)
1472if (nsIndex == _nsStack.Length) 1732if (_top == _stack.Length - 1) 1734TagInfo[] na = new TagInfo[_stack.Length + 10];
FrameworkFork\Microsoft.Xml\Xml\Core\XmlUtf8RawTextWriter.cs (6)
131if (bom.Length != 0) 133Buffer.BlockCopy(bom, 0, bufBytes, 1, bom.Length); 134bufPos += bom.Length; 135textPos += bom.Length; 582Debug.Assert(count >= 0 && index + count <= buffer.Length); 604Debug.Assert(count >= 0 && index + count <= buffer.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (6)
500if (top == _elemScopeStack.Length) 1120if (count > buffer.Length - index) 1158if (count > buffer.Length - index) 1222if (count > buffer.Length - index) 1852if (top == _nsStack.Length) 2221if (top == _attrStack.Length)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriterHelpers.cs (1)
515else if (_items.Length == newItemIndex)
FrameworkFork\Microsoft.Xml\Xml\Core\XsdCachingReader.cs (8)
664Debug.Assert(attIndex <= _attributeEvents.Length); 671if (attIndex >= _attributeEvents.Length - 1) 673ValidatingReaderNodeData[] newAttributeEvents = new ValidatingReaderNodeData[_attributeEvents.Length * 2]; 674Array.Copy(_attributeEvents, 0, newAttributeEvents, 0, _attributeEvents.Length); 688Debug.Assert(_contentIndex <= _contentEvents.Length); 696if (_contentIndex >= _contentEvents.Length - 1) 698ValidatingReaderNodeData[] newContentEvents = new ValidatingReaderNodeData[_contentEvents.Length * 2]; 699Array.Copy(_contentEvents, 0, newContentEvents, 0, _contentEvents.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReader.cs (4)
2186Debug.Assert(attIndex <= _attributePSVINodes.Length); 2193if (attIndex >= _attributePSVINodes.Length - 1) 2195AttributePSVIInfo[] newPSVINodes = new AttributePSVIInfo[_attributePSVINodes.Length * 2]; 2196Array.Copy(_attributePSVINodes, 0, newPSVINodes, 0, _attributePSVINodes.Length);
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentSchemaValidator.cs (3)
569else if (currentIndex >= _nodeSequenceToValidate.Length - 1) 571XmlNode[] newNodeSequence = new XmlNode[_nodeSequenceToValidate.Length * 2]; 572Array.Copy(_nodeSequenceToValidate, 0, newNodeSequence, 0, _nodeSequenceToValidate.Length);
FrameworkFork\Microsoft.Xml\Xml\Dom\DomNameTable.cs (2)
30Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two 113for (int i = 0; i < oldEntries.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\NameTable.cs (1)
227for (int i = 0; i < oldEntries.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Resolvers\XmlPreloadedResolver.cs (6)
79: this(array, 0, array.Length) 203for (int i = 0; i < s_xhtml10_Dtd.Length; i++) 214Debug.Assert(s_rss091_Dtd.Length == 1); 296Add(uri, new ByteArrayChunk(value, 0, value.Length)); 317if (value.Length - offset < count) 376for (int i = 0; i < dtdSet.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\AstTree.cs (3)
577ArrayList AstArray = new ArrayList(xpath.Length); 578_fAxisArray = new ArrayList(xpath.Length); 584for (int i = 0; i < xpath.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\BitSet.cs (14)
47int bitsLength = _bits.Length; 94if ((++nBitSlot) == _bits.Length) 122int bitsLength = _bits.Length; 123int setLength = other._bits.Length; 142int setLength = other._bits.Length; 153for (int i = _bits.Length; --i >= 0;) 172int bitsLength = _bits.Length; 173int setLength = other._bits.Length; 221for (int i = 0; i < _bits.Length; i++) 231int i = Math.Min(_bits.Length, other._bits.Length); 250if (nRequiredLength > _bits.Length) 253int request = 2 * _bits.Length; 257Array.Copy(_bits, newBits, _bits.Length);
FrameworkFork\Microsoft.Xml\Xml\schema\ConstraintStruct.cs (13)
31_tableDim = constraint.Fields.Length; 249_dim = ((Array)obj).Length; 362return atomicValues1.Length == 1 && atomicValues1.GetValue(0).Equals(other.Value); 366return arr1.Length == 1 && arr1.GetValue(0).Equals(other.Value); 376return atomicValues2.Length == 1 && atomicValues2.GetValue(0).Equals(this.Value); 380return arr2.Length == 1 && arr2.GetValue(0).Equals(this.Value); 419_dim = ks.Length; 439for (int i = 0; i < _ks.Length; ++i) 454for (int i = 0; i < _ks.Length; i++) 477for (int j = 0; j < atomicValues.Length; j++) 484for (int j = 0; j < ((Array)_ks[i].Value).Length; j++) 517for (int i = 0; i < _ks.Length; i++) 543for (int i = 1; i < _ks.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (6)
622for (int i = 0; i < followpos.Length; i++) 1637for (int i = 0; i < transitionTable.Length; i++) 1723for (int i = 0; i < transition.Length - 1; i++) 1760for (int i = 0; i < transition.Length - 1; i++) 2105Array.Copy(rposInfo.rangeCounters, 0, newRPosInfo.rangeCounters, 0, rposInfo.rangeCounters.Length); 2132Array.Copy(rposInfo.rangeCounters, 0, newRPosInfo.rangeCounters, 0, rposInfo.rangeCounters.Length);
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (15)
243for (int i = 0; i < s_xsdTypes.Length; i++) 264for (int i = 0; i < s_xsdTypes.Length; i++) 891int length = value1.Length; 892if (length != value2.Length) 988int length = arr1.Length; 989if (length != arr2.Length) 999for (int i = 0; i < atomicValues1.Length; i++) 1011for (int i = 0; i < arr1.Length; i++) 1073for (int i = 0; i < valuesToCheck.Length; i++) 1140for (int i = 0; i < splitString.Length; ++i) 1154for (int i = 0; i < splitString.Length; ++i) 1245for (int i = 0; i < _types.Length; ++i) 1257for (int i = 0; i < _types.Length; ++i) 1278for (int i = 0; i < _types.Length; ++i) 1319for (int i = 0; i < _types.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (3)
1455else if (_condSectionEntityIds.Length == _condSectionDepth) 1457int[] tmp = new int[_condSectionEntityIds.Length * 2]; 1458Array.Copy(_condSectionEntityIds, 0, tmp, 0, _condSectionEntityIds.Length);
FrameworkFork\Microsoft.Xml\Xml\schema\dtdvalidator.cs (2)
363for (int i = 0; i < ss.Length; ++i) 589for (int i = 0; i < ss.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (3)
720for (int i = 0; i < s_map.Length; i++) 1589int length = value.Length; 1655int length = values.Length;
FrameworkFork\Microsoft.Xml\Xml\schema\NamespaceList.cs (1)
50for (int i = 0; i < splitString.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\Preprocessor.cs (2)
1646baseTypeCount += union1.MemberTypes.Length; 1648for (int i = 0; i < qNames.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaCollectionCompiler.cs (1)
631for (int i = 0; i < mainMemberTypes.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaCollectionPreprocessor.cs (2)
1291baseTypeCount += union1.MemberTypes.Length; 1292for (int i = 0; i < union1.MemberTypes.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaSetCompiler.cs (2)
122int numberOfSchemaTypes = schemaSimpleTypes.Length - 3; //skip last 2 xquery types 716for (int i = 0; i < mainMemberTypes.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\XdrBuilder.cs (2)
454for (int i = 0; i < _CurState._Attributes.Length; i++) 1502for (int i = 0; i < _CurState._NextStates.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\xdrvalidator.cs (2)
489for (int i = 0; i < ss.Length; ++i) 590for (int i = 0; i < ss.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaCollection.cs (1)
290if (index == array.Length)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObjectTable.cs (2)
223Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 278Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaSet.cs (2)
803if (index < 0 || index > schemas.Length - 1) 1011for (int i = 0; i < locationsTable.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaSimpleTypeUnion.cs (3)
56if (_memberTypes != null && _memberTypes.Length > 0) 59XmlQualifiedName[] newQNames = new XmlQualifiedName[_memberTypes.Length]; 61for (int i = 0; i < _memberTypes.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidator.cs (12)
1314for (int j = 0; j < locations.Length - 1; j += 2) 2024for (int i = 0; i < ss.Length; ++i) 2188_context.Constr = new ConstraintStruct[currentElementDecl.Constraints.Length]; 2190for (int i = 0; i < currentElementDecl.Constraints.Length; ++i) 2197for (int i = 0; i < _context.Constr.Length; ++i) 2212for (int j = 0; j < constraintStructures.Length; ++j) 2262for (int j = 0; j < constraintStructures.Length; ++j) 2317for (int i = 0; i < constraintStructures.Length; ++i) 2363for (int i = 0; i < constraints.Length; ++i) 2468for (int i = 0; i < vcs.Length; ++i) 2756Debug.Assert(nsList.Length > 0); 2758for (int i = 1; i < nsList.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (2)
3681_converters = new XmlValueConverter[memberTypes.Length]; 3682for (int i = 0; i < memberTypes.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\schema\XsdBuilder.cs (5)
734for (int i = 0; i < _currentEntry.Attributes.Length; i++) 2439for (int i = 0; i < _currentEntry.NextStates.Length; ++i) 2499for (int i = 0; i < values.Length; i++) 2528for (int i = 0; i < stringValues.Length; i++) 2531for (int j = 0; j < s_derivationMethodStrings.Length; j++)
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (10)
321for (int i = 0; i < xsiSchemaLocation.Length - 1; i += 2) 726for (int i = 0; i < ss.Length; ++i) 868context.Constr = new ConstraintStruct[context.ElementDecl.Constraints.Length]; 870for (int i = 0; i < context.ElementDecl.Constraints.Length; ++i) 877for (int i = 0; i < context.Constr.Length; ++i) 892for (int j = 0; j < constraints.Length; ++j) 938for (int j = 0; j < constraints.Length; ++j) 993for (int i = 0; i < constraints.Length; ++i) 1046for (int i = 0; i < constraints.Length; ++i) 1149for (int i = 0; i < vcs.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeExporter.cs (4)
221if (arrayMapping.Elements.Length == 1) 228for (int i = 0; i < arrayMapping.Elements.Length; i++) 245if (mapping.IsFlags && mapping.Constants.Length > 31) 251for (int i = 0; i < mapping.Constants.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (4)
90for (int i = 0; i < argTypes.Length; i++) 2880Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 2881for (int i = 0; i < parameterTypes.Length; ++i)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifier.cs (2)
223for (int i = 0; i < parts.Length; i++) 277for (int i = 0; i < names.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Compilation.cs (1)
81for (int i = 0; i < xmlMappings.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\ImportContext.cs (2)
421for (int i = 0; i < memberTypes.Length; i++) 526for (int i = 0; i < attrs.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Mappings.cs (15)
394_sortedElements = new ElementAccessor[_elements.Length]; 395Array.Copy(_elements, 0, _sortedElements, 0, _elements.Length); 605for (int i = 0; i < _members.Length; i++) 664for (int i = 0; i < _members.Length; i++) 734get { return _text != null && (_elements == null || _elements.Length == 0); } 739get { return (_elements != null && _elements.Length > 0); } 791_sortedElements = new ElementAccessor[_elements.Length]; 792Array.Copy(_elements, 0, _sortedElements, 0, _elements.Length); 828if (_elements != null && _elements.Length > 0) return _elements[0]; 838if (arrayMapping.Elements != null && arrayMapping.Elements.Length == 1) 856if (_elements != null && _elements.Length == 1) 874if (a.Length != b.Length) 876for (int i = 0; i < a.Length; i++) 886if (Elements != null && Elements.Length > 0)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Models.cs (5)
148MemberInfo[] fieldsAndProps = new MemberInfo[members.Length]; 152for (int i = 0; i < members.Length; i++) 160for (int i = 0; i < members.Length; i++) 237if (parameters.Length > 0) return false; 412for (int i = 0; i < fields.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SchemaObjectWriter.cs (4)
217for (int i = 0; i < a.Length; i++) 527for (int ia = 0; ia < a.Length; ia++) 546for (int ia = 0; ia < a.Length; ia++) 597for (int i = 0; i < o.MemberTypes.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapCodeExporter.cs (5)
156for (int i = 0; i < mapping.Members.Length; i++) 163for (int i = 0; i < mapping.Members.Length; i++) 168for (int i = 0; i < mapping.Members.Length; i++) 226if (member.Elements.Length == 0) return; 289for (int i = 0; i < accessors.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (5)
494if (mapping.Elements.Length == 1) 605for (int i = 0; i < model.Constants.Length; i++) 639MemberMapping[] mappings = new MemberMapping[xmlReflectionMembers.Length]; 640for (int i = 0; i < mappings.Length; i++) 806for (int i = 0; i < names.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaExporter.cs (7)
71if (memberMapping.Elements.Length > 0) 276if (accessors.Length == 0) return; 277if (accessors.Length == 1) 286for (int i = 0; i < accessors.Length; i++) 371for (int i = 0; i < members.Length; i++) 374if (member.Elements.Length > 0) 420for (int i = 0; i < mapping.Constants.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaImporter.cs (2)
147for (int i = 0; i < mapping.Members.Length; i++) 654if (isList && enumMapping.Constants.Length > 63)
FrameworkFork\Microsoft.Xml\Xml\Serialization\TypeExtensions.cs (1)
49parameters.Length == 1 &&
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (13)
462if (typeDescs.Length == 0) return null; 466for (int i = 0; i < typeDescs.Length; i++) 478for (i = 0; i < typeDescs.Length; i++) 482if (i == typeDescs.Length) break; 568for (int i = 0; i < s_unsupportedTypes.Length; i++) 616for (int i = 0; i < s_unsupportedTypes.Length; i++) 1040for (int i = 0; i < arguments.Length; i++) 1089for (int i = 0; i < mapping.Members.Length; i++) 1158for (int i = 0; i < mappings.Length; ++i) 1196for (int i = 0; i < mappings.Length; i++) 1356if (defaultMembers != null && defaultMembers.Length > 0) 1360for (int i = 0; i < defaultMembers.Length; i++) 1369if (parameters.Length == 1 && parameters[0].ParameterType == typeof(int))
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCodeExporter.cs (18)
93for (int j = 0; j < mapping.Elements.Length; j++) 231for (int i = 0; i < values.Length; i++) 332for (int i = 0; i < vals.Length; i++) 339for (int i = 0; i < vals.Length; i++) 366string[] names = new string[c.Length]; 367long[] ids = new long[c.Length]; 369for (int i = 0; i < c.Length; i++) 381for (int i = 0; i < c.Length; i++) 509CodeExpression[] initializers = new CodeExpression[vals.Length]; 510for (int i = 0; i < vals.Length; i++) 603for (int i = 0; i < mapping.Members.Length; i++) 613for (int i = 0; i < mapping.Members.Length; i++) 620for (int i = 0; i < mapping.Members.Length; i++) 626for (int i = 0; i < mapping.Members.Length; i++) 686for (int i = 0; i < array.Elements.Length; i++) 743if (member.Elements.Length == 1) 781for (int i = 0; i < member.Elements.Length; i++) 969for (int i = 0; i < accessors.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCustomFormatter.cs (6)
107for (int i = 0; i < toks.Length; i++) 129if (value.Length == 0) 138if (ids.Length != vals.Length) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, "Invalid enum")); 145for (int i = 0; i < ids.Length; i++) 391for (int i = 0; i < parts.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlMapping.cs (1)
142for (int i = 0; i < mappings.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlMembersMapping.cs (3)
25_mappings = new XmlMemberMapping[mapping.Members.Length]; 26for (int i = 0; i < _mappings.Length; i++) 71get { return _mappings.Length; }
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (20)
228if (mapping.Elements != null && mapping.Elements.Length > 0) 884if (member.Elements != null && member.Elements.Length != 0) 974for (int i = 0; i < names.Length; i++) 1014if (mapping.Elements.Length == 1) 1102for (int i = 0; i < mapping.Elements.Length; i++) 1211for (int i = 0; i < model.Constants.Length; i++) 1246MemberMapping[] mappings = new MemberMapping[xmlReflectionMembers.Length]; 1252for (int i = 0; i < mappings.Length; i++) 1386if (xmlReflectionMember.OverrideIsNullable && member.Elements.Length > 0) 1393for (int i = 0; i < reflectionMembers.Length; i++) 1445for (int i = 0; i < xmlReflectionMembers.Length; i++) 1461if (infos == null || infos.Length == 0) 1473else if (infos.Length > 1) 1966if (accessor.TypeDesc.IsArrayLike && accessor.Elements.Length > 0 && !(accessor.Elements[0].Mapping is ArrayMapping)) 1976accessor.ChoiceIdentifier.MemberIds = new string[accessor.Elements.Length]; 1977for (int i = 0; i < accessor.Elements.Length; i++) 1982for (int j = 0; j < choiceMapping.Constants.Length; j++) 2117for (int i = 0; i < choiceMapping.Constants.Length; i++) 2204else if (!isSequence && member.Elements != null && member.Elements.Length > 0) 2206for (int i = 0; i < member.Elements.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaExporter.cs (14)
61if (mapping.Members.Length == 1 && mapping.Members[0].Elements[0].Mapping is SpecialMapping) 106else if (member.Elements == null || member.Elements.Length == 0) 689if (accessors.Length == 0) return; 690if (accessors.Length == 1) 699for (int i = 0; i < accessors.Length; i++) 926string[] names = new string[c.Length]; 927long[] ids = new long[c.Length]; 929for (int i = 0; i < c.Length; i++) 940for (int i = 0; i < c.Length; i++) 1085for (int i = 0; i < members.Length; i++) 1098if (member.Elements.Length > 0) 1101!(member.Elements.Length == 1 && member.Elements[0].Mapping is ArrayMapping); 1156for (int i = 0; i < members.Length; i++) 1201for (int i = 0; i < mapping.Constants.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaImporter.cs (17)
212if (mapping.Members.Length != 1 || !mapping.Members[0].Accessor.Any) 251MemberMapping[] members = new MemberMapping[names.Length]; 252for (int i = 0; i < names.Length; i++) 691for (int i = 0; i < structMapping.Members.Length; i++) 882Hashtable uniqueTypeDescs = new Hashtable(member.Elements.Length); 884for (int i = 0; i < member.Elements.Length; i++) 920for (int i = 0; i < typeDescs.Length; i++) 948member.ChoiceIdentifier.MemberIds = new string[member.Elements.Length]; 950for (int i = 0; i < member.Elements.Length; i++) 988if (arrayMapping.Elements.Length != 1) 1064for (int j = 0; j < elements.Length; j++) 1113for (int i = 0; i < elements.Length; i++) 1199if (elements.Length == 0) 1202for (int i = 0; i < elements.Length; i++) 1625if (nodes != null && nodes.Length > 0) 1876if (isList && enumMapping.Constants.Length > 63) 1913for (int i = 0; i < choice.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationGeneratedCode.cs (8)
54if (scopes.Length > 0) 102if (index < a.Length) return a; 103TypeMapping[] b = new TypeMapping[a.Length + 32]; 163if (methods != null && methods.Length != 0 && xmlMappings != null && xmlMappings.Length == methods.Length) 165for (int i = 0; i < methods.Length; i++) 188for (int i = 0; i < types.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (9)
40if (scopes.Length > 0) 134if (index < a.Length) return a; 135TypeMapping[] b = new TypeMapping[a.Length + 32]; 202if (methods != null && methods.Length != 0 && xmlMappings != null && xmlMappings.Length == methods.Length) 211for (int i = 0; i < methods.Length; i++) 235for (int i = 0; i < types.Length; i++) 442for (int i = 0; i < xmlMappings.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (10)
504if (offset == buffer.Length) 513bytes = _r.ReadElementContentAsBase64(buffer, offset, buffer.Length - offset); 517bytes = _r.ReadElementContentAsBinHex(buffer, offset, buffer.Length - offset); 527currentSize = Math.Min(block.Length, total); 1019int charsLength = chars.Length; 1107for (int i = 0; i < dimensions.Length; i++) 1438if (index < a.Length) return a; 1439Array b = Array.CreateInstance(elementType, a.Length * 2); 1452if (a.Length == length) return a; 1638for (int i = 0; i < array.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (41)
355for (int i = 0; i < xmlNodes.Length; i++) 385XmlCustomFormatter.WriteArrayBase64(_w, (byte[])o, 0, ((byte[])o).Length); 1019XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1037XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1059XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1158XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1300int arrayLength = a.Length; 1740for (int i = 0; i < values.Length; i++) 1915for (int i = 0; i < mapping.Members.Length; i++) 1928for (int j = 0; j < mapping.Members.Length; j++) 1968for (int i = 0; i < mapping.Members.Length; i++) 1982for (int j = 0; j < mapping.Members.Length; j++) 2012for (int j = 0; j < mapping.Members.Length; j++) 2031if (isRpc && member.IsReturnValue && member.Elements.Length > 0) 2063Writer.Write(mapping.Members.Length.ToString()); 2067WriteExtraMembers(mapping.Members.Length.ToString(), "pLength"); 2152if (constants.Length > 0) 2160for (int i = 0; i < constants.Length; i++) 2180for (int i = 0; i < constants.Length; i++) 2191for (int i = 0; i < constants.Length; i++) 2449for (int i = 0; i < members.Length; i++) 2488for (int i = 0; i < members.Length; i++) 2494bool checkShouldPersist = m.CheckShouldPersist && (m.Elements.Length > 0 || m.Text != null); 2750!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 2759if (elements.Length == 0 && text == null) return; 2877int count = elements.Length + (text == null ? 0 : 1); 2905if (elements.Length == 0 && text == null) return; 2906if (elements.Length == 1 && text == null) 2929for (int i = 0; i < elements.Length; i++) 2993if (elements.Length - anyCount > 0) Writer.Write("else "); 3090if (elements.Length > 0) 3112if (elements.Length > 0) 3606for (int i = 0; i < members.Length; i++) 3663for (int i = 0; i < choiceMapping.Constants.Length; i++) 3737for (int i = 0; i < parameterTypes.Length; i++) 3921for (int i = 0; i < structMapping.Members.Length; i++) 3945for (int i = 0; i < enumFields.Length; i++) 3996for (int i = 0; i < memberInfos.Length; i++) 4044for (int i = 0; i < paramTypes.Length; i++) 4047if (i < (paramTypes.Length - 1)) 4109for (int i = 0; i < args.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (27)
212for (int i = 0; i < values.Length; i++) 416for (int i = 0; i < mapping.Members.Length; i++) 429for (int j = 0; j < mapping.Members.Length; j++) 471for (int i = 0; i < mapping.Members.Length; i++) 485for (int j = 0; j < mapping.Members.Length; j++) 519for (int j = 0; j < mapping.Members.Length; j++) 631if (constants.Length > 0) 642for (int i = 0; i < constants.Length; i++) 671ilg.NewArray(typeof(String), constants.Length); 673for (int i = 0; i < constants.Length; i++) 683ilg.NewArray(typeof(long), constants.Length); 686for (int i = 0; i < constants.Length; i++) 1123for (int i = 0; i < members.Length; i++) 1154for (int i = 0; i < members.Length; i++) 1160bool checkShouldPersist = m.CheckShouldPersist && (m.Elements.Length > 0 || m.Text != null); 1488!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 1498if (elements.Length == 0 && text == null) return; 1630int count = elements.Length + (text == null ? 0 : 1); 1650if (elements.Length == 0 && text == null) return; 1651if (elements.Length == 1 && text == null) 1674for (int i = 0; i < elements.Length; i++) 1737if (elements.Length - anyCount > 0) 1745if (elements.Length - anyCount > 0) ilg.InitElseIf(); 1905if (elements.Length > 0) 1919if (elements.Length > 0) 2341for (int i = 0; i < members.Length; i++) 2379for (int i = 0; i < choiceMapping.Constants.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializer.cs (10)
262for (int i = 0; i < extraTypes.Length; i++) 541if (mappings == null || mappings.Length == 0) return new XmlSerializer[0]; 556XmlSerializer[] serializers = new XmlSerializer[mappings.Length]; 560for (int i = 0; i < serializers.Length; i++) 577XmlSerializer[] serializers = new XmlSerializer[mappings.Length]; 578for (int i = 0; i < serializers.Length; i++) 586XmlSerializer[] serializers = new XmlSerializer[mappings.Length]; 602for (int i = 0; i < mappings.Length; i++) 647XmlTypeMapping[] mappings = new XmlTypeMapping[types.Length]; 648for (int i = 0; i < types.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializerNamespaces.cs (1)
46for (int i = 0; i < namespaces.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\XmlCharType.cs (2)
721Debug.Assert(startPos + len <= chars.Length); 722Debug.Assert(startPos <= chars.Length);
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (1)
343return BinHexEncoder.Encode(inArray, 0, inArray.Length);
FrameworkFork\Microsoft.Xml\Xml\XmlEncoding.cs (2)
237return chars.Length * 4; 278return bytes.Length / 4;
FrameworkFork\Microsoft.Xml\Xml\XmlException.cs (3)
195return BuildCharExceptionArgs(data, data.Length, invCharIndex); 200Debug.Assert(invCharIndex < data.Length); 202Debug.Assert(length <= data.Length);
FrameworkFork\Microsoft.Xml\Xml\XmlNamespaceManager.cs (3)
169if (_lastDecl == _nsdecls.Length - 1) 171NamespaceDeclaration[] newNsdecls = new NamespaceDeclaration[_nsdecls.Length * 2]; 172Array.Copy(_nsdecls, 0, newNsdecls, 0, _nsdecls.Length);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\FunctionQuery.cs (1)
29for (int i = 0; i < tmp.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\IDQuery.cs (1)
52for (int idx = 0; idx < ids.Length; idx++)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\SortQuery.cs (6)
168Debug.Assert(_expressions.Length == _comparers.Length); 169Debug.Assert(0 < _expressions.Length); 170Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 172if (_numSorts == _expressions.Length) 184Debug.Assert(_numSorts < _expressions.Length);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (1)
32for (int i = 0; i < tmp.Length; i++)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathMultyIterator.cs (9)
24for (int i = 0; i < this.arr.Length; i++) 33for (int i = 0; i < arr.Length; i++) 37for (int i = arr.Length - 2; firstNotEmpty <= i;) 101Debug.Assert(firstNotEmpty <= item && item < arr.Length); 103while (item + 1 < arr.Length) 134for (int i = 0; i < arr.Length; i++) 158Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false"); 168if (firstNotEmpty >= arr.Length) 178if (firstNotEmpty >= arr.Length)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathParser.cs (2)
563if (pi.ArgTypes.Length < argCount) 565argCount = pi.ArgTypes.Length; // argument we have the type specified (can be < pi.Minargs)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\BitFlagsGenerator.cs (4)
24for (int i = 0; i < _locals.Length; i++) 55return _locals.Length; 72_ilg.NewArray(typeof(byte), _locals.Length); 74for (int i = 0; i < _locals.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (14)
504int baseChildElementNamespaceCount = (baseChildElementNamespaces != null) ? baseChildElementNamespaces.Length : 0; 507Array.Copy(baseChildElementNamespaces, 0, childElementNamespaces, 0, baseChildElementNamespaces.Length); 833baseMemberCount = BaseContract.MemberNames.Length; 838baseContractCount = BaseContract.ContractNamespaces.Length; 945for (int i = 0; i < memberInfos.Length; i++) 951if (memberAttributes != null && memberAttributes.Length > 0) 953if (memberAttributes.Length > 1) 977if (getMethod.GetParameters().Length > 0) 1016if (memberAttributes != null && memberAttributes.Length > 0) 1018if (memberAttributes.Length > 1) 1027if (getMethod == null || IsMethodOverriding(getMethod) || getMethod.GetParameters().Length > 0) 1060if (optionalFields == null || optionalFields.Length == 0) 1202for (int i = 0; i < methods.Length; i++) 1239if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != Globals.TypeOfStreamingContext)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (8)
194Type[] paramTypes = new Type[parameters.Length]; 195for (int i = 0; i < parameters.Length; i++) 224for (int i = 0; i < argTypes.Length; i++) 518if (methodInfo.GetParameters().Length != expectedCount) 519throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.ParameterCountMismatch, methodInfo.Name, methodInfo.GetParameters().Length, expectedCount))); 1605for (int i = 0; i < caseLabels.Length; i++) 1691NewArray(typeof(object), values.Length); 1695for (int i = 0; i < values.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (2)
1029for (int i = 0; i < knownInterfaces.Length; i++) 1102for (int i = 0; i < knownInterfaces.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (19)
618if (id < s_dataContractCache.Length && ContractMatches(classContract, s_dataContractCache[id])) 648if (value >= s_dataContractCache.Length) 1542if (attributes.Length > 1) 1581if (collectionContractAttributes != null && collectionContractAttributes.Length > 0) 1584if (collectionContractAttributes.Length > 1) 1691for (int i = 0; i < genParams.Length; i++) 1842for (int i = 0; i < nsAttributes.Length; i++) 1908int blocks = (namespaces.Length + 8) / 64 + 1; 1920if (offset + 64 > namespaces.Length) 1924for (int j = offset; j < namespaces.Length; j++) 1928if (offset <= namespaces.Length) 1930block[namespaces.Length - offset] = 0x80; 1934block[56] = (byte)(namespaces.Length << 3); 1935block[57] = (byte)(namespaces.Length >> 5); 1936block[58] = (byte)(namespaces.Length >> 13); 1937block[59] = (byte)(namespaces.Length >> 21); 2081for (int i = 0; i < knownTypeAttributes.Length; ++i) 2354_genericParams = new object[genericParams.Length]; 2364return _genericParams.Length;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (6)
276List<DataMember> tempMembers = new List<DataMember>(fields.Length); 277List<long> tempValues = new List<long>(fields.Length); 279for (int i = 0; i < fields.Length; i++) 286if (memberAttributes != null && memberAttributes.Length > 0) 288if (memberAttributes.Length > 1) 306if (dataMemberAttributes != null && dataMemberAttributes.Length > 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (3)
183baseContractCount = BaseContract._contractNamespaces.Length; 274for (int i = 0; i < memberInfos.Length; i++) 477gen.Emit(OpCodes.Ldarg, messageGetter.GetParameters().Length);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataObject.cs (1)
206for (int i = 0; i < element.attributes.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataReader.cs (7)
498else if (_elements.Length == _depth) 500ElementData[] newElements = new ElementData[_elements.Length * 2]; 501Array.Copy(_elements, 0, newElements, 0, _elements.Length); 509return (_elements == null || _elements.Length <= nextDepth || _elements[nextDepth] == null) 583else if (attributes.Length == attributeCount) 585AttributeData[] newAttributes = new AttributeData[attributes.Length * 2]; 586Array.Copy(attributes, 0, newAttributes, 0, attributes.Length);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (3)
1009if (seq1 == null || seq2 == null || seq1.Length != seq2.Length) 1011for (int i = 0; i < seq1.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ObjectReferenceStack.cs (4)
31if (_count == _objectArray.Length) 32Array.Resize<object>(ref _objectArray, _objectArray.Length * 2); 65else if (_count == _isReferenceArray.Length) 67Array.Resize<bool>(ref _isReferenceArray, _isReferenceArray.Length * 2);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ObjectToIdCache.cs (8)
23m_objs = new Object[m_ids.Length]; 40if (m_currentCount >= (m_objs.Length - 1)) 70int pos = ((hashcode & 0x7FFFFFFF) % m_objs.Length); 83if (i == (m_objs.Length - 1)) 96j = (i + 1) % m_objs.Length; 113int size = GetPrime(m_objs.Length + 1); // The lookup does an inherent doubling 119for (int j = 0; j < oldObjs.Length; j++) 134for (int i = 0; i < primes.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaExporter.cs (1)
37if (attrs == null || attrs.Length == 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (1)
1441for (int i = 0; i < markup.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ScopedKnownTypes.cs (2)
19else if (_count == dataContractDictionaries.Length) 20Array.Resize<DataContractDictionary>(ref dataContractDictionaries, dataContractDictionaries.Length * 2);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (1)
249if (xmlRootAttributes == null || xmlRootAttributes.Length == 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (3)
271int memberCount = classContract.MemberNames.Length; 313for (; nextRequiredIndex < requiredMembers.Length; nextRequiredIndex++) 358int memberCount = contract.MemberNames.Length;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
193if (classContract.ContractNamespaces.Length > 1) 206for (int i = 0; i < classContract.ChildElementNamespaces.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (8)
220for (int i = memberIndex + 1; i < memberNames.Length; i++) 226return memberNames.Length; 235for (int i = memberIndex + 1; i < memberNames.Length; i++) 245return memberNames.Length; 255if (requiredIndex == memberNames.Length) 468if (array.Length <= index) 479Array.Copy(array, 0, newArray, 0, array.Length); 491if (size != array.Length)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlReaderDelegator.cs (8)
101for (int i = 0; i < localNames.Length; i++) 664context.IncrementItemCount(array.Length); 698context.IncrementItemCount(array.Length); 732context.IncrementItemCount(array.Length); 766context.IncrementItemCount(array.Length); 800context.IncrementItemCount(array.Length); 834context.IncrementItemCount(array.Length); 868context.IncrementItemCount(array.Length);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlSerializableServices.cs (1)
65for (int i = 0; i < nodes.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (15)
489writer.WriteBase64(bytes, 0, bytes.Length); 666for (int i = 0; i < value.Length; i++) 673dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 685for (int i = 0; i < value.Length; i++) 692dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 704for (int i = 0; i < value.Length; i++) 711dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 723for (int i = 0; i < value.Length; i++) 730dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 742for (int i = 0; i < value.Length; i++) 749dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 761for (int i = 0; i < value.Length; i++) 768dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 780for (int i = 0; i < value.Length; i++) 787dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
FrameworkFork\System.Runtime.Serialization\System\Text\Base64Encoding.cs (32)
69if (index > chars.Length) 70throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("index", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 73if (count > chars.Length - index) 74throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - index))); 129if (charIndex > chars.Length) 130throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 134if (charCount > chars.Length - charIndex) 135throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - charIndex))); 141if (byteIndex > bytes.Length) 142throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length))); 157byte* pbMax = _bytes + bytes.Length - byteIndex; 212if (charIndex > chars.Length) 213throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 217if (charCount > chars.Length - charIndex) 218throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - charIndex))); 224if (byteIndex > bytes.Length) 225throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length))); 240byte* pbMax = _bytes + bytes.Length - byteIndex; 305if (byteIndex > bytes.Length) 306throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length))); 309if (byteCount > bytes.Length - byteIndex) 310throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex))); 317if (charIndex > chars.Length) 318throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 319if (charCount < 0 || charCount > chars.Length - charIndex) 399if (byteIndex > bytes.Length) 400throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length))); 403if (byteCount > bytes.Length - byteIndex) 404throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("byteCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex))); 411if (charIndex > chars.Length) 412throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 414if (charCount < 0 || charCount > chars.Length - charIndex)
FrameworkFork\System.Runtime.Serialization\System\Text\BinHexEncoding.cs (14)
56if (charIndex > chars.Length) 57throw new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)); 60if (charCount > chars.Length - charIndex) 61throw new ArgumentOutOfRangeException("charCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)); 66if (byteIndex > bytes.Length) 67throw new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length)); 69if (byteCount < 0 || byteCount > bytes.Length - byteIndex) 127if (byteIndex > bytes.Length) 128throw new ArgumentOutOfRangeException("byteIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, bytes.Length)); 131if (byteCount > bytes.Length - byteIndex) 132throw new ArgumentOutOfRangeException("byteCount", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)); 138if (charIndex > chars.Length) 139throw new ArgumentOutOfRangeException("charIndex", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length)); 140if (charCount < 0 || charCount > chars.Length - charIndex)
FrameworkFork\System.Runtime.Serialization\System\Xml\ArrayHelper.cs (7)
32while (read < array.Length) 34int actual = ReadArray(reader, localName, namespaceUri, array, read, array.Length - read); 40if (read < array.Length || reader.NodeType == XmlNodeType.EndElement) 47if (totalRead != array.Length || arrayCount > 0) 53Array.Copy(arrays[i], 0, newArray, offset, arrays[i].Length); 54offset += arrays[i].Length; 72int actual = ReadArray(reader, localName, namespaceUri, array, 0, array.Length);
FrameworkFork\System.Runtime.Serialization\System\Xml\EncodingStreamWrapper.cs (13)
210if (bom.Length > 0) 211_stream.Write(bom, 0, bom.Length); 390if (!Compare(s_encodingAttr, buffer, i - s_encodingAttr.Length + 1)) 416if (encCount == s_encodingUTF8.Length && CompareCaseInsensitive(s_encodingUTF8, buffer, encStart)) 420else if (encCount == s_encodingUnicodeLE.Length && CompareCaseInsensitive(s_encodingUnicodeLE, buffer, encStart)) 424else if (encCount == s_encodingUnicodeBE.Length && CompareCaseInsensitive(s_encodingUnicodeBE, buffer, encStart)) 428else if (encCount == s_encodingUnicode.Length && CompareCaseInsensitive(s_encodingUnicode, buffer, encStart)) 431ThrowEncodingMismatch(s_safeUTF8.GetString(buffer, encStart, encCount), s_safeUTF8.GetString(s_encodingUTF8, 0, s_encodingUTF8.Length)); 444for (int i = 0; i < key.Length; i++) 457for (int i = 0; i < key.Length; i++) 629_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2); 721int size = _chars.Length < count ? _chars.Length : count;
FrameworkFork\System.Runtime.Serialization\System\Xml\StringHandle.cs (3)
145length = buffer.Length; 152length = buffer.Length; 160length = buffer.Length;
FrameworkFork\System.Runtime.Serialization\System\Xml\UniqueId.cs (13)
90if (offset > guid.Length) 91throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, guid.Length))); 92if (guidLength > guid.Length - offset) 130if (offset > chars.Length) 131throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 134if (count > chars.Length - offset) 135throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - offset))); 274if (offset > chars.Length) 275throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 277if (count > chars.Length - offset) 361if (offset > buffer.Length) 362throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length))); 364if (guidLength > buffer.Length - offset)
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (6)
455if (actualLength != buffer.Length) 525return Base64Encoding.GetString(bytes, 0, bytes.Length); 654DiagnosticUtility.DebugAssert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length)); 737DiagnosticUtility.DebugAssert(byteOffset + actualByteCount < bytes.Length, 738string.Format("byteOffset {0} + actualByteCount {1} MUST BE < bytes.Length {2}", byteOffset, actualByteCount, bytes.Length));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (33)
297else if (_elementNodes.Length == _depth) 331else if (_attributeNodes.Length == attributeIndex) 488if (_attributeNodes != null && _attributeNodes.Length > 16) 490if (_elementNodes != null && _elementNodes.Length > 16) 1071for (int i = 0; i < localNames.Length; i++) 1086for (int i = 0; i < localNames.Length; i++) 1113for (int i = 0; i < localNames.Length; i++) 1128for (int i = 0; i < localNames.Length; i++) 1149if (offset > chars.Length) 1150throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, chars.Length))); 1153if (count > chars.Length - offset) 1154throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - offset))); 1179if (offset > buffer.Length) 1180throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length))); 1183if (count > buffer.Length - offset) 1184throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1295if (value.Length > _quotas.MaxArrayLength) 1303return ReadContentAsBase64(_quotas.MaxArrayLength, _bufferReader.Buffer.Length); 1339if (offset > buffer.Length) 1340throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length))); 1343if (count > buffer.Length - offset) 1344throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1866if (_chars == null || _chars.Length < count) 2469if (_indeces != null && _indeces.Length > 32) 2479if (_indeces != null && _indeces.Length == _attributeCount && IsSorted()) 2483for (int i = 0; i < newIndeces.Length; i++) 2492for (int i = 0; i < _indeces.Length - 1; i++) 2569if (_namespaces != null && _namespaces.Length > 32) 2571if (_attributes != null && _attributes.Length > 4) 2593nameSpace.Uri.SetValue(3, xmlBuffer.Length - 3); 2630for (int i = 0; i < _shortPrefixUri.Length; i++) 2694else if (_attributes.Length == _attributeCount) 2732else if (_namespaces.Length == _nsCount)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseWriter.cs (14)
616else if (_elements.Length == _depth) 1008if (count > chars.Length - offset) 1009throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - offset))); 1065if (count > chars.Length - offset) 1066throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, chars.Length - offset))); 1435if (count > buffer.Length - offset) 1436throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1554for (int i = 0; i < array.Length; i++) 1573for (int i = 0; i < array.Length; i++) 1771if (_namespaces != null && _namespaces.Length > 32) 1773if (_attributes != null && _attributes.Length > 4) 1853else if (_attributes.Length == _attributeCount) 1881for (int i = 0; i < s_prefixes.Length; i++) 1947if (_namespaces.Length == _nsCount)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryReader.cs (9)
41if (offset > buffer.Length) 42throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length))); 45if (count > buffer.Length - offset) 46throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1006BufferReader.InsertBytes(buffer, 0, buffer.Length); 1211if (offset > array.Length) 1212throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, array.Length))); 1215if (count > array.Length - offset) 1216throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, array.Length - offset)));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryReaderSession.cs (6)
49else if (id >= _strings.Length) 51XmlDictionaryString[] newStrings = new XmlDictionaryString[Math.Min(Math.Max(id + 1, _strings.Length * 2), MaxArrayEntries)]; 52Array.Copy(_strings, 0, newStrings, 0, _strings.Length); 62if (_strings != null && key >= 0 && key < _strings.Length) 83for (int i = 0; i < _strings.Length; i++) 126Array.Clear(_strings, 0, _strings.Length);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryWriter.cs (6)
1157while ((count = reader.ReadValueChunk(_chars, 0, _chars.Length)) > 0) 1182while ((count = reader.ReadValueAsBase64(_bytes, 0, _bytes.Length)) > 0) 1273if (offset > array.Length) 1274throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, array.Length))); 1277if (count > array.Length - offset) 1278throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, array.Length - offset)));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryWriterSession.cs (6)
121Array.Clear(_list, 0, _list.Length); 178if (_listCount < _list.Length) 243if (index >= _array.Length) 250if (index >= _array.Length) 252int[] newArray = new int[Math.Max(index + 1, _array.Length * 2)]; 253Array.Copy(_array, 0, newArray, 0, _array.Length);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBufferReader.cs (9)
84_windowOffsetMax = _streamBuffer.Length; 105if (_streamBuffer != null && _streamBuffer.Length > 4096) 199if (_offsetMax >= _buffer.Length) 223if (newOffsetMax > _buffer.Length) 225byte[] newBuffer = new byte[Math.Max(newOffsetMax, _buffer.Length * 2)]; 251if (_offsetMax > buffer.Length - count) 582if (_chars == null || _chars.Length < count) 910int length2 = buffer2.Length; 1138System.Buffer.BlockCopy(_buffer, offset, _guid, 0, _guid.Length);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (3)
466if (objects.Length == 0) 469if (objects.Length > 1) 472for (int i = 1; i < objects.Length; i++)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionary.cs (1)
57else if (_nextId == _strings.Length)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (20)
42return CreateBinaryReader(buffer, 0, buffer.Length, quotas); 84return CreateTextReader(buffer, 0, buffer.Length, quotas); 239for (int i = 0; i < localNames.Length; i++) 265for (int i = 0; i < localNames.Length; i++) 411while (read < buffer.Length) 415actual = ReadContentAsBase64(buffer, read, buffer.Length - read); 417actual = ReadContentAsBinHex(buffer, read, buffer.Length - read); 423if (read < buffer.Length) 431Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length); 432offset += buffers[i].Length; 485Guid[] guids = new Guid[values.Length]; 486for (int i = 0; i < values.Length; i++) 493UniqueId[] uniqueIds = new UniqueId[values.Length]; 494for (int i = 0; i < values.Length; i++) 507for (int i = 0; i < strings.Length; i++) 527for (int i = 0; i < strings.Length; i++) 897if (offset > array.Length) 898throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, array.Length))); 901if (count > array.Length - offset) 902throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, array.Length - offset)));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryWriter.cs (4)
409if (offset > array.Length) 410throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, array.Length))); 413if (count > array.Length - offset) 414throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, array.Length - offset)));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlStreamNodeWriter.cs (3)
425for (int i = 0; i < chArray.Length; i++) 444byte* bytesMax = &bytes[buffer.Length - offset]; 471int toCopy = Math.Min(newBytes.Length, (int)(bytesMax - bytes));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlUTF8TextReader.cs (5)
568if (offset > buffer.Length) 569throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", string.Format(SRSerialization.OffsetExceedsBufferSize, buffer.Length))); 572if (count > buffer.Length - offset) 573throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", string.Format(SRSerialization.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1444while (j < _rowOffsets.Length - 1 && _rowOffsets[j + 1] < offset)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlUTF8TextWriter.cs (6)
137if (_chars == null || _chars.Length < charCount) 146WriteUTF8Chars(s_utf8Decl, 0, s_utf8Decl.Length); 150WriteUTF8Chars(s_startDecl, 0, s_startDecl.Length); 155WriteUTF8Chars(s_endDecl, 0, s_endDecl.Length); 470int isEscapedCharLength = isEscapedChar.Length; 488int isEscapedCharLength = isEscapedChar.Length;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\BufferedOutputStream.cs (10)
112if (_currentChunk.Length > (int.MaxValue / 2)) 118newChunkSize = _currentChunk.Length * 2; 125if (_chunkCount == _chunks.Length) 127byte[][] newChunks = new byte[_chunks.Length * 2][]; 128Array.Copy(_chunks, newChunks, _chunks.Length); 205Buffer.BlockCopy(chunk, 0, buffer, offset, chunk.Length); 206offset += chunk.Length; 252int remainingSizeInChunk = _currentChunk.Length - _currentChunkSize; 261_currentChunkSize = _currentChunk.Length; 285if (_currentChunkSize == _currentChunk.Length)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (3)
246if (typeNames != null && typeNames.Length > 0) 248List<Type> types = new List<Type>(typeNames.Length); 249for (int i = 0; i < typeNames.Length; i++)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InputQueue.cs (8)
383for (int i = 0; i < outstandingReaders.Length; i++) 497for (int i = 0; i < outstandingReaders.Length; i++) 505for (int i = 0; i < waiters.Length; i++) 978_head = (_head + 1) % _items.Length; 984if (_totalCount == _items.Length) 986Item[] newItems = new Item[_items.Length * 2]; 989newItems[i] = _items[(_head + i) % _items.Length]; 994int tail = (_head + _totalCount) % _items.Length;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InternalBufferManager.cs (9)
97_bufferSizes = new int[_bufferPools.Length]; 98for (int i = 0; i < _bufferPools.Length; i++) 110for (int i = 0; i < _bufferPools.Length; i++) 151for (int i = 0; i < _bufferPools.Length; i++) 175for (int i = 0; i < _bufferPools.Length; i++) 196for (int i = 0; i < _bufferSizes.Length; i++) 217BufferPool bufferPool = FindPool(buffer.Length); 220if (buffer.Length != bufferPool.BufferSize) 337for (int i = 0; i < _bufferPools.Length; i++)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\SynchronizedPool.cs (11)
85for (int i = 0; i < entries.Length; i++) 101_entries = new Entry[_entries.Length]; 118for (int i = 0; i < _entries.Length; i++) 142for (int i = 0; i < localPending.Length; i++) 176for (int i = 0; i < localPending.Length; i++) 197if (localPending.Length >= maxPendingEntries) 199_pending = new PendingEntry[localPending.Length]; 203PendingEntry[] newPending = new PendingEntry[localPending.Length * 2]; 204Array.Copy(localPending, newPending, localPending.Length); 230for (int i = 0; i < entries.Length; i++) 285for (int i = 0; i < entries.Length; i++)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\UrlUtility.cs (4)
90return AsciiEncoding.GetString(bytes, 0, bytes.Length); 151bytes = UrlEncodeBytesToBytesInternalNonAscii(bytes, 0, bytes.Length, false); 153return AsciiEncoding.GetString(bytes, 0, bytes.Length); 173return UrlEncodeBytesToBytesInternal(bytes, 0, bytes.Length, false);
FrameworkFork\System.ServiceModel\System\IdentityModel\CanonicalFormWriter.cs (5)
20if (s.Length > workBuffer.Length) 45EncodeAndWrite(stream, workBuffer, chars, chars.Length); 50if (count > workBuffer.Length) 76stream.Write(buffer, 0, buffer.Length); 82stream.Write(buffer, 0, buffer.Length);
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\ClaimComparer.cs (5)
196if (bytes1.Length != bytes2.Length) 199for (int i = 0; i < bytes1.Length; ++i) 215for (int i = 0; i < bytes.Length && i < 4; ++i) 220return hashCode ^ bytes.Length;
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (5)
175if (dnsEntries.Length > 0) 177for (int i = 0; i < dnsEntries.Length; ++i) 261if (dnsEntries.Length > 0) 263for (int i = 0; i < dnsEntries.Length; ++i) 321for (int i = 0; i < rawDnsEntries.Length; i++)
FrameworkFork\System.ServiceModel\System\IdentityModel\SecurityUtils.cs (7)
76return CloneBuffer(buffer, 0, buffer.Length); 83DiagnosticUtility.DebugAssert(buffer.Length - offset >= len, "Invalid parameters to CloneBuffer."); 104if (src == null || srcOffset >= src.Length) 106if (dst == null || dstOffset >= dst.Length) 108if ((src.Length - srcOffset) != (dst.Length - dstOffset)) 111for (int i = srcOffset, j = dstOffset; i < src.Length; i++, j++)
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\SecurityTokenSerializer.cs (1)
223for (int i = 0; i < tokenTypes.Length; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\Selectors\X509CertificateValidator.cs (1)
102for (int i = 0; i < chainStatus.Length; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\BinaryKeyIdentifierClause.cs (1)
26if (identificationData.Length == 0)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\LocalIdKeyIdentifierClause.cs (2)
57get { return (_ownerTypes == null || _ownerTypes.Length == 0) ? null : _ownerTypes[0]; } 75for (int i = 0; i < _ownerTypes.Length; ++i)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityKeyIdentifier.cs (2)
30_clauses = new List<SecurityKeyIdentifierClause>(clauses.Length); 31for (int i = 0; i < clauses.Length; i++)
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SymmetricKey.cs (7)
28if (symmetricKey.Length == 0) 30throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(string.Format(SRServiceModel.SymmetricKeyLengthTooShort, symmetricKey.Length))); 32_keySize = symmetricKey.Length * 8; 36_symmetricKey = new byte[symmetricKey.Length]; 37Buffer.BlockCopy(symmetricKey, 0, _symmetricKey, 0, symmetricKey.Length); 96byte[] local = new byte[_symmetricKey.Length]; 97Buffer.BlockCopy(_symmetricKey, 0, local, 0, _symmetricKey.Length);
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\WSSecurityJan2004.cs (3)
311writer.WriteBase64(keyIdentifier, 0, keyIdentifier.Length); 315writer.WriteBinHex(keyIdentifier, 0, keyIdentifier.Length); 319writer.WriteString(new UTF8Encoding().GetString(keyIdentifier, 0, keyIdentifier.Length));
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\XmlEncApr2001.cs (1)
130writer.WriteBase64(encryptedKey, 0, encryptedKey.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (11)
408if (buffer.Length < requiredBufferSize) 1129if (size < buffer2.Length) 1134for (int i = 0; i < buffer2.Length; i++, j++) 1141return buffer2.Length; 1371totalBytesMatched = s_requestFragment1.Length + messageIDSize + s_requestFragment2.Length; 1413totalBytesMatched = s_responseFragment1.Length + messageIDSize + s_responseFragment2.Length; 1416totalBytesMatched += s_commonFragment.Length + actionSize; 1433int abandonedSize = totalBytesMatched - s_bodyFragment.Length; 1438Buffer.BlockCopy(s_bodyFragment, 0, buffer, offset, s_bodyFragment.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BindingElementCollection.cs (2)
33for (int i = 0; i < elements.Length; i++) 55for (int i = 0; i < elements.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BindingParameterCollection.cs (1)
23for (int i = 0; i < parameters.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedWriteStream.cs (3)
80if (_buffer.Length != _bufferSize || _bufferSize >= MaxShadowBufferSize) 269Contract.Assert(count <= array.Length - offset); 400Contract.Assert(count <= buffer.Length - offset);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChainedAsyncResult.cs (2)
145for (int index = 0; index < objs.Length; index++) 180for (int index = 0; index < objs.Length; index++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (2)
123: this(innerConnection, initialData, 0, initialData.Length) 779ValidateBufferBounds(buffer.Length, offset, size);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\CoreClrSocketConnection.cs (1)
895_asyncReadEventArgs.SetBuffer(_readBuffer, 0, _readBuffer.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (18)
54Connection.Write(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length, true, timeout); 59return Connection.WriteAsync(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length, true, timeout); 90return this.Connection.BeginWrite(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length, 200int startSize = ClientDuplexEncoder.ModeBytes.Length + SessionEncoder.CalcStartSize(encodedVia, encodedContentType); 205startSize += ClientDuplexEncoder.PreambleEndBytes.Length; 209Buffer.BlockCopy(ClientDuplexEncoder.ModeBytes, 0, startBytes, 0, ClientDuplexEncoder.ModeBytes.Length); 210SessionEncoder.EncodeStart(startBytes, ClientDuplexEncoder.ModeBytes.Length, encodedVia, encodedContentType); 213Buffer.BlockCopy(ClientDuplexEncoder.PreambleEndBytes, 0, startBytes, preambleEndOffset, ClientDuplexEncoder.PreambleEndBytes.Length); 267await connection.WriteAsync(ClientDuplexEncoder.PreambleEndBytes, 0, ClientDuplexEncoder.PreambleEndBytes.Length, true, timeoutHelper.RemainingTime()); 270int ackBytesRead = await connection.ReadAsync(ackBuffer, 0, ackBuffer.Length, timeoutHelper.RemainingTime()); 301connection.Write(ClientDuplexEncoder.PreambleEndBytes, 0, ClientDuplexEncoder.PreambleEndBytes.Length, true, timeoutHelper.RemainingTime()); 305int ackBytesRead = connection.Read(ackBuffer, 0, ackBuffer.Length, timeoutHelper.RemainingTime()); 495int size = connection.Read(faultBuffer, offset, faultBuffer.Length, timeoutHelper.RemainingTime()); 518size = connection.Read(faultBuffer, offset, faultBuffer.Length, timeoutHelper.RemainingTime()); 535connection.Write(encodedUpgrade.EncodedBytes, 0, encodedUpgrade.EncodedBytes.Length, true, timeoutHelper.RemainingTime()); 539int size = connection.Read(buffer, 0, buffer.Length, timeoutHelper.RemainingTime()); 569await connection.WriteAsync(encodedUpgrade.EncodedBytes, 0, encodedUpgrade.EncodedBytes.Length, true, timeout); 573int size = await connection.ReadAsync(buffer, 0, buffer.Length, timeout);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingDecoders.cs (2)
134if (_encodedBytes == null || _encodedBytes.Length < _encodedSize) 179for (int i = 0; i < buffer1.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingEncoders.cs (15)
80(_encodedBytes[_encodedBytes.Length / 2] << 8) | 81_encodedBytes[_encodedBytes.Length - 1]; 98if (_encodedBytes.Length != otherBytes.Length) 101for (int i = 0; i < _encodedBytes.Length; i++) 209return via.EncodedBytes.Length + contentType.EncodedBytes.Length; 214Buffer.BlockCopy(via.EncodedBytes, 0, buffer, offset, via.EncodedBytes.Length); 215Buffer.BlockCopy(contentType.EncodedBytes, 0, buffer, offset + via.EncodedBytes.Length, contentType.EncodedBytes.Length); 343return via.EncodedBytes.Length + contentType.EncodedBytes.Length; 348Buffer.BlockCopy(via.EncodedBytes, 0, buffer, offset, via.EncodedBytes.Length); 349Buffer.BlockCopy(contentType.EncodedBytes, 0, buffer, offset + via.EncodedBytes.Length, contentType.EncodedBytes.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
1056for (int i = 0; i < headerKeys.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelHelpers.cs (2)
211if (offset >= buffer.Length) 214string.Format(SRServiceModel.OffsetExceedsBufferBound, buffer.Length - 1)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (5)
46if (handlers.Length == 0) 51_handlerCtors = new ConstructorInfo[handlers.Length]; 52for (int cnt = 0; cnt < handlers.Length; cnt++) 161DelegatingHandler[] instances = new DelegatingHandler[_handlerCtors.Length]; 162for (int cnt = 0; cnt < _handlerCtors.Length; cnt++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\IdlingCommunicationPool.cs (2)
259for (int i = 0; i < connectionsCopy.Length; i++) 271for (int i = 0; i < connectionsCopy.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Message.cs (5)
1787for (int i = 0; i < attributes.Length; i++) 1803for (int i = 0; i < attributes.Length; i++) 1841for (int i = 0; i < attributes.Length; i++) 2065if (_count < _entries.Length) 2071Array.Copy(_entries, 1, _entries, 0, _entries.Length - 1);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageBuffer.cs (3)
70for (int i = 0; i < _understoodHeaders.Length; ++i) 98for (int i = 0; i < _properties.Length; i++) 127for (int i = 0; i < _understoodHeaders.Length; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (3)
58for (int i = 0; i < headerKeys.Length; i++) 97Contract.Assert(actionParams.Length <= 1, "action MUST only appear as a content type parameter at most 1 time"); 98if (actionParams.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (1)
62int currentBufferSize = Math.Min(buffer.Length, maxBufferSize);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageHeaders.cs (12)
116Init(collection._version, collection._headers.Length); 147get { return _headers.Length <= MaxRecycledArrayLength; } 546if (index < 0 || (index + _headerCount) > array.Length) 550string.Format(SRServiceModel.ValueMustBeInRange, 0, array.Length - _headerCount))); 639for (int j = 0; j < actors.Length; j++) 645if (actors.Length == 1) 672for (int j = 0; j < actors.Length; j++) 678if (actors.Length == 1) 1118for (int actorIndex = 0; actorIndex < actors.Length; ++actorIndex) 1239if (_headerCount == _headers.Length) 1241if (_headers.Length == 0) 1247Header[] newHeaders = new Header[_headers.Length * 2];
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageProperties.cs (19)
84return _properties == null || _properties.Length <= MaxRecycledArrayLength; 186for (int i = 0; i < _properties.Length; i++) 249for (int i = 0; i < _properties.Length; i++) 316for (int i = 0; i < _properties.Length; i++) 352for (int i = 0; i < properties._properties.Length; i++) 390for (int i = 0; i < properties._properties.Length; i++) 423for (int i = 0; i < array.Length; i++) 477for (int i = 0; i < _properties.Length; i++) 506for (int i = 0; i < _properties.Length; i++) 646for (shiftIndex = index + 1; shiftIndex < _properties.Length; shiftIndex++) 698for (newIndex = 0; newIndex < _properties.Length; newIndex++) 706if (newIndex == _properties.Length) 708Property[] newProperties = new Property[_properties.Length * 2]; 709Array.Copy(_properties, newProperties, _properties.Length); 727if (array.Length < _propertyCount) 729if (index < 0 || index > array.Length - _propertyCount) 731string.Format(SRServiceModel.ValueMustBeInRange, 0, array.Length - _propertyCount))); 747for (int i = 0; i < _properties.Length; i++) 817for (int i = 0; i < _properties.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ProducerConsumerStream.cs (4)
57if (offset < 0 || offset > buffer.Length) 61if (count <= 0 || count > buffer.Length - offset) 114if (offset < 0 || offset > buffer.Length) 118if (count < 0 || count > buffer.Length - offset)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (5)
430for (int i = 0; i < methodDatas.Length; i++) 452for (int i = 0; i < _methodDatas.Length; i++) 460MethodData[] newMethodDatas = new MethodData[_methodDatas.Length * 2]; 461Array.Copy(_methodDatas, newMethodDatas, _methodDatas.Length); 462newMethodDatas[_methodDatas.Length] = methodData;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SessionConnectionReader.cs (4)
148var result = _connection.BeginRead(0, _buffer.Length, timeoutHelper.RemainingTime(), TaskHelpers.OnAsyncCompletionCallback, tcs); 205(EnvelopeSize - EnvelopeOffset) >= _buffer.Length) 207bytesRead = _connection.Read(EnvelopeBuffer, EnvelopeOffset, _buffer.Length, timeoutHelper.RemainingTime()); 212bytesRead = _connection.Read(_buffer, 0, _buffer.Length, timeoutHelper.RemainingTime());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (5)
52_asyncReadBufferSize = _readBuffer.Length; 503if (addresses.Length == 0) 532invalidAddressCount, addresses.Length, addressStringBuilder.ToString()), innerException)); 549for (int i = 0; i < addresses.Length; i++) 601for (int i = 0; i < addresses.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (5)
56Encoding[] enc = new Encoding[supported.Length]; 57Array.Copy(supported, enc, supported.Length); 101ContentEncoding[] map = new ContentEncoding[readEncodings.Length]; 102for (int i = 0; i < readEncodings.Length; i++) 120for (int i = 0; i < contentMap.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportDefaults.cs (4)
74for (int i = 0; i < supportedEncodings.Length; i++) 86for (int i = 0; i < charSetEncodings.Length; i++) 103for (int i = 0; i < charSetEncodings.Length; i++) 113for (int i = 0; i < charSetEncodings.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketHelper.cs (1)
85for (int i = 0; i < chars.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (4)
581new ArraySegment<byte>(internalBuffer, receivedByteCount, internalBuffer.Length - receivedByteCount), 588if (receivedByteCount >= internalBuffer.Length && !result.EndOfMessage) 590if (internalBuffer.Length >= _maxBufferSize) 596int newSize = (int)Math.Min(((double)internalBuffer.Length) * 2, _maxBufferSize);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportSettings.cs (1)
103if (value.Split(WebSocketHelper.ProtocolSeparators).Length > 1)
FrameworkFork\System.ServiceModel\System\ServiceModel\ClientBase.cs (10)
541object[] inArgs = new object[args.Length + 2]; 542Array.Copy(args, inArgs, args.Length); 543inArgs[inArgs.Length - 2] = callback; 544inArgs[inArgs.Length - 1] = state; 554object[] inArgs = new object[args.Length + 1]; 555Array.Copy(args, inArgs, args.Length); 556inArgs[inArgs.Length - 1] = result; 566Fx.Assert(retArgs.Length == inArgs.Length, "retArgs.Length should be equal to inArgs.Length"); 567Array.Copy(retArgs, args, args.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ClientClassGenerator.cs (19)
115Fx.Assert(s_clientCtorParamNames.Length == s_clientCtorParamTypes.Length, s_debugCheckTable_errorString); 117for (int i = 0; i < s_clientCtorParamTypes.Length; i++) 131Fx.Assert(s_clientBaseType.GetConstructors(s_ctorBindingFlags).Length == s_clientCtorParamTypes.Length * 2, s_debugCheckTable_errorString); 134Fx.Assert(s_duplexClientBaseType.GetConstructors(s_ctorBindingFlags).Length == s_clientCtorParamTypes.Length * 2, s_debugCheckTable_errorString); 139T[] newArr = new T[arr.Length + 1]; 141Array.Copy(arr, 0, newArr, 1, arr.Length); 150Fx.Assert(parameters.Length == paramNames.Length, s_debugCheckTable_errorString); 151for (int i = 0; i < paramNames.Length; i++) 174if (!(s_clientCtorParamNames.Length == s_clientCtorParamTypes.Length)) 180for (int i = 0; i < s_clientCtorParamNames.Length; i++) 182if (!(s_clientCtorParamNames[i].Length == s_clientCtorParamTypes[i].Length)) 195for (int j = 0; j < s_clientCtorParamNames[i].Length; j++) 532for (int i = 0; i < s_eventArgsCtorParamTypes.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ImportedPolicyConversionContext.cs (2)
282for (currentDigit = 0; currentDigit < digits.Length && !digits[currentDigit].Value.MoveNext(); currentDigit++) 292if (currentDigit == digits.Length)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessageContractImporter.cs (3)
728if (parts.Length > 0) 736for (; partIndex < parts.Length; partIndex++) 1316for (int i = 0; i < messageParts.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (1)
1287for (int i = 0; i < supportedEncodings.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceContractGenerator.cs (1)
650for (int i = 0; i < xHeaders.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (15)
66for (int i = 0; i < args.Length; ++i) 516if (attrs.Length == 0) 531if (attrs == null || attrs.Length == 0) 535else if (attrs.Length > 1) 568if (attrs != null && attrs.Length > 0) 698int len = parameters.Length; 734int len = parameters.Length; 768int len = parameters.Length; 791if (endMethods.Length == 0) 795if (endMethods.Length > 1) 825parameters.Length < 2 || 826parameters[parameters.Length - 2].ParameterType != s_asyncCallbackType || 827parameters[parameters.Length - 1].ParameterType != s_objectType || 885parameters.Length < 1 || 886parameters[parameters.Length - 1].ParameterType != s_asyncResultType)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (25)
308for (int i = 0; i < ifaceAttributes.Length; i++) 358if (knownTypeAttributes.Length == 1) 382for (int i = 0; i < knownTypeAttributes.Length; ++i) 454for (int k = 0; k < methodAttributes.Length; k++) 536if (parameters1.Length != parameters2.Length) 541for (int i = 0; i < parameters1.Length; ++i) 974if (opAttr.IsOneWay && methodAttributes.Length > 0) 979for (int i = 0; i < methodAttributes.Length; i++) 1131if (parameters.Length == 1 && parameters[0].ParameterType.IsDefined(typeof(MessageContractAttribute), false)) 1158if (responseType.IsDefined(typeof(MessageContractAttribute), false) && parameters.Length == 0) 1226for (int index = 0; index < parameters.Length; index++) 1544if (partDescriptions.Length > 1) 1591if (_syncInputs.Length != _asyncInputs.Length || _syncOutputs.Length != _asyncOutputs.Length) 1605for (int i = 0; i < _syncInputs.Length; i++) 1622for (int i = 0; i < _syncOutputs.Length; i++) 1732if (_syncInputs.Length != _taskInputs.Length) 1745for (int i = 0; i < _syncInputs.Length; i++) 1849if (_taskInputs.Length != _asyncInputs.Length) 1863for (int i = 0; i < _taskInputs.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlExporter.cs (4)
971if (!(scopes.Length > 0)) 985for (int j = 0; j < scopes.Length; j++) 1152originalAttributeCount = originalAttributes.Length; 1159attributes[attributes.Length - 1] = newAttribute;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (6)
817if (xfeAttributes.Length > 0) 1033if (attributes != null && attributes.Length > 0) 1376if (attributes != null && attributes.Length > 0) 1385i = attributes.Length; 1412if (attributes != null && attributes.Length > 0) 2146if (attributes != null && attributes.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\XmlSerializerOperationBehavior.cs (1)
499Array.Copy(members, newMembers, newMembers.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (6)
147if (headerParts == null || headerParts.Length == 0) 150for (int i = 0; i < headerParts.Length; i++) 209for (int i = 0; i < parts.Length; i++) 282multipleHeaderValues = new KeyValuePair<Type, ArrayList>[parameters.Length]; 316for (int i = 0; i < parameters.Length; i++) 384for (int i = nextPartIndex; i < parts.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DispatchOperationRuntime.cs (4)
166if (this.ParameterInspectors.Length > 0) 174for (int i = 0; i < this.ParameterInspectors.Length; i++) 187if (this.ParameterInspectors.Length > 0) 195for (int i = this.ParameterInspectors.Length - 1; i >= 0; i--)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (2)
225if (array != null && array.Length > 0) 588if (array != null && array.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ErrorBehavior.cs (2)
116for (int i = 0; i < _handlers.Length; i++) 188for (int i = 0; i < _handlers.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\FaultFormatter.cs (3)
20for (int i = 0; i < detailTypes.Length; i++) 72for (int i = 0; i < _faultContractInfos.Length; i++) 97for (int i = 0; i < _faultContractInfos.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ImmutableClientRuntime.cs (6)
48_correlationCount = _messageInspectors.Length + behavior.MaxParameterInspectors; 58get { return _messageInspectors.Length; } 92for (int i = 0; i < _messageInspectors.Length; i++) 120for (int i = 0; i < _messageInspectors.Length; i++) 163for (int i = 0; i < _channelInitializers.Length; ++i) 261while (++_index < _initializers.Length)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\InvokerUtil.cs (3)
34var inputCount = parameters.Length; 47outputParameterCount = outputPos.Length; 69for (var i = 0; i < outputPos.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ListenerHandler.cs (3)
155for (int index = 0; index < channels.Length; index++) 225for (int index = 0; index < channels.Length; index++) 273for (int index = 0; index < channels.Length; index++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\MessageOperationFormatter.cs (4)
28if (parameters != null && parameters.Length > 0) 40if (parameters.Length != 1) 50if (parameters != null && parameters.Length > 0) 60if (parameters.Length != 1 || !(parameters[0] is Message))
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\OperationFormatter.cs (3)
626for (int i = 0; i < _members.Length; i++) 634for (int i = 0; i < _members.Length; i++) 642get { return _members.Length; }
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (18)
519if (parts.Length != parameters.Length) 521new ArgumentException(string.Format(SRServiceModel.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters")); 526for (int i = nextPartIndex; i < parts.Length; i++) 584if (parts.Length != parameters.Length) 586new ArgumentException(string.Format(SRServiceModel.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters")); 589for (int i = 0; i < parts.Length; i++) 813writer.WriteBase64(arrayValue, 0, arrayValue.Length); 819writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 825writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 831writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 837writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 843writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 849writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 855writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ProxyOperationRuntime.cs (14)
172for (int i = _parameterInspectors.Length - 1; i >= 0; i--) 213for (int i = 0; i < _parameterInspectors.Length; i++) 307if (_outParams.Length == 0) 313outs = new object[_outParams.Length]; 315if (_inParams.Length == 0) 323if (_inParams.Length == 0) 329ins = new object[_inParams.Length]; 333for (int i = 0; i < ins.Length; i++) 338callback = args[methodCall.Args.Length - 2] as AsyncCallback; 339asyncState = args[methodCall.Args.Length - 1]; 345outs = new object[_endOutParams.Length]; 346result = methodCall.Args[methodCall.Args.Length - 1] as IAsyncResult; 366if (parameters.Length == 0) 372for (int i = 0; i < parameters.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\StreamFormatter.cs (1)
250if (buffer.Length - offset < count)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\SyncMethodInvoker.cs (2)
85else if (inputs.Length != _inputParameterCount) 86throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(SRServiceModel.SFxInputParametersToServiceInvalid, _inputParameterCount, inputs.Length)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (2)
142else if (inputs.Length != _inputParameterCount) 145inputs.Length)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerObjectSerializer.cs (1)
100if (deserializedObjects != null && deserializedObjects.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (7)
74messageHeaderOfTHelper = new MessageHeaderOfTHelper(parameters.Length); 187messageHeaderOfTHelper = new MessageHeaderOfTHelper(parameters.Length); 434MessageHeader<object>[] messageHeaderOfTAttributes = new MessageHeader<object>[messageHeaderOfTArray.Length]; 435Array tArray = Array.CreateInstance(headerDescription.Type, messageHeaderOfTArray.Length); 436for (int i = 0; i < tArray.Length; i++) 458for (int i = 0; i < messageHeaderOfTAttributes.Length; i++) 495for (int i = 0; i < messageHeaderOfTArray.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (1)
170if (headers == null || headers.Length == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\FaultException.cs (4)
251for (int i = nodes.Length - 1; i >= 0; i--) 263for (int i = 0; i < array.Length; i++) 299FaultReasonText[] reasons = new FaultReasonText[nodes.Length]; 301for (int i = 0; i < nodes.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\OperationContractAttribute.cs (1)
126|| methodInfo.GetParameters().Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Pool.cs (1)
39if (_count < _items.Length)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\BinaryNegotiation.cs (1)
70writer.WriteBase64(_negotiationData, 0, _negotiationData.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\DataProtectionSecurityStateEncoder.cs (5)
34_entropy = DiagnosticUtility.Utility.AllocateByteArray(entropy.Length); 35Buffer.BlockCopy(entropy, 0, _entropy, 0, entropy.Length); 52result = DiagnosticUtility.Utility.AllocateByteArray(_entropy.Length); 53Buffer.BlockCopy(_entropy, 0, result, 0, _entropy.Length); 63result.AppendFormat("{0} Entropy Length={1}", Environment.NewLine, (_entropy == null) ? 0 : _entropy.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\EncryptedData.cs (2)
95writer.WriteBase64(_iv, 0, _iv.Length); 96writer.WriteBase64(_cipherText, 0, _cipherText.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\EncryptedType.cs (1)
131writer.WriteBase64(_wrappedKey, 0, _wrappedKey.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\InMemoryNonceCache.cs (4)
69if (nonce.Length < s_minimumNonceLength) 79if (nonce.Length < s_minimumNonceLength) 121int length1 = nonce1.Length; 123int length2 = nonce2.Length;
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\MessagePartSpecification.cs (3)
171if (headerTypes != null && headerTypes.Length > 0) 173_headerTypes = new List<XmlQualifiedName>(headerTypes.Length); 174for (int i = 0; i < headerTypes.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (13)
173for (int i = 0; i < s_TokenImpersonationLevelOrder.Length; i++) 436while (read < buffer.Length) 438int actual = reader.ReadContentAsBase64(buffer, read, buffer.Length - read); 446if (read < buffer.Length) 454Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length); 455offset += buffers[i].Length; 852byte[] copy = Fx.AllocateByteArray(buffer.Length); 853Buffer.BlockCopy(buffer, 0, copy, 0, buffer.Length); 859certificate = (rawData == null || rawData.Length == 0) ? null : new X509Certificate2(rawData); 965if (partsWithSlashDelimiter.Length == 2 && partsWithAtDelimiter.Length == 1) 972else if (partsWithSlashDelimiter.Length == 1 && partsWithAtDelimiter.Length == 2)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityVersion.cs (1)
276writer.WriteBase64(signature, 0, signature.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\BinarySecretSecurityToken.cs (3)
52_key = new byte[key.Length]; 53Buffer.BlockCopy(key, 0, _key, 0, key.Length); 82get { return (_key.Length * 8); }
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\Tokens\SecurityContextSecurityToken.cs (5)
228byte[] retval = new byte[_key.Length]; 229Buffer.BlockCopy(_key, 0, retval, 0, _key.Length); 246if (key == null || key.Length == 0) 271_key = new byte[key.Length]; 272Buffer.BlockCopy(key, 0, _key, 0, key.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecureConversation.cs (4)
213if (nonce != null && nonce.Length > _maxKeyDerivationNonceLength) 215throw DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(new MessageSecurityException(string.Format(SRServiceModel.DerivedKeyTokenNonceTooLong, nonce.Length, _maxKeyDerivationNonceLength))); 298writer.WriteBase64(derivedKeyToken.Nonce, 0, derivedKeyToken.Nonce.Length); 441writer.WriteBase64(sct.CookieBlob, 0, sct.CookieBlob.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityJan2004.cs (1)
148writer.WriteBase64(rawData, 0, rawData.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityTokenSerializer.cs (1)
471for (int i = 0; i < tokenTypes.Length; ++i)
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSUtilitySpecificationVersion.cs (6)
98writer.WriteChars(creationTime, 0, creationTime.Length); 103writer.WriteChars(expiryTime, 0, expiryTime.Length); 154stream.Write(_fragment1, 0, _fragment1.Length); 156stream.Write(_fragment2, 0, _fragment2.Length); 158stream.Write(_fragment3, 0, _fragment3.Length); 160stream.Write(_fragment4, 0, _fragment4.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\XmlHelper.cs (3)
256if (value == null || value.Length == 0) 282if (parts.Length > 2) 287if (parts.Length == 2)
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (1)
287for (int index = 0; index < channels.Length; index++)
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedCollection.cs (2)
49_items = new List<T>(list.Length); 50for (int i = 0; i < list.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedReadOnlyCollection.cs (2)
48_items = new List<T>(list.Length); 49for (int i = 0; i < list.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\UriSchemeKeyedCollection.cs (1)
21for (int i = 0; i < addresses.Length; i++)
FrameworkFork\System.ServiceModel\System\ServiceModel\XmlBuffer.cs (1)
74return _buffer.Length;
FrameworkFork\System.Web.Services\Configuration\WebServicesSection.cs (5)
59if (attrs.Length == 0) 77string[] prefixes = new string[attrs.Length]; 79for (int i = 0; i < attrs.Length; i++) 86for (int i = 0; i < prefixes.Length; i++) 112if (attrs.Length == 0)
FrameworkFork\System.Web.Services\Services\Description\ServiceDescription.cs (3)
1226for (int i = 0; i < _parameters.Length; i++) 1432MessagePart[] partArray = new MessagePart[partNames.Length]; 1433for (int i = 0; i < partNames.Length; i++)
FrameworkFork\System.Web.Services\Services\Description\ServiceDescriptionSerializer.cs (65)
45for (int i = 0; i < a.Length; i++) 157for (int i = 0; i < a.Length; i++) 227for (int i = 0; i < a.Length; i++) 398for (int i = 0; i < a.Length; i++) 495for (int i = 0; i < a.Length; i++) 593for (int i = 0; i < a.Length; i++) 773for (int i = 0; i < a.Length; i++) 1383for (int i = 0; i < a.Length; i++) 1763for (int i = 0; i < a.Length; i++) 1833for (int i = 0; i < a.Length; i++) 1934for (int i = 0; i < a.Length; i++) 1995for (int i = 0; i < a.Length; i++) 2056for (int i = 0; i < a.Length; i++) 2117for (int i = 0; i < a.Length; i++) 2187for (int i = 0; i < a.Length; i++) 2249for (int i = 0; i < a.Length; i++) 2338for (int i = 0; i < a.Length; i++) 2456for (int i = 0; i < a.Length; i++) 2520for (int ia = 0; ia < a.Length; ia++) 2580for (int ia = 0; ia < a.Length; ia++) 2640for (int i = 0; i < a.Length; i++) 2699for (int i = 0; i < a.Length; i++) 2777for (int i = 0; i < a.Length; i++) 2834for (int i = 0; i < a.Length; i++) 2950for (int i = 0; i < a.Length; i++) 2999for (int i = 0; i < a.Length; i++) 3040for (int i = 0; i < a.Length; i++) 3089for (int i = 0; i < a.Length; i++) 3139for (int i = 0; i < a.Length; i++) 3202for (int i = 0; i < a.Length; i++) 3241for (int i = 0; i < a.Length; i++) 3347for (int i = 0; i < a.Length; i++) 3389for (int i = 0; i < a.Length; i++) 3431for (int i = 0; i < a.Length; i++) 3473for (int i = 0; i < a.Length; i++) 3515for (int i = 0; i < a.Length; i++) 3557for (int i = 0; i < a.Length; i++) 3599for (int i = 0; i < a.Length; i++) 3641for (int i = 0; i < a.Length; i++) 3683for (int i = 0; i < a.Length; i++) 3725for (int i = 0; i < a.Length; i++) 3767for (int i = 0; i < a.Length; i++) 3809for (int i = 0; i < a.Length; i++) 3851for (int i = 0; i < a.Length; i++) 3863for (int i = 0; i < a.Length; i++) 3945for (int i = 0; i < a.Length; i++) 4069for (int i = 0; i < a.Length; i++) 4111for (int i = 0; i < a.Length; i++) 4187for (int i = 0; i < a.Length; i++) 4225for (int i = 0; i < a.Length; i++) 4265for (int i = 0; i < a.Length; i++) 4314for (int i = 0; i < a.Length; i++) 4392for (int i = 0; i < a.Length; i++) 4447for (int i = 0; i < a.Length; i++) 4538for (int i = 0; i < a.Length; i++) 4629for (int i = 0; i < a.Length; i++) 4683for (int i = 0; i < a.Length; i++) 4817for (int i = 0; i < a.Length; i++) 4883for (int i = 0; i < a.Length; i++) 4923for (int i = 0; i < a.Length; i++) 4990for (int i = 0; i < a.Length; i++) 5028for (int i = 0; i < a.Length; i++) 5067for (int i = 0; i < a.Length; i++) 5140for (int i = 0; i < a.Length; i++) 9385for (int i = 0; i < vals.Length; i++)
FrameworkFork\System.Web.Services\Services\Description\SoapFormatExtensions.cs (1)
143for (int i = 0; i < _parts.Length; i++)
Metadata\MetadaExchangeResolver.cs (2)
422while ((idx = responseStream.Read(buffer, 0, buffer.Length)) != 0) 452for (int i = 1; i < paramDecls.Length; i++)
Metadata\MetadataDocumentLoader.cs (3)
106_resolveExternalDocs = fileInfoList.Length == 1; 529if (schemaUri.Segments.Length > 0) 532fullFileName = Path.Combine(basePath, schemaUri.Segments[schemaUri.Segments.Length - 1]);
Metadata\MetadataFileNameManager.cs (2)
155for (int i = 0; i < chars.Length; i++) 259if (fileInfoList.Length == 0)
OutputPathHelper.cs (1)
161for (int i = 0; i < chars.Length; i++)
Shared\Options\OptionBase.cs (1)
39if (aliases != null && aliases.Length > 0)
Shared\Options\OptionValueParser.cs (1)
215ThrowInvalidValueIf(parts.Length != 2, stringValue, option);
Shared\Options\WCFCSUpdateOptions.cs (3)
169OptionValueParser.ThrowInvalidValueIf(parts.Length > 2, stringValue, option); 171var valueKey = parts.Length == 1 ? "*" : parts[0]; 172var valueVal = parts.Length == 1 ? parts[0] : parts[1];
Shared\ProjectDependency.cs (3)
222if (values.Length == 1 || values.Length == 2) 225string version = values.Length > 1 ? values[1].Trim() : string.Empty;
Shared\Utilities\PathHelper.cs (6)
127while (idx < parentSegments.Length) 129if (idx >= childSegments.Length || !childSegments[idx].Equals(parentSegments[idx], RuntimeEnvironmentHelper.FileStringComparison)) 131for (int jdx = idx; jdx < parentSegments.Length; jdx++) 140while (idx < childSegments.Length) 163return pathParts.Length > 0 ? pathParts[pathParts.Length - 1] : string.Empty;
dotnet-svcutil-lib.Tests (2)
TestInit.cs (2)
551Assert.True(nugetFiles.Length <= 1, "There should be one and only one nuget package for testing."); 553if (nugetFiles.Length == 0)
dotnet-user-jwts (11)
artifacts\obj\dotnet-user-jwts\Release\net10.0\Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\dotnet-user-jwts\Release\net10.0\Microsoft.AspNetCore.Tools.SecretsHelpersResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Helpers\ConsoleTable.cs (3)
37if (_columns.Count != values.Length) 40$"The number of columns in the table '{_columns.Count}' does not match the number of columns in the row '{values.Length}'."); 111for (var j = 0; j < rows[i].Length; j++)
Helpers\DevJwtCliHelpers.cs (1)
199if (parts.Length != 2)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-user-secrets (7)
artifacts\obj\dotnet-user-secrets\Release\net10.0\Microsoft.AspNetCore.Tools.SecretsHelpersResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\dotnet-user-secrets\Release\net10.0\Microsoft.Extensions.SecretManager.Tools.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
Extensibility.MessageEncoder.IntegrationTests (1)
CustomTextMessageEncoder.cs (1)
63Array.Copy(buffer.Array, buffer.Offset, msgContents, 0, msgContents.Length);
Extensibility.WebSockets.IntegrationTests (3)
WebSocketTests.4.1.0.cs (3)
59readResult = stream.Read(buffer, 0, buffer.Length); 291readResult = stream.Read(buffer, 0, buffer.Length); 453readResult = stream.Read(buffer, 0, buffer.Length);
GenerateRulesMissingDocumentation (2)
Program.cs (2)
17if (args.Length != expectedArguments) 19await Console.Error.WriteLineAsync($"Excepted {expectedArguments} arguments, found {args.Length}: {string.Join(';', args)}").ConfigureAwait(false);
GetDocument.Insider (8)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24551.5\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
117&& factory.GetParameters().Length == 1 236if (parameters.Length == 0)
artifacts\obj\GetDocument.Insider\Release\netcoreapp2.1\Microsoft.Extensions.ApiDescription.Tool.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
HeaderPropagationSample (1)
Startup.cs (1)
111for (var i = 0; i < features.Length; i++)
HostedBlazorWebassemblyApp.Server (1)
Data\WeatherForecastService.cs (1)
25Summary = Summaries[Random.Shared.Next(Summaries.Length)]
HostFilteringSample (1)
Startup.cs (1)
33options.AllowedHosts = (hosts?.Length > 0 ? hosts : new[] { "*" });
http2cat (22)
artifacts\obj\http2cat\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\http2cat\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\Http2cat\Http2Utilities.cs (4)
417frame.PayloadLength = payload.Length; 451frame.PayloadLength = payload.Length; 521frame.PayloadLength = headerBlock.Length; 586frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
HttpStress (10)
Program.cs (10)
362for (int i = 0; i < clientOperations.Length; i++) 529long[] success = new long[clientOperations.Length], fail = new long[clientOperations.Length]; 558for (int i = 0; i < clientOperations.Length; i++) 585long opIndex = i % clientOperations.Length; 616for (var i = 0; i < fail.Length; i++) 659versions[_random.Next(0, versions.Length)]; 697stream.WriteAsync(_data, 0, _data.Length); 701length = _data.Length; 715for (int i = 0; i < _buffer.Length; i++)
IdeCoreBenchmarks (4)
SegmentedArrayBenchmarks_Indexer.cs (4)
35for (var i = 0; i < _values.Length - 1; i++) 46Array.Copy(_values, 1, _values, 0, _values.Length - 1); 53for (var i = 0; i < _valuesObject.Length - 1; i++) 64Array.Copy(_valuesObject, 1, _valuesObject, 0, _valuesObject.Length - 1);
Identity.DefaultUI.WebSite (1)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (1)
431return mergedCodes.Split(';').Length;
IIS.Common.TestLib (2)
TestConnections.cs (2)
68for (var index = 0; index < bytes.Length; index++) 131var task = _stream.ReadAsync(actual, offset, actual.Length - offset);
IIS.FunctionalTests (31)
artifacts\obj\IIS.FunctionalTests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.FunctionalTests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
42for (var i = 0; i < expectedRegexMatchString.Length; i++) 72if (matchedEntries.Length == 0) 86Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 87Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 116eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
41Assert.True(timings.Length > (int)HttpSysRequestTimingType.Http3HeaderDecodeEnd);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (2)
375Assert.Equal(10, (await _fixture.Client.GetByteArrayAsync($"/UnflushedResponsePipe")).Length); 382Assert.Equal(20, (await _fixture.Client.GetByteArrayAsync($"/FlushedPipeAndThenUnflushedPipe")).Length);
src\Shared\Http2cat\Http2Utilities.cs (4)
417frame.PayloadLength = payload.Length; 451frame.PayloadLength = payload.Length; 521frame.PayloadLength = headerBlock.Length; 586frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
IIS.LongTests (29)
artifacts\obj\IIS.LongTests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.LongTests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
42for (var i = 0; i < expectedRegexMatchString.Length; i++) 72if (matchedEntries.Length == 0) 86Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 87Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 116eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1519Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
417frame.PayloadLength = payload.Length; 451frame.PayloadLength = payload.Length; 521frame.PayloadLength = headerBlock.Length; 586frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
66var payloadLength = _helloWorldPayload.Length;
IIS.NewHandler.FunctionalTests (29)
artifacts\obj\IIS.NewHandler.FunctionalTests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.NewHandler.FunctionalTests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
42for (var i = 0; i < expectedRegexMatchString.Length; i++) 72if (matchedEntries.Length == 0) 86Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 87Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 116eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1519Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
417frame.PayloadLength = payload.Length; 451frame.PayloadLength = payload.Length; 521frame.PayloadLength = headerBlock.Length; 586frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
IIS.NewShim.FunctionalTests (29)
artifacts\obj\IIS.NewShim.FunctionalTests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.NewShim.FunctionalTests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
42for (var i = 0; i < expectedRegexMatchString.Length; i++) 72if (matchedEntries.Length == 0) 86Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 87Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 116eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1519Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
417frame.PayloadLength = payload.Length; 451frame.PayloadLength = payload.Length; 521frame.PayloadLength = headerBlock.Length; 586frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
IIS.ShadowCopy.Tests (9)
artifacts\obj\IIS.ShadowCopy.Tests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.ShadowCopy.Tests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
42for (var i = 0; i < expectedRegexMatchString.Length; i++) 72if (matchedEntries.Length == 0) 86Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 87Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 116eventLogEntry.ReplacementStrings.Length < 3)
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
IIS.Tests (2)
ResponseBodySizeTests.cs (2)
23await ctx.Response.Body.WriteAsync(buffer, 0, buffer.Length); 30Assert.Equal(bufferSize, content.Length);
IISExpress.FunctionalTests (34)
artifacts\obj\IISExpress.FunctionalTests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IISExpress.FunctionalTests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
InProcess\WebSocketTests.cs (2)
141await stream.WriteAsync(requestBytes, 0, requestBytes.Length); 157result = await webSocket.ReceiveAsync(new ArraySegment<byte>(received, offset, received.Length - offset), default);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
42for (var i = 0; i < expectedRegexMatchString.Length; i++) 72if (matchedEntries.Length == 0) 86Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 87Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 116eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
41Assert.True(timings.Length > (int)HttpSysRequestTimingType.Http3HeaderDecodeEnd);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (2)
375Assert.Equal(10, (await _fixture.Client.GetByteArrayAsync($"/UnflushedResponsePipe")).Length); 382Assert.Equal(20, (await _fixture.Client.GetByteArrayAsync($"/FlushedPipeAndThenUnflushedPipe")).Length);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1519Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
417frame.PayloadLength = payload.Length; 451frame.PayloadLength = payload.Length; 521frame.PayloadLength = headerBlock.Length; 586frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
illink (39)
ILLink.RoslynAnalyzer (2)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueExtensions.cs (1)
25 for (int i = 0; i < args.Length; i++) {
TrimAnalysis\TrimAnalysisVisitor.cs (1)
112 for (int i = 0; i < elements.Length; i++) {
ILLink.Tasks (2)
CreateRuntimeRootDescriptorFile.cs (2)
161 if (namespaceDefElements.Length == 3) { 193 if (featureSwitchElements.Length != 4) {
Infrastructure.Common (9)
SafeKeychainHandle.cs (2)
53int osStatus = SecKeychainCreate(pathName, utf8Passphrase.Length, utf8Passphrase, false, IntPtr.Zero, out keychain); 79osStatus = SecKeychainUnlock(keychain, utf8Passphrase.Length, utf8Passphrase, true);
xunit\ConditionAttribute.cs (4)
36int conditionCount = Conditions == null ? 0 : Conditions.Length; 60if (symbols.Length == 2) 113if (mi != null && mi.IsStatic && mi.GetParameters().Length == 0 && mi.ReturnType == typeof(bool)) 117if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0)
xunit\WcfTestDiscoverer.cs (3)
34if (issues.Length > 0) 61if (conditions.Length > 0) 63List<string> skipReasons = new List<string>(conditions.Length);
InMemory.FunctionalTests (227)
ChunkedRequestTests.cs (9)
29var count = await request.Body.ReadAsync(buffer, 0, buffer.Length); 66response.Headers["Content-Length"] = bytes.Length.ToString(CultureInfo.InvariantCulture); 67await response.Body.WriteAsync(bytes, 0, bytes.Length); 261while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 498while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 542while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 587while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 669while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 713while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
ConnectionMiddlewareTests.cs (2)
465for (int i = 0; i < buffer.Length; i++) 478for (int i = 0; i < buffer.Length; i++)
Http2\Http2ConnectionTests.cs (50)
793withLength: _maxData.Length, 841withLength: _maxData.Length, 856withLength: _maxData.Length, 868withLength: _maxData.Length, 883withLength: _maxData.Length, 903var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length; 905updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 947for (var i = 0; i < _helloWorldBytes.Length; i++) 1074withLength: _maxData.Length, 1089withLength: _maxData.Length, 1101withLength: _maxData.Length, 1122withLength: _maxData.Length, 1135withLength: _maxData.Length, 1151var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length; 1153updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 1265var maxDataMinusPadding = _maxData.AsMemory(0, _maxData.Length - padLength - 1); 1310withLength: _maxData.Length, 1326var updateSize = ((framesInWindow / 2) + 1) * _maxData.Length; 1365var updateSize = ((framesConnectionInWindow / 2) + 1) * _maxData.Length; 1388while (readResult.Buffer.Length != _maxData.Length * 4) 1397Assert.Equal(readResult.Buffer.Length, _maxData.Length * 5); 1437withLength: _maxData.Length, 1462var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length; 1464updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 1896var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 1897var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 1898var remainingBytesAfterBackpressure = _maxData.Length - remainingBytesBeforeBackpressure; 1913await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 1937withLength: _maxData.Length, 3186var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 3187var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 3217await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 3246withLength: _maxData.Length, 3279withLength: _maxData.Length, 3307var initialWindowSize = _helloWorldBytes.Length / 2; 3331await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length); 3419var updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 4209var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 4210var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 4240await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 4269withLength: _maxData.Length, 4314var initialWindowSize = _helloWorldBytes.Length / 2; 4338await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length); 4567var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 4589await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 4593var lastWriteTask = context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 4620withLength: _maxData.Length, 4625var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 4626var remainingBytesAfterBackpressure = _maxData.Length - remainingBytesBeforeBackpressure; 4660var initialWindowSize = _helloWorldBytes.Length / 2;
Http2\Http2StreamTests.cs (24)
878var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 880read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 908var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 910read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 956var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 960read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total); 1050var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1054read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total); 1151while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1186while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1221while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1257while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1867var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1869read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1912while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1953var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1955read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1997while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2058while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2114var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2117read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 3429var thrownExTask = Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Request.Body.ReadAsync(buffer, 0, buffer.Length)); 3454var thrownExTask = Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Request.Body.ReadAsync(buffer, 0, buffer.Length)); 3637for (var i = 0; i < frames.Length; i++)
Http2\Http2TestBase.cs (9)
241while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 254while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 265while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 341received += await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 344var stalledReadTask = context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 819frame.PayloadLength = payload.Length; 894frame.PayloadLength = headerBlock.Length; 959frame.PayloadLength = payload.Length; 1322if (expectedErrorMessage?.Length > 0)
Http2\Http2TimeoutTests.cs (21)
166withLength: _helloWorldBytes.Length, 337while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 375AdvanceTime(TimeSpan.FromSeconds((_bytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) + 386withLength: _helloWorldBytes.Length, 427var timeToWriteMaxData = TimeSpan.FromSeconds((_bytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) + 441withLength: _maxData.Length, 516_clientSettings.InitialWindowSize = (uint)_maxData.Length - 1; 570_clientSettings.InitialWindowSize = (uint)_maxData.Length - 1; 638await StartStreamAsync(1, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 685await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false); 700var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 736await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false); 749await StartStreamAsync(3, ReadRateRequestHeaders(_maxData.Length), endStream: false); 761var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond); 803await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false); 821await StartStreamAsync(3, ReadRateRequestHeaders(_maxData.Length), endStream: false); 835var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 876await StartStreamAsync(1, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 946await StartStreamAsync(3, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 976var expectedUpdateSize = ((framesConnectionInWindow / 2) + 1) * _maxData.Length + _helloWorldBytes.Length;
Http3\Http3ConnectionTests.cs (3)
44while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 84while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 147while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0)
Http3\Http3StreamTests.cs (16)
559var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 561read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 588var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 592read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total); 726for (var i = 0; i < data.Length; i++) 737while (receivedData.Count < data.Length) 2508var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2510read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2546while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2581var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2583read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2618while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2671while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2719var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2722read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2853for (var i = 0; i < sourceData.Length; i++)
Http3\Http3TestBase.cs (4)
68while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 83received += await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 86var stalledReadTask = context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 139if (expectedErrorMessage?.Length > 0)
Http3\Http3TimeoutTests.cs (14)
351var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 434while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 470Http3Api.AdvanceTime(TimeSpan.FromSeconds((requestStream.BytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) + 481Assert.Equal(_helloWorldBytes.Length, data.Length); 511var timeToWriteMaxData = TimeSpan.FromSeconds((requestStream.BytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) + 545var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 554var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 591var requestStream1 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 597var requestStream2 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 603var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond); 648var requestStream1 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 657var requestStream2 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 665var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 709var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false);
Http3\WebTransport\WebTransportHandshakeTests.cs (1)
133for (var i = 0; i < headers.Length; i += 2)
HttpsConnectionMiddlewareTests.cs (3)
1099await stream.WriteAsync(request, 0, request.Length).DefaultTimeout(); 1491var count = await request.Body.ReadAsync(buffer, 0, buffer.Length); 1520await stream.WriteAsync(request, 0, request.Length);
HttpsTests.cs (2)
262await sslStream.WriteAsync(request, 0, request.Length); 306await sslStream.WriteAsync(request, 0, request.Length);
KeepAliveTimeoutTests.cs (2)
282while (await httpContext.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) 288await responseStream.WriteAsync(responseBytes, 0, responseBytes.Length);
KestrelMetricsTests.cs (2)
923if (buffer.Length > 0) 926await response.Body.WriteAsync(buffer, 0, buffer.Length);
RequestTests.cs (9)
135var task = context.Request.Body.ReadAsync(data, 0, data.Length, cts.Token); 1130Assert.Equal(22, ms1.ToArray().Length); 1363await duplexStream.WriteAsync(data, 0, data.Length); 1418context.Response.ContentLength = request.Length; 1420await context.Response.Body.WriteAsync(request, 0, request.Length); 1603await duplexStream.WriteAsync(response, 0, response.Length); 1651await stream.WriteAsync(response, 0, response.Length); 2337var mask = Math.Pow(2, lines.Length) - 1; 2345for (var pos = 0; pos < lines.Length; pos++)
ResponseTests.cs (26)
161var writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 168writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 1041await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1076await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1721httpContext.Response.ContentLength = response.Length - 1; 1724await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1763httpContext.Response.ContentLength = response.Length - 1; 1766await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1805httpContext.Response.ContentLength = response.Length - 1; 1808await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1809await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 1850httpContext.Response.ContentLength = response.Length - 1; 1853await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1854await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 1893httpContext.Response.ContentLength = response.Length - 1; 1896return httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)).AsTask(); 1933httpContext.Response.ContentLength = response.Length - 1; 1936await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1937await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 2379await stream.WriteAsync(response, 0, response.Length);
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
149for (int i = intermediates.Length - 1; i >= 0; i--)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
25frame.PayloadLength = payload.Length;
src\Servers\Kestrel\shared\test\RevocationResponder.cs (6)
189Trace($"Responded with {certData.Length}-byte certificate from {authority.SubjectName}."); 207Trace($"Responded with {crl.Length}-byte CRL from {authority.SubjectName}."); 252Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName} delegated to {authority.OcspResponderSubjectName}"); 256Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName}"); 313int read = stream.Read(requestBytes, 0, requestBytes.Length); 314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Servers\Kestrel\shared\test\TestApp.cs (10)
20if (buffer.Length > 0) 23await response.Body.WriteAsync(buffer, 0, buffer.Length); 35response.Headers.ContentLength = bytes.Length; 36await response.Body.WriteAsync(bytes, 0, bytes.Length); 50if (buffer.Length > 0) 54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 69response.Headers.ContentLength = bytes.Length; 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
InProcessWebSite (10)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (9)
631var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 635result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 644var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 649result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 719count += await ctx.Request.Body.ReadAsync(data, count, data.Length - count); 720} while (count != data.Length); 721await ctx.Response.Body.WriteAsync(data, 0, data.Length); 737var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 744result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (1)
24parameters.Length == 1)
installer.tasks (21)
GenerateFileVersionProps.cs (1)
116$"Missing FileVersion in {versionlessFiles.Length} shared framework files:" +
GenerateRunScript.cs (9)
28if (RunCommands.Length == 0) 68for (int i = 0; i < SetCommands.Length; i++) 71for (int j = 0; j < setCommandsSplit.Length; j++) 74if ((j < setCommandsSplit.Length - 1) || (i < SetCommands.Length - 1)) 83for (int i = 0; i < RunCommands.Length; i++) 86for (int j = 0; j < runCommandsSplit.Length; j++) 89if ((j < runCommandsSplit.Length - 1) || (i < RunCommands.Length - 1))
RegenerateDownloadTable.cs (2)
79$"| --- | {string.Concat(Enumerable.Repeat(" :---: |", Branches.Length))}" 94.Skip(beforeTable.Length)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
176Log.LogMessage(MessageImportance.High, $"Importing {newSections.Length} sections...");
StaticFileRegeneration\TpnDocument.cs (3)
20int linesUntilNext = lines.Length - headerEndLine; 22if (i + 1 < headers.Length) 45if (sections.Length == 0)
StaticFileRegeneration\TpnSectionHeader.cs (5)
24for (int i = 1; i < lines.Length - 2; i++) 106if (nameLines.Take(nameLines.Length - 1).Any(IsSeparatorLine)) 122LineLength = 2 + nameLines.Length 139int nameStartLine = i - nameLines.Length; 149LineLength = nameLines.Length + 1
InteractiveHost.UnitTests (1)
AbstractInteractiveHostTests.cs (1)
210=> paths.Length == 0 ? "SearchPaths { }" : $"SearchPaths {{ {string.Join(", ", paths.Select(p => "\"" + p.Replace("\\", "\\\\") + "\""))} }}";
InteractiveHost32 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
25Contract.ThrowIfFalse(args.Length == 4, "Expecting arguments: <pipe name> <client process id> <culture name> <ui culture name>");
InteractiveHost64 (1)
src\Interactive\HostProcess\InteractiveHostEntryPoint.cs (1)
25Contract.ThrowIfFalse(args.Length == 4, "Expecting arguments: <pipe name> <client process id> <culture name> <ui culture name>");
Interop.FunctionalTests (34)
Http2\Http2RequestTests.cs (4)
243var memory = c.Response.BodyWriter.GetMemory(randomBytes.Length); 245logger.LogInformation($"Server writing {randomBytes.Length} bytes response"); 250logger.LogInformation($"Server advancing {randomBytes.Length} bytes response"); 251c.Response.BodyWriter.Advance(randomBytes.Length);
Http3\Http3RequestTests.cs (12)
263await responseStream.ReadAtLeastLengthAsync(TestData.Length, clientBufferSize).DefaultTimeout(); 266await responseStream.ReadAtLeastLengthAsync(TestData.Length, clientBufferSize).DefaultTimeout(); 405var data = await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 469await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 712var data = await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 987var data = await requestBody.ReadAtLeastLengthAsync(TestData.Length); 1034var data = await responseStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 1082var currentData = await requestBody.ReadAtLeastLengthAsync(data.Length); 1092context.Response.BodyWriter.GetSpan(data.Length); 1093context.Response.BodyWriter.Advance(data.Length); 1325var data = await responseStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 1353await context.Request.BodyReader.ReadAtLeastAsync(TestData.Length);
HttpClientHttp2InteropTests.cs (10)
204for (var i = 0; i < Content.Length; i++) 216await stream.WriteAsync(Content, 0, Content.Length, timer.Token).DefaultTimeout(); 236read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout(); 242Assert.True(totalRead <= Repetitions * Content.Length, "Too Long"); 246Assert.Equal(Content[patternOffset % Content.Length], buffer[offset]); 251read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout(); 254Assert.True(totalRead == Repetitions * Content.Length, "Too Short"); 1505read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length).DefaultTimeout(); 1727var read = await stream.ReadAsync(responseBuffer, totalRead, responseBuffer.Length - totalRead).DefaultTimeout(); 1733} while (totalRead < responseBuffer.Length);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
IOperationGenerator (1)
Program.cs (1)
14if (args.Length != 2)
Keycloak.ApiService (1)
Program.cs (1)
35summaries[Random.Shared.Next(summaries.Length)]
KeyManagementSimulator (4)
Program.cs (4)
20for (var i = 0; i < args.Length; i++) 26if (i + 1 < args.Length && int.TryParse(args[i + 1], out var d) && d > 0) 41if (i + 1 < args.Length && int.TryParse(args[i + 1], out var inst) && inst > 0) 56if (i + 1 < args.Length && int.TryParse(args[i + 1], out var s) && s > 0)
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
46if (children.Length == 1)
Microsoft.Analyzers.Extra.Tests (1)
Resources\AnalyzerOptionsFactory.cs (1)
17var immutableFiles = ImmutableArray.Create(files, 0, files.Length);
Microsoft.Analyzers.Local (3)
ApiLifecycle\Utils.cs (3)
27return substrings.Length == 2 54if (substrings.Length > 1) 61if (substrings.Length > 2)
Microsoft.Analyzers.Local.Tests (4)
InternalReferencedInPublicDocAnalyzerTests.cs (3)
459Debug.Assert(lineNumbers.Length == detectedTexts.Length, "Line numbers and texts should be the same length"); 463var expectedNumberOfWarnings = lineNumbers.Length;
Resources\AnalyzerOptionsFactory.cs (1)
17var immutableFiles = ImmutableArray.Create(files, 0, files.Length);
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (1)
291if (args is { Length: > 0 })
WebHost.cs (1)
261options.AllowedHosts = (hosts?.Length > 0 ? hosts : new[] { "*" });
Microsoft.AspNetCore.Analyzer.Testing (7)
DiagnosticAnalyzerRunner.cs (1)
66if (additionalEnabledDiagnostics.Length > 0)
DiagnosticProject.cs (2)
70for (var i = 0; i < sources.Length; i++) 73if (sources.Length > 1)
DiagnosticVerifier.cs (3)
86if (additionalEnabledDiagnostics.Length > 0) 144Debug.Assert(sources.Length == documents.Length);
TestSource.cs (1)
25for (var i = 0; i < lines.Length; i++)
Microsoft.AspNetCore.Antiforgery (14)
artifacts\obj\Microsoft.AspNetCore.Antiforgery\Release\net10.0\Microsoft.AspNetCore.Antiforgery.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\AntiforgerySerializationContext.cs (3)
84if (_chars == null || _chars.Length < count) 86var newLength = _chars == null ? InitialCharsLength : checked(_chars.Length * 2); 100if (_chars != null && _chars.Length > MaximumCharsLength)
Internal\BinaryBlob.cs (8)
30if (data == null || data.Length != bitLength / 8) 42return checked(_data.Length * 8); 60Debug.Assert(_data.Length == other._data.Length); 73Debug.Assert(_data != null && _data.Length >= (32 / 8)); 89if (a == null || b == null || a.Length != b.Length) 95for (var i = 0; i < a.Length; i++)
Internal\DefaultAntiforgeryTokenSerializer.cs (2)
48stream.Write(unprotectedBytes, offset: 0, count: unprotectedBytes.Length); 158var count = bytes.Length;
Microsoft.AspNetCore.Antiforgery.Test (3)
BinaryBlobTest.cs (1)
17Assert.Equal(64 / 8, data.Length);
DefaultAntiforgeryTokenSerializerTest.cs (2)
165var salt = data[data.Length - 1]; 171return data.Take(data.Length - 1).ToArray();
Microsoft.AspNetCore.App.Analyzers (4)
artifacts\obj\Microsoft.AspNetCore.App.Analyzers\Release\netstandard2.0\Microsoft.AspNetCore.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
31for (var i = 0; i < WellKnownTypeData.WellKnownTypeNames.Length; i++) 52_lazyWellKnownTypes = new INamedTypeSymbol?[WellKnownTypeData.WellKnownTypeNames.Length];
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
348var length = disallowedMethodTypes.Length;
Microsoft.AspNetCore.App.Analyzers.Test (12)
Http\HeaderDictionaryIndexerAnalyzerTests.cs (1)
165.Where(p => p.CanWrite && p.CanRead && p.PropertyType == typeof(StringValues) && p.GetIndexParameters().Length == 0)
RouteEmbeddedLanguage\Infrastructure\ExportProviderExtensions.cs (4)
41where method.IsGenericMethod && method.GetGenericArguments().Length == 2 42where method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(string) 51where method.IsGenericMethod && method.GetGenericArguments().Length == 1 52where method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(string)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (2)
373var conj = $"({regexes[regexes.Length - 1]})"; 374for (var i = regexes.Length - 2; i >= 0; i--)
RouteEmbeddedLanguage\RoutePatternParserTests_ConformanceTests.cs (3)
832Assert.Equal(expectedNames.Length, tree.RouteParameters.Length); 833Assert.Equal(expectedQualifiers.Length, tree.RouteParameters.Length); 835for (var i = 0; i < expectedNames.Length; i++)
WebApplicationBuilder\UseTopLevelRouteRegistrationInsteadOfUseEndpointsTest.cs (2)
157Assert.Equal(4, diagnostics.Length); 259Assert.Equal(2, diagnostics.Length);
Microsoft.AspNetCore.App.UnitTests (5)
SharedFxTests.cs (2)
253Assert.Equal(2, lines.Length); 281var fileName = fileParts[fileParts.Length - 1];
TargetingPackTests.cs (3)
147Assert.Equal(packageOverrideFileLines.Length, runtimeDependencies.Count + aspnetcoreDependencies.Count); 171Assert.Equal(2, packageOverrideParts.Length); 278Assert.Equal(4, parts.Length);
Microsoft.AspNetCore.Authentication (1)
artifacts\obj\Microsoft.AspNetCore.Authentication\Release\net10.0\Microsoft.AspNetCore.Authentication.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.Abstractions (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.Abstractions\Release\net10.0\Microsoft.AspNetCore.Authentication.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateAuthenticationHandler.cs (1)
146var chainErrors = new List<string>(chain.ChainStatus.Length);
Microsoft.AspNetCore.Authentication.Cookies (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
Microsoft.AspNetCore.Authentication.Facebook (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.Facebook\Release\net10.0\Microsoft.AspNetCore.Authentication.Facebook.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.Google (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.Google\Release\net10.0\Microsoft.AspNetCore.Authentication.Google.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.JwtBearer\Release\net10.0\Microsoft.AspNetCore.Authentication.JwtBearer.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.MicrosoftAccount\Release\net10.0\Microsoft.AspNetCore.Authentication.MicrosoftAccount.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.OAuth (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.OAuth\Release\net10.0\Microsoft.AspNetCore.Authentication.OAuth.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
artifacts\obj\Microsoft.AspNetCore.Authentication.OpenIdConnect\Release\net10.0\Microsoft.AspNetCore.Authentication.OpenIdConnect.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
OpenIdConnectHandler.cs (2)
290Response.ContentLength = buffer.Length; 538Response.ContentLength = buffer.Length;
Microsoft.AspNetCore.Authentication.Test (3)
CookieTests.cs (1)
1900return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length);
TestExtensions.cs (2)
61return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length); 78return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length);
Microsoft.AspNetCore.Authentication.Twitter (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.Twitter\Release\net10.0\Microsoft.AspNetCore.Authentication.Twitter.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.WsFederation (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.WsFederation\Release\net10.0\Microsoft.AspNetCore.Authentication.WsFederation.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authorization (3)
artifacts\obj\Microsoft.AspNetCore.Authorization\Release\net10.0\Microsoft.AspNetCore.Authorization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AuthorizationPolicy.cs (2)
153if (rolesSplit?.Length > 0) 161if (authTypesSplit?.Length > 0)
Microsoft.AspNetCore.Authorization.Policy (2)
artifacts\obj\Microsoft.AspNetCore.Authorization.Policy\Release\net10.0\Microsoft.AspNetCore.Authorization.Policy.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AuthorizationEndpointConventionBuilderExtensions.cs (1)
67if (authorizeData.Length == 0)
Microsoft.AspNetCore.Components (63)
artifacts\obj\Microsoft.AspNetCore.Components\Release\net10.0\Microsoft.AspNetCore.Components.Routing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BindConverter.cs (4)
1811if (value.Length == 0) 1820for (var i = 1; i < value.Length; i++) 2024var convertedArray = new T[initialArray.Length]; 2026for (var i = 0; i < initialArray.Length; i++)
CascadingParameterState.cs (3)
40if (infos.Length == 0) 49var numInfos = infos.Length; 57resultStates ??= new List<CascadingParameterState>(infos.Length - infoIndex);
RenderTree\EventArgsTypeCache.cs (2)
18if (parameterInfos.Length == 0) 22else if (parameterInfos.Length > 1)
RenderTree\Renderer.cs (2)
827for (int i = 0; i < updatedComponentsId.Length; i++) 872for (var i = 0; i < updatedComponents.Length; i++)
RenderTree\RenderTreeFrameArrayBuilder.cs (20)
19if (_itemsInUse == _items.Length) 21GrowBuffer(_items.Length * 2); 34if (_itemsInUse == _items.Length) 36GrowBuffer(_items.Length * 2); 49if (_itemsInUse == _items.Length) 51GrowBuffer(_items.Length * 2); 64if (_itemsInUse == _items.Length) 66GrowBuffer(_items.Length * 2); 80if (_itemsInUse == _items.Length) 82GrowBuffer(_items.Length * 2); 95if (_itemsInUse == _items.Length) 97GrowBuffer(_items.Length * 2); 110if (_itemsInUse == _items.Length) 112GrowBuffer(_items.Length * 2); 126if (_itemsInUse == _items.Length) 128GrowBuffer(_items.Length * 2); 140if (_itemsInUse == _items.Length) 142GrowBuffer(_items.Length * 2); 155if (_itemsInUse == _items.Length) 157GrowBuffer(_items.Length * 2);
Routing\RouteTableFactory.cs (3)
105var templates = new string[routeAttributes.Length]; 106for (var i = 0; i < routeAttributes.Length; i++) 149for (var i = 0; i < templates.Length; i++)
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (10)
328for (var i = 0; i < keys.Length; i++) 348for (var i = 0; i < values.Length; i++) 449if (arrayIndex < 0 || arrayIndex > array.Length || array.Length - arrayIndex < Count) 661if (_arrayStorage.Length < capacity) 694if (_arrayStorage.Length < capacity) 696capacity = _arrayStorage.Length == 0 ? DefaultCapacity : _arrayStorage.Length * 2; 733if ((uint)count <= (uint)array.Length) 756if ((uint)count <= (uint)array.Length)
src\Http\Routing\src\ParameterPolicyActivator.cs (8)
105if (constructors.Length == 1 && GetNonConvertableParameterTypeCount(serviceProvider, constructors[0].GetParameters()) == 1) 119var matchingConstructors = GetMatchingConstructors(constructors, serviceProvider, arguments.Length); 125parameterPolicyType.Name, arguments.Length)); 169var length = constructor.GetParameters().Length; 196return parameters.Length; 200for (var i = 0; i < parameters.Length; i++) 213var parameters = new object?[parameterInfos.Length]; 215for (var i = 0; i < parameterInfos.Length; i++)
src\Http\Routing\src\Patterns\RoutePatternFactory.cs (1)
471for (var i = 0; i < updatedSegments.Length; i++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
Microsoft.AspNetCore.Components.Analyzers (2)
artifacts\obj\Microsoft.AspNetCore.Components.Analyzers\Release\netstandard2.0\Microsoft.AspNetCore.Components.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
42for (var i = 0; i < NamespaceParts.Length; i++)
Microsoft.AspNetCore.Components.Analyzers.Tests (18)
Helpers\CodeFixVerifier.Helper.cs (2)
49while (newIndex < newArray.Length) 51if (oldIndex < oldArray.Length && oldArray[oldIndex].Id == newArray[newIndex].Id)
Helpers\DiagnosticResult.cs (3)
71return this.Locations.Length > 0 ? this.Locations[0].Path : ""; 79return this.Locations.Length > 0 ? this.Locations[0].Line : -1; 87return this.Locations.Length > 0 ? this.Locations[0].Column : -1;
Helpers\DiagnosticVerifier.Helper.cs (3)
72for (int i = 0; i < documents.Length; i++) 119if (sources.Length != documents.Length)
Verifiers\CodeFixVerifier.cs (1)
81var attempts = analyzerDiagnostics.Length;
Verifiers\DiagnosticVerifier.cs (9)
108int expectedCount = expectedResults.Length; 119for (int i = 0; i < expectedResults.Length; i++) 138if (additionalLocations.Length != expected.Locations.Length - 1) 144expected.Locations.Length - 1, additionalLocations.Length, 148for (int j = 0; j < additionalLocations.Length; ++j) 240for (int i = 0; i < diagnostics.Length; ++i) 274if (i != diagnostics.Length - 1)
Microsoft.AspNetCore.Components.Authorization (2)
AttributeAuthorizeDataCache.cs (1)
29for (var i = 0; i < allAttributes.Length; i++)
AuthorizeViewCore.cs (1)
121for (var i = 0; i < authorizeData.Length; i++)
Microsoft.AspNetCore.Components.Endpoints (19)
artifacts\obj\Microsoft.AspNetCore.Components.Endpoints\Release\net10.0\Microsoft.AspNetCore.Components.Endpoints.FormMapping.FormDataResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Components.Endpoints\Release\net10.0\Microsoft.AspNetCore.Components.Endpoints.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Builder\ResourceCollectionUrlEndpoint.cs (3)
140if (rented == null || rented.Length < length) 237context.Response.ContentLength = contents.Length; 246var quality = 1 / (1 + _gzipContent.Length);
DependencyInjection\DefaultRazorComponentsServiceOptionsConfiguration.cs (1)
58if (initializers == null || initializers.Length == 0)
Discovery\IRazorComponentApplication.cs (1)
26for (var i = 0; i < exported.Length; i++)
FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (3)
16if (buffer.Count >= buffer.Data.Length) 18var newBuffer = ArrayPool<TElement>.Shared.Rent(buffer.Data.Length * 2); 19Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
FormMapping\Metadata\FormDataMetadataFactory.cs (2)
125if (constructors.Length == 1) 135else if (constructors.Length > 1)
Rendering\Buffering\TextChunkPage.cs (1)
28if (_count < _buffer.Length)
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 282Debug.Assert(parameters.Length == 1); 441var filteredProperties = new List<PropertyHelper>(allProperties.Length); 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Components.Endpoints.Tests (18)
Binding\FormDataMapperTests.cs (8)
2031Assert.Equal(expectedString, Encoding.UTF8.GetString(buffer, 0, buffer.Length)); 2066Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer1, 0, buffer1.Length)); 2073Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer2, 0, buffer2.Length)); 2248if (components.Length != 2) 2296if (components.Length != 2) 2343if (buffer.Count >= buffer.Data.Length) 2345var newBuffer = Rent(buffer.Data.Length * 2); 2346Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
Binding\PrefixResolverTests.cs (8)
39var prefixResolver = new PrefixResolver(GetKeys(keys), keys.Length); 55var container = new PrefixResolver(GetKeys(keys), keys.Length); 73var container = new PrefixResolver(GetKeys(keys), keys.Length); 96var container = new PrefixResolver(GetKeys(keys), keys.Length); 114var container = new PrefixResolver(GetKeys(keys), keys.Length); 136var container = new PrefixResolver(GetKeys(keys), keys.Length); 160var container = new PrefixResolver(GetKeys(keys), keys.Length); 184var container = new PrefixResolver(GetKeys(keys), keys.Length);
RazorComponentsServiceCollectionExtensionsTest.cs (2)
129if (implementationTypes.Length == 0) 133else if (implementationTypes.Length != implementationTypes.Distinct().Count())
Microsoft.AspNetCore.Components.Forms (1)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
63var newEndIndex = newBuffer.Length - _currentBuffer.Length + _nextEndIndex;
Microsoft.AspNetCore.Components.Forms.Tests (6)
ExpressionFormatterTest.cs (5)
57for (var i = 0; i < result.Length; i++) 91for (; i < result.Length; i++) 125for (var i = 0; i < result.Length; i++) 143for (; i < result.Length; i++) 163for (; i < result.Length; i++)
FieldIdentifierTest.cs (1)
148for (var i = 0; i < models.Length; i++)
Microsoft.AspNetCore.Components.Performance (5)
Program.cs (1)
10if (args.Length == 0 || args[0] != "--profile")
RouteTableFactoryBenchmarks.cs (4)
40if (i >= routes.Length) 48if (i >= routes.Length) 57if (i >= routes.Length) 66if (i >= routes.Length)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
artifacts\obj\Microsoft.AspNetCore.Components.SdkAnalyzers\Release\netstandard2.0\Microsoft.AspNetCore.Components.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
42for (var i = 0; i < NamespaceParts.Length; i++)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (18)
Helpers\CodeFixVerifier.Helper.cs (2)
49while (newIndex < newArray.Length) 51if (oldIndex < oldArray.Length && oldArray[oldIndex].Id == newArray[newIndex].Id)
Helpers\DiagnosticResult.cs (3)
71return this.Locations.Length > 0 ? this.Locations[0].Path : ""; 79return this.Locations.Length > 0 ? this.Locations[0].Line : -1; 87return this.Locations.Length > 0 ? this.Locations[0].Column : -1;
Helpers\DiagnosticVerifier.Helper.cs (3)
72for (int i = 0; i < documents.Length; i++) 119if (sources.Length != documents.Length)
Verifiers\CodeFixVerifier.cs (1)
81var attempts = analyzerDiagnostics.Length;
Verifiers\DiagnosticVerifier.cs (9)
108int expectedCount = expectedResults.Length; 119for (int i = 0; i < expectedResults.Length; i++) 138if (additionalLocations.Length != expected.Locations.Length - 1) 144expected.Locations.Length - 1, additionalLocations.Length, 148for (int j = 0; j < additionalLocations.Length; ++j) 240for (int i = 0; i < diagnostics.Length; ++i) 274if (i != diagnostics.Length - 1)
Microsoft.AspNetCore.Components.Server (41)
Circuits\CircuitHost.cs (6)
238for (var i = 0; i < _circuitHandlers.Length; i++) 267for (var i = 0; i < _circuitHandlers.Length; i++) 296for (var i = 0; i < _circuitHandlers.Length; i++) 323for (var i = 0; i < _circuitHandlers.Length; i++) 822? new Task[operations.Length] 829for (var i = 0; i < operations.Length; i++)
Circuits\CircuitIdFactory.cs (1)
62if (unprotectedBytes.Length != SecretLength)
Circuits\CircuitOptionsJavaScriptInitializersConfiguration.cs (1)
25for (var i = 0; i < initializers.Length; i++)
Circuits\RemoteJSDataStream.cs (3)
104if (chunk.Length == 0) 109if (chunk.Length > _chunkSize) 114_bytesRead += chunk.Length;
Circuits\RemoteJSRuntime.cs (2)
139if (_maximumIncomingBytes - data.Length < _byteArraysToBeRevivedTotalBytes) 148_byteArraysToBeRevivedTotalBytes += Math.Max(4, data.Length);
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
31for (var i = 0; i < assemblies.Length; i++)
src\Components\Shared\src\RootComponentTypeCache.cs (1)
32for (var i = 0; i < assemblies.Length; i++)
src\Shared\PooledArrayBufferWriter.cs (11)
57return _rentedBuffer.Length; 67return _rentedBuffer.Length - _index; 118if (_index > _rentedBuffer.Length - count) 120ThrowInvalidOperationException(_rentedBuffer.Length); 153var availableSpace = _rentedBuffer.Length - _index; 157var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 159var newSize = checked(_rentedBuffer.Length + growBy); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (3)
447writer.WriteArrayHeader(message.Arguments.Length); 472writer.WriteArrayHeader(message.Arguments.Length); 513writer.WriteArrayHeader(streamIds.Length);
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.Components.Server.Tests (23)
Circuits\CircuitHostTest.cs (3)
653for (var i = circuitHandlers.Length - 1; i >= 0; i--) 782for (int i = 0; i < _renderTcsArray.Length; i++) 790if (_instanceCount >= _renderTcsArray.Length)
Circuits\CircuitIdFactoryTest.cs (2)
76for (int i = protectedBytes.Length - 10; i < protectedBytes.Length; i++)
Circuits\RenderBatchWriterTest.cs (4)
156editsBuilder.Append(edits, 0, edits.Length); 157var editsSegment = editsBuilder.ToSegment(1, edits.Length); // Skip first to show offset is respected 289var stringTableStartPosition = ReadInt(bytes, bytes.Length - 4); 290var stringTableEndPositionExcl = bytes.Length - 20;
Circuits\ServerComponentDeserializerTest.cs (6)
462var markers = new ComponentMarker[types.Length]; 463for (var i = 0; i < types.Length; i++) 475var markers = new ComponentMarker[types.Length]; 476for (var i = 0; i < types.Length; i++) 493var markers = new ComponentMarker[types.Length]; 494for (var i = 0; i < types.Length; i++)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
444Assert.Equal(testData.Size, Write(testData.Message).Length); 489BinaryMessageFormatter.WriteLengthPrefix(input.Length, stream);
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestHubMessageEqualityComparer.cs (6)
92if (left == null || right == null || left.Length != right.Length) 97for (var i = 0; i < left.Length; i++) 148if (left.Length != right.Length) 153for (var i = 0; i < left.Length; i++)
Microsoft.AspNetCore.Components.Tests (19)
CascadingParameterStateTest.cs (2)
405var result = new ComponentState[components.Length]; 407for (var i = 0; i < components.Length; i++)
RendererTest.cs (2)
5666Assert.Equal(parametersSetEvent.Length, parametersSetAsyncEvent.Length);
Rendering\ArrayBuilderSegmentTest.cs (1)
44Array.Clear(originalBuffer, 0, originalBuffer.Length); // Extra proof that we're not using the original storage
Rendering\ArrayBuilderTest.cs (9)
87builder.Append(array, 0, array.Length); 90Assert.Equal(array.Length, builder.Count); 91Assert.Equal(array, builder.Buffer.Take(array.Length)); 122builder.Append(array, 0, array.Length); 125Assert.Equal(array.Length, builder.Count); 126Assert.Equal(array, builder.Buffer.Take(array.Length)); 313buffer => Assert.Equal(2, buffer.Length), 314buffer => Assert.Equal(4, buffer.Length), 315buffer => Assert.Equal(8, buffer.Length));
RenderTreeDiffBuilderTest.cs (4)
2334for (var i = 0; oldTree.GetFrames().Count < oldTree.GetFrames().Array.Length; i++) 2339for (var i = 0; newTree.GetFrames().Count < newTree.GetFrames().Array.Length; i++) 2367for (var i = 0; oldTree.GetFrames().Count < oldTree.GetFrames().Array.Length; i++) 2372for (var i = 0; newTree.GetFrames().Count < newTree.GetFrames().Array.Length; i++)
RenderTreeUpdaterTest.cs (1)
187=> new ArrayRange<RenderTreeFrame>(frames, frames.Length);
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
63var newEndIndex = newBuffer.Length - _currentBuffer.Length + _nextEndIndex;
Microsoft.AspNetCore.Components.Web.Tests (6)
WebEventData\DragEventArgsReaderTest.cs (3)
73Assert.Equal(expected.Length, actual.Length); 74for (var i = 0; i < expected.Length; i++)
WebEventData\TouchEventArgsReaderTest.cs (3)
93Assert.Equal(expected.Length, actual.Length); 94for (var i = 0; i < expected.Length; i++)
Microsoft.AspNetCore.Components.WebAssembly (7)
Hosting\WebAssemblyCultureProvider.cs (1)
67if (culturesToLoad.Length == 0)
HotReload\HotReloadAgent.cs (1)
155var sortedAssemblies = new List<Assembly>(assemblies.Length);
src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
31for (var i = 0; i < assemblies.Length; i++)
src\Components\Shared\src\PullFromJSDataStream.cs (3)
85return bytesRead.Length; 101if (bytesRead.Length != numBytesToRead) 106_offset += bytesRead.Length;
src\Components\Shared\src\RootComponentTypeCache.cs (1)
32for (var i = 0; i < assemblies.Length; i++)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
TargetPickerUi.cs (2)
54var bytesWithHeader = Encoding.UTF8.GetBytes($"{bytes.Length}:").Concat(bytes).ToArray(); 70if (bytesRead + 1 > _lengthBuffer.Length)
Microsoft.AspNetCore.Components.WebAssembly.Tests (2)
PullFromJSDataStreamTest.cs (2)
48Assert.Equal(pullFromJSDataStream.Position, Data.Length); 108var pullFromJSDataStream = PullFromJSDataStream.CreateJSDataStream(runtime, jsStreamReference, totalLength: data.Length, cancellationToken: CancellationToken.None);
Microsoft.AspNetCore.Components.WebView (22)
artifacts\obj\Microsoft.AspNetCore.Components.WebView\Release\net10.0\Microsoft.AspNetCore.Components.WebView.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
IpcCommon.cs (1)
46args = new ArraySegment<JsonElement>(parsed, 1, parsed.Length - 1);
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
src\Components\Shared\src\PullFromJSDataStream.cs (3)
85return bytesRead.Length; 101if (bytesRead.Length != numBytesToRead) 106_offset += bytesRead.Length;
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (9)
27_fileProviders = new IFileProvider[manifest.ContentRoots.Length]; 29for (int i = 0; i < manifest.ContentRoots.Length; i++) 54for (var i = 0; i < segments.Length; i++) 164for (var i = 0; i < segments.Length; i++) 350internal bool HasPatterns() => Patterns != null && Patterns.Length > 0; 404if (value.Patterns.Length > 0) 406var newList = new StaticWebAssetPattern[existingNode.Patterns.Length + value.Patterns.Length]; 408value.Patterns.CopyTo(newList, existingNode.Patterns.Length);
WebViewManager.cs (1)
286if (manifest.ContentRoots.Length > 0)
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
BasicBlazorHybridTest.cs (1)
32Console.WriteLine($"Found {thisAppFiles.Length} files in this app:");
Microsoft.AspNetCore.Connections.Abstractions (6)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (4)
107_parameterValues = new object?[_parameters.Length]; 114for (var givenIndex = 0; givenIndex != givenParameters.Length; givenIndex++) 119for (var applyIndex = applyIndexStart; givenMatched == false && applyIndex != _parameters.Length; ++applyIndex) 147for (var index = 0; index < _parameters.Length; index++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
Microsoft.AspNetCore.CookiePolicy.Test (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
Microsoft.AspNetCore.Cors (1)
artifacts\obj\Microsoft.AspNetCore.Cors\Release\net10.0\Microsoft.AspNetCore.Cors.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Cryptography.Internal (1)
artifacts\obj\Microsoft.AspNetCore.Cryptography.Internal\Release\net462\Microsoft.AspNetCore.Cryptography.Internal.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Cryptography.Internal.Tests (5)
Cng\CachedAlgorithmHandlesTests.cs (5)
149hashHandle.HashData(pInput, (uint)_dataToHash.Length, pOutput, (uint)outputHash.Length); 176var hashHandle = algorithmHandle.CreateHmac(pKey, (uint)_hmacKey.Length); 182hashHandle.HashData(pInput, (uint)_dataToHash.Length, pOutput, (uint)outputHash.Length);
Microsoft.AspNetCore.Cryptography.KeyDerivation (15)
PBKDF2\ManagedPbkdf2Provider.cs (11)
32byte[] saltWithBlockIndex = new byte[checked(salt.Length + sizeof(uint))]; 33Buffer.BlockCopy(salt, 0, saltWithBlockIndex, 0, salt.Length); 40saltWithBlockIndex[saltWithBlockIndex.Length - 4] = (byte)(blockIndex >> 24); 41saltWithBlockIndex[saltWithBlockIndex.Length - 3] = (byte)(blockIndex >> 16); 42saltWithBlockIndex[saltWithBlockIndex.Length - 2] = (byte)(blockIndex >> 8); 43saltWithBlockIndex[saltWithBlockIndex.Length - 1] = (byte)blockIndex; 58int numBytesToCopy = Math.Min(numBytesRemaining, T_blockIndex.Length); 89Array.Clear(passwordBytes, 0, passwordBytes.Length); 96Debug.Assert(src.Length == dest.Length); 97for (int i = 0; i < src.Length; i++)
PBKDF2\Win7Pbkdf2Provider.cs (2)
67cbSalt: (uint)salt.Length, 70cbDerivedKey: (uint)retVal.Length,
PBKDF2\Win8Pbkdf2Provider.cs (2)
36DeriveKeyCore(keyHandle, algorithmName, pbSalt, (uint)salt.Length, (ulong)iterationCount, pbRetVal, (uint)retVal.Length);
Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests (5)
Pbkdf2Tests.cs (5)
34for (int i = 0; i < salt.Length; i++) 97for (int i = 0; i < salt.Length; i++) 124for (int i = 0; i < salt.Length; i++) 151for (int i = 0; i < salt.Length; i++) 205Assert.Equal(numBytesRequested, derivedKey.Length);
Microsoft.AspNetCore.DataProtection (88)
ArraySegmentExtensions.cs (2)
13if (arraySegment.Offset == 0 && arraySegment.Count == arraySegment.Array!.Length) 19Buffer.BlockCopy(arraySegment.Array!, arraySegment.Offset, retVal, 0, retVal.Length);
artifacts\obj\Microsoft.AspNetCore.DataProtection\Release\net462\Microsoft.AspNetCore.DataProtection.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AuthenticatedEncryption\AuthenticatedEncryptorExtensions.cs (4)
29var retVal = new byte[checked(preBufferSize + temp.Length + postBufferSize)]; 30Buffer.BlockCopy(temp, 0, retVal, checked((int)preBufferSize), temp.Length); 51CryptoUtil.Assert(roundTrippedData != null && roundTrippedData.Length == plaintextAsBytes.Length && plaintextAsGuid == new Guid(roundTrippedData),
AuthenticatedEncryption\ConfigurationModel\SecretExtensions.cs (2)
33Array.Clear(unprotectedSecretRawBytes, 0, unprotectedSecretRawBytes.Length); 59Array.Clear(unprotectedSecret, 0, unprotectedSecret.Length);
Cng\CbcAuthenticatedEncryptor.cs (3)
102cbDerivedKey: (uint)tempKeys.Length); 136CryptoUtil.Assert(ptr - pbRetVal == retVal.Length, "ptr - pbRetVal == retVal.Length"); 272Buffer.BlockCopy(decryptedPayload, 0, resizedDecryptedPayload, 0, resizedDecryptedPayload.Length);
Cng\CngGcmAuthenticatedEncryptor.cs (2)
93cbDerivedKey: (uint)tempKeys.Length); 110CryptoUtil.Assert(ptr - pbRetVal == retVal.Length, "ptr - pbRetVal == retVal.Length");
Cng\DpapiSecretSerializerHelper.cs (9)
55return ProtectWithDpapiCore(pbPlaintextSecret, (uint)plaintextSecret.Length, pbPurpose, (uint)_purpose.Length, fLocalMachine: protectToLocalMachine); 61Array.Clear(plaintextSecret, 0, plaintextSecret.Length); 134cbData: (uint)plaintextSecret.Length); 139Array.Clear(plaintextSecret, 0, plaintextSecret.Length); 204return UnprotectWithDpapiCore(pbProtectedSecret, (uint)protectedSecret.Length, pbPurpose, (uint)_purpose.Length); 268cbData: (uint)protectedData.Length); 329cbData: (uint)protectedData.Length);
Internal\ContainerUtils.cs (1)
57if (fields.Length < 2 // line had too few fields
KeyManagement\KeyRingBasedDataProtector.cs (8)
47if (originalPurposes != null && originalPurposes.Length > 0) 49var newPurposes = new string[originalPurposes.Length + 1]; 50Array.Copy(originalPurposes, 0, newPurposes, 0, originalPurposes.Length); 51newPurposes[originalPurposes.Length] = newPurpose; 116CryptoUtil.Assert(retVal != null && retVal.Length >= sizeof(uint) + sizeof(Guid), "retVal != null && retVal.Length >= sizeof(uint) + sizeof(Guid)"); 193if (protectedData.Length < sizeof(uint) /* magic header */ + sizeof(Guid) /* key id */) 277ArraySegment<byte> ciphertext = new ArraySegment<byte>(protectedData, sizeof(uint) + sizeof(Guid), protectedData.Length - (sizeof(uint) + sizeof(Guid))); // chop off magic header + encryptor id 356Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */);
KeyManagement\XmlKeyManager.cs (2)
440for (var i = 0; i < deletableElementsArray.Length; i++) 466for (var i = 0; i < deletableElementsArray.Length; i++)
Managed\AesGcmAuthenticatedEncryptor.cs (7)
134Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 135Array.Clear(derivedKey, 0, derivedKey.Length); 173Buffer.BlockCopy(keyModifier, 0, retVal, (int)preBufferSize, keyModifier.Length); 174Buffer.BlockCopy(nonceBytes, 0, retVal, (int)preBufferSize + keyModifier.Length, nonceBytes.Length); 210Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 211Array.Clear(derivedKey, 0, derivedKey.Length);
Managed\ManagedAuthenticatedEncryptor.cs (28)
118CryptoUtil.Assert(ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes, "ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes"); 119Buffer.BlockCopy(ciphertext, 0, retVal, idx, ciphertext.Length); 129CryptoUtil.Assert(digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes, "digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes"); 130Buffer.BlockCopy(digest, 0, retVal, idx, digest.Length); 134CryptoUtil.Assert(idx == retVal.Length, "idx == retVal.Length"); 191Buffer.BlockCopy(protectedPayload.Array!, ivOffset, iv, 0, iv.Length); 199var derivedKeysBuffer = new byte[checked(decryptionSubkey.Length + validationSubkey.Length)]; 217Buffer.BlockCopy(derivedKeysBuffer, 0, decryptionSubkey, 0, decryptionSubkey.Length); 218Buffer.BlockCopy(derivedKeysBuffer, decryptionSubkey.Length, validationSubkey, 0, validationSubkey.Length); 237if (!CryptoUtil.TimeConstantBuffersAreEqual(correctHash, 0, correctHash.Length, protectedPayload.Array!, macOffset, eofOffset - macOffset)) 261Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 262Array.Clear(decryptionSubkey, 0, decryptionSubkey.Length); 263Array.Clear(validationSubkey, 0, validationSubkey.Length); 264Array.Clear(derivedKeysBuffer, 0, derivedKeysBuffer.Length); 297outputStream.Write(keyModifier, 0, keyModifier.Length); 298outputStream.Write(iv, 0, iv.Length); 308var derivedKeysBuffer = new byte[checked(encryptionSubkey.Length + validationSubkey.Length)]; 326Buffer.BlockCopy(derivedKeysBuffer, 0, encryptionSubkey, 0, encryptionSubkey.Length); 327Buffer.BlockCopy(derivedKeysBuffer, encryptionSubkey.Length, validationSubkey, 0, validationSubkey.Length); 350outputStream.Write(mac, 0, mac.Length); 361Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 362Array.Clear(encryptionSubkey, 0, encryptionSubkey.Length); 363Array.Clear(validationSubkey, 0, validationSubkey.Length); 364Array.Clear(derivedKeysBuffer, 0, derivedKeysBuffer.Length);
RegistryPolicyResolver.cs (1)
106for (var i = 0; i < keyEscrowSinks.Length; i++)
Secret.cs (3)
89_localAllocHandle = Protect(pbTempPlaintextBuffer, (uint)tempPlaintextBuffer.Length); 90_plaintextLength = (uint)tempPlaintextBuffer.Length; 94UnsafeBufferUtil.SecureZeroMemory(pbTempPlaintextBuffer, tempPlaintextBuffer.Length);
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (9)
26prfInput[prfInput.Length - 4] = (byte)(outputSizeInBits >> 24); 27prfInput[prfInput.Length - 3] = (byte)(outputSizeInBits >> 16); 28prfInput[prfInput.Length - 2] = (byte)(outputSizeInBits >> 8); 29prfInput[prfInput.Length - 1] = (byte)(outputSizeInBits); 46CryptoUtil.Assert(prfOutputSizeInBytes == prfOutput.Length, "prfOutputSizeInBytes == prfOutput.Length"); 49Array.Clear(prfOutput, 0, prfOutput.Length); // contains key material, so delete it 60var combinedContext = new byte[checked(contextHeader.Length + context.Count)]; 61Buffer.BlockCopy(contextHeader, 0, combinedContext, 0, contextHeader.Length); 62Buffer.BlockCopy(context.Array!, context.Offset, combinedContext, contextHeader.Length, context.Count);
SP800_108\SP800_108_CTR_HMACSHA512Extensions.cs (3)
12var cbCombinedContext = checked((uint)contextHeader.Length + cbContext); 27UnsafeBufferUtil.BlockCopy(from: pbContextHeader, to: pbCombinedContext, byteCount: contextHeader.Length); 29UnsafeBufferUtil.BlockCopy(from: pbContext, to: &pbCombinedContext[contextHeader.Length], byteCount: cbContext);
SP800_108\Win7SP800_108_CTR_HMACSHA512Provider.cs (1)
63hashHandle.HashData(pbTempInputBuffer, (uint)tempInputBuffer.Length, pbHashDigest, SHA512_DIGEST_SIZE_IN_BYTES);
XmlEncryption\XmlEncryptionExtensions.cs (2)
176Array.Clear(underlyingBuffer, 0, underlyingBuffer.Length); 197Array.Clear(plaintextSecret, 0, plaintextSecret.Length);
Microsoft.AspNetCore.DataProtection.Abstractions (7)
artifacts\obj\Microsoft.AspNetCore.DataProtection.Abstractions\Release\net10.0\Microsoft.AspNetCore.DataProtection.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DataProtectionCommonExtensions.cs (1)
80if (subPurposes != null && subPurposes.Length > 0)
src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 238return Base64UrlEncode(input, offset: 0, count: input.Length); 252ValidateParameters(input.Length, nameof(input), offset, count); 293ValidateParameters(input.Length, nameof(input), offset, count); 297if (output.Length - outputOffset < arraySizeRequired)
Microsoft.AspNetCore.DataProtection.Extensions (6)
artifacts\obj\Microsoft.AspNetCore.DataProtection.Extensions\Release\net462\Microsoft.AspNetCore.DataProtection.Extensions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
TimeLimitedDataProtector.cs (5)
53byte[] plaintextWithHeader = new byte[checked(8 + plaintext.Length)]; 55Buffer.BlockCopy(plaintext, 0, plaintextWithHeader, 8, plaintext.Length); 74if (plaintextWithHeader.Length < 8) 91byte[] retVal = new byte[plaintextWithHeader.Length - 8]; 92Buffer.BlockCopy(plaintextWithHeader, 8, retVal, 0, retVal.Length);
Microsoft.AspNetCore.DataProtection.Tests (16)
KeyManagement\KeyRingBasedDataProtectorTests.cs (2)
150badProtectedPayload = badProtectedPayload.Take(badProtectedPayload.Length - 1).ToArray(); // chop off the last byte 625.Concat(BitConverter.GetBytes(IPAddress.HostToNetworkOrder(purposes.Length))); // purposeCount
KeyManagement\XmlKeyManagerTests.cs (2)
371Assert.Equal(2, keys.Length); 448Assert.Equal(4, keys.Length);
SequentialGenRandom.cs (1)
16for (int i = 0; i < bytes.Length; i++)
SP800_108\SP800_108Tests.cs (11)
81for (int i = 0; i < kdk.Length; i++) 105for (int i = 0; i < kdk.Length; i++) 129for (int i = 0; i < kdk.Length; i++) 151ISP800_108_CTR_HMACSHA512Provider provider = factory(pbKdk, (uint)kdk.Length); 152provider.DeriveKeyWithContextHeader(pbLabel, (uint)label.Length, contextHeader, pbContext, (uint)context.Length, pbDerivedSubkey, (uint)derivedSubkey.Length); 160var labelSegment = new ArraySegment<byte>(new byte[label.Length + 10], 3, label.Length); 162var contextSegment = new ArraySegment<byte>(new byte[context.Length + 10], 5, context.Length);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (11)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
Microsoft.AspNetCore.Diagnostics (7)
artifacts\obj\Microsoft.AspNetCore.Diagnostics\Release\net10.0\Microsoft.AspNetCore.Diagnostics.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
459if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
artifacts\obj\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore\Release\net10.0\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Strings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
artifacts\obj\Microsoft.AspNetCore.Diagnostics.HealthChecks\Release\net10.0\Microsoft.AspNetCore.Diagnostics.HealthChecks.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Diagnostics.Middleware (15)
Logging\HeaderNormalizer.cs (2)
12var normalizedHeaders = new string[headers.Length]; 14for (int i = 0; i < headers.Length; i++)
Logging\HeaderReader.cs (1)
36for (int i = 0; i < _headers.Length; i++)
Logging\HttpLoggingRedactionInterceptor.cs (2)
68if (_excludePathStartsWith.Length != 0 && ShouldExcludePath(context.Request.Path.Value!)) 145if (_enrichers.Length == 0
Logging\IncomingHttpRouteUtility.cs (1)
54if (dataClassificationAttributes.Length > 0)
Logging\RequestHeadersLogEnricher.cs (4)
41if (_headersDataClasses.Length > 0) 58if (_headersDataClasses.Length == 0) 63if (_headersDataClasses.Length != 0) 65for (int i = 0; i < _headersDataClasses.Length; i++)
src\Shared\BufferWriterPool\BufferWriter.cs (5)
70get => _buffer.Length; 121_ = Throw.IfOutOfRange(count, 0, _buffer.Length - WrittenCount); 171var avail = _buffer.Length - WrittenCount; 174var targetCapacity = _buffer.Length == 0 ? DefaultCapacity : _buffer.Length * 2;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (12)
Latency\ChecpointAcceptanceTests.cs (1)
131Assert.Equal(2, metricFragments.Length);
Logging\HeaderNormalizerTests.cs (1)
22Assert.Equal(2, headers.Length);
Logging\IncomingHttpRouteUtilityTests.cs (9)
31controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 69controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 109controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 151controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 193controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 240controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 281controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 329controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length); 374controllerActionDescriptor.Parameters = new List<ParameterDescriptor>(parametersInfo.Length);
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\JsonRequestHelpers.cs (1)
357Debug.Assert(read == data.Length);
Internal\JsonTranscodingRouteAdapter.cs (1)
147for (var i = 0; i < values.Length; i++)
src\Grpc\JsonTranscoding\src\Shared\X509CertificateHelpers.cs (1)
55for (var i = 0; i < rawDnsEntries.Length; i++)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
Infrastructure\SyncPoint.cs (1)
76if (counter >= localSyncPoints.Length)
UnaryServerCallHandlerTests.cs (3)
1175return Task.FromResult(new HelloReply { Message = $"Hello {requestData.Length}!" }); 1187for (var i = 0; i < requestContent.Length; i++) 1209Assert.Equal($"Hello {requestContent.Length}!", responseJson.RootElement.GetProperty("message").GetString());
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingFeature.cs (1)
62if (header.Position >= _boxes.Length)
Microsoft.AspNetCore.HostFiltering (2)
HostFilteringMiddleware.cs (2)
72context.Response.ContentLength = DefaultResponse.Length; 74return context.Response.Body.WriteAsync(DefaultResponse, 0, DefaultResponse.Length);
Microsoft.AspNetCore.Hosting (26)
artifacts\obj\Microsoft.AspNetCore.Hosting\Release\net10.0\Microsoft.AspNetCore.Hosting.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\ConfigureBuilder.cs (2)
30var parameters = new object[parameterInfos.Length]; 31for (var index = 0; index < parameterInfos.Length; index++)
Internal\ConfigureContainerBuilder.cs (1)
27if (parameters.Length != 1)
Internal\ConfigureServicesBuilder.cs (3)
39if (parameters.Length > 1 || 45var arguments = new object[MethodInfo.GetParameters().Length]; 47if (parameters.Length > 0)
Internal\HostingMetrics.cs (1)
115return (uint)statusCode < (uint)boxes.Length
Internal\StartupLoader.cs (3)
180if (filters.Length == 0) 186for (int i = filters.Length - 1; i >= 0; i--) 199if (filters.Length > 0 && result != null)
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
397if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (9)
27_fileProviders = new IFileProvider[manifest.ContentRoots.Length]; 29for (int i = 0; i < manifest.ContentRoots.Length; i++) 54for (var i = 0; i < segments.Length; i++) 164for (var i = 0; i < segments.Length; i++) 350internal bool HasPatterns() => Patterns != null && Patterns.Length > 0; 404if (value.Patterns.Length > 0) 406var newList = new StaticWebAssetPattern[existingNode.Patterns.Length + value.Patterns.Length]; 408value.Patterns.CopyTo(newList, existingNode.Patterns.Length);
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Hosting.Tests (4)
Internal\HostingEventSourceTests.cs (2)
127Assert.Equal(expected.Length, payloadList.Count); 128for (var i = 0; i < expected.Length; i++)
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
WebHostTests.cs (1)
1133for (int i = 0; i < signals.Length; i++)
Microsoft.AspNetCore.Http (12)
Internal\ResponseCookies.cs (1)
151for (var i = 0; i < values.Length; i++)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
163for (var i = 0; i < keys.Length; i++) 188for (var i = 0; i < values.Length; i++) 297if ((uint)arrayIndex > array.Length || array.Length - arrayIndex < this.Count) 505if (_arrayStorage!.Length >= capacity) 530capacity = _arrayStorage.Length == 0 ? DefaultArrayThreshold : _arrayStorage.Length * 2; 546Debug.Assert(_count <= _arrayStorage.Length);
Microsoft.AspNetCore.Http.Abstractions (46)
artifacts\obj\Microsoft.AspNetCore.Http.Abstractions\Release\net10.0\Microsoft.AspNetCore.Http.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Extensions\UseMiddlewareExtensions.cs (12)
58if (args.Length > 0) 93if (parameters.Length == 0 || parameters[0].ParameterType != typeof(HttpContext)) 128var ctorArgs = new object[_args.Length + 1]; 130Array.Copy(_args, 0, ctorArgs, 1, _args.Length); 132if (_parameters.Length == 1) 204for (var i = 1; i < parameters.Length; i++) 214var precomputedKeys = new object?[parameters.Length]; 215for (var i = 1; i < parameters.Length; i++) 224var methodArguments = new object[parameters.Length]; 226for (var i = 1; i < parameters.Length; i++) 301var methodArguments = new Expression[parameters.Length]; 303for (var i = 1; i < parameters.Length; i++)
Internal\ParsingHelpers.cs (1)
107if (values == null || values.Length == 0)
Metadata\ProducesResponseTypeMetadata.cs (2)
29if (contentTypes is null || contentTypes.Length == 0) 35for (var i = 0; i < contentTypes.Length; i++)
Routing\EndpointMetadataCollection.cs (5)
63public int Count => _items.Length; 78var length = result.Length; 88var length = result.Length; 115for (var i = 0; i < items.Length; i++) 202if (_index < _items.Length)
Routing\RouteValueDictionary.cs (17)
68var end = items.Length - 1; 153_count = storage.Properties.Length; 328for (var i = 0; i < keys.Length; i++) 348for (var i = 0; i < values.Length; i++) 449if (arrayIndex < 0 || arrayIndex > array.Length || array.Length - arrayIndex < Count) 631for (var i = 0; i < storage.Properties.Length; i++) 656if (_propertyStorage != null || _arrayStorage.Length < capacity) 680capacity = Math.Max(DefaultCapacity, Math.Max(storage.Properties.Length, capacity)); 683for (var i = 0; i < storage.Properties.Length; i++) 694if (_arrayStorage.Length < capacity) 696capacity = _arrayStorage.Length == 0 ? DefaultCapacity : _arrayStorage.Length * 2; 733if ((uint)count <= (uint)array.Length) 756if ((uint)count <= (uint)array.Length) 777for (var i = 0; i < properties.Length; i++) 903for (var i = 0; i < properties.Length; i++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 282Debug.Assert(parameters.Length == 1); 441var filteredProperties = new List<PropertyHelper>(allProperties.Length); 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (4)
GetHeaderSplitBenchmark.cs (4)
30if (values.Length != 1) 40if (values.Length != 1) 50if (values.Length != 2) 60if (values.Length != 6)
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
HttpMethodslTests.cs (1)
29for (int j = 0; j < testCase.methods.Length; j++)
HttpResponseWritingExtensionsTests.cs (4)
43var actual = new byte[expected.Length]; 46Assert.Equal(expected.Length, length); 61var actual = new byte[expected.Length * 2]; 67Assert.Equal(expected.Length, length);
RouteValueDictionaryTests.cs (2)
2047Assert.Equal(4, storage.Length); 2057Assert.Equal(8, storage.Length);
Microsoft.AspNetCore.Http.Connections (10)
src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 238return Base64UrlEncode(input, offset: 0, count: input.Length); 252ValidateParameters(input.Length, nameof(input), offset, count); 293ValidateParameters(input.Length, nameof(input), offset, count); 297if (output.Length - outputOffset < arraySizeRequired)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\ServerSentEventsTransport.cs (1)
142Log.MessageToApplication(_logger, item.Data.Length);
Microsoft.AspNetCore.Http.Connections.Tests (29)
HttpConnectionDispatcherTests.cs (8)
216requestBody.Write(bytes, 0, bytes.Length); 586requestBody.Write(bytes, 0, bytes.Length); 650requestBody.Write(bytes, 0, bytes.Length); 2576requestBody.Write(buffer, 0, buffer.Length); 2636requestBody.Write(buffer, 0, buffer.Length); 2640await connection.ApplicationStream.WriteAsync(buffer, 0, buffer.Length).DefaultTimeout(); 2693requestBody.Write(buffer, 0, buffer.Length); 2697await connection.ApplicationStream.WriteAsync(buffer, 0, buffer.Length).DefaultTimeout();
NegotiateProtocolTests.cs (1)
35Assert.Equal(availableTransports?.Length, response.AvailableTransports?.Count);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
TestWebSocketConnectionFeature.cs (5)
134if (_internalBuffer.Buffer == null || _internalBuffer.Buffer.Length == 0) 152var length = _internalBuffer.Buffer.Length; 153if (buffer.Count - buffer.Offset < _internalBuffer.Buffer.Length) 155length = Math.Min(buffer.Count - buffer.Offset, _internalBuffer.Buffer.Length); 168endOfMessage = _internalBuffer.Buffer.Length == 0 && endOfMessage;
Microsoft.AspNetCore.Http.Extensions (54)
artifacts\obj\Microsoft.AspNetCore.Http.Extensions\Release\net10.0\Microsoft.AspNetCore.Components.Endpoints.FormMapping.FormDataResources.cs (1)
25for (var i = 0; i < formatterNames.Length; i++)
HeaderDictionaryTypeExtensions.cs (2)
272if (methodParams.Length == 2 309return methodParams.Length == 2
ProblemDetailsService.cs (1)
35for (var i = 0; i < _writers.Length; i++)
RequestDelegateFactory.cs (11)
603var expandedArguments = new Expression[arguments.Length + 1]; 641if (parameters is null || parameters.Length == 0) 646var args = new Expression[parameters.Length]; 648factoryContext.ArgumentTypes = new Type[parameters.Length]; 649factoryContext.BoxedArgs = new Expression[parameters.Length]; 652for (var i = 0; i < parameters.Length; i++) 1575if (constructor is not null && parameters is { Length: > 0 }) 1579var constructorArguments = new Expression[parameters.Length]; 1581for (var i = 0; i < parameters.Length; i++) 1602var bindings = new List<MemberBinding>(properties.Length); 1604for (var i = 0; i < properties.Length; i++)
SessionExtensions.cs (1)
39if (data == null || data.Length < 4)
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (3)
16if (buffer.Count >= buffer.Data.Length) 18var newBuffer = ArrayPool<TElement>.Shared.Rent(buffer.Data.Length * 2); 19Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (2)
125if (constructors.Length == 1) 135else if (constructors.Length > 1)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
189if (index < 0 || index > MethodParameters.Length - 1) 205var parameters = new List<Expression>(paramInfos.Length); 206for (int i = 0; i < paramInfos.Length; i++) 257var parameters = new List<Expression>(paramInfos.Length); 258for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\Shared\ParameterBindingMethodCache.cs (8)
319if (constructor is null || constructor.GetParameters().Length == 0) 325var lookupTable = new Dictionary<ParameterLookupKey, PropertyInfo>(properties.Length); 326for (var i = 0; i < properties.Length; i++) 339var parametersWithPropertyInfo = new ConstructorParameter[parameters.Length]; 341for (var i = 0; i < parameters.Length; i++) 370if (constructors.Length == 1) 377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0); 401if (parameterlessConstructor is null && constructors.Length > 1)
src\Shared\PropertyAsParameterInfo.cs (16)
69if (parameters.Length == 0) 77for (var i = 0; i < parameters.Length; i++) 91List<ParameterInfo> list = new(parameters.Length); 107if (constructor is not null && constructorParameters is { Length: > 0 }) 144if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length]; 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 162if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length]; 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Http.Extensions.Tests (37)
HttpResponseJsonExtensionsTests.cs (4)
328Assert.InRange(body.ToArray().Length, 0, 1); 362Assert.InRange(body.ToArray().Length, 0, 1); 396Assert.InRange(body.ToArray().Length, 0, 1); 430Assert.InRange(body.ToArray().Length, 0, 1);
ParameterBindingMethodCacheTests.cs (7)
37Assert.Equal(4, parameters.Length); 55Assert.Equal(3, parameters.Length); 79Assert.Equal(3, parameters.Length); 86Assert.Equal(4, parameters.Length); 109Assert.Equal(3, parameters.Length); 133Assert.Equal(2, parameters.Length); 190Assert.Equal(2, parameters.Length);
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
144for (int i = 0; i < endpoints.Length; i++)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
139var sourceText = SourceText.From(buffer, buffer.Length, encoding, canBeEmbedded: true); 384if (expectedLines.Length != sourceText.Lines.Count) 386message = $"Line numbers do not match. Expected: {expectedLines.Length} lines, but generated {sourceText.Lines.Count}";
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (1)
391Assert.Equal(3, logs.Length);
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (4)
158while (i < BindAsyncUriTypesAndOptionalitySupport.Length * 2) 172Assert.Equal(BindAsyncUriTypesAndOptionalitySupport.Length * 2, endpoints.Length); 174for (i = 0; i < BindAsyncUriTypesAndOptionalitySupport.Length * 2; i++)
RequestDelegateGenerator\RequestDelegateCreationTests.cs (2)
157Assert.Equal(3, endpoints.Length); 310Assert.Equal(3, endpoints.Length);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (11)
133Assert.Equal(2, endpoints.Length); 243byte[] data = new byte[requestBodyBytes.Length]; 245Assert.Equal(read, data.Length); 250Assert.Equal(requestBodyBytes.Length, result.Buffer.Length); 284byte[] data = new byte[requestBodyBytes.Length]; 286Assert.Equal(read, data.Length); 291Assert.Equal(requestBodyBytes.Length, result.Buffer.Length); 319httpContext.Request.Headers["Content-Length"] = requestBodyBytes.Length.ToString(CultureInfo.InvariantCulture); 328int read = await httpContext.Request.Body.ReadAsync(new byte[requestBodyBytes.Length].AsMemory()); 360httpContext.Request.Headers["Content-Length"] = requestBodyBytes.Length.ToString(CultureInfo.InvariantCulture); 369int read = await httpContext.Request.Body.ReadAsync(new byte[requestBodyBytes.Length].AsMemory());
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (4)
47Assert.Equal(4, logs.Length); 110Assert.Equal(2, logs.Length); 230Assert.Equal(2, logs.Length); 310Assert.Equal(2, logs.Length);
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
139var sourceText = SourceText.From(buffer, buffer.Length, encoding, canBeEmbedded: true); 384if (expectedLines.Length != sourceText.Lines.Count) 386message = $"Line numbers do not match. Expected: {expectedLines.Length} lines, but generated {sourceText.Lines.Count}";
Microsoft.AspNetCore.Http.RequestDelegateGenerator (18)
artifacts\obj\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Release\netstandard2.0\Microsoft.AspNetCore.Http.RequestDelegateGenerator.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
31for (var i = 0; i < WellKnownTypeData.WellKnownTypeNames.Length; i++) 52_lazyWellKnownTypes = new INamedTypeSymbol?[WellKnownTypeData.WellKnownTypeNames.Length];
StaticRouteHandlerModel\Endpoint.cs (3)
120a.Parameters.Length != b.Parameters.Length) 125for (var i = 0; i < a.Parameters.Length; i++)
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (12)
24if (endpoint.Parameters.Length == 0) 74if (endpoint.Parameters.Length > 0) 172var argumentList = endpoint.Parameters.Length == 0 ? string.Empty : $", {endpoint.EmitArgumentList()}"; 173var invocationCreator = endpoint.Parameters.Length > 8 176var invocationGenericArgs = endpoint.Parameters.Length is > 0 and < 8 184if (endpoint.Parameters.Length > 0) 443if (endpoint.Parameters.Length == 0) 450for (var i = 0; i < endpoint.Parameters.Length; i++) 458if (i < endpoint.Parameters.Length - 1) 469if (endpoint.Parameters.Length == 0) 476for (var i = 0; i < endpoint.Parameters.Length; i++) 480if (i < endpoint.Parameters.Length - 1)
Microsoft.AspNetCore.Http.Results (2)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
379for (var i = 0; i < states.Length; i++)
Microsoft.AspNetCore.Http.Results.Tests (9)
ContentResultTests.cs (1)
123Assert.Equal(expectedContentData.Length, httpContext.Response.ContentLength);
HttpResultsHelperTests.cs (1)
202Assert.Equal(3, body.Length);
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
Microsoft.AspNetCore.Http.Tests (12)
Features\FormFeatureTests.cs (7)
620var toWrite = Math.Min(size - written, bytes.Length); 641stream.Write(bytes, 0, bytes.Length); 647stream.Write(bytes, 0, bytes.Length); 656var readA = streamA.Read(bytesA, 0, bytesA.Length); 657var readB = streamB.Read(bytesB, 0, bytesB.Length); 670readA = streamA.Read(bytesA, 0, bytesA.Length); 671readB = streamB.Read(bytesB, 0, bytesB.Length);
RequestCookiesCollectionTests.cs (2)
51Assert.Equal(expectedCookieValues.Length, cookies.Count); 52for (int i = 0; i < expectedCookieValues.Length; i++)
ResponseCookiesTest.cs (3)
138Assert.Equal(testCookies.Length, deletedCookies.Length); 169Assert.Equal(2, deletedCookies.Length);
Microsoft.AspNetCore.HttpLogging (14)
artifacts\obj\Microsoft.AspNetCore.HttpLogging\Release\net10.0\Microsoft.AspNetCore.HttpLogging.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
FileLoggerProcessor.cs (1)
310return files.Length == 0
HttpLoggingMiddleware.cs (5)
61if (_interceptors.Length == 0 && loggingFields == HttpLoggingFields.None) 95for (var i = 0; i < _interceptors.Length; i++) 202if (loggingFields.HasFlag(HttpLoggingFields.ResponseBody) || _interceptors.Length > 0) 310for (var i = 0; i < interceptors.Length; i++) 320for (var i = 0; i < interceptors.Length; i++)
src\Shared\Buffers\BufferSegmentStack.cs (3)
28if ((uint)size >= (uint)array.Length) 46if ((uint)size < (uint)array.Length) 61Array.Resize(ref _array, 2 * _array.Length);
W3CLogger.cs (2)
40for (var i = 0; i < elements.Length; i++) 64for (var i = 0; i < additionalHeaders.Length; i++)
W3CLoggingMiddleware.cs (2)
250if (src.Length == 0) 258if (src.Length == 0)
Microsoft.AspNetCore.HttpLogging.Tests (11)
FileLoggerProcessorTests.cs (7)
191Assert.Equal(4, actualFiles.Length); 244.ToArray().Length); 314Assert.Equal(6, actualFiles1.Length); 338Assert.Equal(5, actualFiles2.Length); 398Assert.Equal(3, actualFiles.Length); 464Assert.Equal(2, actualFiles.Length); 534Assert.Equal(2, actualFiles.Length);
HttpLoggingMiddlewareTests.cs (3)
1293Assert.Equal(lines.Length, i); 1566Assert.Equal(lines.Length, i); 1606Assert.Equal(lines.Length, i);
W3CLoggingMiddlewareTests.cs (1)
266Assert.Equal(19, lines[3].Split(' ').Length);
Microsoft.AspNetCore.HttpOverrides (33)
ForwardedHeadersMiddleware.cs (31)
133entryCount = Math.Max(forwardedFor.Length, entryCount); 140if (_options.RequireHeaderSymmetry && checkFor && forwardedFor!.Length != forwardedProto.Length) 145entryCount = Math.Max(forwardedProto.Length, entryCount); 153&& ((checkFor && forwardedFor!.Length != forwardedHost.Length) 154|| (checkProto && forwardedProto!.Length != forwardedHost.Length))) 159entryCount = Math.Max(forwardedHost.Length, entryCount); 167&& ((checkFor && forwardedFor!.Length != forwardedPrefix.Length) 168|| (checkProto && forwardedProto!.Length != forwardedPrefix.Length) 169|| (checkHost && forwardedHost!.Length != forwardedPrefix.Length))) 174entryCount = Math.Max(forwardedPrefix.Length, entryCount); 185for (int i = 0; i < sets.Length; i++) 189if (checkFor && i < forwardedFor!.Length) 191set.IpAndPortText = forwardedFor[forwardedFor.Length - i - 1]; 193if (checkProto && i < forwardedProto!.Length) 195set.Scheme = forwardedProto[forwardedProto.Length - i - 1]; 197if (checkHost && i < forwardedHost!.Length) 199set.Host = forwardedHost[forwardedHost.Length - i - 1]; 201if (checkPrefix && i < forwardedPrefix!.Length) 203set.Prefix = forwardedPrefix[forwardedPrefix.Length - i - 1]; 220for (; entriesConsumed < sets.Length; entriesConsumed++) 312if (forwardedFor!.Length > entriesConsumed) 331if (forwardedProto!.Length > entriesConsumed) 349if (forwardedHost!.Length > entriesConsumed) 371if (forwardedPrefix!.Length > entriesConsumed) 483var newLength = forwarded.Length - entriesConsumed;
IPNetwork.cs (2)
66for (int i = 0; i < PrefixBytes.Length && Mask[i] != 0; i++) 79var mask = new byte[PrefixBytes.Length];
Microsoft.AspNetCore.Identity (5)
artifacts\obj\Microsoft.AspNetCore.Identity\Release\net10.0\Microsoft.AspNetCore.Identity.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
IdentityApiEndpointRouteBuilderExtensions.cs (4)
330RecoveryCodesLeft = recoveryCodes?.Length ?? await userManager.CountRecoveryCodesAsync(user), 442newDescriptions = new string[descriptions.Length + 1]; 443Array.Copy(descriptions, newDescriptions, descriptions.Length); 444newDescriptions[descriptions.Length] = error.Description;
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
artifacts\obj\Microsoft.AspNetCore.Identity.EntityFrameworkCore\Release\net10.0\Microsoft.AspNetCore.Identity.EntityFrameworkCore.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (2)
DbUtil.cs (2)
59return count == columns.Length; 78return count == columns.Length;
Microsoft.AspNetCore.Identity.FunctionalTests (7)
MapIdentityApiTests.cs (3)
748Assert.Equal(10, recoveryCodes.Length); 846Assert.Equal(10, recoveryCodes.Length); 877Assert.Equal(10, resetRecoveryCodes.Length);
src\Identity\Extensions.Core\src\Base32.cs (2)
56for (int offset = 0; offset < input.Length;) 88while (outputIndex < output.Length)
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (2)
72var combined = new byte[checked(input.Length + modifierBytes.Length)]; 74Buffer.BlockCopy(modifierBytes, 0, combined, input.Length, modifierBytes.Length);
Microsoft.AspNetCore.Identity.InMemory.Test (2)
FunctionalTest.cs (1)
424await res.Body.WriteAsync(memory.ToArray(), 0, memory.ToArray().Length);
InMemoryUserStore.cs (1)
431return mergedCodes.Split(';').Length;
Microsoft.AspNetCore.Identity.Test (2)
Base32Test.cs (1)
33Assert.Equal(20, output.Length);
PasswordHasherTest.cs (1)
198for (int i = 0; i < data.Length; i++)
Microsoft.AspNetCore.Identity.UI (3)
Areas\Identity\Pages\V4\Account\Manage\ShowRecoveryCodes.cshtml.cs (1)
35if (RecoveryCodes == null || RecoveryCodes.Length == 0)
Areas\Identity\Pages\V5\Account\Manage\ShowRecoveryCodes.cshtml.cs (1)
35if (RecoveryCodes == null || RecoveryCodes.Length == 0)
IdentityPageModelConvention.cs (1)
31if (genericArguments.Length != 1)
Microsoft.AspNetCore.InternalTesting (1)
xunit\ConditionalTheoryDiscoverer.cs (1)
49if (skipReason == null && dataRow?.Length > 0)
Microsoft.AspNetCore.InternalTesting.Tests (1)
HttpClientSlimTest.cs (1)
107await context.Response.OutputStream.WriteAsync(_defaultResponse, 0, _defaultResponse.Length);
Microsoft.AspNetCore.JsonPatch (3)
artifacts\obj\Microsoft.AspNetCore.JsonPatch\Release\net462\Microsoft.AspNetCore.JsonPatch.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\ParsedPath.cs (2)
31if (_segments == null || _segments.Length == 0) 36return _segments[_segments.Length - 1];
Microsoft.AspNetCore.Localization (4)
ApplicationBuilderExtensions.cs (1)
84if (cultures.Length == 0)
artifacts\obj\Microsoft.AspNetCore.Localization\Release\net10.0\Microsoft.AspNetCore.Localization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
RequestLocalizationOptions.cs (2)
125var supportedCultures = new List<CultureInfo>(cultures.Length); 144var supportedUICultures = new List<CultureInfo>(uiCultures.Length);
Microsoft.AspNetCore.Localization.Tests (1)
CustomRequestCultureProviderTest.cs (1)
68if (segments.Length > 1 && segments[0].Length == 2)
Microsoft.AspNetCore.Mvc.Abstractions (15)
artifacts\obj\Microsoft.AspNetCore.Mvc.Abstractions\Release\net10.0\Microsoft.AspNetCore.Mvc.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ModelBinding\BindingInfo.cs (2)
150if (propertyFilterProviders.Length == 1) 155else if (propertyFilterProviders.Length > 1)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\ParameterBindingMethodCache.cs (8)
319if (constructor is null || constructor.GetParameters().Length == 0) 325var lookupTable = new Dictionary<ParameterLookupKey, PropertyInfo>(properties.Length); 326for (var i = 0; i < properties.Length; i++) 339var parametersWithPropertyInfo = new ConstructorParameter[parameters.Length]; 341for (var i = 0; i < parameters.Length; i++) 370if (constructors.Length == 1) 377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0); 401if (parameterlessConstructor is null && constructors.Length > 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
SymbolApiResponseMetadataProvider.cs (2)
164if (attributes.Length == 0) 170for (var i = 0; i < attributes.Length; i++)
Microsoft.AspNetCore.Mvc.ApiExplorer (16)
ApiDescriptionGroupCollectionProvider.cs (1)
72for (var i = _apiDescriptionProviders.Length - 1; i >= 0; i--)
src\Shared\PropertyAsParameterInfo.cs (15)
69if (parameters.Length == 0) 77for (var i = 0; i < parameters.Length; i++) 91List<ParameterInfo> list = new(parameters.Length); 144if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length]; 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 162if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length]; 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
Microsoft.AspNetCore.Mvc.Core (114)
ActionConstraints\ActionConstraintCache.cs (2)
125for (var i = 0; i < _actionConstraintProviders.Length; i++) 130for (var i = _actionConstraintProviders.Length - 1; i >= 0; i--)
ApiConventionMethodAttribute.cs (2)
53if (methods.Length == 0) 57else if (methods.Length > 1)
ApiConventionTypeAttribute.cs (1)
67if (unsupportedAttributes.Length == 0)
ApiExplorer\ApiConventionMatcher.cs (5)
25for (var i = 0; i < conventionMethodParameters.Length; i++) 33if (methodParameters.Length <= i) 50return methodParameters.Length == conventionMethodParameters.Length; 69for (var i = 0; i < attributes.Length; i++)
ApplicationModels\ApiConventionApplicationModelConvention.cs (1)
64if (apiConventionAttributes.Length == 0)
ApplicationModels\ApplicationModelFactory.cs (2)
39for (var i = 0; i < _applicationModelProviders.Length; i++) 44for (var i = _applicationModelProviders.Length - 1; i >= 0; i--)
ApplicationModels\AuthorizationApplicationModelProvider.cs (2)
45if (controllerModelAuthData.Length > 0) 57if (actionModelAuthData.Length > 0)
ApplicationModels\DefaultApplicationModelProvider.cs (4)
128if (routeAttributes.Length > 0) 318if (routeAttributes.Length > 0) 336var applicableAttributes = new List<object>(routeAttributes.Length); 638if (httpMethods.Length > 0)
ApplicationParts\RelatedAssemblyAttribute.cs (2)
63if (attributes.Length == 0) 80for (var i = 0; i < attributes.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Mvc.Core\Release\net10.0\Microsoft.AspNetCore.Mvc.Core.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BindAttribute.cs (2)
26var items = new List<string>(include.Length); 56if (Include != null && Include.Length > 0)
ConsumesAttribute.cs (3)
47for (var i = 0; i < otherContentTypes.Length; i++) 70for (var i = 0; i < otherContentTypes.Length; i++) 238var completeArgs = new List<string>(args.Length + 1);
Controllers\ControllerBinderDelegateProvider.cs (2)
62for (var i = 0; i < parameters.Length; i++) 88for (var i = 0; i < properties.Length; i++)
Controllers\ControllerFactoryProvider.cs (3)
61for (var i = 0; i < propertyActivators.Length; i++) 117var propertyActivators = new Action<ControllerContext, object>[_propertyActivators.Length]; 118for (var i = 0; i < _propertyActivators.Length; i++)
Controllers\DefaultControllerPropertyActivator.cs (2)
24for (var i = 0; i < propertiesToActivate.Length; i++) 49for (var i = 0; i < propertiesToActivate.Length; i++)
Filters\FilterCursor.cs (1)
46while (_index < _filters.Length)
Filters\FilterFactory.cs (6)
41for (var i = 0; i < staticFilterItems.Length; i++) 51if (allFiltersAreReusable && filterProviders.Length == 1 && filterProviders[0] is DefaultFilterProvider defaultFilterProvider) 76var filterItems = new List<FilterItem>(cachedFilterItems.Length); 77for (var i = 0; i < cachedFilterItems.Length; i++) 99for (var i = 0; i < filterProviders.Length; i++) 104for (var i = filterProviders.Length - 1; i >= 0; i--)
Filters\MiddlewareFilterConfigurationProvider.cs (2)
94var parameters = new object[parameterInfos.Length]; 95for (var index = 0; index < parameterInfos.Length; index++)
Infrastructure\ActionInvokerFactory.cs (1)
29for (var i = _actionInvokerProviders.Length - 1; i >= 0; i--)
Infrastructure\ActionMethodExecutor.cs (1)
45for (var i = 0; i < Executors.Length; i++)
Infrastructure\ActionSelectionTable.cs (2)
167var routeValues = new string[routeKeys.Length]; 168for (var i = 0; i < routeKeys.Length; i++)
Infrastructure\ControllerActionInvoker.cs (3)
532var count = declaredParameterInfos.Length; 628var convertedArguments = new string?[arguments.Length]; 629for (var i = 0; i < arguments.Length; i++)
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (5)
80if (_actionDescriptorChangeProviders.Length == 1) 85var changeTokens = new IChangeToken[_actionDescriptorChangeProviders.Length]; 86for (var i = 0; i < _actionDescriptorChangeProviders.Length; i++) 122for (var i = 0; i < _actionDescriptorProviders.Length; i++) 127for (var i = _actionDescriptorProviders.Length - 1; i >= 0; i--)
Infrastructure\FileContentResultExecutor.cs (1)
36result.FileContents.Length,
Infrastructure\ParameterDefaultValues.cs (2)
17var values = new object?[parameters.Length]; 19for (var i = 0; i < parameters.Length; i++)
Infrastructure\StringArrayComparer.cs (4)
36if (x.Length != y.Length) 41for (var i = 0; i < x.Length; i++) 65for (var i = 0; i < obj.Length; i++)
ModelBinding\Binders\CollectionModelBinder.cs (1)
487return (indexes == null || indexes.Length == 0) ? null : indexes;
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (1)
53for (var i = 0; i < parameterBinders.Length; i++)
ModelBinding\Binders\HeaderModelBinder.cs (5)
168if (!bindingContext.IsTopLevelObject && values.Length == 0) 179var collection = ModelBindingHelper.GetCompatibleCollection<string>(bindingContext, values.Length); 180for (var i = 0; i < values.Length; i++) 201return _values.Length != 0; 206if (_values.Length == 0)
ModelBinding\DefaultModelBindingContext.cs (1)
288var rootModelType = states[states.Length - 1].ModelMetadata.ModelType;
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (6)
53if (propertyFilterProviders.Length == 0) 57else if (propertyFilterProviders.Length == 1) 88if (constructors.Length == 0) 108if (constructors.Length > 1) 116if (parameters.Length == 0) 124for (var i = 0; i < parameters.Length; i++)
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (10)
85var properties = new ModelMetadata[propertyDetails.Length]; 86for (var i = 0; i < properties.Length; i++) 218for (var i = 0; i < propertyHelpers.Length; i++) 235var parameterMetadata = new ModelMetadata[parameters.Length]; 236var parameterTypes = new Type[parameters.Length]; 238for (var i = 0; i < parameters.Length; i++) 269var constructorArguments = new Expression[constructorParameters.Length]; 271for (var i = 0; i < constructorParameters.Length; i++) 337var propertyEntries = new List<DefaultMetadataDetails>(propertyHelpers.Length); 338for (var i = 0; i < propertyHelpers.Length; i++)
ModelBinding\Metadata\HasValidatorsValidationMetadataProvider.cs (1)
34for (var i = 0; i < _validatorProviders!.Length; i++)
ModelBinding\ModelBinderFactory.cs (2)
55if (_providers.Length == 0) 148for (var i = 0; i < _providers.Length; i++)
ModelBinding\ModelBindingHelper.cs (4)
330if (expressions.Length == 0) 640var converted = (IList)Array.CreateInstance(destinationElementType, valueAsArray.Length); 641for (var i = 0; i < valueAsArray.Length; i++) 660if (valueAsArray.Length > 0)
ModelBinding\PrefixContainer.cs (2)
51if (_sortedValues.Length == 0) 187var end = _sortedValues.Length - 1;
ProducesAttribute.cs (2)
44for (var i = 0; i < additionalContentTypes.Length; i++) 109var completeArgs = new List<string>(args.Length + 1);
ProducesResponseTypeAttribute.cs (2)
57for (var i = 0; i < additionalContentTypes.Length; i++) 110var completeContentTypes = new List<string>(additionalContentTypes.Length + 1);
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
189if (index < 0 || index > MethodParameters.Length - 1) 205var parameters = new List<Expression>(paramInfos.Length); 206for (int i = 0; i < paramInfos.Length; i++) 257var parameters = new List<Expression>(paramInfos.Length); 258for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\Shared\PropertyActivator\PropertyActivator.cs (1)
90property.GetIndexParameters().Length == 0 &&
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 282Debug.Assert(parameters.Length == 1); 441var filteredProperties = new List<PropertyHelper>(allProperties.Length); 554property.GetMethod.GetParameters().Length == 0;
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
379for (var i = 0; i < states.Length; i++)
Microsoft.AspNetCore.Mvc.Core.Test (32)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (4)
369Assert.Equal(2, descriptors.Length); 1431for (var i = unorderedStart + unorderedLineCount; i < expectedLines.Length; i++) 1436Assert.Equal(expectedLines.Length, actualLines.Length);
ContentResultTest.cs (1)
140Assert.Equal(expectedContentData.Length, httpContext.Response.ContentLength);
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (3)
49AssertServiceCountEquals(services, serviceType.Key, serviceType.Value.Length + 1); 363if (matches.Length == 0) 367else if (matches.Length > 1)
Filters\FilterFactoryTest.cs (3)
161Assert.Equal(2, filters.Length); 236Assert.Equal(3, filters.Length); 247Assert.Equal(3, filters.Length);
Formatters\SystemTextJsonOutputFormatterTest.cs (1)
144Assert.InRange(body.ToArray().Length, 0, 1);
Infrastructure\JsonResultExecutorTestBase.cs (3)
379Assert.InRange(written.Length, 0, 1); 413Assert.InRange(written.Length, 0, 2); 463Assert.InRange(written.Length, 0, 2);
ModelBinding\Binders\ArrayModelBinderTest.cs (1)
184var arrayLength = model.Length;
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (1)
521if (tokens.Length >= 2)
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (4)
96Assert.Equal(2, metadata.Length); 126Assert.Equal(properties1.Length, properties2.Length); 127for (var i = 0; i < properties1.Length; i++)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (2)
495Assert.Equal(expectedProperties.Length, properties.Count); 497for (var i = 0; i < expectedProperties.Length; i++)
ModelBinding\ModelBindingHelperTest.cs (2)
1137Assert.Equal(2, result.Length); 1155Assert.Equal(2, result.Length);
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
SimpleValueProvider.cs (2)
44var stringValues = new string[array.Length]; 45for (var i = 0; i < array.Length; i++)
Microsoft.AspNetCore.Mvc.Cors (1)
artifacts\obj\Microsoft.AspNetCore.Mvc.Cors\Release\net10.0\Microsoft.AspNetCore.Mvc.Cors.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
artifacts\obj\Microsoft.AspNetCore.Mvc.DataAnnotations\Release\net10.0\Microsoft.AspNetCore.Mvc.DataAnnotations.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
artifacts\obj\Microsoft.AspNetCore.Mvc.DataAnnotations.Test\Release\net10.0\Microsoft.AspNetCore.Mvc.DataAnnotations.Test.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ModelMetadataProviderTest.cs (1)
1062if (_attributes?.Length > 0)
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
artifacts\obj\Microsoft.AspNetCore.Mvc.Formatters.Xml\Release\net10.0\Microsoft.AspNetCore.Mvc.Formatters.Xml.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (48)
DelegatingEnumerableTest.cs (2)
44Assert.Equal(errors.Length, delegatingEnumerable.Count()); 46for (var i = 0; i < errors.Length; i++)
XmlDataContractSerializerInputFormatterTest.cs (23)
485var contentBytes = new byte[inpStart.Length + inp.Length + inpEnd.Length]; 486Buffer.BlockCopy(inpStart, 0, contentBytes, 0, inpStart.Length); 487Buffer.BlockCopy(inp, 0, contentBytes, inpStart.Length, inp.Length); 488Buffer.BlockCopy(inpEnd, 0, contentBytes, inpStart.Length + inp.Length, inpEnd.Length); 538var expectedBytes = new byte[sampleString.Length + bom.Length]; 540var contentBytes = new byte[inputStart.Length + bom.Length + inputEnd.Length]; 541Buffer.BlockCopy(inputStart, 0, contentBytes, 0, inputStart.Length); 542Buffer.BlockCopy(bom, 0, contentBytes, inputStart.Length, bom.Length); 543Buffer.BlockCopy(inputEnd, 0, contentBytes, inputStart.Length + bom.Length, inputEnd.Length); 555Buffer.BlockCopy(sampleStringBytes, 0, expectedBytes, 0, sampleStringBytes.Length); 556Buffer.BlockCopy(bom, 0, expectedBytes, sampleStringBytes.Length, bom.Length); 743request.SetupGet(f => f.ContentLength).Returns(contentBytes.Length);
XmlSerializerInputFormatterTest.cs (23)
505var contentBytes = new byte[inpStart.Length + inp.Length + inpEnd.Length]; 506Buffer.BlockCopy(inpStart, 0, contentBytes, 0, inpStart.Length); 507Buffer.BlockCopy(inp, 0, contentBytes, inpStart.Length, inp.Length); 508Buffer.BlockCopy(inpEnd, 0, contentBytes, inpStart.Length + inp.Length, inpEnd.Length); 558var expectedBytes = new byte[sampleString.Length + bom.Length]; 560var contentBytes = new byte[inputStart.Length + bom.Length + inputEnd.Length]; 561Buffer.BlockCopy(inputStart, 0, contentBytes, 0, inputStart.Length); 562Buffer.BlockCopy(bom, 0, contentBytes, inputStart.Length, bom.Length); 563Buffer.BlockCopy(inputEnd, 0, contentBytes, inputStart.Length + bom.Length, inputEnd.Length); 575Buffer.BlockCopy(sampleStringBytes, 0, expectedBytes, 0, sampleStringBytes.Length); 576Buffer.BlockCopy(bom, 0, expectedBytes, sampleStringBytes.Length, bom.Length); 679request.SetupGet(f => f.ContentLength).Returns(contentBytes.Length);
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
BasicTests.cs (1)
452Assert.Equal(2, result.Length);
InputObjectValidationTests.cs (2)
148var errorKeyValuePair = Assert.Single(responseObject, keyValuePair => keyValuePair.Value.Length > 0); 176var errorKeyValuePair = Assert.Single(responseObject, keyValuePair => keyValuePair.Value.Length > 0);
Microsoft.AspNetCore.Mvc.Localization (1)
Properties\Resources.Designer.cs (1)
53for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Localization.Test (2)
MvcLocalizationServiceCollectionExtensionsTest.cs (2)
62if (matches.Length == 0) 66else if (matches.Length > 1)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
artifacts\obj\Microsoft.AspNetCore.Mvc.NewtonsoftJson\Release\net10.0\Microsoft.AspNetCore.Mvc.NewtonsoftJson.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BsonTempDataSerializer.cs (2)
182Debug.Assert(genericTypeArguments.Length == 1, "IList<T> has one generic argument"); 189genericTypeArguments.Length == 2,
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (5)
NewtonsoftJsonInputFormatterTest.cs (1)
455httpContext.Setup(h => h.Request.ContentLength).Returns(content.Length);
NewtonsoftJsonPatchInputFormatterTest.cs (1)
263request.SetupGet(f => f.ContentLength).Returns(contentBytes.Length);
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (3)
379Assert.InRange(written.Length, 0, 1); 413Assert.InRange(written.Length, 0, 2); 463Assert.InRange(written.Length, 0, 2);
Microsoft.AspNetCore.Mvc.Razor (9)
artifacts\obj\Microsoft.AspNetCore.Mvc.Razor\Release\net10.0\Microsoft.AspNetCore.Mvc.Razor.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DefaultTagHelperFactory.cs (1)
60for (var i = 0; i < propertiesToActivate.Length; i++)
RazorPage.cs (1)
228if (sectionsNotIgnored.Length > 0)
RazorPagePropertyActivator.cs (1)
49for (var i = 0; i < _propertyActivators.Length; i++)
RazorViewEngine.cs (1)
465for (var i = 0; i < viewStarts.Length; i++)
TagHelpers\TagHelperComponentPropertyActivator.cs (1)
36for (var i = 0; i < propertiesToActivate.Length; i++)
TagHelpers\TagHelperComponentTagHelper.cs (2)
65for (var i = 0; i < _components.Length; i++) 80for (var i = 0; i < _components.Length; i++)
TagHelpers\UrlResolutionTagHelper.cs (1)
129for (var i = 0; i < attributeNames.Length; i++)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (8)
artifacts\obj\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation\Release\net10.0\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ChecksumValidator.cs (2)
121if (bytes.Length * 2 != checksum.Length) 126for (var i = 0; i < bytes.Length; i++)
PageActionDescriptorChangeProvider.cs (5)
60var changeTokens = new IChangeToken[_additionalFilesToTrack.Length + _searchPatterns.Length]; 61for (var i = 0; i < _additionalFilesToTrack.Length; i++) 66for (var i = 0; i < _searchPatterns.Length; i++) 69changeTokens[_additionalFilesToTrack.Length + i] = wildcardChangeToken;
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
PageLoaderMatcherPolicyTest.cs (3)
98var values = new RouteValueDictionary[actions.Length]; 99for (var i = 0; i < actions.Length; i++) 107new int[actions.Length]);
Microsoft.AspNetCore.Mvc.Razor.Test (3)
RazorPageTest.cs (3)
1032page.BeginAddHtmlAttributeValues(executionContext, "someattr", attributeValues.Length, HtmlAttributeValueStyle.SingleQuotes); 1078page.BeginAddHtmlAttributeValues(executionContext, "someattr", attributeValues.Length, HtmlAttributeValueStyle.SingleQuotes); 1246page.BeginWriteAttribute("someattr", prefix, 0, suffix, 0, attributeValues.Length);
Microsoft.AspNetCore.Mvc.RazorPages (20)
ApplicationModels\AuthorizationPageApplicationModelProvider.cs (1)
40if (authorizeData.Length > 0)
ApplicationModels\CompiledPageActionDescriptorBuilder.cs (2)
80for (var i = 0; i < handlerDescriptors.Length; i++) 102for (var i = 0; i < parameters.Length; i++)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (1)
58for (var i = 0; i < methodParameters.Length; i++)
ApplicationModels\DefaultPageApplicationModelProvider.cs (1)
144for (var i = 0; i < methods.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Mvc.RazorPages\Release\net10.0\Microsoft.AspNetCore.Mvc.RazorPages.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Infrastructure\CompiledPageActionDescriptorFactory.cs (2)
38for (var i = 0; i < _applicationModelProviders.Length; i++) 43for (var i = _applicationModelProviders.Length - 1; i >= 0; i--)
Infrastructure\DefaultPageModelFactoryProvider.cs (1)
39for (var i = 0; i < propertyActivator.Length; i++)
Infrastructure\ExecutorFactory.cs (2)
56var unpackExpressions = new Expression[parameters.Length]; 57for (var i = 0; i < parameters.Length; i++)
Infrastructure\PageActionDescriptorProvider.cs (4)
63for (var i = 0; i < _routeModelProviders.Length; i++) 68for (var i = _routeModelProviders.Length - 1; i >= 0; i--) 83for (var i = 0; i < _conventions.Length; i++) 145for (var i = 0; i < segments.Length; i++)
Infrastructure\PageActionInvoker.cs (1)
228for (var i = 0; i < arguments.Length; i++)
Infrastructure\PageBinderFactory.cs (2)
96for (var i = 0; i < parameterBindingInfo.Length; i++) 135for (var i = 0; i < parameterBindingInfo.Length; i++)
PageLoggerExtensions.cs (2)
97var convertedArguments = new string[arguments.Length]; 98for (var i = 0; i < arguments.Length; i++)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\PageActionInvokerTest.cs (1)
1532for (var i = 0; i < handlers.Length; i++)
Microsoft.AspNetCore.Mvc.TagHelpers (14)
artifacts\obj\Microsoft.AspNetCore.Mvc.TagHelpers\Release\net10.0\Microsoft.AspNetCore.Mvc.TagHelpers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AttributeMatcher.cs (2)
44if (allAttributesCount >= requiredAttributes.Length && 60for (var i = 0; i < requiredAttributes.Length; i++)
Cache\DistributedCacheTagHelperService.cs (10)
168var keyLength = BitConverter.GetBytes(serializedKey.Length); 170buffer.Write(keyLength, 0, keyLength.Length); 171buffer.Write(serializedKey, 0, serializedKey.Length); 172buffer.Write(value, 0, value.Length); 185buffer.Read(keyLengthBuffer, 0, keyLengthBuffer.Length); 189buffer.Read(serializedKeyBuffer, 0, serializedKeyBuffer.Length); 194decoded = new byte[value.Length - keyLengthBuffer.Length - serializedKeyBuffer.Length]; 195buffer.Read(decoded, 0, decoded.Length);
CacheTagHelper.cs (1)
264var pageLength = Math.Min(length, page.Length);
Microsoft.AspNetCore.Mvc.Test (7)
MvcServiceCollectionExtensionsTest.cs (3)
73AssertServiceCountEquals(services, serviceType.Key, serviceType.Value.Length + 1); 640if (matches.Length == 0) 644else if (matches.Length > 1)
Routing\ActionConstraintMatcherPolicyTest.cs (4)
445for (var i = 0; i < actions.Length; i++) 487var values = new RouteValueDictionary[actions.Length]; 488for (var i = 0; i < actions.Length; i++) 496new int[actions.Length]);
Microsoft.AspNetCore.Mvc.Testing (6)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24551.5\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
117&& factory.GetParameters().Length == 1 236if (parameters.Length == 0)
artifacts\obj\Microsoft.AspNetCore.Mvc.Testing\Release\net10.0\Microsoft.AspNetCore.Mvc.Testing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
WebApplicationFactory.cs (3)
262for (var i = 0; i < metadataAttributes.Length; i++) 482if (handlers == null || handlers.Length == 0) 488for (var i = handlers.Length - 1; i > 0; i--)
Microsoft.AspNetCore.Mvc.ViewFeatures (37)
artifacts\obj\Microsoft.AspNetCore.Mvc.ViewFeatures\Release\net10.0\Microsoft.AspNetCore.Mvc.ViewFeatures.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AttributeDictionary.cs (3)
229if (arrayIndex < 0 || arrayIndex >= array.Length) 408if (arrayIndex < 0 || arrayIndex >= array.Length) 513if (arrayIndex < 0 || arrayIndex >= array.Length)
Buffers\MemoryPoolViewBufferScope.cs (1)
75Array.Clear(segment, 0, segment.Length);
Buffers\PagedBufferedTextWriter.cs (2)
57var pageLength = Math.Min(length, page.Length); 82_charBuffer.Append(buffer, 0, buffer.Length);
Buffers\PagedCharBuffer.cs (4)
32length += pages[i].Length; 60var copyLength = Math.Min(count, page.Length - _charIndex); 81var copyLength = Math.Min(count, page.Length - _charIndex); 125if (CurrentPage == null || _charIndex == CurrentPage.Length)
Buffers\ViewBufferPage.cs (1)
17public int Capacity => Buffer.Length;
Buffers\ViewBufferTextWriter.cs (2)
86ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 189if (count < 0 || (buffer.Length - index < count))
Infrastructure\DefaultTempDataSerializer.cs (1)
15if (value.Length == 0)
MemberExpressionCacheKey.cs (1)
68if (_index >= _members.Length)
ModelExplorer.cs (1)
238for (var i = 0; i < PropertiesInternal.Length; i++)
ModelExplorerExtensions.cs (1)
75if (modelExplorer.PropertiesInternal.Length == 0)
src\Shared\PooledArrayBufferWriter.cs (11)
57return _rentedBuffer.Length; 67return _rentedBuffer.Length - _index; 118if (_index > _rentedBuffer.Length - count) 120ThrowInvalidOperationException(_rentedBuffer.Length); 153var availableSpace = _rentedBuffer.Length - _index; 157var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 159var newSize = checked(_rentedBuffer.Length + growBy); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
ViewComponents\DefaultViewComponentDescriptorProvider.cs (2)
72if (methods.Length == 0) 77else if (methods.Length > 1)
ViewComponents\DefaultViewComponentFactory.cs (1)
57for (var i = 0; i < propertiesToActivate.Length; i++)
ViewComponents\DefaultViewComponentInvoker.cs (3)
270if (arguments == null || arguments.Length == 0) 275var formattedArguments = new string[arguments.Length]; 276for (var i = 0; i < formattedArguments.Length; i++)
ViewDataDictionaryControllerPropertyActivator.cs (2)
45for (var i = 0; i < propertiesToActivate.Length; i++) 68for (var i = 0; i < propertiesToActivate.Length; i++)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (19)
artifacts\obj\Microsoft.AspNetCore.Mvc.ViewFeatures.Test\Release\net10.0\Microsoft.AspNetCore.Mvc.ViewFeatures.Test.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Buffers\PagedBufferedTextWriterTest.cs (10)
15for (var i = 0; i < Content.Length; i++) 31for (var i = 0; i < Content.Length; i++) 70Assert.Equal(4096, Content.Length); // Update these numbers if this changes. 91for (var i = 0; i < Content.Length; i++) 122Assert.Equal(4096, Content.Length); // Update these numbers if this changes. 167Assert.Equal(4096, Content.Length); // Update these numbers if this changes. 251for (var i = 0; i < Content.Length; i++) 271for (var i = 0; i < Content.Length; i++) 291for (var i = 0; i < Content.Length; i++) 311for (var i = 0; i < Content.Length; i++)
Buffers\PagedCharBufferTest.cs (7)
339buffer.Append(laterChars, 0, laterChars.Length); 340buffer.Append(laterChars, 0, laterChars.Length); 369buffer.Append(laterChars, 0, laterChars.Length); 370buffer.Append(laterChars, 0, laterChars.Length); 398buffer.Append(laterChars, 0, laterChars.Length); 399buffer.Append(laterChars, 0, laterChars.Length); 418buffer.Append(arrayToAppend, 0, arrayToAppend.Length);
ModelExplorerTest.cs (1)
49Assert.Equal(2, properties.Length);
Microsoft.AspNetCore.OpenApi (44)
Services\OpenApiDocumentService.cs (4)
140for (var i = 0; i < schemaTransformers.Length; i++) 144for (var i = 0; i < operationTransformers.Length; i++) 157for (var i = 0; i < OpenApiConstants.OperationTypes.Length; i++) 260for (var i = 0; i < operationTransformers.Length; i++)
Services\Schemas\OpenApiSchemaService.cs (2)
151if (schemaTransformers.Length == 0) 164for (var i = 0; i < schemaTransformers.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
189if (index < 0 || index > MethodParameters.Length - 1) 205var parameters = new List<Expression>(paramInfos.Length); 206for (int i = 0; i < paramInfos.Length; i++) 257var parameters = new List<Expression>(paramInfos.Length); 258for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\Shared\ParameterBindingMethodCache.cs (8)
319if (constructor is null || constructor.GetParameters().Length == 0) 325var lookupTable = new Dictionary<ParameterLookupKey, PropertyInfo>(properties.Length); 326for (var i = 0; i < properties.Length; i++) 339var parametersWithPropertyInfo = new ConstructorParameter[parameters.Length]; 341for (var i = 0; i < parameters.Length; i++) 370if (constructors.Length == 1) 377var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0); 401if (parameterlessConstructor is null && constructors.Length > 1)
src\Shared\PropertyAsParameterInfo.cs (16)
69if (parameters.Length == 0) 77for (var i = 0; i < parameters.Length; i++) 91List<ParameterInfo> list = new(parameters.Length); 107if (constructor is not null && constructorParameters is { Length: > 0 }) 144if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length]; 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 162if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length]; 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Transformers\Implementations\OpenApiSchemaReferenceTransformer.cs (1)
42for (var i = 0; i < OpenApiConstants.OperationTypes.Length; i++)
Microsoft.AspNetCore.OutputCaching (17)
artifacts\obj\Microsoft.AspNetCore.OutputCaching\Release\net10.0\Microsoft.AspNetCore.OutputCaching.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Memory\MemoryOutputCacheStore.cs (3)
120Size = value.Length 123if (tags != null && tags.Length > 0) 137Debug.Assert(tags.Length > 0);
OutputCacheEntryFormatter.cs (2)
510var pairs = new List<KeyValuePair<string, int>>(arr.Length); 511for (var i = 0; i < arr.Length; i++)
OutputCacheKeyProvider.cs (1)
309var valueNamesCount = orderedKeys.Length;
Policies\VaryByHeaderPolicy.cs (1)
25if (headerNames != null && headerNames.Length > 0)
Policies\VaryByQueryPolicy.cs (1)
26if (queryKeys != null && queryKeys.Length > 0)
Policies\VaryByRouteValuePolicy.cs (1)
25if (routeValueNames != null && routeValueNames.Length > 0)
RecyclableArrayBufferWriter.cs (7)
24public int FreeCapacity => _buffer.Length - _index; 37if (tmp.Length != 0) 50if (_index > _buffer.Length - count) 66Debug.Assert(_buffer.Length > _index); 73Debug.Assert(_buffer.Length > _index); 91int currentLength = _buffer.Length; 121if (oldArray.Length != 0)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
EndToEndBenchmarks.cs (1)
39if (arr.Length != 0)
Microsoft.AspNetCore.OutputCaching.Tests (5)
OutputCacheEntryFormatterTests.cs (1)
108for (int i = 0; i < arr.Length; i++)
OutputCacheTests.cs (2)
984for (int i = 0; i < clients.Length; i++) 991for (int i = 0; i < clients.Length; i++)
TestUtils.cs (2)
260Assert.Equal(expectedMessages.Length, messageList.Count); 283response.Body.Write(data, 0, data.Length);
Microsoft.AspNetCore.Owin (2)
DictionaryStringValuesWrapper.cs (1)
55if (rawValue.Length == 1 &&
OwinEnvironment.cs (1)
259if (arrayIndex + _entries.Count + _context.Items.Count > array.Length)
Microsoft.AspNetCore.RateLimiting (1)
artifacts\obj\Microsoft.AspNetCore.RateLimiting\Release\net10.0\Microsoft.AspNetCore.RateLimiting.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.RateLimiting.Tests (1)
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
Microsoft.AspNetCore.Razor (1)
TagHelpers\RestrictChildrenAttribute.cs (1)
26var concatenatedNames = new string[1 + childTags.Length];
Microsoft.AspNetCore.Razor.Runtime (3)
artifacts\obj\Microsoft.AspNetCore.Razor.Runtime\Release\net10.0\Microsoft.AspNetCore.Razor.Runtime.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (1)
579Assert.Equal(2, tagHelpers.Length);
Microsoft.AspNetCore.RequestDecompression.Tests (5)
SizeLimitedStreamTests.cs (5)
33var buffer = new byte[bytes.Length]; 57var buffer = new byte[bytes.Length]; 62while (sizeLimitedStream.Read(buffer, 0, buffer.Length) > 0) { } 81var buffer = new byte[bytes.Length]; 86var asyncResult = sizeLimitedStream.BeginRead(buffer, 0, buffer.Length, (o) => { }, null);
Microsoft.AspNetCore.ResponseCaching (10)
CacheEntry\CachedResponseBody.cs (2)
36var span = destination.GetSpan(segment.Length); 39destination.Advance(segment.Length);
ResponseCachingFeature.cs (2)
20if (value?.Length > 1) 22for (var i = 0; i < value.Length; i++)
ResponseCachingKeyProvider.cs (4)
118for (var j = 0; j < headerValuesArray.Length; j++) 139for (var i = 0; i < queryArray.Length; i++) 148for (var j = 0; j < queryValueArray.Length; j++) 172for (var j = 0; j < queryValueArray.Length; j++)
ResponseCachingMiddleware.cs (2)
492var newArray = new string[originalArray.Length]; 494for (var i = 0; i < originalArray.Length; i++)
Microsoft.AspNetCore.ResponseCaching.Tests (2)
TestUtils.cs (2)
246Assert.Equal(messageList.Count, expectedMessages.Length); 269response.Body.Write(data, 0, data.Length);
Microsoft.AspNetCore.ResponseCompression (5)
ResponseCompressionBody.cs (1)
211for (var i = 0; i < varyValues.Length; i++)
ResponseCompressionProvider.cs (4)
38if (_providers.Length == 0) 47for (var i = 0; i < _providers.Length; i++) 106for (int i = 0; i < _providers.Length; i++) 119for (int i = 0; i < _providers.Length; i++)
Microsoft.AspNetCore.ResponseCompression.Tests (8)
ResponseCompressionBodyTest.cs (3)
40stream.Write(buffer, 0, buffer.Length); 56await stream.WriteAsync(buffer, 0, buffer.Length); 88stream.BeginWrite(buffer, 0, buffer.Length, (o) => { }, null);
ResponseCompressionMiddlewareTest.cs (5)
479Assert.Equal(expectedLength, (await response.Content.ReadAsByteArrayAsync()).Length); 542Assert.Equal(expectedLength, (await response.Content.ReadAsByteArrayAsync()).Length); 605Assert.Equal(expectedLength, (await response.Content.ReadAsByteArrayAsync()).Length); 1014var read = await body.ReadAsync(data, 0, data.Length); 1279for (var i = 0; i < requestAcceptEncodings?.Length; i++)
Microsoft.AspNetCore.Rewrite (5)
artifacts\obj\Microsoft.AspNetCore.Rewrite\Release\net10.0\Microsoft.AspNetCore.Rewrite.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
RedirectToNonWwwRule.cs (1)
25if (domains.Length < 1)
RedirectToWwwRule.cs (1)
25if (domains.Length < 1)
UrlActions\CustomResponseAction.cs (2)
40response.ContentLength = content.Length; 42response.Body.Write(content, 0, content.Length);
Microsoft.AspNetCore.Routing (91)
ArrayBuilder.cs (2)
43public int Capacity => _array?.Length ?? 0; 114if (_count < result.Length)
artifacts\obj\Microsoft.AspNetCore.Routing\Release\net10.0\Microsoft.AspNetCore.Routing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (3)
87var contentTypes = new string[additionalContentTypes.Length + 1]; 305var allContentTypes = new string[additionalContentTypes.Length + 1]; 308for (var i = 0; i < additionalContentTypes.Length; i++)
EndpointNameAddressScheme.cs (4)
61var newEntry = new Endpoint[existing.Length + 1]; 62Array.Copy(existing, newEntry, existing.Length); 63newEntry[existing.Length] = endpoint; 80if (group.Key is not null && group.Value.Length > 1)
Matching\AcceptsMatcherPolicy.cs (3)
276for (var i = 0; i < ordered.Length; i++) 292for (var i = 0; i < destinations.Length; i++) 367for (var i = 0; i < destinations.Length; i++)
Matching\Candidate.cs (4)
82for (var i = 0; i < slots.Length; i++) 90if (captures.Length > 0) 100if (complexSegments.Length > 0) 105if (constraints.Length > 0)
Matching\CandidateSet.cs (14)
41if (endpoints.Length != values.Length || endpoints.Length != scores.Length) 46Candidates = new CandidateState[endpoints.Length]; 47for (var i = 0; i < endpoints.Length; i++) 56Candidates = new CandidateState[candidates.Length]; 57for (var i = 0; i < candidates.Length; i++) 71public int Count => Candidates.Length; 246var candidates = new CandidateState[original.Length - 1 + endpoints.Count]; 284for (var i = 1; i < buffer.Length; i++) 303for (var i = index + 1; i < original.Length; i++) 327for (var i = 0; i < candidates.Length; i++) 340for (var i = 0; i < candidates.Length; i++)
Matching\ContentEncodingNegotiationMatcherPolicy.cs (1)
52for (var i = 0; i < destinations.Length; i++)
Matching\DfaMatcher.cs (9)
52var candidateCount = candidates.Length; 68var policyCount = policies.Length; 134var slots = new KeyValuePair<string, object?>[prototype.Length]; 138Array.Copy(prototype, 0, slots, 0, prototype.Length); 240for (var i = 0; i < captures.Length; i++) 282for (var i = 0; i < complexSegments.Length; i++) 303for (var i = 0; i < constraints.Length; i++) 321for (var i = 0; i < policies.Length; i++) 356=> CandidatesFound(logger, candidates.Length, path);
Matching\DfaMatcherBuilder.cs (2)
652for (var i = 0; i < _endpointSelectorPolicies.Length; i++) 891for (var i = 0; i < _nodeBuilders.Length; i++)
Matching\DfaState.cs (1)
31$"matches: {Candidates?.Length ?? 0}, " +
Matching\EndpointComparer.cs (3)
30_comparers = new IComparer<Endpoint>[2 + policies.Length]; 33for (var i = 0; i < policies.Length; i++) 94for (var i = 0; i < _comparers.Length; i++)
Matching\EndpointMetadataComparer.cs (1)
54for (var i = 0; i < comparers.Length; i++)
Matching\HostMatcherPolicy.cs (5)
203if (hosts is null || hosts.Length == 0) 208for (var j = 0; j < hosts.Length; j++) 225if (endpointKeys is null || endpointKeys.Length == 0) 242for (var j = 0; j < endpointKeys.Length; j++) 383for (var i = 0; i < destinations.Length; i++)
Matching\ILEmitTrieFactory.cs (4)
108if (groups.Length >= binarySearchThreshold) 333if (groups.Length >= binarySearchThreshold) 457if (!disableBinarySearch && groups.Length >= binarySearchThreshold) 524Debug.Assert(entries.Length == 1, "We should have a single entry");
Matching\JumpTableBuilder.cs (5)
38if (pathEntries == null || pathEntries.Length == 0) 45if (pathEntries.Length == 1 && Ascii.IsValid(pathEntries[0].text)) 52if (pathEntries.Length == 1) 69if (pathEntries.Length >= threshold) 79if (pathEntries.Length <= 10)
Matching\LinearSearchJumpTable.cs (1)
34for (var i = 0; i < entries.Length; i++)
Matching\NegotiationMatcherPolicy.cs (3)
344for (var i = 0; i < destinations.Length; i++) 361if (endpointsQuality.Length == 0) 367for (var i = 1; i < endpointsQuality.Length; i++)
ParameterPolicyActivator.cs (8)
105if (constructors.Length == 1 && GetNonConvertableParameterTypeCount(serviceProvider, constructors[0].GetParameters()) == 1) 119var matchingConstructors = GetMatchingConstructors(constructors, serviceProvider, arguments.Length); 125parameterPolicyType.Name, arguments.Length)); 169var length = constructor.GetParameters().Length; 196return parameters.Length; 200for (var i = 0; i < parameters.Length; i++) 213var parameters = new object?[parameterInfos.Length]; 215for (var i = 0; i < parameterInfos.Length; i++)
Patterns\RoutePatternFactory.cs (2)
471for (var i = 0; i < updatedSegments.Length; i++) 1120var check = checkDuplicates?.Invoke(combinedList.Length, rawText!);
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 282Debug.Assert(parameters.Length == 1); 441var filteredProperties = new List<PropertyHelper>(allProperties.Length); 554property.GetMethod.GetParameters().Length == 0;
Template\TemplateBinder.cs (9)
164var slots = new KeyValuePair<string, object?>[_slots.Length]; 165Array.Copy(_slots, 0, slots, 0, slots.Length); 174for (var i = 0; i < slots.Length; i++) 206for (var i = 0; i < requiredKeys.Length; i++) 356for (var i = 0; i < filters.Length; i++) 434for (var i = 0; i < constraints.Length; i++) 504for (var i = 0; i < parameterTransformers.Length; i++) 722var slots = new KeyValuePair<string, object?>[pattern.Parameters.Count + filters.Length]; 729for (var i = 0; i < filters.Length; i++)
Microsoft.AspNetCore.Routing.Abstractions (6)
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 282Debug.Assert(parameters.Length == 1); 441var filteredProperties = new List<PropertyHelper>(allProperties.Length); 554property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Routing.Microbenchmarks (35)
EndpointMetadataCollectionBenchmark.cs (7)
34for (var i = 0; i < _items.Length; i++) 36_items[i] = seeds[i % seeds.Length]; 47for (var i = items.Length - 1; i >= 0; i--) 52for (var i = items.Length - 1; i >= 0; i--) 57for (var i = items.Length - 1; i >= 0; i--) 62for (var i = items.Length - 1; i >= 0; i--) 67for (var i = items.Length - 1; i >= 0; i--)
EndpointRoutingBenchmarkBase.cs (1)
59for (var i = 0; i < samples.Length; i++)
Matching\CreateMatcherRegexConstraintBenchmark.cs (2)
19for (var i = 0; i < Endpoints.Length; i++) 32for (var i = 0; i < Endpoints.Length; i++)
Matching\JumpTableMultipleEntryBenchmark.cs (9)
28for (var i = 0; i < _strings.Length; i++) 34for (var i = 0; i < samples.Length; i++) 36samples[i] = i * (_strings.Length / Count); 40for (var i = 0; i < samples.Length; i++) 60for (var i = 0; i < strings.Length; i++) 95for (var i = 0; i < strings.Length; i++) 110for (var i = 0; i < strings.Length; i++) 125for (var i = 0; i < strings.Length; i++) 140for (var i = 0; i < strings.Length; i++)
Matching\JumpTableSingleEntryBenchmark.cs (5)
51for (var i = 0; i < strings.Length; i++) 86for (var i = 0; i < strings.Length; i++) 101for (var i = 0; i < strings.Length; i++) 116for (var i = 0; i < strings.Length; i++) 131for (var i = 0; i < strings.Length; i++)
Matching\JumpTableZeroEntryBenchmark.cs (2)
43for (var i = 0; i < strings.Length; i++) 58for (var i = 0; i < strings.Length; i++)
Matching\MatcherBuilderMultipleEntryBenchmark.cs (1)
64for (int i = 0; i < Endpoints.Length; i++)
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcher.cs (4)
25for (var i = 0; i < Matchers.Length; i++) 60var comparand = _segments.Length > segment ? _segments[segment] : null; 83var comparand = _segments.Length > segment ? _segments[segment] : null; 100return segment == _segments.Length;
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (2)
86_values = new RouteValueDictionary[_candidates.Length]; 87_scores = new int[_candidates.Length];
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (2)
88_values = new RouteValueDictionary[_candidates.Length]; 89_scores = new int[_candidates.Length];
Microsoft.AspNetCore.Routing.Tests (43)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (2)
84Assert.Equal(3, metadataArray.Length); 1115for (var i = 0; i < otherContentTypes.Length; i++)
DefaultLinkGeneratorTest.cs (3)
637for (int i = 0; i < routeNames.Length; i++) 676for (int i = 0; i < routeNames.Length; i++) 714for (int i = 0; i < routeNames.Length; i++)
Matching\AcceptsMatcherPolicyTest.cs (2)
621return new CandidateSet(endpoints, new RouteValueDictionary[endpoints.Length], new int[endpoints.Length]);
Matching\BarebonesMatcher.cs (4)
25for (var i = 0; i < Matchers.Length; i++) 60var comparand = _segments.Length > segment ? _segments[segment] : null; 83var comparand = _segments.Length > segment ? _segments[segment] : null; 100return segment == _segments.Length;
Matching\BarebonesMatcherConformanceTest.cs (1)
48for (var i = 0; i < endpoints.Length; i++)
Matching\CandidateSetTest.cs (11)
19for (var i = 0; i < endpoints.Length; i++) 50for (var i = 0; i < endpoints.Length; i++) 83for (var i = 0; i < endpoints.Length; i++) 113for (var i = 0; i < endpoints.Length; i++) 149for (var i = 0; i < endpoints.Length; i++) 199for (var i = 0; i < endpoints.Length; i++) 256for (var i = 0; i < endpoints.Length; i++) 306for (var i = 0; i < endpoints.Length; i++) 338for (var i = 0; i < endpoints.Length; i++) 344for (var i = 0; i < endpoints.Length; i++) 373for (var i = 0; i < metadata.Length; i++)
Matching\DefaultEndpointSelectorTest.cs (1)
187return new CandidateSet(endpoints, new RouteValueDictionary[endpoints.Length], scores);
Matching\DfaMatcherConformanceTest.cs (1)
72for (var i = 0; i < endpoints.Length; i++)
Matching\DfaMatcherTest.cs (1)
39for (var i = 0; i < policies.Length; i++)
Matching\HostMatcherPolicyIntegrationTestBase.cs (1)
376for (var i = 0; i < endpoints.Length; i++)
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (1)
355for (var i = 0; i < endpoints.Length; i++)
Matching\HttpMethodMatcherPolicyTest.cs (1)
167var candidates = new CandidateSet(endpoints, new RouteValueDictionary[endpoints.Length], Enumerable.Repeat<int>(-1, candidateNum).ToArray());
Matching\MatcherAssert.cs (2)
46if (keys.Length != values.Length)
Matching\RouteMatcherBuilder.cs (2)
86_values = new RouteValueDictionary[_candidates.Length]; 87_scores = new int[_candidates.Length];
Matching\RouteMatcherConformanceTest.cs (1)
44for (var i = 0; i < endpoints.Length; i++)
Matching\TreeRouterMatcherBuilder.cs (2)
88_values = new RouteValueDictionary[_candidates.Length]; 89_scores = new int[_candidates.Length];
Matching\TreeRouterMatcherConformanceTest.cs (1)
58for (var i = 0; i < endpoints.Length; i++)
PathTokenizerTest.cs (2)
88Assert.Equal(expectedSegments.Length, count); 99for (var i = 0; i < expectedSegments.Length; i++)
RouteCollectionTest.cs (1)
508int index = Random.Shared.Next(0, routeNames.Length - 1);
Tree\TreeRouterTest.cs (3)
142for (var i = 0; i < routeValueKeys.Length; i++) 194for (var i = 0; i < routeValueKeys.Length; i++) 237for (var i = 0; i < routeValueKeys.Length; i++)
Microsoft.AspNetCore.Server.HttpSys (15)
artifacts\obj\Microsoft.AspNetCore.Server.HttpSys\Release\net10.0\Microsoft.AspNetCore.Server.HttpSys.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Helpers.cs (1)
84return new ArraySegment<byte>(header, offset, header.Length - offset);
RequestProcessing\ClientCertLoader.cs (1)
279Marshal.Copy((IntPtr)pClientCertInfo->pCertEncoded, certEncoded, 0, certEncoded.Length);
RequestProcessing\HttpReasonPhrase.cs (1)
93if (j < HttpReasonPhrases[i]!.Length)
RequestProcessing\RequestContext.cs (1)
235(uint)buffer.Length,
RequestProcessing\Response.cs (1)
136for (var i = 0; i < StatusWithNoResponseBody.Length; i++)
RequestProcessing\ResponseStreamAsyncResult.cs (6)
54objectsToPin = new object[_dataChunks.Length + 1]; 94Debug.Assert(currentChunk == _dataChunks.Length); 115object[] objectsToPin = new object[_dataChunks.Length]; 116objectsToPin[_dataChunks.Length - 1] = _dataChunks; 135Debug.Assert(currentChunk == _dataChunks.Length); 204return (ushort)_dataChunks.Length;
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length); 811Marshal.Copy((IntPtr)clientCert, certEncoded, 0, certEncoded.Length);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (119)
artifacts\obj\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
HttpsTests.cs (4)
43httpContext.Response.ContentLength = body.Length; 44return httpContext.Response.Body.WriteAsync(body, 0, body.Length); 60httpContext.Response.ContentLength = body.Length; 61await httpContext.Response.Body.WriteAsync(body, 0, body.Length);
Listener\RequestBodyTests.cs (13)
31Assert.Throws<InvalidOperationException>(() => context.Request.Body.Read(input, 0, input.Length)); 36var read = context.Request.Body.Read(input, 0, input.Length); 59Task<int> task = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 81int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 84read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 106int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 109read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 130int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 132var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 155int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 158var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 182int read = await context.Request.Body.ReadAsync(input, 0, input.Length, context.DisconnectToken); 185var assertTask = Assert.ThrowsAsync<IOException>(async () => await context.Request.Body.ReadAsync(input, 0, input.Length, context.DisconnectToken));
Listener\ResponseBodyTests.cs (11)
72Assert.Equal(20, (await response.Content.ReadAsByteArrayAsync()).Length); 256context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 261Assert.Throws<ObjectDisposedException>(() => context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length)); 292await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 297await Assert.ThrowsAsync<ObjectDisposedException>(() => context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length)); 325context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 352await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 390context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 429await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 466context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 500await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
Listener\ResponseHeaderTests.cs (1)
264await context.Response.Body.WriteAsync(responseBytes, 0, responseBytes.Length);
OpaqueUpgradeTests.cs (4)
226int read = await opaqueStream.ReadAsync(buffer, 0, buffer.Length); 240int read = await stream.ReadAsync(data, 0, data.Length); 352await stream.WriteAsync(requestBytes, 0, requestBytes.Length); 391await stream.WriteAsync(requestBytes, 0, requestBytes.Length);
RequestBodyLimitTests.cs (24)
31int read = httpContext.Request.Body.Read(input, 0, input.Length); 54int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 75int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 98int read = httpContext.Request.Body.Read(input, 0, input.Length); 121int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 142int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 165var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 168ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 190var ex = Assert.Throws<BadHttpRequestException>(() => { var t = httpContext.Request.Body.ReadAsync(input, 0, input.Length); }); 193ex = Assert.Throws<BadHttpRequestException>(() => { var t = httpContext.Request.Body.ReadAsync(input, 0, input.Length); }); 215var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 218ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 241var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 244ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 266var ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length)); 269ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length)); 291var ex = Assert.Throws<BadHttpRequestException>(() => body.EndRead(body.BeginRead(input, 0, input.Length, null, null))); 294ex = Assert.Throws<BadHttpRequestException>(() => body.EndRead(body.BeginRead(input, 0, input.Length, null, null))); 318int read = httpContext.Request.Body.Read(input, 0, input.Length); 321var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 344int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 347var ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length)); 370int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 394int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
RequestBodyTests.cs (17)
32int read = httpContext.Request.Body.Read(input, 0, input.Length); 54read = httpContext.Request.Body.Read(input, 0, input.Length); 73int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 93read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 110int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 131Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, input.Length + 1, 1)); 133Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 1, input.Length)); 134Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 0, input.Length + 1)); 152int read = httpContext.Request.Body.Read(input, 0, input.Length); 155read = httpContext.Request.Body.Read(input, 0, input.Length); 173int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 176read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 192int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 194read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 202Assert.Equal(13, lines.Length); 229int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 322await stream.WriteAsync(requestBytes, 0, requestBytes.Length);
RequestTests.cs (5)
59httpContext.Response.Body.Write(body, 0, body.Length); 123httpContext.Response.Body.Write(body, 0, body.Length); 186httpContext.Response.Body.Write(body, 0, body.Length); 230httpContext.Response.Body.Write(body, 0, body.Length); 327httpContext.Response.Body.Write(body, 0, body.Length);
ResponseBodyTests.cs (5)
85Assert.True(0 < (await response.Content.ReadAsByteArrayAsync()).Length); 104Assert.True(0 < (await response.Content.ReadAsByteArrayAsync()).Length); 159Assert.Equal(WriteSize * NumWrites, bytes.Length); 195await stream.WriteAsync(responseBytes, 0, responseBytes.Length); 411httpContext.Response.ContentLength = data.Length;
ResponseHeaderTests.cs (1)
194return response.Body.WriteAsync(responseBytes, 0, responseBytes.Length);
ResponseSendFileTests.cs (11)
76Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 95Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 114Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 134Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length); 153Assert.Equal(FileLength / 2, (await response.Content.ReadAsByteArrayAsync()).Length); 231Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 252Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 301Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 324Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 346Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length); 364Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length);
ServerTests.cs (1)
668await stream.WriteAsync(requestBytes, 0, requestBytes.Length);
src\Shared\Http2cat\Http2Utilities.cs (4)
417frame.PayloadLength = payload.Length; 451frame.PayloadLength = payload.Length; 521frame.PayloadLength = headerBlock.Length; 586frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
Microsoft.AspNetCore.Server.IIS (17)
artifacts\obj\Microsoft.AspNetCore.Server.IIS\Release\net10.0\Microsoft.AspNetCore.Server.IIS.CoreStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Core\IISHttpContext.cs (4)
420(uint)buffer.Length, 614NativeMethods.HttpResponseSetUnknownHeader(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst); 619NativeMethods.HttpResponseSetKnownHeader(_requestNativeHandle, knownHeaderIndex, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst); 653NativeMethods.HttpResponseSetTrailer(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, replace: isFirst);
Core\IISHttpContext.FeatureCollection.cs (1)
394Marshal.Copy((IntPtr)NativeRequest->pSslInfo->pClientCertInfo->pCertEncoded, rawCertificateCopy, 0, rawCertificateCopy.Length);
Core\IO\AsyncWriteOperationBase.cs (1)
101if (_handles == null || _handles.Length < nChunks)
NativeMethods.cs (1)
333http_set_startup_error_page_content(bytePtr, content.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
397if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length); 811Marshal.Copy((IntPtr)clientCert, certEncoded, 0, certEncoded.Length);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (2)
314var filesOnDisk = new string[embeddedFileNames.Length]; 315for (var i = 0; i < embeddedFileNames.Length; i++)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
IISExpressDeployer.cs (1)
504var length = WindowsNativeMethods.GetClassName(ptr, buffer, buffer.Length);
LoggingHandler.cs (1)
46} while (count != 0 && offset != buffer.Length);
Microsoft.AspNetCore.Server.Kestrel.Core (154)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net10.0\Microsoft.AspNetCore.Server.Kestrel.Core.CoreStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\AddressBinder.cs (2)
37var hasListenOptions = listenOptions.Length > 0; 38var hasAddresses = addresses.Length > 0;
Internal\ConfigurationReader.cs (3)
191if (childrenSections.Length > 0) 193stringProtocols = new string[childrenSections.Length]; 194for (var i = 0; i < childrenSections.Length; i++)
Internal\Http\Http1OutputProducer.cs (1)
687if (_fakeMemory.Length < minSize)
Internal\Http\HttpHeaders.Generated.cs (93)
7024if (arrayIndex == array.Length) 7033if (arrayIndex == array.Length) 7042if (arrayIndex == array.Length) 7051if (arrayIndex == array.Length) 7060if (arrayIndex == array.Length) 7069if (arrayIndex == array.Length) 7078if (arrayIndex == array.Length) 7087if (arrayIndex == array.Length) 7096if (arrayIndex == array.Length) 7105if (arrayIndex == array.Length) 7114if (arrayIndex == array.Length) 7123if (arrayIndex == array.Length) 7132if (arrayIndex == array.Length) 7141if (arrayIndex == array.Length) 7150if (arrayIndex == array.Length) 7159if (arrayIndex == array.Length) 7168if (arrayIndex == array.Length) 7177if (arrayIndex == array.Length) 7186if (arrayIndex == array.Length) 7195if (arrayIndex == array.Length) 7204if (arrayIndex == array.Length) 7213if (arrayIndex == array.Length) 7222if (arrayIndex == array.Length) 7231if (arrayIndex == array.Length) 7240if (arrayIndex == array.Length) 7249if (arrayIndex == array.Length) 7258if (arrayIndex == array.Length) 7267if (arrayIndex == array.Length) 7276if (arrayIndex == array.Length) 7285if (arrayIndex == array.Length) 7294if (arrayIndex == array.Length) 7303if (arrayIndex == array.Length) 7312if (arrayIndex == array.Length) 7321if (arrayIndex == array.Length) 7330if (arrayIndex == array.Length) 7339if (arrayIndex == array.Length) 7348if (arrayIndex == array.Length) 7357if (arrayIndex == array.Length) 7366if (arrayIndex == array.Length) 7375if (arrayIndex == array.Length) 7384if (arrayIndex == array.Length) 7393if (arrayIndex == array.Length) 7402if (arrayIndex == array.Length) 7411if (arrayIndex == array.Length) 7420if (arrayIndex == array.Length) 7429if (arrayIndex == array.Length) 7438if (arrayIndex == array.Length) 7447if (arrayIndex == array.Length) 7456if (arrayIndex == array.Length) 7465if (arrayIndex == array.Length) 14450if (arrayIndex == array.Length) 14459if (arrayIndex == array.Length) 14468if (arrayIndex == array.Length) 14477if (arrayIndex == array.Length) 14486if (arrayIndex == array.Length) 14495if (arrayIndex == array.Length) 14504if (arrayIndex == array.Length) 14513if (arrayIndex == array.Length) 14522if (arrayIndex == array.Length) 14531if (arrayIndex == array.Length) 14540if (arrayIndex == array.Length) 14549if (arrayIndex == array.Length) 14558if (arrayIndex == array.Length) 14567if (arrayIndex == array.Length) 14576if (arrayIndex == array.Length) 14585if (arrayIndex == array.Length) 14594if (arrayIndex == array.Length) 14603if (arrayIndex == array.Length) 14612if (arrayIndex == array.Length) 14621if (arrayIndex == array.Length) 14630if (arrayIndex == array.Length) 14639if (arrayIndex == array.Length) 14648if (arrayIndex == array.Length) 14657if (arrayIndex == array.Length) 14666if (arrayIndex == array.Length) 14675if (arrayIndex == array.Length) 14684if (arrayIndex == array.Length) 14693if (arrayIndex == array.Length) 14702if (arrayIndex == array.Length) 14711if (arrayIndex == array.Length) 14720if (arrayIndex == array.Length) 14729if (arrayIndex == array.Length) 14738if (arrayIndex == array.Length) 14747if (arrayIndex == array.Length) 14756if (arrayIndex == array.Length) 14765if (arrayIndex == array.Length) 14774if (arrayIndex == array.Length) 14783if (arrayIndex == array.Length) 14792if (arrayIndex == array.Length) 17533if (arrayIndex == array.Length) 17542if (arrayIndex == array.Length) 17551if (arrayIndex == array.Length) 17560if (arrayIndex == array.Length)
Internal\Http2\Http2OutputProducer.cs (1)
681if (_fakeMemory.Length < minSize)
Internal\Http3\Http3OutputProducer.cs (1)
247if (_fakeMemory.Length < minSize)
Internal\Http3\QPack\EncoderStreamReader.cs (2)
244if (length > _stringOctets.Length) 301_headerNameLength = header.Name.Length;
Internal\Infrastructure\HttpUtilities.cs (5)
41var length = knownMethods.Length; 229if ((uint)index < (uint)knownMethods.Length) 281Debug.Assert(WordListForPerfectHashOfMethods.Length == (MaxHashValue + 1) && methodsLookup.Length == (MaxHashValue + 1)); 285if (index < (uint)WordListForPerfectHashOfMethods.Length 474if ((uint)methodIndex < (uint)methodNames.Length)
src\Servers\Kestrel\shared\PooledStreamStack.cs (4)
50if ((uint)size >= (uint)array.Length) 67if ((uint)size >= (uint)array.Length) 83if ((uint)size < (uint)array.Length) 98Array.Resize(ref _array, 2 * _array.Length);
src\Shared\Buffers\BufferSegmentStack.cs (3)
28if ((uint)size >= (uint)array.Length) 46if ((uint)size < (uint)array.Length) 61Array.Resize(ref _array, 2 * _array.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
36_hashMask = (byte)(_headerBuckets.Length - 1);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\runtime\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\Shared\runtime\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (1)
674else if (buffer.Length < requiredLength)
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (3)
237int valueLength = separator.Length * (values.Length - 1); 269buffer = buffer.Slice(separator.Length); 284buffer = buffer.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (161)
AsciiDecoding.cs (5)
30for (var i = 0; i <= byteArray.Length; i++) 78Assert.Equal(expectedByteRange.Length, s.Length); 80for (var i = 0; i < expectedByteRange.Length; i++) 95for (var i = 1; i < byteRange.Length; i++) 127for (var i = 0; i <= byteArray.Length; i++)
BufferWriterTests.cs (4)
46for (var i = 0; i < array.Length; i++) 52writer.Write(new Span<byte>(array, array.Length, 0)); 64writer.Write(new Span<byte>(array, 0, array.Length)); 98writer.Write(new Span<byte>(array, 0, array.Length));
Http2\Http2HPackEncoderTests.cs (12)
482Assert.Equal(expectedPayload.Length, length); 541var sliceLength = expectedStatusCodePayload.Length + (exactSize ? 0 : expectedDateHeaderPayload.Length - 1); 543Assert.Equal(expectedStatusCodePayload.Length, length); 548sliceLength = expectedDateHeaderPayload.Length + (exactSize ? 0 : expectedContentTypeHeaderPayload.Length - 1); 550Assert.Equal(expectedDateHeaderPayload.Length, length); 555sliceLength = expectedContentTypeHeaderPayload.Length + (exactSize ? 0 : expectedServerHeaderPayload.Length - 1); 557Assert.Equal(expectedContentTypeHeaderPayload.Length, length); 562sliceLength = expectedServerHeaderPayload.Length; 564Assert.Equal(expectedServerHeaderPayload.Length, length);
HttpParserTests.cs (1)
847Assert.Equal(expectedHeaderNames.Count(), parsedHeaders.Length);
HttpRequestHeadersTests.cs (6)
524for (var i = 0; i < headerValue.Length; i++) 529for (var i = 0; i < headerValue.Length; i++) 585for (var i = 0; i < headerValue.Length; i++) 590for (var i = 0; i < headerValue.Length; i++) 641for (var i = 0; i < valueArray.Length; i++) 646for (var i = 1; i < valueArray.Length; i++)
MessageBodyTests.cs (27)
44var count = stream.Read(buffer, 0, buffer.Length); 48count = stream.Read(buffer, 0, buffer.Length); 170var count = await stream.ReadAsync(buffer, 0, buffer.Length); 174count = await stream.ReadAsync(buffer, 0, buffer.Length); 197var count = stream.Read(buffer, 0, buffer.Length); 203count = stream.Read(buffer, 0, buffer.Length); 222var task = stream.ReadAsync(buffer, 0, buffer.Length); 247var task = stream.ReadAsync(buffer, 0, buffer.Length); 280await stream.ReadAsync(buffer, 0, buffer.Length); 318var count = await stream.ReadAsync(buffer, 0, buffer.Length); 324count = await stream.ReadAsync(buffer, 0, buffer.Length); 344var readTask = stream.ReadAsync(buffer, 0, buffer.Length); 353var res = await stream.ReadAsync(buffer, 0, buffer.Length); 379await stream.ReadAsync(buffer, 0, buffer.Length)); 403await stream.ReadAsync(buffer, 0, buffer.Length)); 430var count = stream.Read(buffer, 0, buffer.Length); 457var count = await stream.ReadAsync(buffer, 0, buffer.Length); 485Assert.Equal(0, stream.Read(buffer, 0, buffer.Length)); 507Assert.Equal(0, await stream.ReadAsync(buffer, 0, buffer.Length)); 535Assert.Equal(8197, requestArray.Length); 536AssertASCII(largeInput + "Hello", new ArraySegment<byte>(requestArray, 0, requestArray.Length)); 666Assert.Equal(5, await stream.ReadAsync(buffer, 0, buffer.Length)); 693Assert.Equal(5, await stream.ReadAsync(buffer, 0, buffer.Length)); 1404Assert.Equal(bytes.Length, actual.Count); 1405for (var index = 0; index < bytes.Length; index++) 1416Assert.Equal(bytes.Length, actual.Length); 1417for (var index = 0; index < bytes.Length; index++)
PipelineExtensionTests.cs (3)
90var written = reader.Buffer.Slice(spacer.Length, numAsString.Length); 116if (expected.Length > 0) 194var written = reader.Buffer.Slice(spacer.Length, stringLength);
src\Servers\Kestrel\shared\KnownHeaders.cs (7)
773Debug.Assert(requestHeaders.Length <= 64); 778Debug.Assert(responseHeaders.Length <= 63); 816header.BytesCount += header.Bytes.Length; 1403{(!loop.ClassName.Contains("Trailers") ? $@"case {loop.Headers.Length - 1}: // Header: ""Content-Length"" 1428{(!loop.ClassName.Contains("Trailers") ? $@"_next = _collection._contentLength.HasValue ? {loop.Headers.Length - 1} : -1;" : "_next = -1;")} 1439? {loop.Headers.Length - 1} 1451return @$"private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>({DefinedHeaderNames.Length}, StringComparer.OrdinalIgnoreCase)
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
149for (int i = intermediates.Length - 1; i >= 0; i--)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
25frame.PayloadLength = payload.Length;
src\Servers\Kestrel\shared\test\RevocationResponder.cs (6)
189Trace($"Responded with {certData.Length}-byte certificate from {authority.SubjectName}."); 207Trace($"Responded with {crl.Length}-byte CRL from {authority.SubjectName}."); 252Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName} delegated to {authority.OcspResponderSubjectName}"); 256Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName}"); 313int read = stream.Read(requestBytes, 0, requestBytes.Length); 314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Servers\Kestrel\shared\test\TestApp.cs (10)
20if (buffer.Length > 0) 23await response.Body.WriteAsync(buffer, 0, buffer.Length); 35response.Headers.ContentLength = bytes.Length; 36await response.Body.WriteAsync(bytes, 0, bytes.Length); 50if (buffer.Length > 0) 54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 69response.Headers.ContentLength = bytes.Length; 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (4)
157Debug.Assert(data.Length == 16); 160insertedSize += data.Length * 2 + HeaderField.RfcOverhead; 239Assert.Equal(entries.Length, dynamicTable.Count); 242for (int i = 0; i < entries.Length; i++)
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (15)
68private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length } 78private static readonly byte[] _headerNameHuffman = new byte[] { (byte)(0x80 | _headerNameHuffmanBytes.Length) } 82private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 86private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 162Assert.InRange(_dynamicTable.MaxSize, 1, _literalHeaderNameBytes.Length); // Assert that our string will be too big 558_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 559_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 574_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 575_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 747for (int i = 0; i < encoded.Length; i++) 749bool end = i + 1 == encoded.Length; 772for (int i = 0; i < segments.Length; i++) 774bool end = i + 1 == segments.Length; 934for (int i = 0; i < encoded.Length; i++) 936bool end = i + 1 == encoded.Length;
src\Shared\test\Shared.Tests\runtime\Http2\HPackIntegerTest.cs (6)
20Assert.Equal(expectedResult.Length, bytesWritten); 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 43for (; !finished && i < encoded.Length; ++i) 49Assert.Equal(encoded.Length, i); 98for (var j = 1; j < octets.Length - 1; j++) 103Assert.Throws<HPackDecodingException>(() => decoder.TryDecode(octets[octets.Length - 1], out intResult));
src\Shared\test\Shared.Tests\runtime\Http2\HuffmanDecodingTests.cs (12)
29for (int i = 0; i < source.Length; i++) 68byte[] encoded = new byte[input.Length * 4]; 72byte[] decoded = new byte[encoded.Length * 2]; 76Assert.Equal(input.Length, decodedByteCount); 87byte[] decoded = new byte[encoded.Length * 2]; 249byte[] dst = new byte[expected.Length]; 250Assert.Equal(expected.Length, Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 270byte[] dst = new byte[encoded.Length * 2]; 287byte[] dst = new byte[encoded.Length * 2]; 297byte[] originalDestination = new byte[encoded.Length]; 332byte[] dst = new byte[encoded.Length * 2]; 344int decodedLength = Huffman.Decode(new ReadOnlySpan<byte>(encoded, 0, encoded.Length), ref decodedBytes);
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (9)
51private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 55private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 236_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 237_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 252_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 253_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 341for (int i = 0; i < encoded.Length; i += chunkSize) 343int resolvedSize = Math.Min(encoded.Length - i, chunkSize); 344bool end = i + resolvedSize == encoded.Length;
TestHelpers\AssertExtensions.cs (3)
13if (expected.Length != actual.Length) 15throw new XunitException($"Expected length to be {expected.Length} but was {actual.Length}"); 18for (var i = 0; i < expected.Length; i++)
UTF8Decoding.cs (4)
32for (var length = bytes.Length; length < Vector<sbyte>.Count * 4 + bytes.Length; length++) 34for (var position = 0; position <= length - bytes.Length; position++) 37Array.Copy(bytes, 0, byteRange, position, bytes.Length);
VariableIntHelperTests.cs (2)
27Assert.Equal(expected.Length, encodedLength); 28for (var i = 0; i < expected.Length; i++)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (24)
Http1LargeWritingBenchmark.cs (3)
40_http1Connection.RequestHeaders.ContentLength = _writeData.Length; 47return _http1Connection.ResponseBody.WriteAsync(_writeData, 0, _writeData.Length, default); 54var segmentSize = _writeData.Length / 10;
Http1ReadingBenchmark.cs (1)
56_http1Connection.RequestHeaders.ContentLength = _readData.Length;
Http1WritingBenchmark.cs (2)
62_http1Connection.RequestHeaders.ContentLength = _writeData.Length; 96return _http1Connection.ResponseBody.WriteAsync(_writeData, 0, _writeData.Length, default(CancellationToken));
Http2\HPackDecoderBenchmark.cs (2)
22private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length } 30private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length }
Http2\Http2ConnectionHeadersBenchmark.cs (1)
27for (var i = 0; i < _headerNames.Length; i++)
HttpParserBenchmark.cs (1)
22var split = RequestParsingData.UnicodeRequest.Length / 2;
InMemoryTransportBenchmark.cs (1)
261var payloadLength = _helloWorldPayload.Length;
IntegerDecoderBenchmark.cs (1)
35for (var j = 1; j < _multiByte.Length; j++)
NamedPipesTransportBenchmark.cs (3)
70await clientStream.ReadAtLeastAsync(_responseBuffer, _responseBuffer.Length); 108await namedPipeClient.ReadAtLeastAsync(_responseBuffer, _responseBuffer.Length); 159var payloadLength = _helloWorldPayload.Length;
ResponseHeadersWritingBenchmark.cs (2)
73responseHeaders.ContentLength = _helloWorldPayload.Length; 152responseHeaders.ContentLength = _helloWorldPayload.Length;
SchedulerBenchmark.cs (5)
40for (var i = 0; i < _inlineSchedulers.Length; i++) 46for (var i = 0; i < _threadPoolSchedulers.Length; i++) 52for (var i = 0; i < _ioQueueSchedulers.Length; i++) 63for (var i = 0; i < _counters.Length; i++) 101PipeScheduler pipeScheduler = schedulers[i % schedulers.Length];
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
25frame.PayloadLength = payload.Length;
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
143Assert.Equal(2, serverOptions.GetListenOptions().Length);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Internal\NamedPipeConnectionListener.cs (1)
75for (var i = 0; i < listeningTasks.Length; i++)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (5)
src\Servers\Kestrel\shared\PooledStreamStack.cs (4)
50if ((uint)size >= (uint)array.Length) 67if ((uint)size >= (uint)array.Length) 83if ((uint)size < (uint)array.Length) 98Array.Resize(ref _array, 2 * _array.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (34)
QuicConnectionContextTests.cs (12)
109var read = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 174var read = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 217var read = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 222var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 268if (data.Count == TestData.Length) 331var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 374var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 420var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 469var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 612var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 684var readResult1 = await serverStream1.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 712var readResult2 = await serverStream2.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout();
QuicStreamContextTests.cs (13)
70var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 123var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 189var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 208Assert.Equal(testData.Length, data.Length); 266var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 310var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 344var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 383var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 417var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 458var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 500var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 503var serverReadTask = serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).AsTask();
QuicTestHelpers.cs (1)
155var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout();
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets\Release\net10.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketsStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Session (13)
artifacts\obj\Microsoft.AspNetCore.Session\Release\net10.0\Microsoft.AspNetCore.Session.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DistributedSession.cs (7)
146if (encodedKey.KeyBytes.Length > KeyLengthLimit) 157var copy = new byte[value.Length]; 158Buffer.BlockCopy(src: value, srcOffset: 0, dst: copy, dstOffset: 0, count: value.Length); 326SerializeNumAs2Bytes(output, keyBytes.Length); 327output.Write(keyBytes, 0, keyBytes.Length); 328SerializeNumAs4Bytes(output, entry.Value.Length); 329output.Write(entry.Value, 0, entry.Value.Length);
EncodedKey.cs (4)
32_keyString = Encoding.UTF8.GetString(KeyBytes, 0, KeyBytes.Length); 47if (KeyBytes.Length != otherKey.KeyBytes.Length) 56for (int i = 0; i < KeyBytes.Length; i++)
SipHash.cs (1)
31uint inlen = (uint)bytes.Length;
Microsoft.AspNetCore.Shared.Tests (149)
AdaptiveCapacityDictionaryTests.cs (3)
1177Assert.Equal(10, storage.Length); 1207Assert.Equal(10, storage.Length); 1237Assert.Equal(10, storage.Length);
artifacts\obj\Microsoft.AspNetCore.Shared.Tests\Release\net10.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Shared.Tests\Release\net10.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
PropertyActivatorTest.cs (1)
133Assert.Equal(5, propertiesToActivate.Length);
PropertyHelperTest.cs (8)
236Assert.Equal(2, helpers.Length); 256Assert.Equal(2, helpers.Length); 276Assert.Equal(2, helpers.Length); 329Assert.Equal(3, result.Length); 360Assert.Equal(2, result.Length); 377Assert.Equal(2, result.Length); 409Assert.Equal(2, result.Length); 426Assert.Equal(2, result.Length);
runtime\Http2\DynamicTableTest.cs (4)
157Debug.Assert(data.Length == 16); 160insertedSize += data.Length * 2 + HeaderField.RfcOverhead; 239Assert.Equal(entries.Length, dynamicTable.Count); 242for (int i = 0; i < entries.Length; i++)
runtime\Http2\HPackDecoderTest.cs (15)
68private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length } 78private static readonly byte[] _headerNameHuffman = new byte[] { (byte)(0x80 | _headerNameHuffmanBytes.Length) } 82private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 86private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 162Assert.InRange(_dynamicTable.MaxSize, 1, _literalHeaderNameBytes.Length); // Assert that our string will be too big 558_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 559_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 574_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 575_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 747for (int i = 0; i < encoded.Length; i++) 749bool end = i + 1 == encoded.Length; 772for (int i = 0; i < segments.Length; i++) 774bool end = i + 1 == segments.Length; 934for (int i = 0; i < encoded.Length; i++) 936bool end = i + 1 == encoded.Length;
runtime\Http2\HPackIntegerTest.cs (6)
20Assert.Equal(expectedResult.Length, bytesWritten); 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 43for (; !finished && i < encoded.Length; ++i) 49Assert.Equal(encoded.Length, i); 98for (var j = 1; j < octets.Length - 1; j++) 103Assert.Throws<HPackDecodingException>(() => decoder.TryDecode(octets[octets.Length - 1], out intResult));
runtime\Http2\HuffmanDecodingTests.cs (12)
29for (int i = 0; i < source.Length; i++) 68byte[] encoded = new byte[input.Length * 4]; 72byte[] decoded = new byte[encoded.Length * 2]; 76Assert.Equal(input.Length, decodedByteCount); 87byte[] decoded = new byte[encoded.Length * 2]; 249byte[] dst = new byte[expected.Length]; 250Assert.Equal(expected.Length, Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 270byte[] dst = new byte[encoded.Length * 2]; 287byte[] dst = new byte[encoded.Length * 2]; 297byte[] originalDestination = new byte[encoded.Length]; 332byte[] dst = new byte[encoded.Length * 2]; 344int decodedLength = Huffman.Decode(new ReadOnlySpan<byte>(encoded, 0, encoded.Length), ref decodedBytes);
runtime\Http3\QPackDecoderTest.cs (9)
51private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 55private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 236_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 237_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 252_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 253_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 341for (int i = 0; i < encoded.Length; i += chunkSize) 343int resolvedSize = Math.Min(encoded.Length - i, chunkSize); 344bool end = i + resolvedSize == encoded.Length;
SegmentWriteStreamTests.cs (12)
55Assert.Equal(WriteData.Length, stream.Length); 56Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count); 58for (var i = 0; i < WriteData.Length; i += segmentSize) 60var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i); 68Assert.Equal(expectedSegmentSize, segment.Length); 82for (var i = 0; i < WriteData.Length; i += writeSize) 84stream.Write(WriteData, i, Math.Min(writeSize, WriteData.Length - i)); 88Assert.Equal(WriteData.Length, stream.Length); 89Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count); 91for (var i = 0; i < WriteData.Length; i += segmentSize) 93var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i); 101Assert.Equal(expectedSegmentSize, segment.Length);
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (4)
107_parameterValues = new object?[_parameters.Length]; 114for (var givenIndex = 0; givenIndex != givenParameters.Length; givenIndex++) 119for (var applyIndex = applyIndexStart; givenMatched == false && applyIndex != _parameters.Length; ++applyIndex) 147for (var index = 0; index < _parameters.Length; index++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
163for (var i = 0; i < keys.Length; i++) 188for (var i = 0; i < values.Length; i++) 297if ((uint)arrayIndex > array.Length || array.Length - arrayIndex < this.Count) 505if (_arrayStorage!.Length >= capacity) 530capacity = _arrayStorage.Length == 0 ? DefaultArrayThreshold : _arrayStorage.Length * 2; 546Debug.Assert(_count <= _arrayStorage.Length);
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
36_hashMask = (byte)(_headerBuckets.Length - 1);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length); 811Marshal.Copy((IntPtr)clientCert, certEncoded, 0, certEncoded.Length);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
189if (index < 0 || index > MethodParameters.Length - 1) 205var parameters = new List<Expression>(paramInfos.Length); 206for (int i = 0; i < paramInfos.Length; i++) 257var parameters = new List<Expression>(paramInfos.Length); 258for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\Shared\PropertyActivator\PropertyActivator.cs (1)
90property.GetIndexParameters().Length == 0 &&
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 282Debug.Assert(parameters.Length == 1); 441var filteredProperties = new List<PropertyHelper>(allProperties.Length); 554property.GetMethod.GetParameters().Length == 0;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\runtime\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\Shared\runtime\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (1)
674else if (buffer.Length < requiredLength)
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (3)
237int valueLength = separator.Length * (values.Length - 1); 269buffer = buffer.Slice(separator.Length); 284buffer = buffer.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 238return Base64UrlEncode(input, offset: 0, count: input.Length); 252ValidateParameters(input.Length, nameof(input), offset, count); 293ValidateParameters(input.Length, nameof(input), offset, count); 297if (output.Length - outputOffset < arraySizeRequired)
UrlDecoderTests.cs (6)
28var destination = new byte[input.Length]; 47var destination = new byte[input.Length]; 71var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new char[source.Length + 10]); 79var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new byte[source.Length + 10], false); 121Assert.Equal(source.Length, length); 159Assert.Equal(source.Length, length);
WebEncodersTests.cs (3)
50string actualBase64Url = WebEncoders.Base64UrlEncode(input, 3, input.Length - 5); // also helps test offsets 71for (var i = 0; i < buffer.Length; i++) 79WebEncoders.Base64UrlEncode(input, offset: 3, output: output, outputOffset: 4, count: input.Length - 5);
Microsoft.AspNetCore.SignalR.Client.Core (15)
HubConnection.cs (12)
765var newArgsCount = args.Length; 767Span<bool> isStreaming = args.Length <= MaxStackSize 768? stackalloc bool[MaxStackSize].Slice(0, args.Length) 769: new bool[args.Length]; 770for (var i = 0; i < args.Length; i++) 795if (newArgsCount == args.Length) 805for (var i = 0; i < args.Length; i++) 872Debug.Assert(genericTypes.Length == 1); 1131Log.PreparingBlockingInvocation(_logger, irq.InvocationId, methodName, irq.ResultType.FullName!, args.Length); 1162Log.PreparingStreamingInvocation(_logger, irq.InvocationId, methodName, irq.ResultType.FullName!, args.Length); 1236Log.PreparingNonBlockingInvocation(_logger, methodName, args.Length); 2417if (handlers.Length > 0)
Internal\DefaultRetryPolicy.cs (2)
28_retryDelays = new TimeSpan?[retryDelays.Length + 1]; 30for (int i = 0; i < retryDelays.Length; i++)
src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Client.Tests (16)
HttpConnectionTests.Transport.cs (2)
202if (requestCount >= messageFragments.Length) 368if (pollCount / 2 >= messageFragments.Length)
HubClientProxyGeneratorTests.cs (6)
85It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 93It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)), 136It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 144It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)), 197It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 213It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)),
ServerSentEventsTransportTests.cs (1)
508if (_index == _contents.Length)
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
TestConnection.cs (1)
218output.Write(message, 0, message.Length);
Microsoft.AspNetCore.SignalR.Common (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Common.Tests (68)
Internal\Formatters\BinaryMessageFormatterTests.cs (4)
40BinaryMessageFormatter.WriteLengthPrefix(message.Length, writer); 85BinaryMessageFormatter.WriteLengthPrefix(payload.Length, writer); 107BinaryMessageFormatter.WriteLengthPrefix(message.Length, writer); 125BinaryMessageFormatter.WriteLengthPrefix(payload.Length, writer);
Internal\Formatters\BinaryMessageParserTests.cs (1)
119Assert.Equal(encoded.Length, buffer.Length);
Internal\Formatters\TextMessageFormatterTests.cs (1)
20ms.Write(buffer, 0, buffer.Length);
Internal\Protocol\JsonHubProtocolTests.cs (1)
134Assert.Equal(1, invocationMessage.Arguments?.Length);
Internal\Protocol\JsonHubProtocolTestsBase.cs (1)
507output.Write(message, 0, message.Length);
Internal\Protocol\MemoryBufferWriterTests.cs (27)
22MinimumSegmentSize = buffer.Length; 86bufferWriter.Write(input, 0, input.Length); 105bufferWriter.Write(input, 0, input.Length); 125bufferWriter.Write(input, 0, input.Length); 146bufferWriter.Write(input, 0, input.Length); 169bufferWriter.Write(input, 0, input.Length); 170Assert.Equal(input.Length, bufferWriter.Length); 185bufferWriter.Write(input, 0, input.Length); 186Assert.Equal(input.Length, bufferWriter.Length); 203bufferWriter.Write(input, 0, input.Length); 204Assert.Equal(input.Length, bufferWriter.Length); 219bufferWriter.Write(input, 0, input.Length); 220Assert.Equal(input.Length, bufferWriter.Length); 236bufferWriter.Write(input, 0, input.Length); 237Assert.Equal(input.Length, bufferWriter.Length); 255bufferWriter.Write(input, 0, input.Length); 256Assert.Equal(input.Length, bufferWriter.Length); 273bufferWriter.Write(input, 0, input.Length); 274Assert.Equal(input.Length, bufferWriter.Length); 293bufferWriter.Write(input, 0, input.Length); 294Assert.Equal(input.Length, bufferWriter.Length); 304Array.Clear(data, 0, data.Length); 320bufferWriter.Write(input, 0, input.Length); 321Assert.Equal(input.Length, bufferWriter.Length); 340bufferWriter.Write(input, 0, input.Length); 341Assert.Equal(input.Length, bufferWriter.Length); 351Array.Clear(data, 0, data.Length);
Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
444Assert.Equal(testData.Size, Write(testData.Message).Length); 489BinaryMessageFormatter.WriteLengthPrefix(input.Length, stream);
Internal\Protocol\TestHubMessageEqualityComparer.cs (6)
92if (left == null || right == null || left.Length != right.Length) 97for (var i = 0; i < left.Length; i++) 148if (left.Length != right.Length) 153for (var i = 0; i < left.Length; i++)
Internal\Protocol\Utf8BufferTextReaderTests.cs (11)
23var read = reader.Read(chars, 0, chars.Length); 36var read = reader.Read(chars, 0, chars.Length); 41read = reader.Read(chars, 0, chars.Length); 54var read = reader.Read(chars, 10, chars.Length - 10); 68var read = reader.Read(chars, 0, chars.Length); 73read = reader.Read(chars, 0, chars.Length); 78read = reader.Read(chars, 0, chars.Length); 83read = reader.Read(chars, 0, chars.Length); 100var read = reader.Read(chars, 0, chars.Length); 105read = reader.Read(chars, 0, chars.Length); 110read = reader.Read(chars, 0, chars.Length);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.AspNetCore.SignalR.Core (22)
Internal\DefaultHubDispatcher.cs (3)
348var clientStreamLength = hubMethodInvocationMessage.StreamIds?.Length ?? 0; 727for (var parameterPointer = 0; parameterPointer < arguments.Length; parameterPointer++) 729if (hubMethodInvocationMessage.Arguments?.Length > hubInvocationArgumentPointer &&
Internal\TypedClientBuilder.cs (7)
151if (genericTypeNames.Length > 0) 161paramTypes = paramTypes.Take(paramTypes.Length - 1).ToArray(); 205generator.Emit(OpCodes.Ldc_I4, paramTypes.Length); // Stack: 210for (var i = 0; i < paramTypes.Length; i++) 225generator.Emit(OpCodes.Ldarg, paramTypes.Length + 1); 259if (interfaceType.GetProperties().Length != 0) 264if (interfaceType.GetEvents().Length != 0)
Internal\Utf8HashLookup.cs (5)
31if (_count == _slots.Length) 42int bucketIndex = hashCode % _buckets.Length; 43int caseSensitiveBucketIndex = caseSensitiveHashCode % _caseSensitiveBuckets.Length; 62for (var i = _caseSensitiveBuckets[caseSensitiveHashCode % _caseSensitiveBuckets.Length] - 1; i >= 0; i = _slots[i].caseSensitiveNext) 99for (var i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
189if (index < 0 || index > MethodParameters.Length - 1) 205var parameters = new List<Expression>(paramInfos.Length); 206for (int i = 0; i < paramInfos.Length; i++) 257var parameters = new List<Expression>(paramInfos.Length); 258for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Microbenchmarks (18)
HubConnectionReceiveBenchmark.cs (1)
38for (var i = 0; i < arguments.Length; i++)
HubConnectionSendBenchmark.cs (1)
71for (var i = 0; i < _arguments.Length; i++)
MessageParserBenchmark.cs (1)
29BinaryMessageFormatter.WriteLengthPrefix(buffer.Length, writer);
RedisHubLifetimeManagerBenchmark.cs (1)
59for (var i = 0; i < _clients.Length; i++)
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (8)
Protocol\MessagePackHubProtocolWorker.cs (3)
447writer.WriteArrayHeader(message.Arguments.Length); 472writer.WriteArrayHeader(message.Arguments.Length); 513writer.WriteArrayHeader(streamIds.Length);
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Specification.Tests (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Tests (18)
EndToEndTests.cs (6)
103logger.LogInformation("Sending {length} byte frame", bytes.Length); 141logger.LogInformation("Sending {length} byte frame", bytes.Length); 276logger.LogInformation("Sending {length} byte message", bytes.Length); 293Assert.Equal(message, Encoding.UTF8.GetString(await connection.Transport.Input.ReadAsync(bytes.Length).DefaultTimeout())); 335logger.LogInformation("Sending {length} byte message", bytes.Length); 344var receivedData = await connection.Transport.Input.ReadAsync(bytes.Length).DefaultTimeout();
HubConnectionHandlerTests.Activity.cs (2)
503Assert.Equal(4, tags.Length); 510Assert.Equal(3, tags.Length);
HubConnectionHandlerTests.cs (8)
480var maximumMessageSize = payload.Length - 10; 509var maximumMessageSize = payload.Length - 10; 520await client.Connection.Application.Output.WriteAsync(payload.AsMemory(0, payload.Length / 2)); 521await client.Connection.Application.Output.WriteAsync(payload.AsMemory(payload.Length / 2)); 544var maximumMessageSize = payload1.Length + 1; 594var maximumMessageSize = payload3.Length + 10; 4433Assert.Equal(phrases.Length + 1, messages.Count); 4434for (var i = 0; i < phrases.Length; i++)
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
TestFilters.cs (1)
48Debug.Assert(syncPoints.Length == 3);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Util\EventedStreamReader.cs (1)
79var chunkLength = await _streamReader.ReadAsync(buf, 0, buf.Length);
Microsoft.AspNetCore.StaticFiles (4)
artifacts\obj\Microsoft.AspNetCore.StaticFiles\Release\net10.0\Microsoft.AspNetCore.StaticFiles.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
HtmlDirectoryFormatter.cs (2)
205context.Response.ContentLength = bytes.Length; 206return context.Response.Body.WriteAsync(bytes, 0, bytes.Length);
StaticFileContext.cs (1)
287for (int i = 0; i < states.Length; i++)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
StaticFileMiddlewareTests.cs (1)
165Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length);
Microsoft.AspNetCore.StaticFiles.Tests (7)
DirectoryBrowserMiddlewareTests.cs (2)
173Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); 230Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length);
StaticFileMiddlewareTests.cs (5)
192Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 231Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 273Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 323Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 366Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length);
Microsoft.AspNetCore.TestHost (4)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-alpha.1.24551.5\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
117&& factory.GetParameters().Length == 1 236if (parameters.Length == 0)
TestWebSocket.cs (2)
200if (buffer.Offset < 0 || buffer.Offset > buffer.Array.Length) 204if (buffer.Count < 0 || buffer.Count > buffer.Array.Length - buffer.Offset)
Microsoft.AspNetCore.TestHost.Tests (17)
HttpContextBuilderTests.cs (2)
128c.Response.Body.Write(bytes, 0, bytes.Length); 131c.Response.Body.Write(bytes, 0, bytes.Length);
ResponseBodyTests.cs (6)
29Assert.Equal(length, bytes.Length); 46Assert.Equal(length, bytes.Length); 56httpContext.Response.Body.Write(contentBytes, 0, contentBytes.Length); 72httpContext.Response.Body.Write(contentBytes, 0, contentBytes.Length); 91await httpContext.Response.Body.WriteAsync(contentBytes, 0, contentBytes.Length); 110await httpContext.Response.Body.WriteAsync(contentBytes, 0, contentBytes.Length);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
TestClientTests.cs (8)
130for (var i = 0; i < data.Length; i++) 627Assert.Equal(hello.Length, result.Count); 628Assert.True(hello.SequenceEqual(buffer.Take(hello.Length))); 632Assert.Equal(world.Length, result.Count); 633Assert.True(world.SequenceEqual(buffer.Take(world.Length))); 813for (var i = 0; i < hello.Length; i++) 815bool last = i == (hello.Length - 1); 817Assert.Equal(buffer.Length, result.Count);
Microsoft.AspNetCore.Tests (3)
WebApplicationTests.cs (3)
1568Assert.Equal(hostLifetimes1.Length, hostLifetimes0.Length); 1991Assert.Equal(5, displayNames.Length);
Microsoft.AspNetCore.WebSockets (3)
WebSocketMiddleware.cs (3)
247if (values.Length == 1) 267if (values.Length == 1) 308if (values.Length == 1)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Autobahn\AutobahnServerResult.cs (1)
22if (splat.Length < 3)
Microsoft.AspNetCore.WebSockets.Tests (20)
BufferStream.cs (2)
274if (offset < 0 || offset > buffer.Length) 278if (count < 0 || count > buffer.Length - offset
WebSocketMiddlewareTests.cs (18)
95var serverBuffer = new byte[originalData.Length]; 98Assert.Equal(originalData.Length, result.Count); 120var serverBuffer = new byte[originalData.Length]; 123Assert.Equal(originalData.Length, result.Count); 146var serverBuffer = new byte[originalData.Length]; 177var serverBuffer = new byte[originalData.Length]; 186new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None); 194new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None); 232var clientBuffer = new byte[originalData.Length]; 235Assert.Equal(originalData.Length, result.Count); 257var clientBuffer = new byte[originalData.Length]; 260Assert.Equal(originalData.Length, result.Count); 282var clientBuffer = new byte[originalData.Length]; 287result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer, receivedCount, clientBuffer.Length - receivedCount), CancellationToken.None); 293Assert.Equal(originalData.Length, receivedCount); 317var clientBuffer = new byte[originalData.Length]; 325new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None); 332new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
Microsoft.AspNetCore.WebUtilities (24)
artifacts\obj\Microsoft.AspNetCore.WebUtilities\Release\net10.0\Microsoft.AspNetCore.WebUtilities.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BufferedReadStream.cs (7)
253_bufferCount = _inner.Read(_buffer, 0, _buffer.Length); 281if (minCount > _buffer.Length) 283throw new ArgumentOutOfRangeException(nameof(minCount), minCount, "The value must be smaller than the buffer size: " + _buffer.Length); 296int read = _inner.Read(_buffer, _bufferOffset + _bufferCount, _buffer.Length - _bufferCount - _bufferOffset); 314if (minCount > _buffer.Length) 316throw new ArgumentOutOfRangeException(nameof(minCount), minCount, "The value must be smaller than the buffer size: " + _buffer.Length); 329int read = await _inner.ReadAsync(_buffer.AsMemory(_bufferOffset + _bufferCount, _buffer.Length - _bufferCount - _bufferOffset), cancellationToken);
FormReader.cs (2)
266_bufferCount = _reader.Read(_buffer, 0, _buffer.Length); 275_bufferCount = await _reader.ReadAsync(_buffer, 0, _buffer.Length);
HttpRequestStreamReader.cs (2)
158if (count < 0 || index + count > buffer.Length) 219if (count < 0 || index + count > buffer.Length)
HttpResponseStreamWriter.cs (1)
417if (remaining >= values.Length + NewLine.Length)
MultipartReaderStream.cs (1)
177var slice = buffer.AsSpan(0, Math.Min(buffer.Length, index));
PagedByteBuffer.cs (5)
32if (_currentPage == null || _currentPageIndex == _currentPage.Length) 53var copyLength = Math.Min(memory.Length, currentPage.Length - _currentPageIndex); 73page.Length; 90page.Length; 107page.Length;
src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 238return Base64UrlEncode(input, offset: 0, count: input.Length); 252ValidateParameters(input.Length, nameof(input), offset, count); 293ValidateParameters(input.Length, nameof(input), offset, count); 297if (output.Length - outputOffset < arraySizeRequired)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (14)
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.AspNetCore.WebUtilities.Tests (129)
FileBufferingReadStreamTests.cs (57)
54var read1 = stream.Read(bytes, 0, bytes.Length); 55Assert.Equal(bytes.Length, read1); 61var read2 = stream.Read(bytes, 0, bytes.Length); 68var read3 = stream.Read(bytes, 0, bytes.Length); 80var read0 = stream.Read(bytes, 0, bytes.Length); 81Assert.Equal(bytes.Length, read0); 87var read1 = stream.Read(bytes, 0, bytes.Length); 88Assert.Equal(bytes.Length, read1); 94var read2 = stream.Read(bytes, 0, bytes.Length); 101var read3 = stream.Read(bytes, 0, bytes.Length); 114var read0 = stream.Read(bytes, 0, bytes.Length); 115Assert.Equal(bytes.Length, read0); 121var read1 = stream.Read(bytes, 0, bytes.Length); 122Assert.Equal(bytes.Length, read1); 130var read2 = stream.Read(bytes, 0, bytes.Length); 138var read3 = stream.Read(bytes, 0, bytes.Length); 152var read0 = stream.Read(bytes, 0, bytes.Length); 153Assert.Equal(bytes.Length, read0); 159var exception = Assert.Throws<IOException>(() => stream.Read(bytes, 0, bytes.Length)); 175var read0 = stream.Read(bytes, 0, bytes.Length); 176Assert.Equal(bytes.Length, read0); 182var read1 = stream.Read(bytes, 0, bytes.Length); 183Assert.Equal(bytes.Length, read1); 191var exception = Assert.Throws<IOException>(() => stream.Read(bytes, 0, bytes.Length)); 216var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 217Assert.Equal(bytes.Length, read1); 223var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 230var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 242var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 243Assert.Equal(bytes.Length, read0); 249var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 250Assert.Equal(bytes.Length, read1); 256var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 263var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 276var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 277Assert.Equal(bytes.Length, read0); 283var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 284Assert.Equal(bytes.Length, read1); 292var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 300var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 328var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 329Assert.Equal(bytes.Length, read1); 332var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 333Assert.Equal(bytes.Length, read2); 336var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 341var read4 = await stream.ReadAsync(bytes, 0, bytes.Length); 355var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 356Assert.Equal(bytes.Length, read0); 362var exception = await Assert.ThrowsAsync<IOException>(() => stream.ReadAsync(bytes, 0, bytes.Length)); 378var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 379Assert.Equal(bytes.Length, read0); 385var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 386Assert.Equal(bytes.Length, read1); 394var exception = await Assert.ThrowsAsync<IOException>(() => stream.ReadAsync(bytes, 0, bytes.Length)); 612var read0 = stream.Read(bytes, 0, bytes.Length); 613Assert.Equal(bytes.Length, read0); 619var read1 = stream.Read(bytes, 0, bytes.Length);
FileBufferingWriteStreamTests.cs (19)
27bufferingStream.Write(input, 0, input.Length); 30Assert.Equal(input.Length, bufferingStream.Length); 54Assert.Equal(input.Length, bufferingStream.Length); 96bufferingStream.Write(input, 0, input.Length); 142await bufferingStream.WriteAsync(input, 0, input.Length); 207await bufferingStream.WriteAsync(input, 0, input.Length); 241Assert.Equal(input.Length, bufferingStream.Length); 255var exception = Assert.Throws<IOException>(() => bufferingStream.Write(input, 0, input.Length)); 269bufferingStream.Write(input, 0, input.Length); 270var exception = Assert.Throws<IOException>(() => bufferingStream.Write(input, 0, input.Length)); 285bufferingStream.Write(input, 0, input.Length); 286bufferingStream.Write(input, 0, input.Length); // Should get to exactly the buffer limit, which is fine 299var exception = await Assert.ThrowsAsync<IOException>(() => bufferingStream.WriteAsync(input, 0, input.Length)); 313await bufferingStream.WriteAsync(input, 0, input.Length); 314var exception = await Assert.ThrowsAsync<IOException>(() => bufferingStream.WriteAsync(input, 0, input.Length)); 329await bufferingStream.WriteAsync(input, 0, input.Length); 330await bufferingStream.WriteAsync(input, 0, input.Length); // Should get to exactly the buffer limit, which is fine 341bufferingStream.Write(input, 0, input.Length); 358bufferingStream.Write(input, 0, input.Length);
HttpRequestStreamReaderTest.cs (19)
75for (var i = 0; i < CharData.Length; i++) 89for (var i = 0; i < CharData.Length; i++) 117var chars = new char[CharData.Length]; 120var read = reader.Read(chars, 0, chars.Length); 123Assert.Equal(chars.Length, read); 124for (var i = 0; i < CharData.Length; i++) 135var chars = new char[CharData.Length]; 271var chars = new char[CharData.Length]; 278Assert.Equal(chars.Length, read); 279for (var i = 0; i < CharData.Length; i++) 290var chars = new char[CharData.Length]; 297Assert.Equal(chars.Length, read); 298for (var i = 0; i < CharData.Length; i++) 309var chars = new char[CharData.Length]; 316Assert.Equal(chars.Length, read); 317for (var i = 0; i < CharData.Length; i++) 328var chars = new char[CharData.Length]; 335Assert.Equal(chars.Length, read); 336for (var i = 0; i < CharData.Length; i++)
MultipartReaderTests.cs (6)
293var read = section.Body.Read(buffer, 0, buffer.Length); 302read = section.Body.Read(buffer, 0, buffer.Length); 326stream.Write(bytes, 0, bytes.Length); 332stream.Write(bytes, 0, bytes.Length); 361stream.Write(bytes, 0, bytes.Length); 367stream.Write(bytes, 0, bytes.Length);
PagedByteBufferTest.cs (14)
20buffer.Add(input, 0, input.Length); 24Assert.Equal(input.Length, buffer.Length); 35buffer.Add(input1, 0, input1.Length); 38buffer.Add(input2, 0, input2.Length); 69buffer.Add(input1, 0, input1.Length); 88buffer.Add(input, 0, input.Length); 102buffer.Add(input, 0, input.Length); 113buffer.Add(newInput, 0, newInput.Length); 127buffer.Add(input, 0, input.Length); 138buffer.Add(newInput, 0, newInput.Length); 151buffer.Add(input, 0, input.Length); 181buffer.Add(input, 0, input.Length); 206buffer.Add(input, 0, input.Length); 229buffer.Add(input, 0, input.Length);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.Build (301)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
AwaitExtensions.cs (2)
113RegisteredWaitHandle[] callbackHandles = new RegisteredWaitHandle[handles.Length]; 114for (int i = 0; i < handles.Length; i++)
BackEnd\BuildManager\BuildManager.cs (2)
1492for (int i = 1; i < instances.Length; i++) 3172if (inputCacheFiles.Length == 0)
BackEnd\BuildManager\CacheAggregator.cs (4)
61ErrorUtilities.VerifyThrow(configs.Length == results.Length, "Assuming 1-to-1 mapping between configs and results. Otherwise it means the caches are either not minimal or incomplete"); 63if (configs.Length == 0 && results.Length == 0)
BackEnd\Client\MSBuildClientPacketPump.cs (4)
196IAsyncResult result = localStream.BeginRead(headerByte, 0, headerByte.Length, null, null); 236if ((headerBytesRead != headerByte.Length) && !localPacketPumpShutdownEvent.WaitOne(0)) 251ErrorUtilities.ThrowInternalError("Incomplete header read. {0} of {1} bytes read", headerBytesRead, headerByte.Length); 295result = localStream.BeginRead(headerByte, 0, headerByte.Length, null, null);
BackEnd\Components\BuildRequestEngine\FullyQualifiedBuildRequest.cs (3)
148if (Targets.Length != other.Targets.Length) 153for (int i = 0; i < Targets.Length; ++i)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (4)
506for (int i = 0; i < handshakeComponents.Length; i++) 633_clientToServerStream.BeginRead(_headerByte, 0, _headerByte.Length, HeaderReadComplete, this); 891if (bytesRead != _headerByte.Length) 893CommunicationsUtilities.Trace(_nodeId, "COMMUNICATIONS ERROR (HRC) Node: {0} Process: {1} Bytes Read: {2} Expected: {3}", _nodeId, _process.Id, bytesRead, _headerByte.Length);
BackEnd\Components\FileAccesses\FileAccessManager.cs (4)
109Handlers[] newHandlers = new Handlers[_handlers.Length + 1]; 113newHandlers[_handlers.Length] = addedHandlers; 125Handlers[] newHandlers = new Handlers[_handlers.Length - 1]; 127for (int handlersIdx = 0; handlersIdx < _handlers.Length; handlersIdx++)
BackEnd\Components\Logging\ProjectLoggingContext.cs (1)
226propertiesToSerialize?.Length > 0 &&
BackEnd\Components\RequestBuilder\IntrinsicTasks\CallTarget.cs (1)
89if ((Targets == null) || (Targets.Length == 0))
BackEnd\Components\RequestBuilder\IntrinsicTasks\IntrinsicTaskFactory.cs (2)
64var propertyInfos = new TaskPropertyInfo[infos.Length]; 65for (int i = 0; i < infos.Length; i++)
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (17)
236if ((Projects == null) || (Projects.Length == 0)) 242if (TargetAndPropertyListSeparators?.Length > 0) 298skipProjects = new bool[Projects.Length]; 299for (int i = 0; i < skipProjects.Length; i++) 313for (int i = 0; i < Projects.Length; i++) 413for (int i = 0; i < Projects.Length; i++) 423if (projectToBuildInParallel.Length <= 0) 502if (runEachTargetSeparately && targets?.Length > 0) 539var projectDirectory = new string[projects.Length]; 540var projectNames = new string[projects.Length]; 541var toolsVersions = new string[projects.Length]; 542var projectProperties = new Dictionary<string, string>[projects.Length]; 543var undefinePropertiesPerProject = new List<string>[projects.Length]; 545for (int i = 0; i < projectNames.Length; i++) 588undefinePropertiesPerProject[i] = new List<string>(propertiesToUndefine.Length); 591if (log != null && propertiesToUndefine.Length > 0) 670for (int i = 0; i < projects.Length; i++)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (14)
340ErrorUtilities.VerifyThrow(projectFiles.Length == properties.Length, "Properties and project counts not the same"); 341ErrorUtilities.VerifyThrow(projectFiles.Length == toolsVersions.Length, "Tools versions and project counts not the same"); 343FullyQualifiedBuildRequest[] requests = new FullyQualifiedBuildRequest[projectFiles.Length]; 345for (int i = 0; i < projectFiles.Length; ++i) 384ErrorUtilities.VerifyThrow(requests.Length == results.Length, "# results != # requests"); 583WaitHandle[] allHandles = new WaitHandle[handles.Length + 1]; 585Array.Copy(handles, 0, allHandles, 1, handles.Length); 997ErrorUtilities.VerifyThrow(requests.Length == results.Length, "# results != # requests"); 1017for (int i = 0; i < requests.Length; i++) 1182ProjectErrorUtilities.VerifyThrowInvalidProject(allTargets.Length > 0,
BackEnd\Components\RequestBuilder\TargetBuilder.cs (4)
110ErrorUtilities.VerifyThrow(targetNames.Length > 0, "List of targets must be non-empty"); 144List<TargetSpecification> targets = new List<TargetSpecification>(targetNames.Length); 247ITargetResult[] results = new TargetResult[targets.Length]; 267for (int i = 0; i < targets.Length; i++)
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
672targetLoggingContext?.LogTargetBatchFinished(projectFullPath, targetSuccess, targetOutputItems.Length > 0 ? targetOutputItems : null);
BackEnd\Components\RequestBuilder\TaskHost.cs (26)
291ErrorUtilities.VerifyThrowArgument((targetOutputsPerProject == null) || (projectFileNames.Length == targetOutputsPerProject.Length), "General.TwoVectorsMustHaveSameLength", projectFileNames.Length, targetOutputsPerProject?.Length ?? 0, "projectFileNames", "targetOutputsPerProject"); 293BuildEngineResult result = BuildProjectFilesInParallel(projectFileNames, targetNames, globalProperties, new List<String>[projectFileNames.Length], toolsVersion, includeTargetOutputs); 299ErrorUtilities.VerifyThrow(targetOutputsPerProject.Length == result.TargetOutputsPerProject.Count, "{0} != {1}", targetOutputsPerProject.Length, result.TargetOutputsPerProject.Count); 301for (int i = 0; i < targetOutputsPerProject.Length; i++) 973if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null) 987for (int i = 0; i < targetNames.Length; i++) 1153if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null) 1166for (int i = 0; i < targetNames.Length; i++) 1178PropertyDictionary<ProjectPropertyInstance>[] propertyDictionaries = new PropertyDictionary<ProjectPropertyInstance>[projectFileNames.Length]; 1180for (int i = 0; i < projectFileNames.Length; i++) 1214ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length, "{0}!={1}.", results.Length, projectFileNames.Length); 1218targetOutputsPerProject = new List<IDictionary<string, ITaskItem[]>>(results.Length); 1222for (int i = 0; i < results.Length; i++) 1233ITaskItem[] clonedTaskItem = new ITaskItem[resultEntry.Value.Items.Length]; 1234for (int j = 0; j < resultEntry.Value.Items.Length; j++) 1259ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length || !overallSuccess, "The number of results returned {0} cannot be less than the number of project files {1} unless one of the results indicated failure.", results.Length, projectFileNames.Length);
BackEnd\Components\Scheduler\Scheduler.cs (7)
1686Stack<BuildRequest> requestsToAdd = new Stack<BuildRequest>(blocker.BuildRequests.Length); 2297int[] previousWork = new int[currentWork.Length]; 2298HashSet<int>[] runningRequests = new HashSet<int>[currentWork.Length]; 2321for (int i = 0; i < currentWork.Length; i++) 2343for (int i = 0; i < currentWork.Length; i++) 2413for (int i = 0; i < nodeActiveTimes.Length; i++) 2438for (int i = 0; i < currentWork.Length; i++)
BackEnd\Components\Scheduler\SchedulingPlan.cs (3)
375if (values.Length < 1) 383for (int i = 1; i < values.Length; i++) 406if (values.Length < 3)
BackEnd\Node\OutOfProcNode.cs (1)
793if (configuration.LoggerDescriptions?.Length > 0)
BackEnd\Shared\BuildResult.cs (1)
761ConcurrentDictionary<string, TargetResult> resultsByTarget = CreateTargetResultDictionary(targetNames.Length);
BackEnd\Shared\TargetResult.cs (6)
242if (_items.Length == 0) 302var itemsCount = _items?.Length ?? 0; 310var defaultBufferCapacity = _items.Length * 128; 320var interner = new LookasideStringInterner(StringComparer.Ordinal, _items.Length); 339using MemoryStream itemsStream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true); 342for (int i = 0; i < _items.Length; i++)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (6)
827var stringOutputs = new string[convertibleOutputs.Length]; 828for (int i = 0; i < convertibleOutputs.Length; i++) 1018for (int i = 0; i < loadedType.Properties.Length; i++) 1449StringBuilder joinedOutputs = (outputs.Length == 0) ? new StringBuilder() : null; 1525if (LogTaskInputs && !_taskLoggingContext.LoggingService.OnlyLogCriticalEvents && outputs.Length > 0 && parameter.Log) 1543StringBuilder joinedOutputs = (outputs.Length == 0) ? new StringBuilder() : null;
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (1)
57catch (ReflectionTypeLoadException ex) when (ex.LoaderExceptions.Length != 0)
BuildCheck\Infrastructure\BuildEventsProcessor.cs (1)
245CheckConfigurationEffective config = configPerRule.Length == 1
BuildCheck\Infrastructure\ConfigurationProvider.cs (2)
130var configurations = new CheckConfigurationEffective[userConfigs.Length]; 132for (int idx = 0; idx < userConfigs.Length; idx++)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
36Debug.Assert(regex.GetGroupNumbers().Length - 1 == numberRangePairs.Length);
CanonicalError.cs (1)
321if (explodedText.Length > 0)
Collections\ArrayDictionary.cs (2)
96if (count < keys.Length) 104throw new InvalidOperationException($"ArrayDictionary is at capacity {keys.Length}");
Collections\ReadOnlyConvertingDictionary.cs (1)
158ErrorUtilities.VerifyThrow(array.Length - arrayIndex >= _backing.Count, "Specified array size insufficient to hold the contents of the collection.");
Collections\RetrievableEntryHashSet\HashHelpers.cs (1)
63for (int i = 0; i < primes.Length; i++)
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (16)
184if ((_count == 0 && _slots.Length > HashHelpers.GetMinPrime()) || 185(_count > 0 && _slots.Length / _count > ShrinkThreshold)) 271Array.Clear(_buckets, 0, _buckets.Length); 369for (int i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next) 420int bucket = hashCode % _buckets.Length; 526info.AddValue(CapacityName, _buckets == null ? 0 : _buckets.Length); 568for (int i = 0; i < array.Length; i++) 638if (index < 0 || Count > array.Length - index) 677if (arrayIndex > array.Length || count > array.Length - arrayIndex) 743Debug.Assert(newSlots.Length <= _slots.Length, "capacity increased after TrimExcess"); 826int bucket = hashCode % _buckets.Length; 827for (int i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next) 846if (_lastIndex == _slots.Length) 850bucket = hashCode % _buckets.Length;
CommunicationsUtilities.cs (3)
463ErrorUtilities.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes"); 465stream.Write(bytes, 0, bytes.Length); 543for (int i = 0; i < bytes.Length; i++)
Construction\Solution\SolutionFile.cs (6)
959if (words.Length >= 2) 1655ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationNames.Length == 2, "SubCategoryForSolutionParsingErrors", 1681configurationPlatformParts.Length == 2, 1732ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(nameValue.Length == 2, "SubCategoryForSolutionParsingErrors", 1780ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationPlatformParts.Length <= 2, "SubCategoryForSolutionParsingErrors", 1786(configurationPlatformParts.Length > 1) ? configurationPlatformParts[1] : string.Empty,
Construction\Solution\SolutionProjectGenerator.cs (1)
2063var properties = new Dictionary<string, string>(_metaprojectGlobalProperties.Length, StringComparer.OrdinalIgnoreCase);
Definition\BuiltInMetadata.cs (1)
27{ return FileUtilities.ItemSpecModifiers.All.Length; }
Definition\ProjectItem.cs (1)
306{ return Metadata.Count + FileUtilities.ItemSpecModifiers.All.Length; }
Definition\Toolset.cs (1)
705if (defaultTasksFiles.Length == 0)
ErrorUtilities.cs (3)
164if (parameterValue.Length == 0) 617VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 619int arrayCapacity = array.Length - arrayIndex;
Evaluation\Evaluator.cs (2)
406if (includeSplitFilesEscaped.Length > 0) 2035if (importFilesEscaped.Length == 0)
Evaluation\Expander.cs (79)
2346ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2394ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2441ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2465ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2541ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2608ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2680ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2699ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2708ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2791ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2808ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2842ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2875ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2908ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 3488args = new object[_arguments.Length]; 3491for (int n = 0; n < _arguments.Length; n++) 3525if (objectInstance != null && args.Length == 1 && (String.Equals("Equals", _methodMethodName, StringComparison.OrdinalIgnoreCase) || String.Equals("CompareTo", _methodMethodName, StringComparison.OrdinalIgnoreCase))) 3544if (_methodMethodName.Equals("GetPathOfFileAbove") && args.Length == 1) 3602IEnumerable<MethodInfo> methods = _receiverType.GetMethods(_bindingFlags).Where(m => m.Name.Equals(_methodMethodName) && m.GetParameters().Length == args.Length); 3707for (int i = index; i < args.Length; i++) 3726ErrorUtilities.ThrowArgument("CouldNotDifferentiateBetweenCompatibleMethods", _methodMethodName, args.Length); 3791if (args.Length == 0) 3799if (args.Length == 0) 3815if (args.Length == 0) 3865if (args.Length == 0) 4046if (args.Length >= 4 && 4049returnVal = IntrinsicFunctions.GetRegistryValueFromView(arg0, arg1, args[2], new ArraySegment<object>(args, 3, args.Length - 3)); 4055if (args.Length == 0) 4122if (args.Length == 0) 4130if (args.Length == 0) 4138if (args.Length == 0) 4146if (args.Length == 0) 4154if (args.Length == 0) 4162if (args.Length == 0) 4170if (args.Length == 0) 4410switch (args.Length) 4453if (args.Length == 0) 4477if (args.Length == 0) 4523if (args.Length == 0) 4530else if (string.Equals(_methodMethodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3) 4576if (args.Length == 0) 4592for (var i = 0; i < args.Length; i++) 4608if (enforceLength && args.Length != 2) 4631if (args.Length != 3) 4657if (args.Length != 4) 4683if (args.Length != 2) 4706if (args.Length != 3) 4728if (args.Length != 1) 4739if (args.Length != 1) 4856if (args.Length != 1) 4868if (args.Length != 2) 4898if (args.Length != 1) 4911if (args.Length != 2) 4925if (args.Length != 2) 4939if (args.Length != 2) 4964if (args.Length != 2) 4990if (args.Length != 2) 5353object[] coercedArguments = new object[args.Length]; 5358for (int n = 0; n < parameters.Length; n++) 5523Type[] types = new Type[_arguments.Length]; 5524for (int n = 0; n < _arguments.Length; n++) 5569if (parameters.Length == _arguments.Length) 5646return parameters.Length > 0
Evaluation\IntrinsicFunctions.cs (1)
230if (views == null || views.Length == 0)
EventArgsFormatting.cs (2)
351for (int i = 0; i < lines.Length; i++) 360if (i < (lines.Length - 1))
FileMatcher.cs (5)
484string[] longParts = new string[parts.Length - startingElement]; 487for (int i = startingElement; i < parts.Length; ++i) 511for (int j = i; j < parts.Length; ++j) 894for (int i = 0; i < excludeNextSteps.Length; i++) 942for (int i = 0; i < excludeNextSteps.Length; i++)
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1144ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1159while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1164if (index == splitBase.Length && index == splitPath.Length) 1177for (int i = index; i < splitBase.Length; i++) 1181for (int i = index; i < splitPath.Length; i++)
FrameworkLocationHelper.cs (2)
838if (directories.Length == 0) 854for (int i = 1; i < directories.Length; ++i)
Graph\ProjectInterpretation.cs (1)
146if (configurationPlatformParts.Length > 1)
Instance\ProjectItemInstance.cs (1)
947List<string> names = new List<string>(capacity: metadataCollection.Count + FileUtilities.ItemSpecModifiers.All.Length);
Instance\TaskFactoryWrapper.cs (1)
268for (int i = 0; i < propertyInfos.Length; i++)
Instance\TaskRegistry.cs (1)
723string unqualifiedTaskName = nameComponents[nameComponents.Length - 1];
LoadedType.cs (3)
72Properties = new ReflectableTaskPropertyInfo[props.Length]; 75PropertyAssemblyQualifiedNames = new string[props.Length]; 78for (int i = 0; i < props.Length; i++)
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
492var dictionary = ArrayDictionary<string, string>.Create(list.Length); 493for (int i = 0; i < list.Length; i++)
Logging\BinaryLogger\BuildEventArgsWriter.cs (3)
770if (arguments == null || arguments.Length == 0) 775int count = arguments.Length; 853if (e is LazyFormattedBuildEventArgs { RawArguments: { Length: > 0 } } and
Logging\BinaryLogger\Postprocessing\StreamExtensions.cs (2)
48int read = stream.Read(buffer, 0, (int)Math.Min(bytesCount - totalRead, buffer.Length)); 65return buffer.Length == ms.Length ? buffer : ms.ToArray();
Logging\DistributedLoggers\ConfigurableForwardingLogger.cs (1)
76for (int param = 0; param < parameterComponents.Length; param++)
Logging\DistributedLoggers\DistributedFileLogger.cs (2)
47for (int param = 0; param < parameterComponents.Length; param++) 53if (parameterAndValue.Length > 1)
Logging\FileLogger.cs (1)
190parameterAndValue.Length > 1 ? parameterAndValue[1] : null);
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++) 524IAsyncResult result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null); 568if (bytesRead != headerByte.Length) 588CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length); 613result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
PlatformNegotiation.cs (1)
113if (keyVal.Length != 2 || string.IsNullOrEmpty(keyVal[0]) || string.IsNullOrEmpty(keyVal[1]))
ProjectWriter.cs (2)
142ErrorUtilities.VerifyThrow(itemVectorTransforms.Count == (surroundingTextPieces.Length - 1), 167base.WriteString(surroundingTextPieces[surroundingTextPieces.Length - 1]);
ResourceUtilities.cs (1)
372if (args?.Length > 0)
TaskLoggingHelper.cs (3)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 295if (messageArgs?.Length > 0) 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
TaskParameter.cs (6)
133ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 135for (int i = 0; i < inputAsITaskItemArray.Length; i++) 351int length = wrappedItems.Length; 609int length = array.Length; 692int length = array.Length; 810return count + FileUtilities.ItemSpecModifiers.All.Length;
TypeLoader.cs (2)
195Dictionary<string, string> assembliesDictionary = new(localAssemblies.Length + runtimeAssemblies.Length);
Utilities\EngineFileUtilities.cs (1)
349for (int i = 0; i < fileList.Length; i++)
Utilities\NuGetFrameworkWrapper.cs (2)
168StringBuilder publicKeyTokenString = new(publicKeyToken.Length * 2); 169for (int i = 0; i < publicKeyToken.Length; i++)
Utilities\RegistryKeyWrapper.cs (1)
168for (int i = 0; i < keyNames.Length && wrapper.Exists(); ++i)
Microsoft.Build.CommandLine.UnitTests (11)
CommandLineSwitches_Tests.cs (8)
794Assert.Equal(3, parameters.Length); 838Assert.Equal(2, parameters.Length); 879Assert.Equal(4, parameters.Length); 899Assert.True(parameters.Length > 0); 1072Assert.Equal(3, parameters.Length); 1091switches[CommandLineSwitches.ParameterizedSwitch.Target].Length.ShouldBe(2); 1111switches[CommandLineSwitches.ParameterizedSwitch.Target].Length.ShouldBe(1); 1552for (int i = 0; i < helpMessageLines.Length; i++)
XMake_Tests.cs (3)
93parameters.Length.ShouldBe(1); 110parameters.Length.ShouldBe(2); 129parameters.Length.ShouldBe(0);
Microsoft.Build.Engine.OM.UnitTests (19)
Construction\ConstructionEditing_Tests.cs (4)
3256Assert.True(splits.Length >= 1); 3260if (splits.Length == 1) 3268for (var i = 1; i < splits.Length - 1; i++) 3273sb.Append(itemSpace).Append(splits[splits.Length - 1]);
Definition\Project_Tests.cs (1)
352for (int i = 0; i < tasks.Length; i++)
ErrorUtilities.cs (3)
164if (parameterValue.Length == 0) 617VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 619int arrayCapacity = array.Length - arrayIndex;
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1144ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1159while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1164if (index == splitBase.Length && index == splitPath.Length) 1177for (int i = index; i < splitBase.Length; i++) 1181for (int i = index; i < splitPath.Length; i++)
Instance\ProjectItemInstance_Tests.cs (1)
1182for (int i = 0; i < includes.Length; i++)
ResourceUtilities.cs (1)
372if (args?.Length > 0)
Microsoft.Build.Engine.UnitTests (110)
BackEnd\AssemblyTaskFactory_Tests.cs (3)
217Assert.Equal(comparisonInfo.Length, propertyInfos.Length); 222for (int i = 0; i < propertyInfos.Length; i++)
BackEnd\BuildManager_Tests.cs (2)
453Assert.Equal(3, item.Length); 1006deferredMessages.Length.ShouldBe(3);
BackEnd\CacheAggregator_Tests.cs (2)
270aggregatedConfigs.Length.ShouldBe(currentBuildResultIndex); 271aggregatedResults.Length.ShouldBe(currentBuildResultIndex);
BackEnd\DebugUtils_tests.cs (2)
34(exceptionFiles.Length - exceptionFilesBefore.Length).ShouldBe(1);
BackEnd\ItemCreationTask.cs (2)
57CopiedOutputItems = new ITaskItem[InputItemsToCopy.Length]; 59for (int i = 0; i < InputItemsToCopy.Length; i++)
BackEnd\MockLoggingService.cs (1)
341if (messageArgs?.Length > 0)
BackEnd\MSBuild_Tests.cs (7)
160Assert.Equal(7, targetOutputs["Build"].Items.Length); 569Assert.Equal(4, targetOutputs["Build"].Items.Length); 636Assert.Equal(2, targetOutputs["Build"].Items.Length); 1064Assert.Equal(3, targetOutputs["Build"].Items.Length); 1133Assert.Equal(3, targetOutputs["Build"].Items.Length); 1199Assert.Equal(2, targetOutputs["Build"].Items.Length); 1809Assert.Equal(5, targetOutputs["Build"].Items.Length);
BackEnd\RequestBuilder_Tests.cs (5)
294_newBuildRequests_BuildRequests = new BuildRequest[requests.Length]; 375string[] projectFiles = new string[_newRequests.Length]; 376PropertyDictionary<ProjectPropertyInstance>[] properties = new PropertyDictionary<ProjectPropertyInstance>[_newRequests.Length]; 377string[] toolsVersions = new string[_newRequests.Length]; 379for (int i = 0; i < projectFiles.Length; ++i)
BackEnd\ResultsCache_Tests.cs (1)
85results.Length.ShouldBe(2);
BackEnd\TargetBuilder_Tests.cs (1)
1547Assert.Equal(tasks.Length, mockBuilder.ExecutedTasks.Count);
BackEnd\TargetEntry_Tests.cs (5)
478Assert.Equal(2, results.Items.Length); 497Assert.Equal(3, results.Items.Length); 515Assert.Equal(3, results.Items.Length); 556Assert.Equal(2, results.Items.Length); 619Assert.Equal(4, results.Items.Length);
BackEnd\TargetUpToDateChecker_Tests.cs (1)
579for (int i = 0; i < filesToAnalyze.Length; ++i)
BackEnd\TaskBuilderTestTask.cs (4)
1307var propertyInfos = new TaskPropertyInfo[infos.Length]; 1308for (int i = 0; i < infos.Length; i++) 1313infos[i].GetCustomAttributes(typeof(OutputAttribute), false).Length > 0, 1314infos[i].GetCustomAttributes(typeof(RequiredAttribute), false).Length > 0);
BackEnd\TaskExecutionHost_Tests.cs (13)
1326Assert.Equal(values.Length, _bucket.Lookup.GetItems("output").Count); 1327for (int i = 0; i < values.Length; i++) 1341Assert.Equal(values.Length, _bucket.Lookup.GetItems("output").Count); 1342for (int i = 0; i < values.Length; i++) 1422Assert.Equal(expectedItems.Length, actualItems.Length); 1424for (int i = 0; i < expectedItems.Length; i++) 1440Assert.Equal(expectedItems.Length, actualItems.Length); 1442for (int i = 0; i < expectedItems.Length; i++) 1460Assert.Equal(expectedArray.Length, actualArray.Length); 1461for (int i = 0; i < expectedArray.Length; i++)
BackEnd\TaskHostConfiguration_Tests.cs (3)
745if (x.Length != y.Length) 750for (int i = 0; i < x.Length; i++)
BackEnd\TaskThatReturnsDictionaryTaskItem.cs (2)
146if (index < 0 || index > array.Length) 151if (array.Length - index < Count)
BackEnd\TranslationHelpers.cs (1)
75for (int i = 0; i < leftArray.Length; i++)
BinaryLogger_Tests.cs (2)
256while (br1.ReadBytes(bufferSize) is { Length: > 0 } bytes1) 265br2.ReadBytes(bufferSize).Length.ShouldBe(0, "Second buffer contains bytes after first file end");
BuildEventArgsSerialization_Tests.cs (3)
50Assert.Equal(bytes.Length, binaryReader.Read7BitEncodedInt()); 51Assert.Equal(bytes, binaryReader.ReadBytes(bytes.Length)); 524(AssemblyLoadingContext)(new Random().Next(Enum.GetNames(typeof(AssemblyLoadingContext)).Length));
ChangeWaves_Tests.cs (7)
72log.WarningCount.ShouldBe(warningCodesLogShouldContain.Length); 86for (int i = 0; i < ChangeWaves.AllWaves.Length - 1; i++) 146for (int i = 0; i < ChangeWaves.AllWaves.Length; i++) 166for (int i = 0; i < ChangeWaves.AllWaves.Length - 1; i++) 176versionToCheckAgainstCurrentChangeWave: ChangeWaves.AllWaves[ChangeWaves.AllWaves.Length - 1], 203for (int i = 0; i < ChangeWaves.AllWaves.Length - 1; i++) 213versionToCheckAgainstCurrentChangeWave: ChangeWaves.AllWaves[ChangeWaves.AllWaves.Length - 1],
Construction\SolutionFile_OldParser_Tests.cs (1)
2476for (int i = 0; i < lines.Length; i++)
Construction\SolutionProjectGenerator_Tests.cs (1)
623for (int i = 0; i < solutions.Length; i++)
Definition\ProjectEvaluationContext_Tests.cs (4)
693string[][] prependedExpectedGlobExpansions = new string[expectedGlobExpansions.Length][]; 694for (int expIndex = 0; expIndex < expectedGlobExpansions.Length; expIndex++) 697string[] prependedGlobExpansion = new string[globExpansion.Length]; 700for (var i = 0; i < globExpansion.Length; i++)
Definition\ToolsetConfigurationReader_Tests.cs (1)
587Assert.Equal(paths.SearchPaths.Count, expectedPaths.Length);
Definition\ToolsVersion_Tests.cs (4)
278Assert.Equal(sortedTasksExpectedPaths.Count, foundFiles.Length); 279for (int i = 0; i < foundFiles.Length; i++) 284Assert.Equal(sortedOverrideExpectedPaths.Count, foundoverrideFiles.Length); 285for (int i = 0; i < foundoverrideFiles.Length; i++)
Evaluation\Expander_Tests.cs (2)
3975for (int a = 0; a < hashes.Length; a++) 3977for (int b = a; b < hashes.Length; b++)
Evaluation\ProjectSdkImplicitImport_Tests.cs (1)
491events.Length.ShouldBe(2);
FileLogger_Tests.cs (5)
144for (int i = 0; i < verbositySettings.Length; i++) 155for (int i = 0; i < verbositySettings.Length; i++) 473Assert.Equal(expectedLines.Length, actualLines.Length); 475for (int i = 0; i < expectedLines.Length; i++)
FileMatcher_Tests.cs (2)
71fileMatches.Length.ShouldBe(expectedMatchCount, $"Matches: '{String.Join("', '", fileMatches)}'"); 86fileMatches.Length.ShouldBe(1);
Globbing\CompositeGlob_Tests.cs (1)
133Assert.Equal(4, leafGlobs.Length);
Graph\GraphLoadedFromSolution_tests.cs (1)
39for (var i = 0; i < files.Length; i++)
Graph\GraphTestingUtilities.cs (1)
71innerBuilds.Length.ShouldBe(expectedInnerBuildCount);
Graph\IsolateProjects_Tests.cs (4)
345declaredReferenceBuildResults.Length.ShouldBe(1); 346rootBuildResults.Length.ShouldBe(1); 364declaredReferenceBuildResults[0]["DeclaredReferenceTarget"].Items.Length.ShouldBe(1); 366rootBuildResults[0]["BuildDeclaredReference"].Items.Length.ShouldBe(0);
Graph\ProjectGraph_Tests.cs (2)
1815toposort.Length.ShouldBe(projectGraph.ProjectNodes.Count); 1817for (var i = 0; i < toposort.Length; i++)
Graph\ResultCacheBasedBuilds_Tests.cs (2)
140result.ResultsByTarget["Build"].Items.Length.ShouldBe(1); 172resultFromCachedBuild.ResultsByTarget["Build"].Items.Length.ShouldBe(1);
Instance\TaskItem_Tests.cs (1)
194item.MetadataCount.ShouldBe(s_builtInMetadataNames.Length + 2);
ProjectCache\ProjectCacheTests.cs (3)
1634logger.ProjectStartedEvents.Count.ShouldBe(2 * projectPaths.Length); 1636cacheHitCount.ShouldBe(projectPaths.Length); 1637nonCacheHitCount.ShouldBe(projectPaths.Length);
SolutionFileBuilder.cs (2)
114if (SolutionDependencies?.Length > 0) 125if (SolutionDependenciesProjectNameToGuids?.Length > 0)
TaskParameter_Tests.cs (5)
99Array array = Array.CreateInstance(type, values.Length); 100for (int i = 0; i < values.Length; i++) 158Assert.Equal(2, stringArray.Length); 254Assert.Equal(2, wrappedParameter.Length); 265Assert.Equal(2, wrappedParameter2.Length);
Microsoft.Build.Framework (53)
BinaryTranslator.cs (7)
270length = byteArray.Length; 893int count = array.Length; 952int count = array.Length; 1004int count = array.Length; 1245var length = byteArray?.Length ?? 0; 1281int count = array.Length; 1303int count = array.Length;
ChangeWaves.cs (1)
63return AllWaves[AllWaves.Length - 1];
EncodingUtilities.cs (4)
144var buffer = new byte[preamble.Length]; 154bytesRead = stream.Read(buffer, 0, preamble.Length); 162return bytesRead == preamble.Length && !buffer.Where((t, i) => preamble[i] != t).Any(); 234if (defaultEncoding is UTF8Encoding e && e.GetPreamble().Length > 0)
LazyFormattedBuildEventArgs.cs (4)
91if (argsOrMessage is object[] arguments && arguments.Length > 0 && base.Message is not null) 109if (argsOrMessage is object[] arguments && arguments.Length > 0) 112writer.Write(arguments.Length); 173if ((args?.Length > 0))
Logging\LoggerParametersHelper.cs (1)
64yield return new Tuple<string, string?>(parameterAndValue[0], parameterAndValue.Length > 1 ? parameterAndValue[1] : null);
NativeMethods.cs (1)
1412if (statFields.Length >= 3)
Sdk\SdkReference.cs (4)
89if (parts.Length < 1 || parts.Length > 2) 99if (parts.Length == 1 || string.IsNullOrWhiteSpace(parts[1])) 103else if (parts.Length == 2)
SegmentedArray.cs (6)
55if (length > destinationArray.Length) 487var remainingInSegment = firstSegment.Length - offset; 590var remainingInFirstSegment = firstSegment.Length - firstOffset; 591var remainingInSecondSegment = secondSegment.Length - secondOffset; 729var remainingInSegment = segment.Length - offset; 778var remainingInSegment = segment.Length - offset;
SegmentedArray`1.cs (11)
84for (var i = 0; i < _items.Length - 1; i++) 93var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 95_items[_items.Length - 1] = new T[lastPageSize]; 148for (var i = 0; i < items.Length; i++) 158for (var i = 0; i < _items.Length; i++) 166for (var i = 0; i < _items.Length; i++) 242for (var i = 0; i < _items.Length; i++) 257for (var i = 0; i < _items.Length; i++) 398if (_items.Length == 0) 401if (_nextItemIndex == _items[_nextItemSegment].Length) 403if (_nextItemSegment == _items.Length - 1)
SegmentedDictionary`2.cs (12)
300if ((uint)index > (uint)array.Length) 305if (array.Length - index < Count) 862if ((uint)index > (uint)array.Length) 867if (array.Length - index < Count) 1282if (index < 0 || index > array.Length) 1287if (array.Length - index < _dictionary.Count) 1343if ((uint)index > (uint)array.Length) 1348if (array.Length - index < _dictionary.Count) 1482if ((uint)index > array.Length) 1487if (array.Length - index < _dictionary.Count) 1543if ((uint)index > (uint)array.Length) 1548if (array.Length - index < _dictionary.Count)
SegmentedList`1.cs (1)
94if ((T[][])_items.SyncRoot is { Length: 1 } segments)
Traits.cs (1)
566if ((args?.Length > 0))
Microsoft.Build.Framework.UnitTests (2)
AssemblyLoadBuildEventArgs_Tests.cs (1)
22(AssemblyLoadingContext)(new Random().Next(Enum.GetNames(typeof(AssemblyLoadingContext)).Length));
ResourceUtilities.cs (1)
372if (args?.Length > 0)
Microsoft.Build.Tasks.CodeAnalysis (16)
CommandLineBuilderExtension.cs (6)
194string[] splitAndTrimmed = new string[splits.Length]; 195for (int i = 0; i < splits.Length; ++i) 213for (int i = 0; i < splits.Length; ++i) 241|| (metadataNames?.Length == treatAsFlags.Length), 252for (int i = 0; i < metadataNames.Length; ++i)
ManagedCompiler.cs (1)
838(Sources.Length > 0) &&
MvidReader.cs (1)
100if (name!.Length == 8 && name[0] == '.' &&
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
329responseBuffer.Length,
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
160_loggingStream.Write(bytes, 0, bytes.Length);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
Vbc.cs (3)
556if ((this.References == null) || (this.References.Length == 0)) 561var references = new List<ITaskItem>(this.References.Length); 562var links = new List<ITaskItem>(this.References.Length);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (7)
DotNetSdkTests.cs (2)
577if (findEditorConfigs && editorConfigs.Length == 1) 583if (findGlobalConfigs && globalConfigs.Length == 1)
MapSourceRootTests.cs (4)
58Assert.Equal(4, task.MappedSourceRoots.Length); 107Assert.Equal(3, task.MappedSourceRoots.Length); 184Assert.Equal(4, task.MappedSourceRoots.Length); 222Assert.Equal(3, task.MappedSourceRoots.Length);
TargetTests.cs (1)
562Assert.Equal(3, noneItems.Length);
Microsoft.Build.Tasks.Core (223)
AssemblyDependency\AssemblyInformation.cs (1)
556if (publicKeyOrToken.Length <= 8)
AssemblyDependency\AssemblyResolution.cs (2)
161var resolvers = new Resolver[searchPaths.Length]; 163for (int p = 0; p < searchPaths.Length; ++p)
AssemblyDependency\GenerateBindingRedirects.cs (5)
57if (SuggestedRedirects == null || SuggestedRedirects.Length == 0) 257if (oldVersionRange.Length == 0 || oldVersionRange.Length > 2) 263var oldVerStrHigh = oldVersionRange[oldVersionRange.Length == 1 ? 0 : 1]; 361ErrorUtilities.VerifyThrow(SuggestedRedirects?.Length > 0, "This should not be called if there is no suggested redirect.");
AssemblyDependency\Reference.cs (1)
259if (scatterFilesToAttach == null || scatterFilesToAttach.Length == 0)
AssemblyDependency\ReferenceTable.cs (11)
965string satelliteFilename = subDirectories.Length > 0 1034var dependencies = new List<AssemblyNameExtension>(dependentAssemblies?.Length ?? 0); 1036if (dependentAssemblies?.Length > 0) 1039for (int i = 0; i < dependentAssemblies.Length; i++) 1883if (pkt?.Length > 0) 2023if (_latestTargetFrameworkDirectories?.Length > 0) 2290return refPkt != null && refPkt.Length != 0; 2304if (rpkt.Length != dpkt.Length) 2309for (int i = 0; i < rpkt.Length; i++) 2737if (relatedFileExtensions.Count > 0 || satellites.Count > 0 || serializationAssemblyFiles.Count > 0 || scatterFiles.Length > 0)
AssemblyDependency\ResolveAssemblyReference.cs (29)
1314var buffer = new StringBuilder(a.Length * 2); 1315for (int i = 0; i < a.Length; ++i) 2055if (_cache == null && AssemblyInformationCachePaths != null && AssemblyInformationCachePaths.Length > 0) 2194for (int i = 0; i < _targetFrameworkDirectories.Length; i++) 2207if (installedAssemblyTableInfo?.Length > 0) 2218bool targetingProfile = !String.IsNullOrEmpty(ProfileName) && ((FullFrameworkFolders.Length > 0) || (FullFrameworkAssemblyTables.Length > 0)); 2232if (inclusionListSubsetTableInfo.Length > 0 && (redistList?.Count > 0)) 2286for (int i = 0; i < redistList.Errors.Length; ++i) 2648MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies); 2665MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies); 2771if (fullRedistAssemblyTableInfo.Length > 0) 2802for (int i = 0; i < fullFrameworkRedistList.Errors.Length; ++i) 2855bool targetFrameworkSubsetIsSet = TargetFrameworkSubsets.Length != 0 || InstalledAssemblySubsetTables.Length != 0; 2859bool fullFrameworkFoldersIsSet = FullFrameworkFolders.Length > 0; 2860bool fullFrameworkTableLocationsIsSet = FullFrameworkAssemblyTables.Length > 0; 2958if (IgnoreDefaultInstalledAssemblySubsetTables && _installedAssemblySubsetTables.Length == 0) 2965if (_targetFrameworkSubsets.Length == 0 && _installedAssemblySubsetTables.Length == 0) 3048if (TargetFrameworkDirectories?.Length == 1)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
AssignCulture.cs (3)
129AssignedFiles = new ITaskItem[Files.Length]; 130CultureNeutralAssignedFiles = new ITaskItem[Files.Length]; 136for (int i = 0; i < Files.Length; ++i)
AssignProjectConfiguration.cs (2)
311if (configurationPlatformParts.Length > 1) 398if (platforms.Length != 2)
AssignTargetPath.cs (3)
48AssignedFiles = new ITaskItem[Files.Length]; 50if (Files.Length > 0) 74for (int i = 0; i < Files.Length; ++i)
BootstrapperUtil\BootstrapperBuilder.cs (1)
1605var output = new StringBuilder(byteArray.Length);
BootstrapperUtil\ResourceUpdater.cs (6)
75if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)resource.Type, resource.Name, 0, data, data.Length)) 87if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)42, "COUNT", 0, countArray, countArray.Length)) 119if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)42, keyName, 0, data, data.Length)) 147byte[] data = new byte[strBytes.Length + 2]; 149data[data.Length - 2] = 0; 150data[data.Length - 1] = 0;
CallTarget.cs (1)
65if ((Targets == null) || (Targets.Length == 0))
CanonicalError.cs (1)
321if (explodedText.Length > 0)
CommandLineBuilderExtension.cs (5)
188string[] splitAndTrimmed = new string[splits.Length]; 189for (int i = 0; i < splits.Length; ++i) 238(metadataNames != null && metadataNames.Length == treatAsFlags.Length), 249for (int i = 0; i < metadataNames.Length; ++i)
Copy.cs (18)
433success = parallelism == 1 || DestinationFiles.Length == 1 457destinationFilesSuccessfullyCopied = new List<ITaskItem>(DestinationFiles.Length); 465DestinationFiles.Length, // Set length to common case of 1:1 source->dest. 469for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 544DestinationFiles.Length, // Set length to common case of 1:1 source->dest. 547for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 561var successFlags = new IntPtr[DestinationFiles.Length]; 635destinationFilesSuccessfullyCopied = new List<ITaskItem>(DestinationFiles.Length); 636for (int i = 0; i < successFlags.Length; i++) 649return (SourceFiles == null || SourceFiles.Length == 0) && (SourceFolders == null || SourceFolders.Length == 0); 692if (DestinationFiles != null && DestinationFiles.Length != SourceFiles.Length) 694Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", DestinationFiles.Length, SourceFiles.Length, "DestinationFiles", "SourceFiles"); 722DestinationFiles = new ITaskItem[SourceFiles.Length]; 724for (int i = 0; i < SourceFiles.Length; ++i) 747if (isSuccess && SourceFolders != null && SourceFolders.Length > 0)
CreateManifestResourceName.cs (4)
124ManifestResourceNames = new ITaskItem[ResourceFiles.Length]; 125ResourceFilesWithManifestResourceNames = new ITaskItem[ResourceFiles.Length]; 349for (int i = 1; i < subNames.Length; i++) 379for (int i = 1; i < subNames.Length; i++)
ErrorUtilities.cs (3)
164if (parameterValue.Length == 0) 617VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 619int arrayCapacity = array.Length - arrayIndex;
Exec.cs (1)
628for (int i = 0; i < _charactersToEscape.Length; i++)
FileIO\GetFileHash.cs (2)
84Parallel.For(0, Files.Length, parallelOptions, index => 113if (Files.Length == 1)
FileMatcher.cs (5)
484string[] longParts = new string[parts.Length - startingElement]; 487for (int i = startingElement; i < parts.Length; ++i) 511for (int j = i; j < parts.Length; ++j) 894for (int i = 0; i < excludeNextSteps.Length; i++) 942for (int i = 0; i < excludeNextSteps.Length; i++)
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1144ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1159while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1164if (index == splitBase.Length && index == splitPath.Length) 1177for (int i = index; i < splitBase.Length; i++) 1181for (int i = index; i < splitPath.Length; i++)
FindAppConfigFile.cs (2)
97for (int i = PrimaryList.Length - 1; i >= 0; i--) 105for (int i = SecondaryList.Length - 1; i >= 0; i--)
FindInList.cs (1)
86for (int i = List.Length - 1; i >= 0; i--)
GenerateApplicationManifest.cs (1)
421if (values.Length != 5)
GenerateResource.cs (5)
867OutputResources = new ITaskItem[outputResources.Length + cachedOutputFiles.Count]; 869cachedOutputFiles.CopyTo(OutputResources, outputResources.Length); 2525_assemblyNames = new AssemblyNameExtension[_assemblyFiles.Length]; 2526for (int i = 0; i < _assemblyFiles.Length; i++) 3472if (errors.Length > 0)
GetAssemblyIdentity.cs (1)
48var s = new StringBuilder(a.Length * 2);
GetCompatiblePlatform.cs (2)
54AssignedProjectsWithPlatform = new ITaskItem[AnnotatedProjects.Length]; 55for (int i = 0; i < AnnotatedProjects.Length; i++)
GetSDKReferenceFiles.cs (2)
373if (manifestReferencePaths?.Length > 0) 1006if (sdkManifestReferences?.Length > 0)
Hash.cs (3)
62if (ItemsToHash?.Length > 0) 79for (int i = 0; i < ItemsToHash.Length; i++) 92shaBufferPosition = AddBytesToShaBuffer(sha, shaBuffer, shaBufferPosition, ShaBufferSize, s_itemSeparatorCharacterBytes, s_itemSeparatorCharacterBytes.Length);
ListOperators\RemoveDuplicates.cs (4)
41if (Inputs == null || Inputs.Length == 0) 49var filteredList = new List<ITaskItem>(Inputs.Length); 60HadAnyDuplicates = Inputs.Length != Filtered.Length;
ManifestUtil\EmbeddedManifestReader.cs (1)
56Marshal.Copy(hResource, buffer, 0, buffer.Length);
ManifestUtil\mansign2.cs (10)
516if (cspPublicKeyBlob == null || cspPublicKeyBlob.Length == 0) 535publicKeyBlob.cbData = (uint)cspPublicKeyBlob.Length; 710manifestInformationNode.SetAttribute("Hash", hash.Length == 0 ? "" : BytesToHexString(hash, 0, hash.Length)); 839nonce[nonce.Length - 1] &= 0x7f; 840nonce[nonce.Length - 1] |= 0x01; 850para.Nonce.cbData = (uint)nonce.Length; 860sigValueBytes.Length, 931licenseBlob.cbData = (uint)licenseXml.Length; 943Marshal.Copy(timestampBlob.pbData, timestampSignature, 0, timestampSignature.Length);
ManifestUtil\MetadataReader.cs (1)
170if (pk.Length != 0)
ManifestUtil\Util.cs (4)
70StringBuilder s = new StringBuilder(a.Length); 86StringBuilder s = new StringBuilder(a.Length); 406for (int i = 0; i < s_platforms.Length; ++i) 424if (items.Length <= 1)
ManifestUtil\XmlUtil.cs (2)
105if (entries.Length > 0) 148string filename = uri.Segments[uri.Segments.Length - 1];
Move.cs (8)
94if (SourceFiles == null || SourceFiles.Length == 0) 116if (DestinationFiles != null && DestinationFiles.Length != SourceFiles.Length) 118Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", DestinationFiles.Length, SourceFiles.Length, "DestinationFiles", "SourceFiles"); 125DestinationFiles = new ITaskItem[SourceFiles.Length]; 127for (int i = 0; i < SourceFiles.Length; ++i) 153for (int i = 0; i < SourceFiles.Length && !_canceling; ++i)
MSBuild.cs (11)
202if ((Projects == null) || (Projects.Length == 0)) 208if (TargetAndPropertyListSeparators?.Length > 0) 263skipProjects = new bool[Projects.Length]; 264for (int i = 0; i < skipProjects.Length; i++) 278for (int i = 0; i < Projects.Length; i++) 376for (int i = 0; i < Projects.Length; i++) 457var targetLists = new List<string[]>(runEachTargetSeparately ? targets.Length : 1); 458if (runEachTargetSeparately && targets.Length > 0) 501for (int i = 0; i < projectNames.Length; i++) 540undefinePropertiesPerProject[i] = new List<string>(propertiesToUndefine.Length); 543if (log != null && propertiesToUndefine.Length > 0)
PlatformNegotiation.cs (1)
113if (keyVal.Length != 2 || string.IsNullOrEmpty(keyVal[0]) || string.IsNullOrEmpty(keyVal[1]))
RedistList.cs (11)
224var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 225for (int i = 0; i < redistListPaths.Length; ++i) 260var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 261for (int i = 0; i < redistListPaths.Length; ++i) 277var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 278for (int i = 0; i < redistListPaths.Length; ++i) 346var keyBuilder = assemblyTables.Length > 0 ? new StringBuilder(assemblyTables[0].Descriptor) : new StringBuilder(); 347for (int i = 1; i < assemblyTables.Length; ++i) 534var keyBuilder = allowListAssemblyTableInfo.Length > 0 ? new StringBuilder(allowListAssemblyTableInfo[0].Descriptor) : new StringBuilder(); 537for (int i = 1; i < allowListAssemblyTableInfo.Length; ++i) 1022if (_subsetToSearchFor.Length > 0)
ResGenDependencies.cs (3)
397if (OutputFiles.Length != otherLibrary.OutputFiles.Length) 402for (int i = 0; i < OutputFiles.Length; i++)
ResolveManifestFiles.cs (3)
174if (RuntimePackAssets != null && RuntimePackAssets.Length > 0) 348itemCulture = pathSegments.Length > 1 ? pathSegments[pathSegments.Length - 2] : null;
ResolveSDKReference.cs (6)
276if (InstalledSDKs.Length == 0) 296var sdkItems = new Dictionary<string, ITaskItem>(InstalledSDKs.Length, StringComparer.OrdinalIgnoreCase); 1233for (int i = 0; i < supportedArchitectures.Length; i++) 1238if (supportedArchitectures.Length > 1 && i != supportedArchitectures.Length - 1) 1360switch (appxComponents.Length)
ResourceHandling\MSBuildResXReader.cs (3)
240if (fileRefInfo.Length == 3) 367if (parts.Length > 1) 371else if (parts.Length > 0)
ResourceUtilities.cs (1)
372if (args?.Length > 0)
SetRidAgnosticValueForProjects.cs (2)
47if (isRidAgnosticArray.Length != targetFrameworksArray.Length)
StateFileBase.cs (1)
103if (parameters.Length == 1 && parameters[0].ParameterType == typeof(ITranslator))
System.Design.cs (2)
137if (args?.Length > 0) 139for (int i = 0; i < args.Length; i++)
SystemState.cs (1)
572retVal.isDirty = stateFiles.Length > 0;
Telemetry.cs (1)
42if (item.Length != 2)
Unzip.cs (2)
287if (_includePatterns.Length > 0) 292if (_excludePatterns.Length > 0)
WriteCodeFragment.cs (1)
482.Where(t => t.Length == positionalParameters.Count)
XmlPeek.cs (1)
159if (Result.Length == 0)
XslTransformation.cs (10)
115if (XmlInputPaths != null && XmlInputPaths.Length != _outputPaths.Length) 117Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", _outputPaths.Length, XmlInputPaths.Length, "OutputPaths", "XmlInputPaths"); 122if (XmlContent != null && _outputPaths.Length != 1) 124Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", _outputPaths.Length, 1, "OutputPaths", "XmlContent"); 191for (int i = 0; i < XmlInputPaths.Length; i++) 286_data = new string[xmlFile.Length]; 287for (int i = 0; i < xmlFile.Length; i++) 318public int Count => _data.Length;
Microsoft.Build.Tasks.UnitTests (128)
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (2)
138dll2.scatterFiles.Length.ShouldBe(dll.scatterFiles.Length);
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (5)
2998if (t.InstalledAssemblyTables.Length == 0) 3048Assert.Equal(loadModeResolvedFiles.Length, t.ResolvedFiles.Length); 3049for (int i = 0; i < loadModeResolvedFiles.Length; i++) 3101for (int i = 0; i < t.ResolvedFiles.Length; i++)
AssemblyDependency\SuggestedRedirects.cs (5)
66Assert.Equal(3, t.ResolvedDependencyFiles.Length); 210Assert.Equal(3, t.ResolvedFiles.Length); 255Assert.Equal(3, t.ResolvedFiles.Length); 414Assert.Equal(2, t.ResolvedDependencyFiles.Length); 457Assert.Equal(2, t.ResolvedDependencyFiles.Length);
AssignTargetPath_Tests.cs (5)
28t.AssignedFiles.Length.ShouldBe(1); 43t.AssignedFiles.Length.ShouldBe(1); 64t.AssignedFiles.Length.ShouldBe(1); 81t.AssignedFiles.Length.ShouldBe(1); 107t.AssignedFiles.Length.ShouldBe(1);
Copy_Tests.cs (25)
135(task.CopiedFiles == null || task.CopiedFiles.Length == 0).ShouldBeTrue(); 136(task.DestinationFiles == null || task.DestinationFiles.Length == 0).ShouldBeTrue(); 156task.CopiedFiles.Length.ShouldBe(1); 158task.DestinationFiles.Length.ShouldBe(1); 181task.CopiedFiles.Length.ShouldBe(1); 183task.DestinationFiles.Length.ShouldBe(1); 224task.CopiedFiles.Length.ShouldBe(10); 226task.DestinationFiles.Length.ShouldBe(10); 248task.CopiedFiles.Length.ShouldBe(0); 250task.DestinationFiles.Length.ShouldBe(0); 279task.CopiedFiles.Length.ShouldBe(3); 281task.DestinationFiles.Length.ShouldBe(3); 303task.CopiedFiles.Length.ShouldBe(0); 305task.DestinationFiles.Length.ShouldBe(0); 327task.CopiedFiles.Length.ShouldBe(0); 329task.DestinationFiles.Length.ShouldBe(0); 353(task.DestinationFiles == null || task.DestinationFiles.Length == 0).ShouldBeTrue(); 1006Assert.Equal(2, t.CopiedFiles.Length); 1619Assert.Equal(2, t.DestinationFiles.Length); 1818Assert.Equal(2, t.DestinationFiles.Length); 1825Assert.Equal(2, t.CopiedFiles.Length); 2022Assert.Equal(4, t.CopiedFiles.Length); 2089Assert.Equal(5, t.CopiedFiles.Length); 2685Assert.Equal(2, t.DestinationFiles.Length); 2686Assert.Equal(2, t.CopiedFiles.Length);
Exec_Tests.cs (2)
927Assert.Equal(2, exec.ConsoleOutput.Length); 1047exec.ConsoleOutput.Length.ShouldBe(1);
FindInvalidProjectReferences_Tests.cs (1)
57Assert.Equal(2, t.InvalidReferences.Length);
GetFileHash_Tests.cs (1)
96task.Items.Length.ShouldBe(2);
GetInstalledSDKLocations_Tests.cs (3)
287Assert.Equal(6, installedSDKs.Length); 334Assert.Equal(6, installedSDKs.Length); 408Assert.Equal(6, installedSDKs.Length);
GetSDKReference_Tests.cs (27)
432Assert.Equal(9, t.CopyLocalFiles.Length); 433Assert.Equal(8, t.References.Length); 508Assert.Equal(8, t.References.Length); 519Assert.Equal(8, t.References.Length); 557Assert.Equal(8, t.References.Length); 650Assert.Equal(2, allCacheFiles.Length); 675Assert.Equal(8, t.References.Length); 724Assert.Equal(5, t.References.Length); 816Assert.Equal(8, t.References.Length); 868Assert.Equal(8, t.References.Length); 919Assert.Equal(8, t.References.Length); 956Assert.Equal(8, t.References.Length); 957Assert.Equal(5, t.RedistFiles.Length); 1018Assert.Equal(5, t.RedistFiles.Length); 1049Assert.Equal(5, t.RedistFiles.Length); 1081Assert.Equal(5, t.RedistFiles.Length); 1112Assert.Equal(8, t.References.Length); 1141Assert.Equal(8, t.References.Length); 1169Assert.Equal(5, t.RedistFiles.Length); 1197Assert.Equal(5, t.RedistFiles.Length); 1234Assert.Equal(8, t.References.Length); 1235Assert.Equal(6, t.RedistFiles.Length); 1280Assert.Equal(8, t.References.Length); 1281Assert.Equal(6, t.RedistFiles.Length); 1323Assert.Equal(8, t.References.Length); 1324Assert.Equal(6, t.RedistFiles.Length); 1368Assert.Equal(7, t.RedistFiles.Length);
Hash_Tests.cs (2)
59for (int i = 0; i < itemsToHash.Length; i++) 75for (int i = 0; i < array.Length; i++)
MakeDir_Tests.cs (2)
94Assert.Equal(2, t.DirectoriesCreated.Length); 102Assert.Equal(3, t.DirectoriesCreated.Length);
Move_Tests.cs (2)
461Assert.Equal(2, t.DestinationFiles.Length); 662Assert.Equal(2, t.DestinationFiles.Length);
MSBuild_Tests.cs (1)
1347Assert.Equal(5, msbuildTask.TargetOutputs.Length);
RARPrecomputedCache_Tests.cs (1)
149assembly3.scatterFiles.Length.ShouldBe(2);
ReadLinesFromFile_Tests.cs (3)
55Assert.Equal(3, r.Lines.Length); 102Assert.Equal(3, r.Lines.Length); 198Assert.Equal(3, r.Lines.Length);
RemoveDir_Tests.cs (2)
74t2.RemovedDirectories.Length.ShouldBe(list.Count); 113t.RemovedDirectories.Length.ShouldBe(0);
RemoveDuplicates_Tests.cs (3)
70Assert.Equal(3, t.Filtered.Length); 96Assert.Equal(3, t.Filtered.Length); 115Assert.Equal(2, t.Filtered.Length);
ResolveNonMSBuildProjectOutput_Tests.cs (2)
198for (int i = 0; i < rvpo.UnresolvedProjectReferences.Length; i++) 204for (int i = 0; i < rvpo.ResolvedOutputPaths.Length; i++)
ResolveSDKReference_Tests.cs (9)
106Assert.Equal(4, result.Length); 116Assert.Equal(2, result.Length); 1531Assert.Equal(2, t.ResolvedSDKReferences.Length); 3822Assert.Equal(2, resolvedSDKReferences.Length); 3831Assert.Equal(2, SDkRedistFolders.Length); 3965Assert.Equal(2, resolvedSDKReferences.Length); 3974Assert.Equal(2, SDkRedistFolders.Length); 4083Assert.Equal(2, SDkRedistFolders.Length); 4182Assert.Equal(2, SDkRedistFolders.Length);
ResourceHandling\GenerateResource_Tests.cs (5)
333t.OutputResources.Length.ShouldBe(1); 2152Assert.True(t.FilesWritten?.Length == 0); 2265for (int i = 0; i < t.Sources.Length; i++) 2797Assert.True(t.OutputResources == null || t.OutputResources.Length == 0); 3833for (int i = t.FilesWritten.Length - 1; i >= 0; i--)
ResourceManagement_Tests.cs (3)
28filteredMessages.Length.ShouldBe(1); 43filteredMessages.Length.ShouldBe(2); 70filteredMessages.Length.ShouldBe(2);
RoslynCodeTaskFactory_Tests.cs (1)
215messages.Length.ShouldBe(1);
XmlPeek_Tests.cs (12)
77Assert.Equal(3, p.Result.Length); // "result Length should be 3" 79for (int i = 0; i < p.Result.Length; i++) 100Assert.Equal(3, p.Result.Length); // "result Length should be 3" 108for (int i = 0; i < p.Result.Length; i++) 129Assert.Equal(3, p.Result.Length); // "result Length should be 3" 137for (int i = 0; i < p.Result.Length; i++) 157Assert.Equal(3, p.Result.Length); // "result Length should be 3" 159for (int i = 0; i < p.Result.Length; i++) 177Assert.Equal(3, p.Result.Length); // "result Length should be 3" 179for (int i = 0; i < p.Result.Length; i++) 286for (int i = 0; i < Math.Pow(2, attrs.Length); i++) 289for (int k = 0; k < attrs.Length; k++)
XmlPoke_Tests.cs (2)
264for (int i = 0; i < Math.Pow(2, attrs.Length); i++) 267for (int k = 0; k < attrs.Length; k++)
XslTransformation_Tests.cs (2)
442for (int i = 0; i < Math.Pow(2, attrs.Length); i++) 445for (int k = 0; k < attrs.Length; k++)
Microsoft.Build.UnitTests.Shared (37)
DriveMapping.cs (3)
59while (QueryDosDevice(ToDeviceName(letter), buffer, buffer.Length) == 0) 73buffer = new char[buffer.Length * 4]; 77return new string(buffer, 4, buffer.Length - 4);
MockEngine.cs (3)
265BuildEngineResult result = BuildProjectFilesInParallel(projectFileNames, targetNames, globalProperties, new List<String>[projectFileNames.Length], toolsVersion, includeTargetOutputs); 269for (int i = 0; i < targetOutputsPerProject.Length; i++) 303for (int i = 0; i < projectFileNames.Length; i++)
MockLogger.cs (2)
491if (index == contains.Length) 504if (index != contains.Length)
ObjectModelHelpers.cs (27)
264var metadata = new Dictionary<string, string>[expectedItems.Length]; 266for (var i = 0; i < metadata.Length; i++) 282if (items.Count != 0 || expectedDirectMetadataPerItem.Length != 0) 288int minimumLength = Math.Min(expectedItems.Length, items.Count); 305items.Count.ShouldBe(expectedItems.Length, 308expectedItems.Length.ShouldBe(expectedDirectMetadataPerItem.Length); 382for (int actualItemIndex = 0; actualItemIndex < actualItems.Length; actualItemIndex++) 492Assert.Equal(expected.Length, actual.Length); // "Expected array length of <" + expected.Length + "> but was <" + actual.Length + ">."); 495for (int i = 0; i < expected.Length; i++) 1046for (int i = 0; i < files.Length; i++) 1654var result = new string[files.Length]; 1656for (var i = 0; i < files.Length; i++) 1863if (FileSystems.Default.DirectoryExists(directory) && (Directory.GetFileSystemEntries(directory).Length == 0)) 1930string[] temporary = new string[actualLines.Length - 1]; 1932for (int i = 0; i < temporary.Length; i++) 1943for (int i = 0; i < Math.Min(actualLines.Length, expectedLines.Length); i++) 1952if (actualLines.Length == expectedLines.Length && expectedAndActualDontMatch) 1960if (actualLines.Length > expectedLines.Length) 1965Assert.Fail("Expected content was shorter, actual had this extra line: '" + actualLines[expectedLines.Length] + "'"); 1967else if (actualLines.Length < expectedLines.Length) 1972Assert.Fail("Actual content was shorter, expected had this extra line: '" + expectedLines[actualLines.Length] + "'");
TestEnvironment.cs (2)
504int newFilesCount = newFiles.Length; 533Assert.Equal(_originalFiles.Length, newFilesCount);
Microsoft.Build.Utilities.Core (76)
CanonicalError.cs (1)
321if (explodedText.Length > 0)
CommandLineBuilder.cs (10)
404if (fileNames?.Length > 0) 408for (int i = 0; i < fileNames.Length; ++i) 414for (int i = 0; i < fileNames.Length; ++i) 439if (fileItems?.Length > 0) 443for (int i = 0; i < fileItems.Length; ++i) 452for (int i = 0; i < fileItems.Length; ++i) 571if (parameters?.Length > 0) 603if (parameters?.Length > 0) 682if (parameters?.Length > 0) 713if (parameters?.Length > 0)
ErrorUtilities.cs (3)
164if (parameterValue.Length == 0) 617VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 619int arrayCapacity = array.Length - arrayIndex;
EventArgsFormatting.cs (2)
351for (int i = 0; i < lines.Length; i++) 360if (i < (lines.Length - 1))
ExtensionSDK.cs (1)
161if (words.Length > 1 && Version.TryParse(words[1], out Version ver))
FileMatcher.cs (5)
484string[] longParts = new string[parts.Length - startingElement]; 487for (int i = startingElement; i < parts.Length; ++i) 511for (int j = i; j < parts.Length; ++j) 894for (int i = 0; i < excludeNextSteps.Length; i++) 942for (int i = 0; i < excludeNextSteps.Length; i++)
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1144ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1159while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1164if (index == splitBase.Length && index == splitPath.Length) 1177for (int i = index; i < splitBase.Length; i++) 1181for (int i = index; i < splitPath.Length; i++)
FrameworkLocationHelper.cs (2)
838if (directories.Length == 0) 854for (int i = 1; i < directories.Length; ++i)
LockCheck.cs (2)
149private static readonly int RM_SESSION_KEY_LEN = Guid.Empty.ToByteArray().Length; // 16-byte 313res = RmRegisterResources(handle, (uint)resources.Length, resources, 0, null, 0, null);
ResourceUtilities.cs (1)
372if (args?.Length > 0)
TaskItem.cs (2)
197int count = (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 216public int MetadataCount => (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length;
TaskLoggingHelper.cs (3)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 295if (messageArgs?.Length > 0) 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
ToolLocationHelper.cs (10)
1051if (winmdPaths.Length > 0) 1053ErrorUtilities.DebugTraceMessage("GetLegacyTargetPlatformReferences", "Found {0} contract winmds in '{1}'", winmdPaths.Length, winmdLocation); 1138if (winmdPaths.Length > 0) 1140ErrorUtilities.DebugTraceMessage("GetApiContractReferences", "Found {0} contract winmds in '{1}'", winmdPaths.Length, contractPath); 2524ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkName directories under '{1}'", sdkNameDirectories.Length, extensionSdksDirectory.FullName); 2530ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkVersion directories under '{1}'", sdkVersionDirectories.Length, sdkNameFolders.FullName); 2946if (diskRoots?.Length > 0) 2971if (sdkDiskRoots.Count == 0 && diskRoots?.Length > 0) 3028ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Found '{0}' platform identifier directories under '{1}'", platformIdentifiers.Length, platformsRoot); 3034ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Found '{0}' platform version directories under '{1}'", platformVersions.Length, platformIdentifier.FullName);
ToolTask.cs (3)
1359_environmentVariablePairs = new List<KeyValuePair<string, string>>(EnvironmentVariables.Length); 1365if (nameValuePair.Length == 1 || (nameValuePair.Length == 2 && nameValuePair[0].Length == 0))
TrackedDependencies\CanonicalTrackedInputFiles.cs (7)
237Parallel.For(0, _sourceFiles.Length, index => CheckIfSourceNeedsCompilation(sourcesNeedingCompilationList, allOutputFilesExist, _sourceFiles[index])); 241if (SourcesNeedingCompilation.Length == 0) 428bool thereAreFilesToIgnore = filesToIgnore?.Length > 0; 863if (_tlogFiles?.Length > 0) 1032ErrorUtilities.VerifyThrowArgument(source.Length == correspondingOutputs.Length, "Tracking_SourcesAndCorrespondingOutputMismatch"); 1041for (int sourceIndex = 0; sourceIndex < source.Length; sourceIndex++)
TrackedDependencies\CanonicalTrackedOutputFiles.cs (4)
575if (_tlogFiles?.Length > 0) 726ErrorUtilities.VerifyThrowArgument(source.Length == correspondingOutputs.Length, "Tracking_SourcesAndCorrespondingOutputMismatch"); 735for (int sourceIndex = 0; sourceIndex < source.Length; sourceIndex++)
TrackedDependencies\DependencyTableCache.cs (3)
92for (int i = 0; i < tlogFiles.Length; i++) 251TlogFiles = new ITaskItem[tlogFiles.Length]; 255for (int tlogItemCount = 0; tlogItemCount < tlogFiles.Length; tlogItemCount++)
TrackedDependencies\FileTracker.cs (2)
318var rootSources = new List<string>(sources.Length + outputs.Length);
TrackedDependencies\FlatTrackingData.cs (4)
278if (expandedTlogFilesToIgnore.Length > 0) 313if (TlogFiles == null || TlogFiles.Length == 0) 610if (TlogFiles?.Length > 0) 864if (trackedFilesToRemoveFromTLogs?.Length > 0)
TrackedDependencies\TrackedDependencies.cs (2)
34var expanded = new List<ITaskItem>(expand.Length); 77if (files?.Length > 0)
Microsoft.Build.Utilities.UnitTests (10)
TaskItem_Tests.cs (4)
93taskItem.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length); 99taskItem.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length + 1); 173t.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length); 177t.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length + 1);
ToolLocationHelper_Tests.cs (6)
52returnValue.Length.ShouldBe(0); 59returnValue.Length.ShouldBe(0); 69returnValue.Length.ShouldBe(0); 85returnValue.Length.ShouldBe(3); 108returnValue.Length.ShouldBe(1); 4113for (int i = 0; i < rootDirectories.Length; i++)
Microsoft.Cci.Extensions (10)
Dgml\DgmlExtensions.cs (1)
37for (var i = 0; i < nodes.Length; i++)
Differs\IDifferences.cs (2)
28if (args.Length == 0) 40if (args.Length == 0)
Differs\ListMerger.cs (2)
24return Merge<T>(list0, 0, list0.Length, list1, 0, list1.Length);
HostEnvironment.cs (1)
732for (int extIndex = 0; extIndex < s_probingExtensions.Length; extIndex++)
Mappings\ElementMapping.cs (1)
43public int ElementCount { get { return _elements.Length; } }
Writers\CSharp\CSDeclarationWriter.Attributes.cs (1)
200if (parameters.Length > 0)
Writers\CSharp\CSDeclarationWriter.Generics.cs (1)
46if (constraints.Length <= 0)
Writers\Syntax\IndentionSyntaxWriter.cs (1)
29if (args.Length > 0)
Microsoft.CodeAnalysis (338)
Binding\AbstractLookupSymbolsInfo.cs (1)
77if (index < _arities.Length)
CodeGen\BasicBlock.cs (1)
731return (uint)BranchLabels.Length;
CodeGen\ILBuilderEmit.cs (2)
237Debug.Assert(caseLabels.Length > 0); 266Debug.Assert(caseLabels.Length > 0);
CodeGen\SequencePointList.cs (2)
86return _next == null && _points.Length == 0; 93for (int i = 0; i < result.Length; i++)
CodeGen\SwitchIntegralJumpTableEmitter.cs (1)
62Debug.Assert(caseLabels.Length > 0);
CodeGen\SwitchStringJumpTableEmitter.cs (3)
75Debug.Assert(caseLabels.Length > 0); 89Debug.Assert(_keyHash == null || ShouldGenerateHashTableSwitch(_caseLabels.Length)); 188var stringHashMap = new Dictionary<uint, HashBucket>(caseLabels.Length);
CodeGen\TokenMap.cs (2)
69if (items.Length > count) 98Debug.Assert(token < (uint)_count && _count <= _items.Length);
Collections\ArrayElement.cs (4)
39var array = new ArrayElement<T>[items.Length]; 40for (int i = 0; i < items.Length; i++) 56var array = new T[items.Length]; 57for (int i = 0; i < items.Length; i++)
Collections\BitVector.cs (12)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 71for (int i = 0; i < _bits.Length; i++) 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 114for (int i = 0, n = _bits?.Length ?? 0; i < n; i++) 135for (int i = 0; i < _bits.Length; i++) 216if (_bits is null || _bits.Length == 0) 236for (int i = 0; i < _bits.Length; i++) 266int otherLength = other._bits.Length; 268int thisLength = thisBits.Length; 328for (int i = 0; i < other._bits.Length; i++) 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
Collections\ByteSequenceComparer.cs (3)
77if (left == null || right == null || left.Length != right.Length) 82for (var i = 0; i < left.Length; i++)
Collections\IdentifierCollection.Collection.cs (1)
31while (arrayIndex < array.Length && enumerator.MoveNext())
Collections\ImmutableArrayExtensions.cs (1)
775int last = copy.Length - 1;
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
32Debug.Assert(regex.GetGroupNumbers().Length - 1 == numberRangePairs.Length);
CommandLine\CommandLineParser.cs (1)
355if (kv.Length != 2)
CommandLine\CommonCompiler.cs (1)
1756stream.Write(bytes, 0, bytes.Length);
Compilation\Compilation.cs (2)
1039for (int i = 0; i < parts.Length - 1; i++) 1051foreach (INamedTypeSymbol candidate in container.GetTypeMembers(parts[parts.Length - 1]))
Compilation\SyntaxTreeOptionsProvider.cs (1)
61for (int i = 0; i < trees.Length; i++)
CryptographicHashProvider.cs (1)
258Debug.Assert(bits.Length == 4);
CvtRes.cs (2)
112reader.Read(pAdditional.data, 0, pAdditional.data.Length); 265for (int i = 0; i < relocationSymbolIndices.Length; i++)
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
92if (_messageArgs.Length == 0)
Diagnostic\DiagnosticInfo.cs (9)
49AssertExpectedMessageArgumentsLength(messageProvider, errorCode, arguments.Length); 322if (_arguments.Length == 0) 333for (int i = 0; i < _arguments.Length; i++) 361var newArguments = new object[_arguments.Length]; 362Array.Copy(_arguments, newArguments, newArguments.Length); 398for (int i = 0; i < _arguments.Length; i++) 416if (_arguments.Length == other._arguments.Length) 419for (int i = 0; i < _arguments.Length; i++)
Diagnostic\LocalizableResourceString.cs (1)
75(_formatArguments.Length > 0 ? string.Format(resourceString, _formatArguments) : resourceString) :
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1541if (workerTasks.Length > 0 || syntaxTreeActionsTask.Status != TaskStatus.RanToCompletion || additionalFileActionsTask.Status != TaskStatus.RanToCompletion)
DiagnosticAnalyzer\DiagnosticAnalyzerAttribute.cs (2)
37var languages = new string[additionalLanguages.Length + 1]; 39for (int index = 0; index < additionalLanguages.Length; index++)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
777if (symbolParameters.Length != expectedParameters.Length) 782for (int i = 0; i < expectedParameters.Length; ++i)
DiaSymReader\SymUnmanagedFactory.cs (1)
86if (parameters.Length == 1 && parameters[0].ParameterType == typeof(string))
DiaSymReader\Utilities\ComMemoryStream.cs (2)
57bytesToCopy = Math.Min(chunk.Length, remainingBytes); 87bytesToCopy = Math.Min(chunk.Length, remainingBytes);
DiaSymReader\Writer\SymUnmanagedSequencePointsWriter.cs (2)
40if (length > _offsets.Length) 42int newLength = Math.Max(length, (_offsets.Length + 1) * 2);
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (15)
224if (count < 0 || count > startLines.Length || count > startColumns.Length || count > endLines.Length || count > endColumns.Length) 387encodedLength = bytes.Length; 388value = Encoding.UTF8.GetString(bytes, 0, bytes.Length); 547if (metadata.Length == 0) 552if (metadata.Length > CustomMetadataByteLimit) 557metadata.Length, 568symWriter.SetSymAttribute(0, "MD2", metadata.Length, pb); 612if (data.Length == 0) 623symWriter.SetSourceServerData(dataPtr, data.Length); 639if (data.Length == 0) 650symWriter.SetSourceLinkData(dataPtr, data.Length); 761Buffer.BlockCopy(data, 4, guidBytes, 0, guidBytes.Length);
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
182for (int i = 0; i < tableSizes.Length; i++)
Emit\EditAndContinue\EmitBaseline.cs (1)
493for (int i = 0; i < sizes.Length; i++)
Emit\EditAndContinue\EncLocalInfo.cs (1)
23Debug.Assert(signature.Length > 0);
Emit\EditAndContinueMethodDebugInformation.cs (2)
78data.CopyTo(start, left, 0, left.Length); 81data.CopyTo(offset, right, 0, right.Length);
FileSystem\PathUtilities.cs (6)
558if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 566var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 583var remainingParts = directoryPathParts.Length - index; 593for (int i = index; i < fullPathParts.Length; i++)
Hashing\NonCryptographicHashAlgorithm.cs (1)
119int read = stream.Read(buffer, 0, buffer.Length);
InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length); 19if (start + length > array.Length) 21length = array.Length - start; 31T[] newArray = new T[array.Length + 1]; 37if (position < array.Length) 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 48return InsertAt(array, array.Length, item); 53T[] newArray = new T[array.Length + items.Length]; 59if (position < array.Length) 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 70return InsertAt(array, array.Length, items); 80if (position + length > array.Length) 82length = array.Length - position; 85T[] newArray = new T[array.Length - length]; 91if (position < newArray.Length) 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 101T[] newArray = new T[array.Length]; 102Array.Copy(array, newArray, array.Length); 114ReverseContents(array, 0, array.Length); 132var high = array.Length - 1; 165if (first == null || second == null || first.Length != second.Length) 170for (var i = 0; i < first.Length; i++) 191int high = array.Length - 1;
InternalUtilities\ConcurrentLruCache.cs (1)
51: this(array.Length)
InternalUtilities\EnumerableExtensions.cs (1)
327return source.Length == 0;
InternalUtilities\Hash.cs (2)
97var maxSize = Math.Min(maxItemsToHash, values.Length); 206for (int i = 0; i < data.Length; i++)
InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
InternalUtilities\UICultureUtilities.cs (3)
40if (parameters.Length != 1 || parameters[0].ParameterType != typeof(CultureInfo)) 72if ((object?)currentThreadGetter == null || !currentThreadGetter.IsStatic || currentThreadGetter.ContainsGenericParameters || currentThreadGetter.ReturnType != type || currentThreadGetter.GetParameters().Length != 0) 86if (parameters.Length != 1 || parameters[0].ParameterType != typeof(CultureInfo))
InternalUtilities\WeakList.cs (17)
27Debug.Assert(_size == _items.Length); 28Debug.Assert(_items.Length == 0 || _items.Length >= MinimalNonEmptySize); 30int alive = _items.Length; 32for (int i = 0; i < _items.Length; i++) 45if (alive < _items.Length / 4) 51else if (alive >= 3 * _items.Length / 4) 55var newItems = new WeakReference<T>[GetExpandedSize(_items.Length)]; 63Array.Copy(_items, 0, newItems, 0, _items.Length); 64Debug.Assert(_size == _items.Length); 76Debug.Assert(_items.Length > 0 && _size < 3 * _items.Length / 4, "length: " + _items.Length + " size: " + _size); 82var newItems = (newSize == _items.Length) ? _items : new WeakReference<T>[newSize]; 152if (_size == _items.Length) 157Debug.Assert(_size < _items.Length); 211else if (_alive < _weakList._items.Length / 4)
MemberDescriptor.cs (1)
133int count = nameTable.Length;
MetadataReader\MetadataDecoder.cs (9)
1220int paramInfoLength = paramInfo.Length; 1651for (int i = 0; i < positionalArgs.Length; i++) 1664for (int i = 0; i < namedArgs.Length; i++) 1759for (int i = 0; i < result.Length; i++) 2329if ((signature2.Length - additionalParamCount) != signature1.Length) 2342for (int paramIndex1 = compareReturnType ? 0 : 1; paramIndex1 < signature1.Length; paramIndex1++) 2346signature1.Length : 2372if (methodParams.Length != 2)
MetadataReader\MetadataReaderExtensions.cs (1)
28if ((parts.Length == 2) &&
MetadataReader\PEModule.cs (5)
1442Debug.Assert(AttributeDescription.InterpolatedStringHandlerArgumentAttribute.Signatures.Length == 2); 2920for (int i = 0; i < description.Signatures.Length; i++) 2923Debug.Assert(targetSignature.Length >= 3); 2933for (; j < targetSignature.Length; j++) 3007if (sig.RemainingBytes == 0 && j == targetSignature.Length)
MetadataReader\TypeNameDecoder.cs (2)
171for (int i = 0; i < fullName.NestedTypes.Length; i++) 223int count = arguments.Length;
NativePdbWriter\PdbWriter.cs (2)
96if (!emitAllDebugInfo && blob.Length == 0) 149if (blob.Length > 0)
PEWriter\MetadataWriter.cs (1)
493_pseudoStringTokenToTokenMap = new UserStringHandle[_pseudoStringTokenToStringMap.Length];
PEWriter\NativeResourceWriter.cs (2)
282dataWriter.WriteUInt32((uint)data.Length); 355var sectionWriter = new BlobWriter(builder.ReserveBytes(resourceSections.SectionBytes.Length));
PEWriter\PeWriter.cs (1)
324.Where(m => m.Name == "CalculateChecksum" && m.GetParameters().Length == 2)
PEWriter\SigningUtilities.cs (1)
67keySize = privateKey.Value.Modulus!.Length;
RealParser.cs (1)
670for (int i = dataBytes.Length - 1; i >= 0; i--)
ReferenceManager\CommonReferenceManager.Binding.cs (8)
347for (int i = 0; i < referenceBinding.Length; i++) 417Debug.Assert(bindingIndex == bindingsOfAssemblyBeingBuilt.Length); 480var bindingsOfAssemblyBeingBuilt = ArrayBuilder<AssemblyReferenceBinding>.GetInstance(referenceBindingsOfAssemblyBeingBuilt.Length + implicitAssemblies.Count); 492bindingsOfAssemblyBeingBuilt.AddRange(referenceBindingsOfAssemblyBeingBuilt, explicitAssemblyCount - 1, referenceBindingsOfAssemblyBeingBuilt.Length - explicitAssemblyCount + 1); 618Array.Clear(candidateInputAssemblySymbols, 0, candidateInputAssemblySymbols.Length); 711Array.Clear(candidateInputAssemblySymbols, 0, candidateInputAssemblySymbols.Length); 757Array.Clear(candidateInputAssemblySymbols, 0, candidateInputAssemblySymbols.Length); 823Debug.Assert(candidateReferenceBinding.Length == candidateReferencedSymbols.Count);
ReferenceManager\CommonReferenceManager.Resolution.cs (1)
412for (int i = 0; i < referenceMap.Length; i++)
ReferenceManager\CommonReferenceManager.State.cs (2)
619var visitedAssemblies = BitVector.Create(bindingResult.Length); 622Debug.Assert(bindingResult.Length == aliasesOfReferencedAssembliesBuilder.Count + 1);
SourceGeneration\GeneratorAttribute.cs (2)
42var languages = new string[additionalLanguages.Length + 1]; 44for (int index = 0; index < additionalLanguages.Length; index++)
SpecialTypes.cs (3)
91for (i = 1; i < s_emittedNames.Length; i++) 101for (i = 0; i < s_typeIdToTypeCodeMap.Length; i++) 125for (i = 0; i < s_typeCodeToTypeIdMap.Length; i++)
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (2)
156Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 160builder.WriteBytes(0, sizeof(byte) * (DynamicAttributeSize - info.Flags.Length));
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (4)
73if (customDebugInfo.Length < CustomDebugInfoConstants.GlobalHeaderSize) 86while (offset <= customDebugInfo.Length - CustomDebugInfoConstants.RecordHeaderSize) 107if (offset > customDebugInfo.Length - bodySize || alignmentSize > 3 || alignmentSize > bodySize) 866return Encoding.UTF8.GetString(block, 0, block.Length);
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
353if (array.Length < index + Count)
src\Dependencies\Collections\SegmentedArray.cs (6)
61if (length > destinationArray.Length) 493var remainingInSegment = firstSegment.Length - offset; 596var remainingInFirstSegment = firstSegment.Length - firstOffset; 597var remainingInSecondSegment = secondSegment.Length - secondOffset; 735var remainingInSegment = segment.Length - offset; 784var remainingInSegment = segment.Length - offset;
src\Dependencies\Collections\SegmentedArray`1.cs (11)
81for (var i = 0; i < _items.Length - 1; i++) 90var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 92_items[_items.Length - 1] = new T[lastPageSize]; 145for (var i = 0; i < items.Length; i++) 155for (var i = 0; i < _items.Length; i++) 163for (var i = 0; i < _items.Length; i++) 239for (var i = 0; i < _items.Length; i++) 254for (var i = 0; i < _items.Length; i++) 392if (_items.Length == 0) 395if (_nextItemIndex == _items[_nextItemSegment].Length) 397if (_nextItemSegment == _items.Length - 1)
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
363if ((uint)index > (uint)array.Length) 368if (array.Length - index < Count) 868if ((uint)index > (uint)array.Length) 873if (array.Length - index < Count) 1296if (index < 0 || index > array.Length) 1301if (array.Length - index < _dictionary.Count) 1363if ((uint)index > (uint)array.Length) 1368if (array.Length - index < _dictionary.Count) 1504if ((uint)index > array.Length) 1509if (array.Length - index < _dictionary.Count) 1571if ((uint)index > (uint)array.Length) 1576if (array.Length - index < _dictionary.Count)
src\Dependencies\Collections\SegmentedHashSet`1.cs (2)
814if (arrayIndex > array.Length || count > array.Length - arrayIndex)
src\Dependencies\Collections\SegmentedList`1.cs (2)
96if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 153var oldSegmentCount = segments.Length;
src\Dependencies\PooledObjects\ArrayBuilder.cs (2)
42for (var i = 0; i < result.Length; i++) 615Debug.Assert(start + length <= items.Length);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
Symbols\Attributes\AttributeDescription.cs (1)
40return FullName + "(" + Signatures.Length + ")";
Symbols\Attributes\CommonAttributeData.cs (1)
84int attributeCtorsCount = description.Signatures.Length;
Symbols\Attributes\SecurityWellKnownAttributeData.cs (5)
40Debug.Assert(_lazySecurityActions.Length == totalSourceAttributes); 54Debug.Assert(_lazyPathsForPermissionSetFixup.Length == totalSourceAttributes); 65Debug.Assert(_lazyPathsForPermissionSetFixup == null || _lazySecurityActions != null && _lazyPathsForPermissionSetFixup.Length == _lazySecurityActions.Length); 70Debug.Assert(_lazySecurityActions.Length == customAttributes.Length);
Syntax\AbstractWarningStateMap.cs (1)
56Debug.Assert(_warningStateMapEntries != null && _warningStateMapEntries.Length > 0);
Syntax\GreenNode.cs (8)
67if (diagnostics?.Length > 0) 77if (diagnostics?.Length > 0) 87if (annotations?.Length > 0) 102if (annotations?.Length > 0) 582Debug.Assert(annotations.Length != 0, "annotations should be non-empty"); 926for (int i = 0; i < array.Length; i++) 948for (int i = 0; i < array.Length; i++) 1050var length = errorInfos.Length;
Syntax\GreenNodeExtensions.cs (4)
29if (existingAnnotations == null || existingAnnotations.Length == 0) 64if (newAnnotations.Count == existingAnnotations.Length) 79if (annotations == null || existingAnnotations.Length == 0) 118if (current == null || current.Length == 0)
Syntax\InternalSyntax\SyntaxDiagnosticInfoList.cs (4)
77if (diagIndex < diags.Length - 1) 139if (_count >= _stack.Length) 141var tmp = new NodeIteration[_stack.Length * 2]; 142Array.Copy(_stack, tmp, _stack.Length);
Syntax\InternalSyntax\SyntaxList.cs (2)
68return List(nodes, nodes.Length); 88if (children.Length < 10)
Syntax\InternalSyntax\SyntaxList.WithLotsOfChildren.cs (1)
50int n = children.Length;
Syntax\InternalSyntax\SyntaxList.WithManyChildren.cs (4)
31int n = children.Length; 40for (int i = 0; i < children.Length; i++) 48return children.Length; 58Array.Copy(this.children, 0, array, offset, this.children.Length);
Syntax\InternalSyntax\SyntaxListBuilder.cs (3)
69this.AddRange(items, 0, items.Length); 134int currentSize = _nodes.Length; 164for (int i = 0; i < array.Length; i++)
Syntax\InternalSyntax\SyntaxListPool.cs (3)
67if (_freeIndex >= _freeList.Length) 82var tmp = new ArrayElement<SyntaxListBuilder?>[_freeList.Length * 2]; 83Array.Copy(_freeList, tmp, _freeList.Length);
Syntax\SyntaxList.WithManyWeakChildren.cs (1)
31for (int i = 0; i < childOffsets.Length; ++i)
Syntax\SyntaxListBuilder.cs (7)
37if (Count >= _nodes.Length) 39this.Grow(Count == 0 ? 8 : _nodes.Length * 2); 47this.AddRange(items, 0, items.Length); 52if (Count + length > _nodes.Length) 86if (this.Count + count > _nodes.Length) 120if (this.Count + count > _nodes.Length) 151Array.Copy(_nodes, tmp, _nodes.Length);
Syntax\SyntaxNode.cs (1)
1370if (annotations?.Length > 0)
Syntax\SyntaxNode.Iterators.cs (6)
103if (++_stackPtr >= _stack.Length) 123if (_stack?.Length < 256) 125Array.Clear(_stack, 0, _stack.Length); 169if (++_stackPtr >= _stack.Length) 179if (_stack?.Length < 256) 181Array.Clear(_stack, 0, _stack.Length);
Syntax\SyntaxNodeOrTokenListBuilder.cs (4)
62if (_count >= _nodes.Length) 64this.Grow(_count == 0 ? 8 : _nodes.Length * 2); 94if (_count + length > _nodes.Length) 126Array.Copy(_nodes, tmp, _nodes.Length);
Syntax\SyntaxToken.cs (2)
388if (annotations?.Length > 0) 669return diagnostics.Length == 0
Syntax\SyntaxTokenListBuilder.cs (3)
60this.Add(list, 0, list.Length); 76if (requiredSize > _nodes.Length) 85Array.Copy(_nodes, tmp, _nodes.Length);
Syntax\SyntaxTrivia.cs (1)
383if (annotations == null || annotations.Length == 0)
Syntax\SyntaxTriviaListBuilder.cs (5)
74if (_count >= _nodes.Length) 76this.Grow(_count == 0 ? 8 : _nodes.Length * 2); 96if (_count + length > _nodes.Length) 112if (_count + length > _nodes.Length) 124Array.Copy(_nodes, tmp, _nodes.Length);
Text\CompositeText.cs (2)
41for (int i = 0; i < _segmentOffsets.Length; i++) 140if (count < 0 || count > this.Length - sourceIndex || count > destination.Length - destinationIndex)
Text\LargeText.cs (6)
44offset += chunks[i].Length; 111int charsRead = reader.ReadBlock(chunk, 0, chunk.Length); 119if (charsRead < chunk.Length) 168int charsToCopy = Math.Min(chunk.Length - chunkStartOffset, count); 203int charsToWrite = Math.Min(chunk.Length - chunkStartOffset, count); 205if (chunkWriter != null && chunkStartOffset == 0 && charsToWrite == chunk.Length)
Text\LargeTextWriter.cs (11)
44return _buffer != null && chars <= (_buffer.Length - _currentUsed); 49if (_buffer != null && _currentUsed < _buffer.Length) 71var remaining = _buffer!.Length - _currentUsed; 80if (_currentUsed == _buffer.Length) 90if (index < 0 || index >= chars.Length) 95if (count < 0 || count > chars.Length - index) 104var remaining = _buffer!.Length - _currentUsed; 112if (_currentUsed == _buffer.Length) 124if (CanFitInAllocatedBuffer(chunk.Length)) 126this.Write(chunk, 0, chunk.Length); 139if (_currentUsed < _buffer.Length)
Text\SourceText.cs (9)
262if (length < 0 || length > buffer.Length) 562int count = Math.Min(buffer.Length, end - offset); 633Debug.Assert(charBuffer.Length == CharBufferSize); 731int copyLength = Math.Min(buffer.Length, length); 1051var contentLength = Math.Min(length - position, buffer.Length); 1187Debug.Assert(buffer1.Length == buffer2.Length); 1188Debug.Assert(buffer1.Length == CharBufferSize); 1221Debug.Assert(length <= source.Length);
Text\SourceTextStream.cs (2)
127int length = Math.Min(count, preambleBytes.Length); 134int charsToRead = Math.Min(_charBuffer.Length, _source.Length - _sourceOffset);
VersionHelper.cs (6)
67bool hasWildcard = allowWildcard && elements[elements.Length - 1] == "*"; 69if ((hasWildcard && elements.Length < 3) || elements.Length > 4) 76int lastExplicitValue = hasWildcard ? elements.Length - 1 : elements.Length; 140for (int i = lastExplicitValue; i < values.Length; i++)
WellKnownTypes.cs (2)
706for (int i = 0; i < s_metadataNames.Length; i++) 717for (int i = 0; i < s_metadataNames.Length; i++)
Xml\XmlCharType.cs (2)
1142Debug.Assert(startPos + len <= chars.Length); 1143Debug.Assert(startPos <= chars.Length);
Microsoft.CodeAnalysis.CodeStyle (149)
src\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (3)
71Debug.Assert(customTags.Length == tags.Length); 73for (var i = 0; i < tags.Length; i++)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (3)
89if (reformattedCopyrightTextParts.Length != fileHeaderCopyrightTextParts.Length) 95for (var i = 0; i < reformattedCopyrightTextParts.Length; i++)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (5)
58if (messageArgs == null || messageArgs.Length == 0) 232return Encoding.UTF8.GetString(jsonBytes, 0, jsonBytes.Length); 360_formatArguments = new string[formatArguments.Length]; 361for (var i = 0; i < formatArguments.Length; i++) 371? (_formatArguments.Length > 0 ? string.Format(formatProvider, messageFormat, _formatArguments) : messageFormat)
src\Compilers\Core\Portable\Collections\BitVector.cs (12)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 71for (int i = 0; i < _bits.Length; i++) 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 114for (int i = 0, n = _bits?.Length ?? 0; i < n; i++) 135for (int i = 0; i < _bits.Length; i++) 216if (_bits is null || _bits.Length == 0) 236for (int i = 0; i < _bits.Length; i++) 266int otherLength = other._bits.Length; 268int thisLength = thisBits.Length; 328for (int i = 0; i < other._bits.Length; i++) 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (1)
775int last = copy.Length - 1;
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
777if (symbolParameters.Length != expectedParameters.Length) 782for (int i = 0; i < expectedParameters.Length; ++i)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
558if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 566var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 583var remainingParts = directoryPathParts.Length - index; 593for (int i = index; i < fullPathParts.Length; i++)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (2)
119int read = stream.Read(buffer, 0, buffer.Length); 167int read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false);
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length); 19if (start + length > array.Length) 21length = array.Length - start; 31T[] newArray = new T[array.Length + 1]; 37if (position < array.Length) 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 48return InsertAt(array, array.Length, item); 53T[] newArray = new T[array.Length + items.Length]; 59if (position < array.Length) 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 70return InsertAt(array, array.Length, items); 80if (position + length > array.Length) 82length = array.Length - position; 85T[] newArray = new T[array.Length - length]; 91if (position < newArray.Length) 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 101T[] newArray = new T[array.Length]; 102Array.Copy(array, newArray, array.Length); 114ReverseContents(array, 0, array.Length); 132var high = array.Length - 1; 165if (first == null || second == null || first.Length != second.Length) 170for (var i = 0; i < first.Length; i++) 191int high = array.Length - 1;
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (11)
327return source.Length == 0; 910return array.Length != 0 ? 921while (index < source.Length) 923TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 924index += chunk.Length; 949if (size != array.Length) 954if (i >= array.Length) 956arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 968Debug.Assert(local.Length == size); 969for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 975if (i != array.Length)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
97var maxSize = Math.Min(maxItemsToHash, values.Length); 206for (int i = 0; i < data.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
353if (array.Length < index + Count)
src\Dependencies\Collections\SegmentedArray.cs (6)
61if (length > destinationArray.Length) 493var remainingInSegment = firstSegment.Length - offset; 596var remainingInFirstSegment = firstSegment.Length - firstOffset; 597var remainingInSecondSegment = secondSegment.Length - secondOffset; 735var remainingInSegment = segment.Length - offset; 784var remainingInSegment = segment.Length - offset;
src\Dependencies\Collections\SegmentedArray`1.cs (11)
81for (var i = 0; i < _items.Length - 1; i++) 90var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 92_items[_items.Length - 1] = new T[lastPageSize]; 145for (var i = 0; i < items.Length; i++) 155for (var i = 0; i < _items.Length; i++) 163for (var i = 0; i < _items.Length; i++) 239for (var i = 0; i < _items.Length; i++) 254for (var i = 0; i < _items.Length; i++) 392if (_items.Length == 0) 395if (_nextItemIndex == _items[_nextItemSegment].Length) 397if (_nextItemSegment == _items.Length - 1)
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
363if ((uint)index > (uint)array.Length) 368if (array.Length - index < Count) 868if ((uint)index > (uint)array.Length) 873if (array.Length - index < Count) 1296if (index < 0 || index > array.Length) 1301if (array.Length - index < _dictionary.Count) 1363if ((uint)index > (uint)array.Length) 1368if (array.Length - index < _dictionary.Count) 1504if ((uint)index > array.Length) 1509if (array.Length - index < _dictionary.Count) 1571if ((uint)index > (uint)array.Length) 1576if (array.Length - index < _dictionary.Count)
src\Dependencies\Collections\SegmentedHashSet`1.cs (2)
814if (arrayIndex > array.Length || count > array.Length - arrayIndex)
src\Dependencies\Collections\SegmentedList`1.cs (2)
96if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 153var oldSegmentCount = segments.Length;
src\Dependencies\PooledObjects\ArrayBuilder.cs (2)
42for (var i = 0; i < result.Length; i++) 615Debug.Assert(start + length <= items.Length);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
666=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
692if (trivia.Length == 0) 726if (trivia.Length == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
117if (trivia.Length == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
184Contract.ThrowIfFalse(lines.Length > 0); 188if (0 < lines.Length - 1) 194for (var i = 1; i < lines.Length; i++) 205if (i < lines.Length - 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
118where nameSplit.Length == 3
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
274WriteArrayLength(array.Length); 354for (var offset = 0; offset < spanLength; offset += buffer.Length) 356var segmentLength = Math.Min(buffer.Length, spanLength - offset); 489Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
199var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (8)
101_wordSpans = new TextSpan[distinctValues.Length]; 104for (var i = 0; i < distinctValues.Length; i++) 117_builderNodes = new BuilderNode[distinctValues.Length]; 118_compactEdges = new Edge[distinctValues.Length * CompactEdgeAllocationSize]; 123for (var i = 0; i < _wordSpans.Length; i++) 128var nodes = ImmutableArray.CreateBuilder<Node>(_builderNodes.Length); 132var edges = ImmutableArray.CreateBuilder<Edge>(Math.Max(0, _builderNodes.Length - 1)); 142for (var i = 0; i < _builderNodes.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (6)
23=> CreateReadableStream(bytes, bytes.Length); 81for (long c = 0; c < chunks.Length; c++) 218Read(this.chunks, 0, this.length, array, 0, array.Length); 232var copyCount = Math.Min(chunk.Length, count); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
58if (taskArray.Length == 0) 62for (var i = 0; i < taskArray.Length; i++) 73var result = new T[taskArray.Length]; 74for (var i = 0; i < taskArray.Length; i++)
Microsoft.CodeAnalysis.CodeStyle.Fixes (8)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
60if (typeArguments.Length == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (4)
32Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 33Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
13=> array == null || array.Length == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
446if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\FileExtensionsMetadata.cs (1)
25if (extensions?.Length == 0)
Microsoft.CodeAnalysis.Collections.Package (34)
ImmutableSegmentedHashSet`1.cs (1)
353if (array.Length < index + Count)
SegmentedArray.cs (6)
61if (length > destinationArray.Length) 493var remainingInSegment = firstSegment.Length - offset; 596var remainingInFirstSegment = firstSegment.Length - firstOffset; 597var remainingInSecondSegment = secondSegment.Length - secondOffset; 735var remainingInSegment = segment.Length - offset; 784var remainingInSegment = segment.Length - offset;
SegmentedArray`1.cs (11)
81for (var i = 0; i < _items.Length - 1; i++) 90var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 92_items[_items.Length - 1] = new T[lastPageSize]; 145for (var i = 0; i < items.Length; i++) 155for (var i = 0; i < _items.Length; i++) 163for (var i = 0; i < _items.Length; i++) 239for (var i = 0; i < _items.Length; i++) 254for (var i = 0; i < _items.Length; i++) 392if (_items.Length == 0) 395if (_nextItemIndex == _items[_nextItemSegment].Length) 397if (_nextItemSegment == _items.Length - 1)
SegmentedDictionary`2.cs (12)
363if ((uint)index > (uint)array.Length) 368if (array.Length - index < Count) 868if ((uint)index > (uint)array.Length) 873if (array.Length - index < Count) 1296if (index < 0 || index > array.Length) 1301if (array.Length - index < _dictionary.Count) 1363if ((uint)index > (uint)array.Length) 1368if (array.Length - index < _dictionary.Count) 1504if ((uint)index > array.Length) 1509if (array.Length - index < _dictionary.Count) 1571if ((uint)index > (uint)array.Length) 1576if (array.Length - index < _dictionary.Count)
SegmentedHashSet`1.cs (2)
814if (arrayIndex > array.Length || count > array.Length - arrayIndex)
SegmentedList`1.cs (2)
96if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 153var oldSegmentCount = segments.Length;
Microsoft.CodeAnalysis.CSharp (102)
Binder\Binder.cs (2)
944if (lines.Length == 1) 951var last = lines[lines.Length - 1].Trim();
Binder\Binder_Expressions.cs (1)
9368Debug.Assert(convertedArguments.Length == 1);
Binder\Semantics\Operators\UnaryOperatorEasyOut.cs (1)
92var result = (kindIndex >= s_opkind.Length) ? UnaryOperatorKind.Error : s_opkind[kindIndex][index];
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
3271var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_fixedResults.Length);
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (1)
34Debug.Assert(parameters == null || parameters.Length == length);
CodeGen\EmitStatement.cs (2)
1257Debug.Assert(switchCaseLabels.Length > 0); 1493if (SwitchStringJumpTableEmitter.ShouldGenerateHashTableSwitch(switchCaseLabels.Length))
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
51for (int j = 1; j < identifiers.Length; j++)
Compilation\CSharpCompilerDiagnosticAnalyzer.cs (1)
24var builder = ArrayBuilder<int>.GetInstance(errorCodes.Length);
Compiler\DocumentationCommentCompiler.cs (1)
775int numLines = lines.Length;
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (2)
379if (loadedElements != null && loadedElements.Length > 0) 387if (result.Length > 0)
CSharpExtensions.cs (1)
279var builder = new SyntaxTokenListBuilder(list.Count + items.Length);
Declarations\DeclarationTreeBuilder.cs (1)
346for (int i = fullName.Length - 2; i >= 0; i--)
Emitter\EditAndContinue\CSharpDefinitionMap.cs (1)
181for (int i = 0; i < result.Length; i++)
Emitter\Model\PEModuleBuilder.cs (1)
1225for (int i = 0; i < @params.Length; i++)
Emitter\NoPia\EmbeddedTypesManager.cs (1)
49for (int i = 0; i < _lazyWellKnownTypeMethods.Length; i++)
FlowAnalysis\NullableWalker.cs (3)
7964Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length); 7966var elementsBuilder = ArrayBuilder<BoundNode>.GetInstance(collectionExpressionVisitResults.Length); 7967for (int i = 0; i < collectionExpressionVisitResults.Length; i++)
Lowering\LocalRewriter\LocalRewriter_Call.cs (7)
1109if (expanded && TryOptimizeParamsArray(actualArguments[actualArguments.Length - 1], out optimized)) 1111actualArguments[actualArguments.Length - 1] = optimized; 1313Debug.Assert(refKinds.Count == arguments.Length); 1507for (int a = 0; a < arguments.Length; ++a) 1570for (int s = 0; s < sideeffects.Length; s++) 1607Debug.Assert(actualArguments.Length == parameters.Length); 1612var argsCount = actualArguments.Length;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (3)
347if (expanded && actualArguments[actualArguments.Length - 1] is { IsParamsArrayOrCollection: true } array) 360actualArguments[actualArguments.Length - 1] = boundTemp; 789for (int i = 0; i < boundTempIndices.Length; i++)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (4)
741WellKnownTypes.GetWellKnownActionDelegate(invokeArgumentCount: delegateSignature.Length) : 742WellKnownTypes.GetWellKnownFunctionDelegate(invokeArgumentCount: delegateSignature.Length - 1); 784int parameterCount = delegateSignature.Length - (returnsVoid ? 0 : 1); 924if (j < result.Length)
Lowering\SyntheticBoundNodeFactory.cs (3)
733var ctor = type.InstanceConstructors.Single(c => c.ParameterCount == args.Length); 998for (int i = 0; i < parts.Length - 1; i++) 1006var lastExpression = parts[parts.Length - 1];
Parser\LanguageParser_InterpolatedString.cs (2)
478Debug.Assert(infos.Length > 0); 479var builder = ArrayBuilder<DiagnosticInfo>.GetInstance(infos.Length);
Parser\Lexer.cs (3)
1292if (_identLen >= _identBuffer.Length) 1302var tmp = new char[_identBuffer.Length * 2]; 1303Array.Copy(_identBuffer, tmp, _identBuffer.Length);
Parser\SlidingTextWindow.cs (4)
183int amountToRead = Math.Min(_text.Length, position + _characterWindow.Length) - position; 221if (_characterWindowCount >= _characterWindow.Length) 225char[] newWindow = new char[_characterWindow.Length * 2]; 232_characterWindow.Length - _characterWindowCount);
Parser\SyntaxParser.cs (13)
95if (blendedTokens.Length < 4096) 97Array.Clear(blendedTokens, 0, blendedTokens.Length); 301if (_tokenOffset >= _blendedTokens.Length) 371if (_tokenCount >= _blendedTokens.Length) 383if (_tokenCount >= _lexedTokens.Length) 401if (_tokenOffset > (_blendedTokens.Length >> 1) 420Array.Resize(ref _blendedTokens, _blendedTokens.Length * 2); 429if (_tokenOffset > (_lexedTokens.Length >> 1) 448Array.Resize(ref _lexedTokens, _lexedTokens.Length * 2); 457if (lexedTokens.Length == CachedTokenArraySize) 744int existingLength = existingDiags.Length; 751DiagnosticInfo[] result = new DiagnosticInfo[existingDiags.Length + diagnostics.Length];
Symbols\AssemblySymbol.cs (6)
698Debug.Assert(parts.Length > 0); 710for (int i = 1; i < parts.Length; i++) 830Debug.Assert(typeArgumentIndex == genericArguments.Length); 840forcedArity: typeInfo.GenericTypeArguments.Length); 854Debug.Assert(typeArgumentIndex == genericArguments.Length); 861int remainingTypeArguments = typeArguments.Length - currentTypeArgument;
Symbols\Attributes\SourceAttributeData.cs (1)
275for (int signatureByteIndex = 3; signatureByteIndex < targetSignature.Length; signatureByteIndex++)
Symbols\Compilation_WellKnownMembers.cs (1)
90for (int i = 0; i < wellKnownTypeMembers.Length; i++)
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
218int numParams = targetParamInfo.Length - 1; //don't count return type
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
846int count = paramInfo.Length - 1;
Symbols\Metadata\PE\PEPropertySymbol.cs (5)
855var lastPropertyParamIndex = propertyParams.Length - 1; 891if (propertyParams.Length < 2) 896var numAccessorParams = accessorParams.Length; 898var parameters = new ParameterSymbol[propertyParams.Length - 1]; 899for (int i = 1; i < propertyParams.Length; i++) // from 1 to skip property/return type
Symbols\MetadataOrSourceAssemblySymbol.cs (1)
196for (int i = 0; i < specialTypeMembers.Length; i++)
Symbols\PublicModel\Symbol.cs (1)
21var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Length);
Symbols\ReferenceManager.cs (3)
399Debug.Assert(bindingResult.Length == allAssemblyData.Length); 424for (int i = 1; i < bindingResult.Length; i++) 687Debug.Assert(newIndex == filteredReferencedAssemblies.Length);
Symbols\Source\IndexedTypeParameterSymbol.cs (7)
48if (index >= s_parameterPool.Length) 59while (count > initialPool.Length) 64Array.Copy(initialPool, newPool, initialPool.Length); 66for (int i = initialPool.Length; i < newPool.Length; i++) 87if (count > s_parameterPool.Length) 104if (count > s_parameterPool.Length)
Symbols\Source\SourceNamespaceSymbol.cs (2)
303Array.Clear(memberOfArity, 0, memberOfArity.Length); 311if (arity >= memberOfArity.Length)
Symbols\TypeSymbolExtensions.cs (1)
558for (int i = 0; i < names.Length; i++)
Syntax\CSharpPragmaWarningStateMap.cs (1)
150for (int i = 1; i < entries.Length - 1; ++i)
Syntax\InternalSyntax\SyntaxFirstTokenReplacer.cs (2)
62if (oldDiagnostics == null || oldDiagnostics.Length == 0) 67var numDiagnostics = oldDiagnostics.Length;
Syntax\SyntaxNodeRemover.cs (2)
29if (nodeArray.Length == 0) 73for (int i = 1; i < nodes.Length; i++)
Syntax\SyntaxTreeDiagnosticEnumerator.cs (4)
51if (diagIndex < diags.Length - 1) 171if (_count >= _stack.Length) 173var tmp = new NodeIteration[_stack.Length * 2]; 174Array.Copy(_stack, tmp, _stack.Length);
Utilities\InterceptableLocation.cs (2)
136if (bytes.Length < minLength) 147displayFileName = s_encoding.GetString(bytes, index: displayNameIndex, count: bytes.Length - displayNameIndex);
Utilities\ValueSetFactory.NumericValueSet.cs (1)
302for (int i = 0, n = values.Length; i < n; i += 2)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
85var arrayLengthProperty = TryGetNoArgInt32Property(arrayType, nameof(Array.Length));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
473for (var i = 0; i < originalSwitchLabels.Length; i++)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
304for (var i = 0; i < names.Length; i++)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (9)
CommandLineTests.cs (9)
720Assert.Equal(4, resolvedSourceFiles.Length); 725Assert.Equal(4, resolvedSourceFiles.Length); 8740stream.Write(buffer, 0, buffer.Length); 8747stream.Write(buffer, 0, buffer.Length); 8781stream.Read(buffer, 0, buffer.Length); 8783for (int i = 0; i < buffer.Length; i++) 9360for (int i = 0; i < compileDiagnostics.Length; i++) 14380Assert.Equal(2, touchedFiles.Length); 14383Assert.Equal(2, writtenText.Length);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (14)
CodeActions\SyncNamespace\CSharpSyncNamespaceTestsBase.cs (1)
45if (folder == null || folder.Length == 0)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
866var builder = ArrayBuilder<DiagnosticDescriptor>.GetInstance(reportedIds.Length); 920var builder = ArrayBuilder<SuppressionDescriptor>.GetInstance(reportedIds.Length);
Formatting\CodeCleanupTests.cs (1)
643Assert.Equal(numberOfUnsupportedDiagnosticIds, unsupportedDiagnosticIds.Length);
Intents\IntentTestsBase.cs (1)
86Assert.Equal(expectedTexts.Length, actualDocumentTexts.Count);
LineSeparators\LineSeparatorTests.cs (1)
605Assert.Equal(tokenIndices.Length, spans.Count());
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
214var preprocessorSymbolsAttribute = preprocessorSymbols?.Length > 0 283for (var i = 0; i < sources.Length; i++)
QuickInfo\SemanticQuickInfoSourceTests.cs (3)
71if (expectedResults.Length == 0) 129if (expectedResults.Length == 0) 281if (expectedResults.Length == 0)
SymbolKey\SymbolKeyCompilationsTests.cs (2)
290Assert.Equal(3, originalSymbols.Length); 311Assert.Equal(3, originalSymbols.Length);
SymbolKey\SymbolKeyTests.cs (1)
84Assert.Equal(2, members.Length);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
347for (var i = regexes.Length - 2; i >= 0; i--)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (37)
CodeGen\CodeGenDeconstructTests.cs (4)
3656Assert.Equal(count, nameRef.Length); 6032Assert.Equal(4, discards.Length); 6085Assert.Equal(4, discards.Length); 6134Assert.Equal(4, discards.Length);
CodeGen\CodeGenFunctionPointersTests.cs (3)
3341Assert.Equal(2, addressOfs.Length); 7519Assert.Equal(2, functionPointerSyntaxes.Length); 10806Assert.Equal(2, lambdas.Length);
CodeGen\CodeGenLocalFunctionTests.cs (1)
6315for (var i = 0; i < usings.Length; i++)
CodeGen\CodeGenTupleTest.cs (3)
13982Assert.Equal(5, typeofNodes.Length); 13983for (int i = 0; i < typeofNodes.Length; i++) 24182Assert.Equal(4, nodes.Length);
CodeGen\IndexAndRangeTests.cs (1)
3858Assert.Equal(2, receivers.Length);
Emit\CompilationEmitTests.cs (19)
220Assert.True(mdOnlyImage.Length > 0, "no metadata emitted"); 243Assert.True(output.ToArray().Length > 0, "no metadata emitted"); 278Assert.True(mdOnlyImage.Length > 0, "no metadata emitted"); 324Assert.True(mdOnlyImage.Length > 0, "no metadata emitted"); 377Assert.True(mdOnlyImage.Length > 0, "no metadata emitted"); 431Assert.True(mdOnlyImage.Length > 0, "no metadata emitted"); 484Assert.True(mdOnlyImage.Length > 0, "no metadata emitted"); 533Assert.True(mdOnlyImage.Length > 0, "no metadata emitted"); 2714Assert.True(dllImage.Length > 0, "no metadata emitted"); 3883for (int i = 0; i < System.Math.Max(expectedGlobalMembers.Length, actualGlobalMembers.Length); i++) 3905for (int i = 0; i < System.Math.Max(expectedAMembers.Length, actualAMembers.Length); i++) 3913for (int i = 0; i < System.Math.Max(expectedBMembers.Length, actualBMembers.Length); i++) 5102for (int i = 0; i < pattern.Length; i++) 5116int end = buffer.Length - pattern.Length; 5145Assert.Equal(bytes.Length, stream.Read(bytes, 0, bytes.Length));
Emit\DynamicAnalysis\DynamicAnalysisResourceTests.cs (1)
1052ArrayBuilder<string> expectedSpanSpellings = ArrayBuilder<string>.GetInstance(expected.Length);
Emit\EmitMetadataTests.cs (4)
2308peStream.Read(importAddressTableDirectoryBytes, 0, importAddressTableDirectoryBytes.Length); 2321peStream.Read(importTableDirectoryBytes, 0, importTableDirectoryBytes.Length); 2348peStream.Read(startupStub, 0, startupStub.Length); 2406Marshal.Copy((IntPtr)relocBlock.Pointer, relocBytes, 0, relocBytes.Length);
src\Compilers\Core\MSBuildTask\MvidReader.cs (1)
100if (name!.Length == 8 && name[0] == '.' &&
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (9)
Emit\EditAndContinue\EditAndContinueTestBase.cs (1)
254for (int i = 0; i < diffs.Length; i++)
Emit\EditAndContinue\SymbolMatcherTests.cs (1)
95for (int j = 0; j < tasks.Length; j++)
Emit\NumericIntPtrTests.cs (4)
6249if (expectedDiagnostics.Length == 0) 6625if (expectedDiagnostics.Length == 0) 6857if (expectedDiagnostics.Length == 0) 8130if (expectedDiagnostics.Length == 0)
PDB\CSharpDeterministicBuildCompilationTests.cs (2)
87Assert.Equal(debugDocumentsCount ?? syntaxTrees.Length, pdbReader.Documents.Count); 89VerifyCompilationOptions(compilationOptions, originalCompilation, emitOptions, compilationOptionsReader, langVersion, syntaxTrees.Length);
src\Compilers\Core\MSBuildTask\MvidReader.cs (1)
100if (name!.Length == 8 && name[0] == '.' &&
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2222)
Attributes\AttributeTests.cs (4)
2886Assert.Equal(3, parameters.Length); 2900Assert.Equal(2, parameters.Length); 2910Assert.Equal(5, parameters.Length); 2927Assert.Equal(3, parameters.Length);
Attributes\AttributeTests_Assembly.cs (4)
2129Assert.Equal(1, list.Length); 2161Assert.Equal(1, list.Length); 2191Assert.Equal(1, list.Length); 2223Assert.Equal(1, list.Length);
Attributes\AttributeTests_Dynamic.cs (1)
544Assert.Equal(expectedTransformFlags.Length, actualTransformFlags.Length);
Attributes\AttributeTests_MarshalAs.cs (2)
768{ "SafeArray9", new byte[] { 0x1d, 0x24, (byte)arrayAqn.Length }.Append(arrayAqn) }, 769{ "SafeArray10", new byte[] { 0x1d, 0x24, (byte)openGenericAqn.Length }.Append(openGenericAqn) },
Attributes\AttributeTests_Nullable.cs (1)
4223Assert.Equal(position, expectedNow.Length);
Attributes\AttributeTests_Synthesized.cs (13)
670Assert.Equal(15, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute. 691Assert.Equal(2, equals.Length); 699Assert.Equal(2, ctor.Length); 740Assert.Equal(11, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute. 758Assert.Equal(2, equals.Length); 803Assert.Equal(17, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute. 833Assert.Equal(2, equals.Length); 841Assert.Equal(2, ctor.Length); 876Assert.Equal(14, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute. 882Assert.Equal(2, ctor.Length); 910Assert.Equal(2, equals.Length); 943Assert.Equal(7, record.GetMembers().Length); // If a new record member is added, extend the test with its behavior regarding CompilerGeneratedAttribute. 961Assert.Equal(2, equals.Length);
Attributes\AttributeTests_Tuples.cs (2)
885Assert.Equal(tupleNames.Length, argsReader.ReadInt32()); 982Assert.Equal(tupleNames.Length, argsReader.ReadInt32());
Attributes\AttributeTests_WellKnownAttributes.cs (3)
2430Assert.Equal(2, ps.Length); 2718Assert.Equal(2, methodDefs.Length); // M, ctor 2928Assert.Equal(cases.Length, metadataReader.GetTableRowCount(TableIndex.ImplMap));
Diagnostics\CompilationEventTests.cs (1)
58if (unexpected || expected.Count != 0 || expectedEvents.Length != actual.Count)
Diagnostics\DiagnosticAnalyzerTests.cs (21)
324Assert.Equal(diags.Length, effectiveDiags.Length); 340Assert.Equal(0, effectiveDiags.Length); 352Assert.Equal(diags.Length, effectiveDiags.Length); 402Assert.Equal(4, effectiveDiags.Length); 407Assert.Equal(4, effectiveDiags.Length); 413Assert.Equal(4, effectiveDiags.Length); 420Assert.Equal(4, effectiveDiags.Length); 427Assert.Equal(4, effectiveDiags.Length); 434Assert.Equal(2, effectiveDiags.Length); 454Assert.Equal(1, effectiveDiags.Length); 465Assert.Equal(1, effectiveDiags.Length); 1492for (var i = 0; i < autoGeneratedPrefixes.Length; i++) 2766for (int i = 0; i < expectedFlowGraphs.Length; i++) 2992var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 2993for (int i = 0; i < symbolKinds.Length; i++) 3086var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3087for (int i = 0; i < symbolKinds.Length; i++) 3146var analyzers = new DiagnosticAnalyzer[symbolKinds.Length]; 3147for (int i = 0; i < symbolKinds.Length; i++)
FlowAnalysis\FlowDiagnosticTests.cs (3)
1868Assert.Equal(1, bindingDiags.Length); 1872Assert.Equal(bindingDiags.Length, emitDiags.Length);
OverloadResolutionPriorityTests.cs (2)
760Assert.Equal(2, accesses.Length); 2495Assert.Equal(2, symbols.Length);
RefStructInterfacesTests.cs (1)
21245Assert.Equal(2, localFunctions.Length);
Semantics\CollectionExpressionTests.cs (4)
202Assert.Equal(3, collections.Length); 237Assert.Equal(3, collections.Length); 15147Assert.Equal(12, collections.Length); 20760if (missingMembers.Length == 0)
Semantics\OutVarTests.cs (1074)
827Assert.Equal(count, nameRef.Length); 1888Assert.Equal(1, x1Decl.Length); 1889Assert.Equal(1, x1Ref.Length); 2017Assert.Equal(2, x5Decl.Length); 2023Assert.Equal(2, x6Decl.Length); 2024Assert.Equal(2, x6Ref.Length); 2030Assert.Equal(3, x7Ref.Length); 2127Assert.Equal(2, x5Decl.Length); 2133Assert.Equal(2, x6Decl.Length); 2134Assert.Equal(2, x6Ref.Length); 2140Assert.Equal(3, x7Ref.Length); 2238Assert.Equal(2, x5Decl.Length); 2244Assert.Equal(2, x6Decl.Length); 2245Assert.Equal(2, x6Ref.Length); 2251Assert.Equal(3, x7Ref.Length); 2348Assert.Equal(2, x5Decl.Length); 2354Assert.Equal(2, x6Decl.Length); 2355Assert.Equal(2, x6Ref.Length); 2361Assert.Equal(3, x7Ref.Length); 2642Assert.Equal(2, x1Ref.Length); 2647Assert.Equal(3, x4Ref.Length); 2653Assert.Equal(2, x6Ref.Length); 2658Assert.Equal(2, x7Ref.Length); 2664Assert.Equal(3, x8Ref.Length); 2670Assert.Equal(2, x9Decl.Length); 2671Assert.Equal(4, x9Ref.Length); 2676Assert.Equal(2, y10Ref.Length); 2682Assert.Equal(2, x14Decl.Length); 2683Assert.Equal(2, x14Ref.Length); 2689Assert.Equal(2, x15Ref.Length); 2859Assert.Equal(2, x1Ref.Length); 2864Assert.Equal(3, x4Ref.Length); 2870Assert.Equal(2, x6Ref.Length); 2875Assert.Equal(2, x7Ref.Length); 2881Assert.Equal(3, x8Ref.Length); 2887Assert.Equal(2, x9Decl.Length); 2888Assert.Equal(4, x9Ref.Length); 2893Assert.Equal(2, y10Ref.Length); 2899Assert.Equal(2, x14Decl.Length); 2900Assert.Equal(2, x14Ref.Length); 2906Assert.Equal(2, x15Ref.Length); 2954Assert.Equal(2, x1Ref.Length); 3214Assert.Equal(2, x5Decl.Length); 3220Assert.Equal(2, x6Decl.Length); 3221Assert.Equal(2, x6Ref.Length); 3227Assert.Equal(3, x7Ref.Length); 3316Assert.Equal(2, x5Decl.Length); 3322Assert.Equal(2, x6Decl.Length); 3323Assert.Equal(2, x6Ref.Length); 3329Assert.Equal(3, x7Ref.Length); 3380Assert.Equal(2, x1Ref.Length); 3432Assert.Equal(2, x1Ref.Length); 3656Assert.Equal(2, x5Decl.Length); 3869Assert.Equal(2, x1Ref.Length); 3874Assert.Equal(2, x2Ref.Length); 3879Assert.Equal(3, x4Ref.Length); 3885Assert.Equal(2, x6Ref.Length); 3890Assert.Equal(2, x7Ref.Length); 3896Assert.Equal(3, x8Ref.Length); 3902Assert.Equal(2, x9Decl.Length); 3903Assert.Equal(4, x9Ref.Length); 3908Assert.Equal(2, y10Ref.Length); 3917Assert.Equal(2, x14Decl.Length); 3918Assert.Equal(2, x14Ref.Length); 4011Assert.Equal(1, x1Ref.Length); 4057Assert.Equal(1, x1Decl.Length); 4058Assert.Equal(1, x1Ref.Length); 4101Assert.Equal(1, x1Ref.Length); 4152Assert.Equal(2, x1Decl.Length); 4153Assert.Equal(2, x1Ref.Length); 4212Assert.Equal(1, x1Decl.Length); 4213Assert.Equal(2, x1Ref.Length); 4286Assert.Equal(2, x5Decl.Length); 4292Assert.Equal(2, x6Decl.Length); 4293Assert.Equal(2, x6Ref.Length); 4299Assert.Equal(3, x7Ref.Length); 4512Assert.Equal(2, x5Decl.Length); 4518Assert.Equal(2, x6Decl.Length); 4519Assert.Equal(2, x6Ref.Length); 4525Assert.Equal(3, x7Ref.Length); 4532Assert.Equal(2, x11Ref.Length); 4538Assert.Equal(2, x12Ref.Length); 4688Assert.Equal(2, x5Decl.Length); 4694Assert.Equal(2, x6Decl.Length); 4695Assert.Equal(2, x6Ref.Length); 4701Assert.Equal(3, x7Ref.Length); 4921Assert.Equal(3, x1Decl.Length); 4922Assert.Equal(3, x1Ref.Length); 4937Assert.Equal(2, x4Ref.Length); 4944Assert.Equal(2, x5Ref.Length); 4949Assert.Equal(2, x8Decl.Length); 4950Assert.Equal(2, x8Ref.Length); 4951for (int i = 0; i < x8Decl.Length; i++) 4967Assert.Equal(2, x11Ref.Length); 4972Assert.Equal(2, x12Ref.Length); 5023Assert.Equal(2, x1Decl.Length); 5024Assert.Equal(2, x1Ref.Length); 5070Assert.Equal(1, x1Decl.Length); 5071Assert.Equal(1, x1Ref.Length); 5117Assert.Equal(1, x1Ref.Length); 5193Assert.Equal(2, x5Decl.Length); 5199Assert.Equal(2, x6Decl.Length); 5200Assert.Equal(2, x6Ref.Length); 5206Assert.Equal(3, x7Ref.Length); 5296Assert.Equal(2, x5Decl.Length); 5302Assert.Equal(2, x6Decl.Length); 5303Assert.Equal(2, x6Ref.Length); 5309Assert.Equal(2, x7Ref.Length); 5423Assert.Equal(2, x5Decl.Length); 5429Assert.Equal(2, x6Decl.Length); 5430Assert.Equal(2, x6Ref.Length); 5436Assert.Equal(3, x7Ref.Length); 5525Assert.Equal(4, x5Ref.Length); 5753Assert.Equal(2, x1Ref.Length); 5914Assert.Equal(2, x1Ref.Length); 5919Assert.Equal(2, x2Ref.Length); 5924Assert.Equal(3, x4Ref.Length); 5930Assert.Equal(2, x6Ref.Length); 5935Assert.Equal(2, x7Ref.Length); 5941Assert.Equal(3, x8Ref.Length); 5947Assert.Equal(2, x9Decl.Length); 5948Assert.Equal(4, x9Ref.Length); 5953Assert.Equal(2, y10Ref.Length); 5962Assert.Equal(2, x14Decl.Length); 5963Assert.Equal(2, x14Ref.Length); 6055Assert.Equal(2, x1Ref.Length); 6062Assert.Equal(2, x2Ref.Length); 6067Assert.Equal(2, x3Ref.Length); 6074Assert.Equal(2, x4Decl.Length); 6075Assert.Equal(3, x4Ref.Length); 6332Assert.Equal(2, x1Ref.Length); 6337Assert.Equal(2, x2Ref.Length); 6342Assert.Equal(3, x4Ref.Length); 6348Assert.Equal(2, x6Ref.Length); 6353Assert.Equal(2, x7Ref.Length); 6359Assert.Equal(3, x8Ref.Length); 6365Assert.Equal(2, x9Decl.Length); 6366Assert.Equal(4, x9Ref.Length); 6371Assert.Equal(2, y10Ref.Length); 6380Assert.Equal(2, x14Decl.Length); 6381Assert.Equal(2, x14Ref.Length); 6567Assert.Equal(2, x1Ref.Length); 6572Assert.Equal(2, x2Ref.Length); 6577Assert.Equal(3, x4Ref.Length); 6583Assert.Equal(2, x6Ref.Length); 6588Assert.Equal(2, x7Ref.Length); 6594Assert.Equal(3, x8Ref.Length); 6600Assert.Equal(2, x9Decl.Length); 6601Assert.Equal(4, x9Ref.Length); 6606Assert.Equal(2, y10Ref.Length); 6615Assert.Equal(2, x14Decl.Length); 6616Assert.Equal(2, x14Ref.Length); 6823Assert.Equal(2, x1Ref.Length); 6829Assert.Equal(2, x2Ref.Length); 6835Assert.Equal(3, x4Ref.Length); 6842Assert.Equal(2, x6Ref.Length); 6848Assert.Equal(2, x7Ref.Length); 6854Assert.Equal(3, x8Ref.Length); 6861Assert.Equal(2, x9Decl.Length); 6862Assert.Equal(4, x9Ref.Length); 6869Assert.Equal(2, y10Ref.Length); 6878Assert.Equal(2, x14Decl.Length); 6879Assert.Equal(2, x14Ref.Length); 7069Assert.Equal(2, x1Ref.Length); 7074Assert.Equal(2, x2Ref.Length); 7079Assert.Equal(3, x4Ref.Length); 7085Assert.Equal(2, x6Ref.Length); 7090Assert.Equal(2, x7Ref.Length); 7096Assert.Equal(3, x8Ref.Length); 7102Assert.Equal(2, x9Decl.Length); 7103Assert.Equal(4, x9Ref.Length); 7108Assert.Equal(2, y10Ref.Length); 7117Assert.Equal(2, x14Decl.Length); 7118Assert.Equal(2, x14Ref.Length); 7307Assert.Equal(2, x1Ref.Length); 7312Assert.Equal(2, x2Ref.Length); 7317Assert.Equal(3, x4Ref.Length); 7323Assert.Equal(2, x6Ref.Length); 7328Assert.Equal(2, x7Ref.Length); 7334Assert.Equal(3, x8Ref.Length); 7340Assert.Equal(2, x9Decl.Length); 7341Assert.Equal(4, x9Ref.Length); 7346Assert.Equal(2, y10Ref.Length); 7355Assert.Equal(2, x14Decl.Length); 7356Assert.Equal(2, x14Ref.Length); 7660Assert.Equal(4, x8Decl.Length); 7661Assert.Equal(4, x8Ref.Length); 7669Assert.Equal(3, x9Decl.Length); 7670Assert.Equal(4, x9Ref.Length); 7677Assert.Equal(3, x10Decl.Length); 7678Assert.Equal(4, x10Ref.Length); 7686Assert.Equal(3, x11Decl.Length); 7687Assert.Equal(4, x11Ref.Length); 7695Assert.Equal(2, x12Decl.Length); 7696Assert.Equal(4, x12Ref.Length); 7703Assert.Equal(2, x13Decl.Length); 7704Assert.Equal(4, x13Ref.Length); 7712Assert.Equal(2, x14Decl.Length); 7713Assert.Equal(4, x14Ref.Length); 7721Assert.Equal(4, x15Ref.Length); 7778Assert.Equal(2, x1Ref.Length); 7783Assert.Equal(2, x2Decl.Length); 7784Assert.Equal(2, x2Ref.Length); 7838Assert.Equal(2, x0Ref.Length); 7843Assert.Equal(2, x1Ref.Length); 7848Assert.Equal(2, x2Ref.Length); 7900Assert.Equal(2, x0Ref.Length); 7905Assert.Equal(2, x1Ref.Length); 7910Assert.Equal(2, x2Ref.Length); 7966Assert.Equal(1, x0Decl.Length); 7967Assert.Equal(4, x0Ref.Length); 7972Assert.Equal(1, x1Decl.Length); 7973Assert.Equal(2, x1Ref.Length); 8030Assert.Equal(1, x0Decl.Length); 8031Assert.Equal(4, x0Ref.Length); 8036Assert.Equal(1, x1Decl.Length); 8037Assert.Equal(2, x1Ref.Length); 8097Assert.Equal(1, x0Decl.Length); 8098Assert.Equal(5, x0Ref.Length); 8103Assert.Equal(1, x1Decl.Length); 8104Assert.Equal(3, x1Ref.Length); 8159Assert.Equal(1, x1Decl.Length); 8160Assert.Equal(2, x1Ref.Length); 8214Assert.Equal(1, x1Decl.Length); 8215Assert.Equal(2, x1Ref.Length); 8392Assert.Equal(2, x1Ref.Length); 8397Assert.Equal(2, x2Ref.Length); 8402Assert.Equal(3, x4Ref.Length); 8408Assert.Equal(2, x6Ref.Length); 8413Assert.Equal(2, x7Ref.Length); 8419Assert.Equal(3, x8Ref.Length); 8425Assert.Equal(2, x9Decl.Length); 8426Assert.Equal(4, x9Ref.Length); 8431Assert.Equal(2, y10Ref.Length); 8440Assert.Equal(2, x14Decl.Length); 8441Assert.Equal(2, x14Ref.Length); 8447Assert.Equal(2, x15Ref.Length); 8492Assert.Equal(2, x1Ref.Length); 8664Assert.Equal(2, x1Ref.Length); 8669Assert.Equal(2, x2Ref.Length); 8674Assert.Equal(2, x3Ref.Length); 8680Assert.Equal(2, x4Ref.Length); 8691Assert.Equal(2, x6Ref.Length); 8696Assert.Equal(2, x7Ref.Length); 8702Assert.Equal(2, x8Ref.Length); 8707Assert.Equal(2, x9Decl.Length); 8708Assert.Equal(2, x9Ref.Length); 8713Assert.Equal(2, y10Ref.Length); 8811Assert.Equal(1, x1Ref.Length); 8874Assert.Equal(1, x1Decl.Length); 8875Assert.Equal(4, x1Ref.Length); 8924Assert.Equal(2, x1Decl.Length); 8925Assert.Equal(2, x1Ref.Length); 9174Assert.Equal(2, x5Decl.Length); 9180Assert.Equal(2, x6Decl.Length); 9181Assert.Equal(2, x6Ref.Length); 9187Assert.Equal(5, x7Ref.Length); 9196Assert.Equal(2, x8Ref.Length); 9201Assert.Equal(2, x9Decl.Length); 9202Assert.Equal(2, x9Ref.Length); 9208Assert.Equal(2, x10Decl.Length); 9209Assert.Equal(2, x10Ref.Length); 9215Assert.Equal(3, x11Ref.Length); 9222Assert.Equal(3, x12Ref.Length); 9343Assert.Equal(2, x4Ref.Length); 9354Assert.Equal(2, x8Ref.Length); 9359Assert.Equal(2, x14Decl.Length); 9436Assert.Equal(2, x4Ref.Length); 9447Assert.Equal(2, x8Ref.Length); 9452Assert.Equal(2, x14Decl.Length); 9512Assert.Equal(2, x1Ref.Length); 9519Assert.Equal(2, x2Ref.Length); 9588Assert.Equal(3, x1Ref.Length); 9593Assert.Equal(2, x2Decl.Length); 9594Assert.Equal(2, x2Ref.Length); 9600Assert.Equal(2, x3Ref.Length); 9605Assert.Equal(2, x4Ref.Length); 9650Assert.Equal(1, x1Ref.Length); 9698Assert.Equal(2, x1Ref.Length); 9763Assert.Equal(1, x1Decl.Length); 9764Assert.Equal(2, x1Ref.Length); 9820Assert.Equal(1, x1Decl.Length); 9821Assert.Equal(1, x1Ref.Length); 9899Assert.Equal(2, x4Ref.Length); 9910Assert.Equal(2, x8Ref.Length); 9915Assert.Equal(2, x14Decl.Length); 9994Assert.Equal(2, x4Ref.Length); 10005Assert.Equal(2, x8Ref.Length); 10010Assert.Equal(2, x14Decl.Length); 10072Assert.Equal(2, x1Ref.Length); 10079Assert.Equal(2, x2Ref.Length); 10153Assert.Equal(3, x1Ref.Length); 10161Assert.Equal(2, x2Decl.Length); 10162Assert.Equal(2, x2Ref.Length); 10168Assert.Equal(2, x3Ref.Length); 10173Assert.Equal(2, x4Ref.Length); 10218Assert.Equal(1, x1Ref.Length); 10265Assert.Equal(2, x1Ref.Length); 10332Assert.Equal(1, x1Decl.Length); 10333Assert.Equal(2, x1Ref.Length); 10391Assert.Equal(1, x1Decl.Length); 10392Assert.Equal(2, x1Ref.Length); 10463Assert.Equal(1, x1Decl.Length); 10464Assert.Equal(2, x1Ref.Length); 10469Assert.Equal(1, x2Decl.Length); 10470Assert.Equal(2, x2Ref.Length); 10475Assert.Equal(1, x3Decl.Length); 10476Assert.Equal(2, x3Ref.Length); 10547Assert.Equal(1, x1Decl.Length); 10548Assert.Equal(2, x1Ref.Length); 10553Assert.Equal(1, x2Decl.Length); 10554Assert.Equal(2, x2Ref.Length); 10559Assert.Equal(1, x3Decl.Length); 10560Assert.Equal(2, x3Ref.Length); 10725Assert.Equal(2, x1Ref.Length); 10730Assert.Equal(2, x2Ref.Length); 10735Assert.Equal(3, x4Ref.Length); 10743Assert.Equal(2, x6Ref.Length); 10748Assert.Equal(2, x7Ref.Length); 10754Assert.Equal(3, x8Ref.Length); 10759Assert.Equal(2, x9Decl.Length); 10760Assert.Equal(4, x9Ref.Length); 10765Assert.Equal(2, y10Ref.Length); 10774Assert.Equal(2, x14Decl.Length); 10775Assert.Equal(2, x14Ref.Length); 10867Assert.Equal(1, x1Ref.Length); 10913Assert.Equal(1, x1Decl.Length); 10914Assert.Equal(3, x1Ref.Length); 10963Assert.Equal(2, x1Decl.Length); 10964Assert.Equal(2, x1Ref.Length); 11059Assert.Equal(2, x5Decl.Length); 11065Assert.Equal(2, x6Decl.Length); 11066Assert.Equal(2, x6Ref.Length); 11072Assert.Equal(3, x7Ref.Length); 11196Assert.Equal(2, x5Decl.Length); 11202Assert.Equal(2, x6Decl.Length); 11203Assert.Equal(2, x6Ref.Length); 11209Assert.Equal(3, x7Ref.Length); 11278Assert.Equal(2, x5Decl.Length); 11284Assert.Equal(2, x6Decl.Length); 11285Assert.Equal(2, x6Ref.Length); 11291Assert.Equal(3, x7Ref.Length); 11472Assert.Equal(2, x1Ref.Length); 11720Assert.Equal(4, y1Ref.Length); 11725Assert.Equal(3, y2Ref.Length); 11730Assert.Equal(4, z2Ref.Length); 11737Assert.Equal(3, y3Ref.Length); 11742Assert.Equal(3, z3Ref.Length); 11749Assert.Equal(5, y4Ref.Length); 11754Assert.Equal(6, z4Ref.Length); 11759Assert.Equal(4, u4Ref.Length); 11767Assert.Equal(4, v4Ref.Length); 11775Assert.Equal(5, y5Ref.Length); 11780Assert.Equal(6, z5Ref.Length); 11785Assert.Equal(4, u5Ref.Length); 11793Assert.Equal(4, v5Ref.Length); 11801Assert.Equal(3, y6Ref.Length); 11806Assert.Equal(3, z6Ref.Length); 11813Assert.Equal(4, y7Ref.Length); 11818Assert.Equal(4, z7Ref.Length); 11826Assert.Equal(4, u7Ref.Length); 11834Assert.Equal(2, y8Ref.Length); 11839Assert.Equal(2, z8Ref.Length); 11845Assert.Equal(3, y9Ref.Length); 11850Assert.Equal(3, z9Ref.Length); 11857Assert.Equal(3, u9Ref.Length); 11864Assert.Equal(2, y10Ref.Length); 11870Assert.Equal(2, y11Ref.Length); 11977Assert.Equal(5, y4Ref.Length); 11982Assert.Equal(6, z4Ref.Length); 11987Assert.Equal(4, u4Ref.Length); 11995Assert.Equal(4, v4Ref.Length); 12003Assert.Equal(5, y5Ref.Length); 12008Assert.Equal(6, z5Ref.Length); 12013Assert.Equal(4, u5Ref.Length); 12021Assert.Equal(4, v5Ref.Length); 12132Assert.Equal(3, yRef.Length); 12282Assert.Equal(2, yDecl.Length); 12283Assert.Equal(2, yRef.Length); 12357Assert.Equal(2, yDecl.Length); 12358Assert.Equal(2, yRef.Length); 12666Assert.Equal(i == 10 ? 1 : 2, yRef.Length); 12783Assert.Equal(2, y1Decl.Length); 12788Assert.Equal(2, y2Decl.Length); 13022Assert.Equal(2, x1Ref.Length); 13206Assert.Equal(3, x1Decl.Length); 13207Assert.Equal(3, x1Ref.Length); 13222Assert.Equal(2, x4Ref.Length); 13229Assert.Equal(2, x5Ref.Length); 13234Assert.Equal(2, x8Decl.Length); 13235Assert.Equal(2, x8Ref.Length); 13249Assert.Equal(2, x11Ref.Length); 13254Assert.Equal(2, x12Ref.Length); 13300Assert.Equal(1, x1Decl.Length); 13301Assert.Equal(1, x1Ref.Length); 13347Assert.Equal(1, x1Ref.Length); 13390Assert.Equal(1, x1Decl.Length); 13391Assert.Equal(1, x1Ref.Length); 13444Assert.Equal(2, x2Decl.Length); 13445Assert.Equal(2, x2Ref.Length); 13610Assert.Equal(3, x1Ref.Length); 13615Assert.Equal(3, x4Ref.Length); 13623Assert.Equal(2, x5Ref.Length); 13628Assert.Equal(3, x6Ref.Length); 13633Assert.Equal(2, x7Ref.Length); 13639Assert.Equal(2, x9Decl.Length); 13640Assert.Equal(4, x9Ref.Length); 13645Assert.Equal(2, y10Ref.Length); 13651Assert.Equal(2, x14Decl.Length); 13652Assert.Equal(2, x14Ref.Length); 13746Assert.Equal(1, x1Ref.Length); 13801Assert.Equal(1, x1Decl.Length); 13802Assert.Equal(3, x1Ref.Length); 13851Assert.Equal(2, x1Decl.Length); 13852Assert.Equal(2, x1Ref.Length); 14132Assert.Equal(3, x1Decl.Length); 14133Assert.Equal(6, x1Ref.Length); 14134for (int i = 0; i < x1Decl.Length; i++) 14141Assert.Equal(2, x2Ref.Length); 14146Assert.Equal(2, x3Ref.Length); 14151Assert.Equal(4, x4Ref.Length); 14158Assert.Equal(3, x5Ref.Length); 14164Assert.Equal(2, x8Decl.Length); 14165Assert.Equal(3, x8Ref.Length); 14166for (int i = 0; i < x8Ref.Length; i++) 14174Assert.Equal(6, x9Ref.Length); 14183Assert.Equal(5, x11Ref.Length); 14191Assert.Equal(5, x12Ref.Length); 14199Assert.Equal(2, x13Decl.Length); 14200Assert.Equal(5, x13Ref.Length); 14206Assert.Equal(2, x14Decl.Length); 14207Assert.Equal(4, x14Ref.Length); 14213Assert.Equal(2, x15Decl.Length); 14214Assert.Equal(3, x15Ref.Length); 14215for (int i = 0; i < x15Ref.Length; i++) 14947Assert.Equal(3, x8Ref.Length); 14948for (int i = 0; i < x8Ref.Length; i++) 14956Assert.Equal(5, x13Ref.Length); 14963Assert.Equal(4, x14Ref.Length); 14972Assert.Equal(3, x16Ref.Length); 14973for (int i = 0; i < x16Ref.Length; i++) 14981Assert.Equal(3, x17Ref.Length); 15127Assert.Equal(3, x1Decl.Length); 15128Assert.Equal(3, x1Ref.Length); 15143Assert.Equal(2, x4Ref.Length); 15150Assert.Equal(2, x5Ref.Length); 15155Assert.Equal(2, x8Decl.Length); 15156Assert.Equal(2, x8Ref.Length); 15170Assert.Equal(2, x11Ref.Length); 15175Assert.Equal(2, x12Ref.Length); 15220Assert.Equal(1, x1Decl.Length); 15221Assert.Equal(1, x1Ref.Length); 15267Assert.Equal(1, x1Ref.Length); 15316Assert.Equal(1, x2Decl.Length); 15317Assert.Equal(1, x2Ref.Length); 15374Assert.Equal(2, x2Decl.Length); 15375Assert.Equal(2, x2Ref.Length); 15535Assert.Equal(2, x1Ref.Length); 15540Assert.Equal(2, x2Ref.Length); 15545Assert.Equal(3, x4Ref.Length); 15551Assert.Equal(2, x6Ref.Length); 15556Assert.Equal(2, x7Ref.Length); 15562Assert.Equal(3, x8Ref.Length); 15568Assert.Equal(2, x9Decl.Length); 15569Assert.Equal(4, x9Ref.Length); 15578Assert.Equal(2, y10Ref.Length); 15587Assert.Equal(2, x14Decl.Length); 15588Assert.Equal(2, x14Ref.Length); 15748Assert.Equal(2, x1Ref.Length); 15753Assert.Equal(2, x2Ref.Length); 15758Assert.Equal(3, x4Ref.Length); 15764Assert.Equal(2, x6Ref.Length); 15769Assert.Equal(2, x7Ref.Length); 15775Assert.Equal(3, x8Ref.Length); 15781Assert.Equal(2, x9Decl.Length); 15782Assert.Equal(4, x9Ref.Length); 15791Assert.Equal(2, y10Ref.Length); 15800Assert.Equal(2, x14Decl.Length); 15801Assert.Equal(2, x14Ref.Length); 15961Assert.Equal(2, x1Ref.Length); 15966Assert.Equal(2, x2Ref.Length); 15971Assert.Equal(3, x4Ref.Length); 15977Assert.Equal(2, x6Ref.Length); 15982Assert.Equal(2, x7Ref.Length); 15988Assert.Equal(3, x8Ref.Length); 15994Assert.Equal(2, x9Decl.Length); 15995Assert.Equal(4, x9Ref.Length); 16004Assert.Equal(2, y10Ref.Length); 16013Assert.Equal(2, x14Decl.Length); 16014Assert.Equal(2, x14Ref.Length); 16076Assert.Equal(2, x1Ref.Length); 16083Assert.Equal(2, x2Ref.Length); 16163Assert.Equal(3, x1Ref.Length); 16168Assert.Equal(2, x2Decl.Length); 16169Assert.Equal(3, x2Ref.Length); 16175Assert.Equal(3, x3Ref.Length); 16180Assert.Equal(3, x4Ref.Length); 16404Assert.Equal(2, x1Ref.Length); 16409Assert.Equal(2, x2Ref.Length); 16414Assert.Equal(3, x4Ref.Length); 16420Assert.Equal(2, x6Ref.Length); 16425Assert.Equal(2, x7Ref.Length); 16431Assert.Equal(3, x8Ref.Length); 16437Assert.Equal(2, x9Decl.Length); 16438Assert.Equal(4, x9Ref.Length); 16443Assert.Equal(2, y10Ref.Length); 16452Assert.Equal(2, x14Decl.Length); 16453Assert.Equal(2, x14Ref.Length); 16545Assert.Equal(1, x1Ref.Length); 16593Assert.Equal(1, x1Decl.Length); 16594Assert.Equal(2, x1Ref.Length); 16647Assert.Equal(2, x1Decl.Length); 16648Assert.Equal(2, x1Ref.Length); 16707Assert.Equal(1, x1Decl.Length); 16708Assert.Equal(2, x1Ref.Length); 16767Assert.Equal(1, x1Decl.Length); 16768Assert.Equal(2, x1Ref.Length); 16830Assert.Equal(1, x1Decl.Length); 16831Assert.Equal(3, x1Ref.Length); 16964Assert.Equal(3, x1Decl.Length); 16965Assert.Equal(3, x1Ref.Length); 16980Assert.Equal(2, x4Ref.Length); 16987Assert.Equal(2, x5Ref.Length); 16992Assert.Equal(2, x8Decl.Length); 16993Assert.Equal(2, x8Ref.Length); 16994for (int i = 0; i < x8Decl.Length; i++) 17006Assert.Equal(2, x11Ref.Length); 17011Assert.Equal(2, x12Ref.Length); 17104Assert.Equal(1, x1Ref.Length); 17153Assert.Equal(1, x1Decl.Length); 17154Assert.Equal(2, x1Ref.Length); 17207Assert.Equal(2, x1Decl.Length); 17208Assert.Equal(2, x1Ref.Length); 17391Assert.Equal(3, x1Decl.Length); 17392Assert.Equal(3, x1Ref.Length); 17407Assert.Equal(2, x4Ref.Length); 17414Assert.Equal(2, x5Ref.Length); 17419Assert.Equal(2, x8Decl.Length); 17420Assert.Equal(2, x8Ref.Length); 17421for (int i = 0; i < x8Decl.Length; i++) 17437Assert.Equal(2, x11Ref.Length); 17442Assert.Equal(2, x12Ref.Length); 17493Assert.Equal(1, x1Decl.Length); 17494Assert.Equal(1, x1Ref.Length); 17540Assert.Equal(1, x1Ref.Length); 17594Assert.Equal(1, x1Decl.Length); 17595Assert.Equal(2, x1Ref.Length); 17647Assert.Equal(1, x1Decl.Length); 17648Assert.Equal(1, x1Ref.Length); 18784Assert.Equal(2, x1Ref.Length); 18828Assert.Equal(2, x1Ref.Length); 19016Assert.Equal(2, x1Ref.Length); 19061Assert.Equal(2, x1Ref.Length); 19104Assert.Equal(2, x1Ref.Length); 19158Assert.Equal(3, x1Ref.Length); 19207Assert.Equal(3, x1Ref.Length); 19254Assert.Equal(3, x1Ref.Length); 20051Assert.Equal(3, yRef.Length); 20361Assert.Equal(1, x1Ref.Length); 20367Assert.Equal(1, x2Ref.Length); 20373Assert.Equal(1, x3Ref.Length); 20379Assert.Equal(1, x4Ref.Length); 20927Assert.Equal(2, x4Ref.Length); 20940Assert.Equal(2, x8Ref.Length); 20946Assert.Equal(2, x14Decl.Length); 21038Assert.Equal(2, x1Ref.Length); 21046Assert.Equal(2, x2Ref.Length); 21054Assert.Equal(2, x2Ref.Length); 21133Assert.Equal(3, x1Ref.Length); 21139Assert.Equal(2, x2Decl.Length); 21140Assert.Equal(2, x2Ref.Length); 21147Assert.Equal(2, x3Ref.Length); 21153Assert.Equal(2, x4Ref.Length); 21237Assert.Equal(3, x1Ref.Length); 21243Assert.Equal(2, x2Decl.Length); 21244Assert.Equal(2, x2Ref.Length); 21251Assert.Equal(2, x3Ref.Length); 21257Assert.Equal(2, x4Ref.Length); 21303Assert.Equal(1, x1Ref.Length); 21362Assert.Equal(2, x1Ref.Length); 21613Assert.Equal(2, x1Ref.Length); 21619Assert.Equal(2, x2Ref.Length); 21625Assert.Equal(3, x4Ref.Length); 21632Assert.Equal(2, x6Ref.Length); 21638Assert.Equal(2, x7Ref.Length); 21645Assert.Equal(3, x8Ref.Length); 21652Assert.Equal(2, x9Decl.Length); 21653Assert.Equal(4, x9Ref.Length); 21659Assert.Equal(2, y10Ref.Length); 21668Assert.Equal(2, x14Decl.Length); 21669Assert.Equal(2, x14Ref.Length); 21784Assert.Equal(4, x8Decl.Length); 21785Assert.Equal(4, x8Ref.Length); 21795Assert.Equal(3, x9Decl.Length); 21796Assert.Equal(4, x9Ref.Length); 21968Assert.Equal(2, x1Ref.Length); 21974Assert.Equal(2, x2Ref.Length); 21980Assert.Equal(3, x4Ref.Length); 21987Assert.Equal(2, x6Ref.Length); 21993Assert.Equal(2, x7Ref.Length); 22000Assert.Equal(3, x8Ref.Length); 22007Assert.Equal(2, x9Decl.Length); 22008Assert.Equal(4, x9Ref.Length); 22019Assert.Equal(2, y10Ref.Length); 22028Assert.Equal(2, x14Decl.Length); 22029Assert.Equal(2, x14Ref.Length); 22095Assert.Equal(2, x1Ref.Length); 22104Assert.Equal(2, x2Ref.Length); 22193Assert.Equal(3, x1Ref.Length); 22199Assert.Equal(2, x2Decl.Length); 22200Assert.Equal(3, x2Ref.Length); 22207Assert.Equal(3, x3Ref.Length); 22213Assert.Equal(3, x4Ref.Length); 22381Assert.Equal(2, x1Ref.Length); 22387Assert.Equal(2, x2Ref.Length); 22393Assert.Equal(3, x4Ref.Length); 22400Assert.Equal(2, x6Ref.Length); 22406Assert.Equal(2, x7Ref.Length); 22413Assert.Equal(3, x8Ref.Length); 22420Assert.Equal(2, x9Decl.Length); 22421Assert.Equal(4, x9Ref.Length); 22427Assert.Equal(2, y10Ref.Length); 22436Assert.Equal(2, x14Decl.Length); 22437Assert.Equal(2, x14Ref.Length); 22536Assert.Equal(2, x1Ref.Length); 22544Assert.Equal(2, x2Ref.Length); 22550Assert.Equal(2, x3Ref.Length); 22558Assert.Equal(2, x4Decl.Length); 22559Assert.Equal(3, x4Ref.Length); 22625Assert.Equal(2, x5Decl.Length); 22632Assert.Equal(2, x6Decl.Length); 22633Assert.Equal(2, x6Ref.Length); 22640Assert.Equal(3, x7Ref.Length); 22748Assert.Equal(2, x5Decl.Length); 22755Assert.Equal(2, x6Decl.Length); 22756Assert.Equal(2, x6Ref.Length); 22763Assert.Equal(3, x7Ref.Length); 22830Assert.Equal(2, x5Decl.Length); 22837Assert.Equal(2, x6Decl.Length); 22838Assert.Equal(2, x6Ref.Length); 22845Assert.Equal(3, x7Ref.Length); 22914Assert.Equal(2, x5Decl.Length); 22921Assert.Equal(2, x6Decl.Length); 22922Assert.Equal(2, x6Ref.Length); 22929Assert.Equal(3, x7Ref.Length); 23166Assert.Equal(2, x1Ref.Length); 23171Assert.Equal(3, x4Ref.Length); 23177Assert.Equal(2, x6Ref.Length); 23182Assert.Equal(2, x7Ref.Length); 23188Assert.Equal(3, x8Ref.Length); 23194Assert.Equal(2, x9Decl.Length); 23195Assert.Equal(4, x9Ref.Length); 23200Assert.Equal(2, y10Ref.Length); 23206Assert.Equal(2, x14Decl.Length); 23207Assert.Equal(2, x14Ref.Length); 23213Assert.Equal(2, x15Ref.Length); 23260Assert.Equal(2, x1Ref.Length); 23265Assert.Equal(3, x4Ref.Length); 23271Assert.Equal(2, x6Ref.Length); 23276Assert.Equal(2, x7Ref.Length); 23282Assert.Equal(3, x8Ref.Length); 23288Assert.Equal(2, x9Decl.Length); 23289Assert.Equal(4, x9Ref.Length); 23294Assert.Equal(2, y10Ref.Length); 23300Assert.Equal(2, x14Decl.Length); 23301Assert.Equal(2, x14Ref.Length); 23307Assert.Equal(2, x15Ref.Length); 23350Assert.Equal(2, x1Ref.Length); 23398Assert.Equal(1, x1Ref.Length); 23431Assert.Equal(1, x1Ref.Length); 23482Assert.Equal(2, x1Ref.Length); 23626Assert.Equal(2, x1Ref.Length); 23631Assert.Equal(2, x2Ref.Length); 23636Assert.Equal(3, x4Ref.Length); 23642Assert.Equal(2, x6Ref.Length); 23647Assert.Equal(2, x7Ref.Length); 23653Assert.Equal(3, x8Ref.Length); 23659Assert.Equal(2, x9Decl.Length); 23660Assert.Equal(4, x9Ref.Length); 23665Assert.Equal(2, y10Ref.Length); 23674Assert.Equal(2, x14Decl.Length); 23675Assert.Equal(2, x14Ref.Length); 23724Assert.Equal(2, x1Ref.Length); 23729Assert.Equal(2, x2Ref.Length); 23734Assert.Equal(3, x4Ref.Length); 23740Assert.Equal(2, x6Ref.Length); 23745Assert.Equal(2, x7Ref.Length); 23751Assert.Equal(3, x8Ref.Length); 23757Assert.Equal(2, x9Decl.Length); 23758Assert.Equal(4, x9Ref.Length); 23763Assert.Equal(2, y10Ref.Length); 23772Assert.Equal(2, x14Decl.Length); 23773Assert.Equal(2, x14Ref.Length); 23822Assert.Equal(2, x0Ref.Length); 23827Assert.Equal(2, x1Ref.Length); 23832Assert.Equal(2, x2Ref.Length); 23964Assert.Equal(2, x1Ref.Length); 23969Assert.Equal(2, x2Ref.Length); 23974Assert.Equal(3, x4Ref.Length); 23980Assert.Equal(2, x6Ref.Length); 23985Assert.Equal(2, x7Ref.Length); 23991Assert.Equal(3, x8Ref.Length); 23997Assert.Equal(2, x9Decl.Length); 23998Assert.Equal(4, x9Ref.Length); 24003Assert.Equal(2, y10Ref.Length); 24012Assert.Equal(2, x14Decl.Length); 24013Assert.Equal(2, x14Ref.Length); 24019Assert.Equal(2, x15Ref.Length); 24068Assert.Equal(2, x1Ref.Length); 24073Assert.Equal(2, x2Ref.Length); 24078Assert.Equal(3, x4Ref.Length); 24084Assert.Equal(2, x6Ref.Length); 24089Assert.Equal(2, x7Ref.Length); 24095Assert.Equal(3, x8Ref.Length); 24101Assert.Equal(2, x9Decl.Length); 24102Assert.Equal(4, x9Ref.Length); 24107Assert.Equal(2, y10Ref.Length); 24116Assert.Equal(2, x14Decl.Length); 24117Assert.Equal(2, x14Ref.Length); 24123Assert.Equal(2, x15Ref.Length); 24163Assert.Equal(2, x1Ref.Length); 24259Assert.Equal(2, x5Decl.Length); 24265Assert.Equal(2, x6Decl.Length); 24266Assert.Equal(2, x6Ref.Length); 24272Assert.Equal(5, x7Ref.Length); 24281Assert.Equal(2, x8Ref.Length); 24286Assert.Equal(2, x9Decl.Length); 24287Assert.Equal(2, x9Ref.Length); 24293Assert.Equal(2, x10Decl.Length); 24294Assert.Equal(2, x10Ref.Length); 24300Assert.Equal(3, x11Ref.Length); 24307Assert.Equal(3, x12Ref.Length); 24365Assert.Equal(2, x5Decl.Length); 24371Assert.Equal(2, x6Decl.Length); 24372Assert.Equal(2, x6Ref.Length); 24378Assert.Equal(5, x7Ref.Length); 24387Assert.Equal(2, x8Ref.Length); 24392Assert.Equal(2, x9Decl.Length); 24393Assert.Equal(2, x9Ref.Length); 24399Assert.Equal(2, x10Decl.Length); 24400Assert.Equal(2, x10Ref.Length); 24406Assert.Equal(3, x11Ref.Length); 24413Assert.Equal(3, x12Ref.Length); 24683Assert.Equal(4, y1Ref.Length); 24688Assert.Equal(3, y2Ref.Length); 24693Assert.Equal(4, z2Ref.Length); 24700Assert.Equal(3, y3Ref.Length); 24705Assert.Equal(3, z3Ref.Length); 24712Assert.Equal(5, y4Ref.Length); 24717Assert.Equal(6, z4Ref.Length); 24722Assert.Equal(4, u4Ref.Length); 24730Assert.Equal(4, v4Ref.Length); 24738Assert.Equal(5, y5Ref.Length); 24743Assert.Equal(6, z5Ref.Length); 24748Assert.Equal(4, u5Ref.Length); 24756Assert.Equal(4, v5Ref.Length); 24764Assert.Equal(3, y6Ref.Length); 24769Assert.Equal(3, z6Ref.Length); 24776Assert.Equal(4, y7Ref.Length); 24781Assert.Equal(4, z7Ref.Length); 24789Assert.Equal(4, u7Ref.Length); 24797Assert.Equal(2, y8Ref.Length); 24802Assert.Equal(2, z8Ref.Length); 24808Assert.Equal(3, y9Ref.Length); 24813Assert.Equal(3, z9Ref.Length); 24820Assert.Equal(3, u9Ref.Length); 24827Assert.Equal(2, y10Ref.Length); 24833Assert.Equal(2, y11Ref.Length); 24942Assert.Equal(4, y1Ref.Length); 24947Assert.Equal(3, y2Ref.Length); 24952Assert.Equal(4, z2Ref.Length); 24959Assert.Equal(3, y3Ref.Length); 24964Assert.Equal(3, z3Ref.Length); 24971Assert.Equal(5, y4Ref.Length); 24976Assert.Equal(6, z4Ref.Length); 24981Assert.Equal(4, u4Ref.Length); 24989Assert.Equal(4, v4Ref.Length); 24997Assert.Equal(5, y5Ref.Length); 25002Assert.Equal(6, z5Ref.Length); 25007Assert.Equal(4, u5Ref.Length); 25015Assert.Equal(4, v5Ref.Length); 25023Assert.Equal(3, y6Ref.Length); 25028Assert.Equal(3, z6Ref.Length); 25035Assert.Equal(4, y7Ref.Length); 25040Assert.Equal(4, z7Ref.Length); 25048Assert.Equal(4, u7Ref.Length); 25056Assert.Equal(2, y8Ref.Length); 25061Assert.Equal(2, z8Ref.Length); 25067Assert.Equal(3, y9Ref.Length); 25072Assert.Equal(3, z9Ref.Length); 25079Assert.Equal(3, u9Ref.Length); 25086Assert.Equal(2, y10Ref.Length); 25092Assert.Equal(2, y11Ref.Length); 25246Assert.Equal(2, x1Ref.Length); 25251Assert.Equal(2, x2Ref.Length); 25256Assert.Equal(3, x4Ref.Length); 25262Assert.Equal(2, x6Ref.Length); 25267Assert.Equal(2, x7Ref.Length); 25273Assert.Equal(3, x8Ref.Length); 25279Assert.Equal(2, x9Decl.Length); 25280Assert.Equal(4, x9Ref.Length); 25289Assert.Equal(2, y10Ref.Length); 25298Assert.Equal(2, x14Decl.Length); 25299Assert.Equal(2, x14Ref.Length); 25345Assert.Equal(2, x1Ref.Length); 25350Assert.Equal(2, x2Ref.Length); 25355Assert.Equal(3, x4Ref.Length); 25361Assert.Equal(2, x6Ref.Length); 25366Assert.Equal(2, x7Ref.Length); 25372Assert.Equal(3, x8Ref.Length); 25378Assert.Equal(2, x9Decl.Length); 25379Assert.Equal(4, x9Ref.Length); 25388Assert.Equal(2, y10Ref.Length); 25397Assert.Equal(2, x14Decl.Length); 25398Assert.Equal(2, x14Ref.Length); 25524Assert.Equal(2, x1Ref.Length); 25537Assert.Equal(2, x4Decl.Length); 25568Assert.Equal(2, x1Ref.Length); 25582Assert.Equal(2, x4Decl.Length); 25649Assert.Equal(2, x1Ref.Length); 25662Assert.Equal(2, x4Decl.Length); 25693Assert.Equal(2, x1Ref.Length); 25707Assert.Equal(2, x4Decl.Length); 25748Assert.Equal(2, x1Ref.Length); 25829Assert.Equal(2, x1Ref.Length); 25842Assert.Equal(2, x4Decl.Length); 25848Assert.Equal(2, x5Decl.Length); 25849Assert.Equal(3, x5Ref.Length); 25889Assert.Equal(2, x1Ref.Length); 25903Assert.Equal(2, x4Decl.Length); 25909Assert.Equal(2, x5Decl.Length); 25910Assert.Equal(3, x5Ref.Length); 25986Assert.Equal(2, x1Ref.Length); 25999Assert.Equal(2, x4Decl.Length); 26005Assert.Equal(2, x5Decl.Length); 26006Assert.Equal(3, x5Ref.Length); 26043Assert.Equal(2, x1Ref.Length); 26057Assert.Equal(2, x4Decl.Length); 26063Assert.Equal(2, x5Decl.Length); 26064Assert.Equal(3, x5Ref.Length); 26110Assert.Equal(2, x1Decl.Length); 26111Assert.Equal(3, x1Ref.Length); 26158Assert.Equal(2, x1Decl.Length); 26159Assert.Equal(3, x1Ref.Length); 26239Assert.Equal(2, x1Ref.Length); 26252Assert.Equal(2, x4Decl.Length); 26286Assert.Equal(2, x1Ref.Length); 26300Assert.Equal(2, x4Decl.Length); 26381Assert.Equal(2, x1Ref.Length); 26395Assert.Equal(2, x4Decl.Length); 26429Assert.Equal(2, x1Ref.Length); 26443Assert.Equal(2, x4Decl.Length); 26513Assert.Equal(2, x1Ref.Length); 26526Assert.Equal(2, x4Decl.Length); 26573Assert.Equal(2, x1Ref.Length); 26587Assert.Equal(2, x4Decl.Length); 26657Assert.Equal(2, x1Ref.Length); 26670Assert.Equal(2, x4Decl.Length); 26717Assert.Equal(2, x1Ref.Length); 26731Assert.Equal(2, x4Decl.Length); 26778Assert.Equal(3, x1Ref.Length); 26848Assert.Equal(2, x1Ref.Length); 26861Assert.Equal(2, x4Decl.Length); 26892Assert.Equal(2, x1Ref.Length); 26906Assert.Equal(2, x4Decl.Length); 26978Assert.Equal(2, x1Ref.Length); 26992Assert.Equal(2, x4Decl.Length); 27023Assert.Equal(2, x1Ref.Length); 27037Assert.Equal(2, x4Decl.Length); 27115Assert.Equal(2, x1Ref.Length); 27128Assert.Equal(2, x4Decl.Length); 27134Assert.Equal(2, x5Decl.Length); 27135Assert.Equal(3, x5Ref.Length); 27169Assert.Equal(2, x1Ref.Length); 27183Assert.Equal(2, x4Decl.Length); 27189Assert.Equal(2, x5Decl.Length); 27190Assert.Equal(3, x5Ref.Length); 27268Assert.Equal(2, x1Ref.Length); 27281Assert.Equal(2, x4Decl.Length); 27287Assert.Equal(2, x5Decl.Length); 27288Assert.Equal(3, x5Ref.Length); 27322Assert.Equal(2, x1Ref.Length); 27336Assert.Equal(2, x4Decl.Length); 27342Assert.Equal(2, x5Decl.Length); 27343Assert.Equal(3, x5Ref.Length); 27391Assert.Equal(2, x1Decl.Length); 27392Assert.Equal(3, x1Ref.Length); 27468Assert.Equal(2, x1Ref.Length); 27485Assert.Equal(2, x4Decl.Length); 27492Assert.Equal(2, x5Decl.Length); 27493Assert.Equal(3, x5Ref.Length); 27541Assert.Equal(2, x1Ref.Length); 27558Assert.Equal(2, x4Decl.Length); 27565Assert.Equal(2, x5Decl.Length); 27566Assert.Equal(3, x5Ref.Length); 27645Assert.Equal(2, x1Ref.Length); 27662Assert.Equal(2, x4Decl.Length); 27669Assert.Equal(2, x5Decl.Length); 27670Assert.Equal(3, x5Ref.Length); 27718Assert.Equal(2, x1Ref.Length); 27735Assert.Equal(2, x4Decl.Length); 27742Assert.Equal(2, x5Decl.Length); 27743Assert.Equal(3, x5Ref.Length); 27781Assert.Equal(1, x1Decl.Length); 27782Assert.Equal(1, x1Ref.Length); 27858Assert.Equal(2, x1Ref.Length); 27875Assert.Equal(2, x4Decl.Length); 27882Assert.Equal(2, x5Decl.Length); 27883Assert.Equal(3, x5Ref.Length); 27931Assert.Equal(2, x1Ref.Length); 27948Assert.Equal(2, x4Decl.Length); 27955Assert.Equal(2, x5Decl.Length); 27956Assert.Equal(3, x5Ref.Length); 28036Assert.Equal(2, x1Ref.Length); 28053Assert.Equal(2, x4Decl.Length); 28060Assert.Equal(2, x5Decl.Length); 28061Assert.Equal(3, x5Ref.Length); 28109Assert.Equal(2, x1Ref.Length); 28126Assert.Equal(2, x4Decl.Length); 28133Assert.Equal(2, x5Decl.Length); 28134Assert.Equal(3, x5Ref.Length); 28182Assert.Equal(1, x1Decl.Length); 28183Assert.Equal(1, x1Ref.Length); 28257Assert.Equal(2, x1Ref.Length); 28270Assert.Equal(2, x4Decl.Length); 28276Assert.Equal(2, x5Decl.Length); 28277Assert.Equal(3, x5Ref.Length); 28311Assert.Equal(2, x1Ref.Length); 28325Assert.Equal(2, x4Decl.Length); 28331Assert.Equal(2, x5Decl.Length); 28332Assert.Equal(3, x5Ref.Length); 28408Assert.Equal(2, x1Ref.Length); 28421Assert.Equal(2, x4Decl.Length); 28427Assert.Equal(2, x5Decl.Length); 28428Assert.Equal(3, x5Ref.Length); 28462Assert.Equal(2, x1Ref.Length); 28476Assert.Equal(2, x4Decl.Length); 28482Assert.Equal(2, x5Decl.Length); 28483Assert.Equal(3, x5Ref.Length); 28529Assert.Equal(2, x1Decl.Length); 28530Assert.Equal(3, x1Ref.Length); 28577Assert.Equal(2, x1Decl.Length); 28578Assert.Equal(3, x1Ref.Length); 28661Assert.Equal(2, x1Ref.Length); 28674Assert.Equal(2, x4Decl.Length); 28680Assert.Equal(1, x5Ref.Length); 28685Assert.Equal(1, x6Ref.Length); 28722Assert.Equal(2, x1Ref.Length); 28736Assert.Equal(2, x4Decl.Length); 28742Assert.Equal(1, x5Ref.Length); 28748Assert.Equal(1, x6Ref.Length); 28829Assert.Equal(2, x1Ref.Length); 28842Assert.Equal(2, x4Decl.Length); 28885Assert.Equal(2, x1Ref.Length); 28899Assert.Equal(2, x4Decl.Length); 28980Assert.Equal(2, x1Ref.Length); 28993Assert.Equal(2, x4Decl.Length); 29036Assert.Equal(2, x1Ref.Length); 29050Assert.Equal(2, x4Decl.Length); 29101Assert.Equal(2, x1Ref.Length); 29187Assert.Equal(2, x1Ref.Length); 29200Assert.Equal(2, x4Decl.Length); 29206Assert.Equal(2, x5Ref.Length); 29254Assert.Equal(2, x1Ref.Length); 29268Assert.Equal(2, x4Decl.Length); 29274Assert.Equal(2, x5Ref.Length); 29363Assert.Equal(2, x1Ref.Length); 29376Assert.Equal(2, x4Decl.Length); 29382Assert.Equal(2, x5Ref.Length); 29430Assert.Equal(2, x1Ref.Length); 29444Assert.Equal(2, x4Decl.Length); 29450Assert.Equal(2, x5Ref.Length); 29503Assert.Equal(2, x1Ref.Length); 29650Assert.Equal(2, x1Ref.Length); 29663Assert.Equal(2, x4Decl.Length); 29669Assert.Equal(1, x5Ref.Length); 29674Assert.Equal(1, x6Ref.Length); 29726Assert.Equal(2, x1Ref.Length); 29740Assert.Equal(2, x4Decl.Length); 29851Assert.Equal(2, x1Ref.Length); 29864Assert.Equal(2, x4Decl.Length); 29870Assert.Equal(1, x5Ref.Length); 29875Assert.Equal(1, x6Ref.Length); 29927Assert.Equal(2, x1Ref.Length); 29941Assert.Equal(2, x4Decl.Length); 30005Assert.Equal(2, x1Ref.Length); 30091Assert.Equal(2, x1Ref.Length); 30104Assert.Equal(2, x4Decl.Length); 30152Assert.Equal(2, x1Ref.Length); 30166Assert.Equal(2, x4Decl.Length); 30263Assert.Equal(2, x1Ref.Length); 30276Assert.Equal(2, x4Decl.Length); 30324Assert.Equal(2, x1Ref.Length); 30338Assert.Equal(2, x4Decl.Length); 30388Assert.Equal(2, x1Ref.Length); 30443Assert.Equal(4, x1Ref.Length); 30487Assert.Equal(2, x1Ref.Length); 30531Assert.Equal(2, x1Ref.Length); 30652Assert.Equal(2, x1Ref.Length); 30665Assert.Equal(2, x4Decl.Length); 30721Assert.Equal(2, x1Ref.Length); 30738Assert.Equal(2, x4Decl.Length); 30823Assert.Equal(2, x1Ref.Length); 30836Assert.Equal(2, x4Decl.Length); 30892Assert.Equal(2, x1Ref.Length); 30909Assert.Equal(2, x4Decl.Length); 30956Assert.Equal(2, x1Ref.Length); 31011Assert.Equal(4, x1Ref.Length); 31055Assert.Equal(2, x1Ref.Length); 31099Assert.Equal(2, x1Ref.Length); 31183Assert.Equal(2, x1Ref.Length); 31196Assert.Equal(2, x4Decl.Length); 31242Assert.Equal(2, x1Ref.Length); 31259Assert.Equal(2, x4Decl.Length); 31356Assert.Equal(2, x1Ref.Length); 31369Assert.Equal(2, x4Decl.Length); 31415Assert.Equal(2, x1Ref.Length); 31432Assert.Equal(2, x4Decl.Length); 31484Assert.Equal(2, x1Ref.Length); 31539Assert.Equal(4, x1Ref.Length); 31583Assert.Equal(2, x1Ref.Length); 31627Assert.Equal(2, x1Ref.Length); 31722Assert.Equal(2, x1Ref.Length); 31756Assert.Equal(2, x1Ref.Length); 31809Assert.Equal(2, x1Ref.Length); 31849Assert.Equal(2, x1Ref.Length); 31899Assert.Equal(2, x1Ref.Length); 31933Assert.Equal(2, x1Ref.Length); 31989Assert.Equal(2, x1Ref.Length); 32029Assert.Equal(2, x1Ref.Length); 32152Assert.Equal(1, x1Ref.Length); 32438Assert.Equal(1, x1Ref.Length); 33501Assert.Equal(3, x6Decl.Length); 33502Assert.Equal(3, x6Ref.Length); 33568Assert.Equal(4, refs.Length); 33654Assert.Equal(4, refs.Length); 33744Assert.Equal(2, x5Decl.Length); 33750Assert.Equal(2, x6Decl.Length); 33751Assert.Equal(2, x6Ref.Length); 33757Assert.Equal(3, x7Ref.Length); 33842Assert.Equal(2, x5Decl.Length); 33848Assert.Equal(2, x6Decl.Length); 33849Assert.Equal(2, x6Ref.Length); 33855Assert.Equal(3, x7Ref.Length); 33941Assert.Equal(2, x5Decl.Length); 33947Assert.Equal(2, x6Decl.Length); 33948Assert.Equal(2, x6Ref.Length); 33954Assert.Equal(3, x7Ref.Length); 34039Assert.Equal(2, x5Decl.Length); 34045Assert.Equal(2, x6Decl.Length); 34046Assert.Equal(2, x6Ref.Length); 34052Assert.Equal(3, x7Ref.Length); 34108Assert.Equal(2, x2Decl.Length); 34109Assert.Equal(2, x2Ref.Length); 34164Assert.Equal(2, x2Decl.Length); 34165Assert.Equal(2, x2Ref.Length); 34353Assert.Equal(2, x1Ref.Length); 34358Assert.Equal(2, x2Ref.Length); 34363Assert.Equal(3, x3Ref.Length); 34444Assert.Equal(2, x1Ref.Length); 34449Assert.Equal(3, x2Ref.Length); 34551Assert.Equal(2, x1Ref.Length); 34556Assert.Equal(3, x2Ref.Length); 34672Assert.Equal(2, x1Ref.Length); 34677Assert.Equal(2, x2Ref.Length); 34682Assert.Equal(3, x3Ref.Length); 34713Assert.Equal(1, refs.Length); 34791Assert.Equal(4, refs.Length); 34846Assert.Equal(2, refs.Length); 34900Assert.Equal(2, refs.Length); 34958Assert.Equal(2, refs.Length); 35008Assert.Equal(2, refs.Length); 35062Assert.Equal(2, refs.Length); 35100Assert.Equal(2, refs.Length);
Semantics\ParamsCollectionTests.cs (7)
219Assert.Equal(3, nodes.Length); 335Assert.Equal(3, nodes.Length); 518Assert.Equal(3, nodes.Length); 663Assert.Equal(3, nodes.Length); 1407Assert.Equal(3, nodes.Length); 2531Assert.Equal(3, nodes.Length); 2667Assert.Equal(3, nodes.Length);
Semantics\PatternMatchingTests.cs (95)
697Assert.Equal(1, x1Decl.Length); 698Assert.Equal(4, x1Ref.Length); 741Assert.Equal(2, x1Decl.Length); 742Assert.Equal(2, x1Ref.Length); 1156Assert.Equal(2, x1Decl.Length); 1157Assert.Equal(2, x1Ref.Length); 1225Assert.Equal(2, x1Decl.Length); 1226Assert.Equal(2, x1Ref.Length); 1275Assert.Equal(1, x1Decl.Length); 1276Assert.Equal(3, x1Ref.Length); 1319Assert.Equal(2, x1Decl.Length); 1320Assert.Equal(2, x1Ref.Length); 1434Assert.Equal(1, x1Decl.Length); 1435Assert.Equal(2, x1Ref.Length); 1484Assert.Equal(1, x1Decl.Length); 1485Assert.Equal(1, x1Ref.Length); 1541Assert.Equal(1, x1Decl.Length); 1542Assert.Equal(2, x1Ref.Length); 1593Assert.Equal(1, x1Decl.Length); 1594Assert.Equal(2, x1Ref.Length); 1658Assert.Equal(1, x1Decl.Length); 1659Assert.Equal(2, x1Ref.Length); 1664Assert.Equal(1, x2Decl.Length); 1665Assert.Equal(2, x2Ref.Length); 1670Assert.Equal(1, x3Decl.Length); 1671Assert.Equal(2, x3Ref.Length); 1735Assert.Equal(1, x1Decl.Length); 1736Assert.Equal(2, x1Ref.Length); 1741Assert.Equal(1, x2Decl.Length); 1742Assert.Equal(2, x2Ref.Length); 1747Assert.Equal(1, x3Decl.Length); 1748Assert.Equal(2, x3Ref.Length); 1788Assert.Equal(1, x1Decl.Length); 1789Assert.Equal(2, x1Ref.Length); 1832Assert.Equal(2, x1Decl.Length); 1833Assert.Equal(2, x1Ref.Length); 1886Assert.Equal(1, x1Decl.Length); 1887Assert.Equal(2, x1Ref.Length); 1940Assert.Equal(1, x1Decl.Length); 1941Assert.Equal(2, x1Ref.Length); 1997Assert.Equal(1, x1Decl.Length); 1998Assert.Equal(3, x1Ref.Length); 2035Assert.Equal(1, x1Decl.Length); 2036Assert.Equal(1, x1Ref.Length); 2081Assert.Equal(2, x1Decl.Length); 2082Assert.Equal(2, x1Ref.Length); 2135Assert.Equal(1, x1Decl.Length); 2136Assert.Equal(2, x1Ref.Length); 2183Assert.Equal(2, x0Ref.Length); 2188Assert.Equal(2, x1Ref.Length); 2193Assert.Equal(2, x2Ref.Length); 2239Assert.Equal(2, x0Ref.Length); 2244Assert.Equal(2, x1Ref.Length); 2249Assert.Equal(2, x2Ref.Length); 2299Assert.Equal(1, x0Decl.Length); 2300Assert.Equal(4, x0Ref.Length); 2305Assert.Equal(1, x1Decl.Length); 2306Assert.Equal(2, x1Ref.Length); 2357Assert.Equal(1, x0Decl.Length); 2358Assert.Equal(4, x0Ref.Length); 2363Assert.Equal(1, x1Decl.Length); 2364Assert.Equal(2, x1Ref.Length); 2418Assert.Equal(1, x0Decl.Length); 2419Assert.Equal(5, x0Ref.Length); 2424Assert.Equal(1, x1Decl.Length); 2425Assert.Equal(3, x1Ref.Length); 2463Assert.Equal(2, x1Ref.Length); 2502Assert.Equal(1, x1Decl.Length); 2503Assert.Equal(3, x1Ref.Length); 2546Assert.Equal(2, x1Decl.Length); 2547Assert.Equal(2, x1Ref.Length); 2618Assert.Equal(1, x1Decl.Length); 2619Assert.Equal(2, x1Ref.Length); 2666Assert.Equal(2, x1Decl.Length); 2667Assert.Equal(2, x1Ref.Length); 2704Assert.Equal(1, x1Decl.Length); 2705Assert.Equal(1, x1Ref.Length); 2749Assert.Equal(2, x1Decl.Length); 2750Assert.Equal(2, x1Ref.Length); 2793Assert.Equal(1, x1Decl.Length); 2794Assert.Equal(1, x1Ref.Length); 2845Assert.Equal(2, x1Decl.Length); 2846Assert.Equal(2, x1Ref.Length); 2887Assert.Equal(2, x1Ref.Length); 3042Assert.Equal(1, x1Decl.Length); 3043Assert.Equal(1, x1Ref.Length); 3089Assert.Equal(1, x1Decl.Length); 3090Assert.Equal(1, x1Ref.Length); 4795Assert.Equal(1, colorDecl.Length); 4796Assert.Equal(2, colorRef.Length); 4832Assert.Equal(1, x3Decl.Length); 4833Assert.Equal(1, x3Ref.Length); 4954int index = r.Next(expressions.Length + 1) - 1; 4967string Type() => types[r.Next(types.Length)]; 11366Assert.Equal(2, exprs.Length);
Semantics\PatternMatchingTests_Global.cs (385)
81Assert.Equal(2, x1Ref.Length); 94Assert.Equal(2, x4Decl.Length); 125Assert.Equal(2, x1Ref.Length); 139Assert.Equal(2, x4Decl.Length); 203Assert.Equal(2, x1Ref.Length); 216Assert.Equal(2, x4Decl.Length); 247Assert.Equal(2, x1Ref.Length); 261Assert.Equal(2, x4Decl.Length); 297Assert.Equal(2, x1Ref.Length); 373Assert.Equal(2, x1Ref.Length); 386Assert.Equal(2, x4Decl.Length); 392Assert.Equal(2, x5Decl.Length); 393Assert.Equal(3, x5Ref.Length); 433Assert.Equal(2, x1Ref.Length); 447Assert.Equal(2, x4Decl.Length); 453Assert.Equal(2, x5Decl.Length); 454Assert.Equal(3, x5Ref.Length); 525Assert.Equal(2, x1Ref.Length); 538Assert.Equal(2, x4Decl.Length); 544Assert.Equal(2, x5Decl.Length); 545Assert.Equal(3, x5Ref.Length); 582Assert.Equal(2, x1Ref.Length); 596Assert.Equal(2, x4Decl.Length); 602Assert.Equal(2, x5Decl.Length); 603Assert.Equal(3, x5Ref.Length); 644Assert.Equal(2, x1Decl.Length); 645Assert.Equal(3, x1Ref.Length); 686Assert.Equal(2, x1Decl.Length); 687Assert.Equal(3, x1Ref.Length); 762Assert.Equal(2, x1Ref.Length); 775Assert.Equal(2, x4Decl.Length); 809Assert.Equal(2, x1Ref.Length); 823Assert.Equal(2, x4Decl.Length); 899Assert.Equal(2, x1Ref.Length); 913Assert.Equal(2, x4Decl.Length); 947Assert.Equal(2, x1Ref.Length); 961Assert.Equal(2, x4Decl.Length); 1026Assert.Equal(2, x1Ref.Length); 1039Assert.Equal(2, x4Decl.Length); 1079Assert.Equal(2, x1Ref.Length); 1093Assert.Equal(2, x4Decl.Length); 1158Assert.Equal(2, x1Ref.Length); 1171Assert.Equal(2, x4Decl.Length); 1211Assert.Equal(2, x1Ref.Length); 1225Assert.Equal(2, x4Decl.Length); 1267Assert.Equal(3, x1Ref.Length); 1332Assert.Equal(2, x1Ref.Length); 1345Assert.Equal(2, x4Decl.Length); 1376Assert.Equal(2, x1Ref.Length); 1390Assert.Equal(2, x4Decl.Length); 1457Assert.Equal(2, x1Ref.Length); 1471Assert.Equal(2, x4Decl.Length); 1502Assert.Equal(2, x1Ref.Length); 1516Assert.Equal(2, x4Decl.Length); 1589Assert.Equal(2, x1Ref.Length); 1602Assert.Equal(2, x4Decl.Length); 1608Assert.Equal(2, x5Decl.Length); 1609Assert.Equal(3, x5Ref.Length); 1643Assert.Equal(2, x1Ref.Length); 1657Assert.Equal(2, x4Decl.Length); 1663Assert.Equal(2, x5Decl.Length); 1664Assert.Equal(3, x5Ref.Length); 1737Assert.Equal(2, x1Ref.Length); 1750Assert.Equal(2, x4Decl.Length); 1756Assert.Equal(2, x5Decl.Length); 1757Assert.Equal(3, x5Ref.Length); 1791Assert.Equal(2, x1Ref.Length); 1805Assert.Equal(2, x4Decl.Length); 1811Assert.Equal(2, x5Decl.Length); 1812Assert.Equal(3, x5Ref.Length); 1855Assert.Equal(2, x1Decl.Length); 1856Assert.Equal(3, x1Ref.Length); 1929Assert.Equal(2, x1Ref.Length); 1946Assert.Equal(2, x4Decl.Length); 1953Assert.Equal(2, x5Decl.Length); 1954Assert.Equal(3, x5Ref.Length); 1999Assert.Equal(2, x1Ref.Length); 2016Assert.Equal(2, x4Decl.Length); 2023Assert.Equal(2, x5Decl.Length); 2024Assert.Equal(3, x5Ref.Length); 2100Assert.Equal(2, x1Ref.Length); 2117Assert.Equal(2, x4Decl.Length); 2124Assert.Equal(2, x5Decl.Length); 2125Assert.Equal(3, x5Ref.Length); 2170Assert.Equal(2, x1Ref.Length); 2187Assert.Equal(2, x4Decl.Length); 2194Assert.Equal(2, x5Decl.Length); 2195Assert.Equal(3, x5Ref.Length); 2229Assert.Equal(1, x1Decl.Length); 2230Assert.Equal(1, x1Ref.Length); 2303Assert.Equal(2, x1Ref.Length); 2320Assert.Equal(2, x4Decl.Length); 2327Assert.Equal(2, x5Decl.Length); 2328Assert.Equal(3, x5Ref.Length); 2373Assert.Equal(2, x1Ref.Length); 2390Assert.Equal(2, x4Decl.Length); 2397Assert.Equal(2, x5Decl.Length); 2398Assert.Equal(3, x5Ref.Length); 2475Assert.Equal(2, x1Ref.Length); 2492Assert.Equal(2, x4Decl.Length); 2499Assert.Equal(2, x5Decl.Length); 2500Assert.Equal(3, x5Ref.Length); 2545Assert.Equal(2, x1Ref.Length); 2562Assert.Equal(2, x4Decl.Length); 2569Assert.Equal(2, x5Decl.Length); 2570Assert.Equal(3, x5Ref.Length); 2614Assert.Equal(1, x1Decl.Length); 2615Assert.Equal(1, x1Ref.Length); 2684Assert.Equal(2, x1Ref.Length); 2697Assert.Equal(2, x4Decl.Length); 2703Assert.Equal(2, x5Decl.Length); 2704Assert.Equal(3, x5Ref.Length); 2738Assert.Equal(2, x1Ref.Length); 2752Assert.Equal(2, x4Decl.Length); 2758Assert.Equal(2, x5Decl.Length); 2759Assert.Equal(3, x5Ref.Length); 2830Assert.Equal(2, x1Ref.Length); 2843Assert.Equal(2, x4Decl.Length); 2849Assert.Equal(2, x5Decl.Length); 2850Assert.Equal(3, x5Ref.Length); 2884Assert.Equal(2, x1Ref.Length); 2898Assert.Equal(2, x4Decl.Length); 2904Assert.Equal(2, x5Decl.Length); 2905Assert.Equal(3, x5Ref.Length); 2946Assert.Equal(2, x1Decl.Length); 2947Assert.Equal(3, x1Ref.Length); 2992Assert.Equal(2, x1Decl.Length); 2993Assert.Equal(3, x1Ref.Length); 3073Assert.Equal(2, x1Ref.Length); 3086Assert.Equal(2, x4Decl.Length); 3132Assert.Equal(2, x1Ref.Length); 3146Assert.Equal(2, x4Decl.Length); 3232Assert.Equal(2, x1Ref.Length); 3245Assert.Equal(2, x4Decl.Length); 3288Assert.Equal(2, x1Ref.Length); 3302Assert.Equal(2, x4Decl.Length); 3378Assert.Equal(2, x1Ref.Length); 3391Assert.Equal(2, x4Decl.Length); 3434Assert.Equal(2, x1Ref.Length); 3448Assert.Equal(2, x4Decl.Length); 3494Assert.Equal(2, x1Ref.Length); 3575Assert.Equal(2, x1Ref.Length); 3588Assert.Equal(2, x4Decl.Length); 3594Assert.Equal(2, x5Ref.Length); 3642Assert.Equal(2, x1Ref.Length); 3656Assert.Equal(2, x4Decl.Length); 3662Assert.Equal(2, x5Ref.Length); 3746Assert.Equal(2, x1Ref.Length); 3759Assert.Equal(2, x4Decl.Length); 3765Assert.Equal(2, x5Ref.Length); 3813Assert.Equal(2, x1Ref.Length); 3827Assert.Equal(2, x4Decl.Length); 3833Assert.Equal(2, x5Ref.Length); 3877Assert.Equal(2, x1Ref.Length); 3971Assert.Equal(2, x1Ref.Length); 3984Assert.Equal(2, x4Decl.Length); 3990Assert.Equal(1, x5Ref.Length); 3995Assert.Equal(1, x6Ref.Length); 4047Assert.Equal(2, x1Ref.Length); 4061Assert.Equal(2, x4Decl.Length); 4067Assert.Equal(1, x5Ref.Length); 4073Assert.Equal(1, x6Ref.Length); 4169Assert.Equal(2, x1Ref.Length); 4182Assert.Equal(2, x4Decl.Length); 4188Assert.Equal(1, x5Ref.Length); 4193Assert.Equal(1, x6Ref.Length); 4245Assert.Equal(2, x1Ref.Length); 4259Assert.Equal(2, x4Decl.Length); 4265Assert.Equal(1, x5Ref.Length); 4271Assert.Equal(1, x6Ref.Length); 4316Assert.Equal(2, x1Ref.Length); 4397Assert.Equal(2, x1Ref.Length); 4410Assert.Equal(2, x4Decl.Length); 4458Assert.Equal(2, x1Ref.Length); 4472Assert.Equal(2, x4Decl.Length); 4564Assert.Equal(2, x1Ref.Length); 4577Assert.Equal(2, x4Decl.Length); 4625Assert.Equal(2, x1Ref.Length); 4639Assert.Equal(2, x4Decl.Length); 4680Assert.Equal(2, x1Ref.Length); 4726Assert.Equal(4, x1Ref.Length); 4765Assert.Equal(2, x1Ref.Length); 4804Assert.Equal(2, x1Ref.Length); 4911Assert.Equal(2, x1Ref.Length); 4924Assert.Equal(2, x4Decl.Length); 4980Assert.Equal(2, x1Ref.Length); 4997Assert.Equal(2, x4Decl.Length); 5077Assert.Equal(2, x1Ref.Length); 5090Assert.Equal(2, x4Decl.Length); 5146Assert.Equal(2, x1Ref.Length); 5163Assert.Equal(2, x4Decl.Length); 5201Assert.Equal(2, x1Ref.Length); 5247Assert.Equal(4, x1Ref.Length); 5286Assert.Equal(2, x1Ref.Length); 5325Assert.Equal(2, x1Ref.Length); 5404Assert.Equal(2, x1Ref.Length); 5417Assert.Equal(2, x4Decl.Length); 5480Assert.Equal(2, x1Ref.Length); 5497Assert.Equal(2, x4Decl.Length); 5589Assert.Equal(2, x1Ref.Length); 5602Assert.Equal(2, x4Decl.Length); 5665Assert.Equal(2, x1Ref.Length); 5682Assert.Equal(2, x4Decl.Length); 5730Assert.Equal(2, x1Ref.Length); 5781Assert.Equal(4, x1Ref.Length); 5820Assert.Equal(2, x1Ref.Length); 5859Assert.Equal(2, x1Ref.Length); 5942Assert.Equal(2, x1Ref.Length); 5980Assert.Equal(2, x1Ref.Length); 6030Assert.Equal(2, x1Ref.Length); 6067Assert.Equal(2, x1Ref.Length); 6114Assert.Equal(2, x1Ref.Length); 6146Assert.Equal(2, x1Ref.Length); 6200Assert.Equal(2, x1Ref.Length); 6238Assert.Equal(2, x1Ref.Length); 6517Assert.Equal(2, x1Ref.Length); 6522Assert.Equal(3, x4Ref.Length); 6528Assert.Equal(2, x6Ref.Length); 6533Assert.Equal(2, x7Ref.Length); 6539Assert.Equal(3, x8Ref.Length); 6545Assert.Equal(2, x9Decl.Length); 6546Assert.Equal(4, x9Ref.Length); 6551Assert.Equal(2, y10Ref.Length); 6557Assert.Equal(2, x14Decl.Length); 6558Assert.Equal(2, x14Ref.Length); 6564Assert.Equal(2, x15Ref.Length); 6605Assert.Equal(2, x1Ref.Length); 6610Assert.Equal(3, x4Ref.Length); 6616Assert.Equal(2, x6Ref.Length); 6621Assert.Equal(2, x7Ref.Length); 6627Assert.Equal(3, x8Ref.Length); 6633Assert.Equal(2, x9Decl.Length); 6634Assert.Equal(4, x9Ref.Length); 6639Assert.Equal(2, y10Ref.Length); 6645Assert.Equal(2, x14Decl.Length); 6646Assert.Equal(2, x14Ref.Length); 6652Assert.Equal(2, x15Ref.Length); 6689Assert.Equal(2, x1Ref.Length); 6732Assert.Equal(1, x1Ref.Length); 6765Assert.Equal(1, x1Ref.Length); 6807Assert.Equal(2, x1Ref.Length); 6945Assert.Equal(2, x1Ref.Length); 6950Assert.Equal(2, x2Ref.Length); 6955Assert.Equal(3, x4Ref.Length); 6961Assert.Equal(2, x6Ref.Length); 6966Assert.Equal(2, x7Ref.Length); 6972Assert.Equal(3, x8Ref.Length); 6978Assert.Equal(2, x9Decl.Length); 6979Assert.Equal(4, x9Ref.Length); 6984Assert.Equal(2, y10Ref.Length); 6993Assert.Equal(2, x14Decl.Length); 6994Assert.Equal(2, x14Ref.Length); 7043Assert.Equal(2, x1Ref.Length); 7048Assert.Equal(2, x2Ref.Length); 7053Assert.Equal(3, x4Ref.Length); 7059Assert.Equal(2, x6Ref.Length); 7064Assert.Equal(2, x7Ref.Length); 7070Assert.Equal(3, x8Ref.Length); 7076Assert.Equal(2, x9Decl.Length); 7077Assert.Equal(4, x9Ref.Length); 7082Assert.Equal(2, y10Ref.Length); 7091Assert.Equal(2, x14Decl.Length); 7092Assert.Equal(2, x14Ref.Length); 7135Assert.Equal(2, x0Ref.Length); 7140Assert.Equal(2, x1Ref.Length); 7145Assert.Equal(2, x2Ref.Length); 7262Assert.Equal(2, x1Ref.Length); 7267Assert.Equal(2, x2Ref.Length); 7272Assert.Equal(3, x4Ref.Length); 7278Assert.Equal(2, x6Ref.Length); 7283Assert.Equal(2, x7Ref.Length); 7289Assert.Equal(3, x8Ref.Length); 7295Assert.Equal(2, x9Decl.Length); 7296Assert.Equal(4, x9Ref.Length); 7301Assert.Equal(2, y10Ref.Length); 7310Assert.Equal(2, x14Decl.Length); 7311Assert.Equal(2, x14Ref.Length); 7317Assert.Equal(2, x15Ref.Length); 7366Assert.Equal(2, x1Ref.Length); 7371Assert.Equal(2, x2Ref.Length); 7376Assert.Equal(3, x4Ref.Length); 7382Assert.Equal(2, x6Ref.Length); 7387Assert.Equal(2, x7Ref.Length); 7393Assert.Equal(3, x8Ref.Length); 7399Assert.Equal(2, x9Decl.Length); 7400Assert.Equal(4, x9Ref.Length); 7405Assert.Equal(2, y10Ref.Length); 7414Assert.Equal(2, x14Decl.Length); 7415Assert.Equal(2, x14Ref.Length); 7421Assert.Equal(2, x15Ref.Length); 7455Assert.Equal(2, x1Ref.Length); 7539Assert.Equal(2, x5Decl.Length); 7545Assert.Equal(2, x6Decl.Length); 7546Assert.Equal(2, x6Ref.Length); 7552Assert.Equal(5, x7Ref.Length); 7561Assert.Equal(2, x8Ref.Length); 7566Assert.Equal(2, x9Decl.Length); 7567Assert.Equal(2, x9Ref.Length); 7573Assert.Equal(2, x10Decl.Length); 7574Assert.Equal(2, x10Ref.Length); 7580Assert.Equal(3, x11Ref.Length); 7587Assert.Equal(3, x12Ref.Length); 7633Assert.Equal(2, x5Decl.Length); 7639Assert.Equal(2, x6Decl.Length); 7640Assert.Equal(2, x6Ref.Length); 7646Assert.Equal(5, x7Ref.Length); 7655Assert.Equal(2, x8Ref.Length); 7660Assert.Equal(2, x9Decl.Length); 7661Assert.Equal(2, x9Ref.Length); 7667Assert.Equal(2, x10Decl.Length); 7668Assert.Equal(2, x10Ref.Length); 7674Assert.Equal(3, x11Ref.Length); 7681Assert.Equal(3, x12Ref.Length); 7933Assert.Equal(4, y1Ref.Length); 7938Assert.Equal(3, y2Ref.Length); 7943Assert.Equal(4, z2Ref.Length); 7950Assert.Equal(3, y3Ref.Length); 7955Assert.Equal(3, z3Ref.Length); 7962Assert.Equal(5, y4Ref.Length); 7967Assert.Equal(6, z4Ref.Length); 7972Assert.Equal(4, u4Ref.Length); 7980Assert.Equal(4, v4Ref.Length); 7988Assert.Equal(5, y5Ref.Length); 7993Assert.Equal(6, z5Ref.Length); 7998Assert.Equal(4, u5Ref.Length); 8006Assert.Equal(4, v5Ref.Length); 8014Assert.Equal(3, y6Ref.Length); 8019Assert.Equal(3, z6Ref.Length); 8026Assert.Equal(4, y7Ref.Length); 8031Assert.Equal(4, z7Ref.Length); 8039Assert.Equal(4, u7Ref.Length); 8047Assert.Equal(2, y8Ref.Length); 8052Assert.Equal(2, z8Ref.Length); 8058Assert.Equal(3, y9Ref.Length); 8063Assert.Equal(3, z9Ref.Length); 8070Assert.Equal(3, u9Ref.Length); 8077Assert.Equal(2, y10Ref.Length); 8083Assert.Equal(2, y11Ref.Length); 8192Assert.Equal(4, y1Ref.Length); 8197Assert.Equal(3, y2Ref.Length); 8202Assert.Equal(4, z2Ref.Length); 8209Assert.Equal(3, y3Ref.Length); 8214Assert.Equal(3, z3Ref.Length); 8221Assert.Equal(5, y4Ref.Length); 8226Assert.Equal(6, z4Ref.Length); 8231Assert.Equal(4, u4Ref.Length); 8239Assert.Equal(4, v4Ref.Length); 8247Assert.Equal(5, y5Ref.Length); 8252Assert.Equal(6, z5Ref.Length); 8257Assert.Equal(4, u5Ref.Length); 8265Assert.Equal(4, v5Ref.Length); 8273Assert.Equal(3, y6Ref.Length); 8278Assert.Equal(3, z6Ref.Length); 8285Assert.Equal(4, y7Ref.Length); 8290Assert.Equal(4, z7Ref.Length); 8298Assert.Equal(4, u7Ref.Length); 8306Assert.Equal(2, y8Ref.Length); 8311Assert.Equal(2, z8Ref.Length); 8317Assert.Equal(3, y9Ref.Length); 8322Assert.Equal(3, z9Ref.Length); 8329Assert.Equal(3, u9Ref.Length); 8336Assert.Equal(2, y10Ref.Length); 8342Assert.Equal(2, y11Ref.Length); 8484Assert.Equal(2, x1Ref.Length); 8489Assert.Equal(2, x2Ref.Length); 8494Assert.Equal(3, x4Ref.Length); 8500Assert.Equal(2, x6Ref.Length); 8505Assert.Equal(2, x7Ref.Length); 8511Assert.Equal(3, x8Ref.Length); 8517Assert.Equal(2, x9Decl.Length); 8518Assert.Equal(4, x9Ref.Length); 8527Assert.Equal(2, y10Ref.Length); 8536Assert.Equal(2, x14Decl.Length); 8537Assert.Equal(2, x14Ref.Length); 8583Assert.Equal(2, x1Ref.Length); 8588Assert.Equal(2, x2Ref.Length); 8593Assert.Equal(3, x4Ref.Length); 8599Assert.Equal(2, x6Ref.Length); 8604Assert.Equal(2, x7Ref.Length); 8610Assert.Equal(3, x8Ref.Length); 8616Assert.Equal(2, x9Decl.Length); 8617Assert.Equal(4, x9Ref.Length); 8626Assert.Equal(2, y10Ref.Length); 8635Assert.Equal(2, x14Decl.Length); 8636Assert.Equal(2, x14Ref.Length);
Semantics\PatternMatchingTests_ListPatterns.cs (5)
4087Assert.Equal(4, declarations.Length); 4174Assert.Equal(4, declarations.Length); 4251Assert.Equal(4, declarations.Length); 4365Assert.Equal(5, declarations.Length); 4558Assert.Equal(4, declarations.Length);
Semantics\PatternMatchingTests_Scope.cs (554)
207Assert.Equal(3, x1Decl.Length); 208Assert.Equal(3, x1Ref.Length); 223Assert.Equal(2, x4Ref.Length); 230Assert.Equal(2, x5Ref.Length); 235Assert.Equal(2, x8Decl.Length); 236Assert.Equal(2, x8Ref.Length); 237for (int i = 0; i < x8Decl.Length; i++) 253Assert.Equal(2, x11Ref.Length); 258Assert.Equal(2, x12Ref.Length); 288Assert.Equal(1, x1Decl.Length); 289Assert.Equal(1, x1Ref.Length); 334Assert.Equal(2, x1Decl.Length); 335Assert.Equal(2, x1Ref.Length); 416Assert.Equal(1, x1Ref.Length); 592Assert.Equal(3, x1Decl.Length); 593Assert.Equal(3, x1Ref.Length); 608Assert.Equal(2, x4Ref.Length); 615Assert.Equal(2, x5Ref.Length); 620Assert.Equal(2, x8Decl.Length); 621Assert.Equal(2, x8Ref.Length); 635Assert.Equal(2, x11Ref.Length); 640Assert.Equal(2, x12Ref.Length); 721Assert.Equal(1, x1Ref.Length); 862Assert.Equal(3, x1Decl.Length); 863Assert.Equal(3, x1Ref.Length); 878Assert.Equal(2, x4Ref.Length); 885Assert.Equal(2, x5Ref.Length); 890Assert.Equal(2, x8Decl.Length); 891Assert.Equal(2, x8Ref.Length); 905Assert.Equal(2, x11Ref.Length); 910Assert.Equal(2, x12Ref.Length); 990Assert.Equal(1, x1Ref.Length); 1160Assert.Equal(2, x1Ref.Length); 1165Assert.Equal(2, x2Ref.Length); 1170Assert.Equal(2, x3Ref.Length); 1176Assert.Equal(2, x4Ref.Length); 1187Assert.Equal(2, x6Ref.Length); 1192Assert.Equal(2, x7Ref.Length); 1198Assert.Equal(2, x8Ref.Length); 1203Assert.Equal(2, x9Decl.Length); 1204Assert.Equal(2, x9Ref.Length); 1209Assert.Equal(2, y10Ref.Length); 1294Assert.Equal(1, x1Ref.Length); 1531Assert.Equal(2, x5Decl.Length); 1537Assert.Equal(2, x6Decl.Length); 1538Assert.Equal(2, x6Ref.Length); 1544Assert.Equal(5, x7Ref.Length); 1553Assert.Equal(2, x8Ref.Length); 1558Assert.Equal(2, x9Decl.Length); 1559Assert.Equal(2, x9Ref.Length); 1565Assert.Equal(2, x10Decl.Length); 1566Assert.Equal(2, x10Ref.Length); 1572Assert.Equal(3, x11Ref.Length); 1579Assert.Equal(3, x12Ref.Length); 1823Assert.Equal(4, y1Ref.Length); 1828Assert.Equal(3, y2Ref.Length); 1833Assert.Equal(4, z2Ref.Length); 1840Assert.Equal(3, y3Ref.Length); 1845Assert.Equal(3, z3Ref.Length); 1852Assert.Equal(5, y4Ref.Length); 1857Assert.Equal(6, z4Ref.Length); 1862Assert.Equal(4, u4Ref.Length); 1870Assert.Equal(4, v4Ref.Length); 1878Assert.Equal(5, y5Ref.Length); 1883Assert.Equal(6, z5Ref.Length); 1888Assert.Equal(4, u5Ref.Length); 1896Assert.Equal(4, v5Ref.Length); 1904Assert.Equal(3, y6Ref.Length); 1909Assert.Equal(3, z6Ref.Length); 1916Assert.Equal(4, y7Ref.Length); 1921Assert.Equal(4, z7Ref.Length); 1929Assert.Equal(4, u7Ref.Length); 1937Assert.Equal(2, y8Ref.Length); 1942Assert.Equal(2, z8Ref.Length); 1948Assert.Equal(3, y9Ref.Length); 1953Assert.Equal(3, z9Ref.Length); 1960Assert.Equal(3, u9Ref.Length); 1967Assert.Equal(2, y10Ref.Length); 1973Assert.Equal(2, y11Ref.Length); 2074Assert.Equal(5, y4Ref.Length); 2079Assert.Equal(6, z4Ref.Length); 2084Assert.Equal(4, u4Ref.Length); 2092Assert.Equal(4, v4Ref.Length); 2100Assert.Equal(5, y5Ref.Length); 2105Assert.Equal(6, z5Ref.Length); 2110Assert.Equal(4, u5Ref.Length); 2118Assert.Equal(4, v5Ref.Length); 2223Assert.Equal(3, yRef.Length); 2359Assert.Equal(2, yDecl.Length); 2360Assert.Equal(2, yRef.Length); 2422Assert.Equal(2, yDecl.Length); 2423Assert.Equal(2, yRef.Length); 2713Assert.Equal(i == 10 ? 1 : 2, yRef.Length); 2792Assert.Equal(2, y1Decl.Length); 2797Assert.Equal(2, y2Decl.Length); 2997Assert.Equal(2, x5Decl.Length); 3003Assert.Equal(2, x6Decl.Length); 3004Assert.Equal(2, x6Ref.Length); 3010Assert.Equal(3, x7Ref.Length); 3017Assert.Equal(2, x11Ref.Length); 3023Assert.Equal(2, x12Ref.Length); 3166Assert.Equal(2, x5Decl.Length); 3172Assert.Equal(2, x6Decl.Length); 3173Assert.Equal(2, x6Ref.Length); 3179Assert.Equal(3, x7Ref.Length); 3281Assert.Equal(2, x5Decl.Length); 3287Assert.Equal(2, x6Decl.Length); 3288Assert.Equal(2, x6Ref.Length); 3294Assert.Equal(3, x7Ref.Length); 3370Assert.Equal(2, x5Decl.Length); 3376Assert.Equal(2, x6Decl.Length); 3377Assert.Equal(2, x6Ref.Length); 3383Assert.Equal(3, x7Ref.Length); 3458Assert.Equal(2, x5Decl.Length); 3464Assert.Equal(2, x6Decl.Length); 3465Assert.Equal(2, x6Ref.Length); 3471Assert.Equal(2, x7Ref.Length); 3545Assert.Equal(2, x5Decl.Length); 3551Assert.Equal(2, x6Decl.Length); 3552Assert.Equal(2, x6Ref.Length); 3558Assert.Equal(3, x7Ref.Length); 3621Assert.Equal(2, x5Decl.Length); 3627Assert.Equal(2, x6Decl.Length); 3628Assert.Equal(2, x6Ref.Length); 3634Assert.Equal(3, x7Ref.Length); 3718Assert.Equal(2, x5Decl.Length); 3724Assert.Equal(2, x6Decl.Length); 3725Assert.Equal(2, x6Ref.Length); 3731Assert.Equal(3, x7Ref.Length); 3809Assert.Equal(2, x5Decl.Length); 3815Assert.Equal(2, x6Decl.Length); 3816Assert.Equal(2, x6Ref.Length); 3822Assert.Equal(3, x7Ref.Length); 3899Assert.Equal(2, x5Decl.Length); 3905Assert.Equal(2, x6Decl.Length); 3906Assert.Equal(2, x6Ref.Length); 3912Assert.Equal(3, x7Ref.Length); 3991Assert.Equal(2, x5Decl.Length); 3997Assert.Equal(2, x6Decl.Length); 3998Assert.Equal(2, x6Ref.Length); 4004Assert.Equal(3, x7Ref.Length); 4087Assert.Equal(2, x5Decl.Length); 4093Assert.Equal(2, x6Decl.Length); 4094Assert.Equal(2, x6Ref.Length); 4100Assert.Equal(3, x7Ref.Length); 4233Assert.Equal(2, x5Decl.Length); 4507Assert.Equal(3, x1Decl.Length); 4508Assert.Equal(6, x1Ref.Length); 4509for (int i = 0; i < x1Decl.Length; i++) 4516Assert.Equal(2, x2Ref.Length); 4521Assert.Equal(2, x3Ref.Length); 4526Assert.Equal(4, x4Ref.Length); 4533Assert.Equal(3, x5Ref.Length); 4539Assert.Equal(2, x8Decl.Length); 4540Assert.Equal(3, x8Ref.Length); 4541for (int i = 0; i < x8Ref.Length; i++) 4549Assert.Equal(6, x9Ref.Length); 4558Assert.Equal(5, x11Ref.Length); 4566Assert.Equal(5, x12Ref.Length); 4574Assert.Equal(2, x13Decl.Length); 4575Assert.Equal(5, x13Ref.Length); 4581Assert.Equal(2, x14Decl.Length); 4582Assert.Equal(4, x14Ref.Length); 4588Assert.Equal(2, x15Decl.Length); 4589Assert.Equal(3, x15Ref.Length); 4590for (int i = 0; i < x15Ref.Length; i++) 4907Assert.Equal(3, x1Decl.Length); 4908Assert.Equal(6, x1Ref.Length); 4909for (int i = 0; i < x1Decl.Length; i++) 4916Assert.Equal(2, x2Ref.Length); 4921Assert.Equal(2, x3Ref.Length); 4926Assert.Equal(4, x4Ref.Length); 4933Assert.Equal(3, x5Ref.Length); 4939Assert.Equal(2, x8Decl.Length); 4940Assert.Equal(3, x8Ref.Length); 4941for (int i = 0; i < x8Ref.Length; i++) 4949Assert.Equal(6, x9Ref.Length); 4958Assert.Equal(5, x11Ref.Length); 4966Assert.Equal(5, x12Ref.Length); 4974Assert.Equal(2, x13Decl.Length); 4975Assert.Equal(5, x13Ref.Length); 4981Assert.Equal(2, x14Decl.Length); 4982Assert.Equal(4, x14Ref.Length); 4988Assert.Equal(2, x15Decl.Length); 4989Assert.Equal(3, x15Ref.Length); 4990for (int i = 0; i < x15Ref.Length; i++) 4998Assert.Equal(2, x16Decl.Length); 4999Assert.Equal(3, x16Ref.Length); 5000for (int i = 0; i < x16Ref.Length; i++) 5008Assert.Equal(2, x17Decl.Length); 5009Assert.Equal(3, x17Ref.Length); 5010for (int i = 0; i < x17Ref.Length; i++) 5216Assert.Equal(3, x1Ref.Length); 5221Assert.Equal(3, x4Ref.Length); 5229Assert.Equal(2, x5Ref.Length); 5234Assert.Equal(3, x6Ref.Length); 5239Assert.Equal(2, x7Ref.Length); 5245Assert.Equal(2, x9Decl.Length); 5246Assert.Equal(4, x9Ref.Length); 5251Assert.Equal(4, y10Ref.Length); 5259Assert.Equal(2, x14Decl.Length); 5260Assert.Equal(2, x14Ref.Length); 5265Assert.Equal(3, y15Ref.Length); 5350Assert.Equal(1, x1Ref.Length); 5504Assert.Equal(2, x1Ref.Length); 5509Assert.Equal(2, x2Ref.Length); 5514Assert.Equal(3, x4Ref.Length); 5520Assert.Equal(2, x6Ref.Length); 5525Assert.Equal(2, x7Ref.Length); 5531Assert.Equal(3, x8Ref.Length); 5537Assert.Equal(2, x9Decl.Length); 5538Assert.Equal(4, x9Ref.Length); 5547Assert.Equal(2, y10Ref.Length); 5556Assert.Equal(2, x14Decl.Length); 5557Assert.Equal(2, x14Ref.Length); 5711Assert.Equal(2, x1Ref.Length); 5716Assert.Equal(2, x2Ref.Length); 5721Assert.Equal(3, x4Ref.Length); 5727Assert.Equal(2, x6Ref.Length); 5732Assert.Equal(2, x7Ref.Length); 5738Assert.Equal(3, x8Ref.Length); 5744Assert.Equal(2, x9Decl.Length); 5745Assert.Equal(4, x9Ref.Length); 5754Assert.Equal(2, y10Ref.Length); 5763Assert.Equal(2, x14Decl.Length); 5764Assert.Equal(2, x14Ref.Length); 5918Assert.Equal(2, x1Ref.Length); 5923Assert.Equal(2, x2Ref.Length); 5928Assert.Equal(3, x4Ref.Length); 5934Assert.Equal(2, x6Ref.Length); 5939Assert.Equal(2, x7Ref.Length); 5945Assert.Equal(3, x8Ref.Length); 5951Assert.Equal(2, x9Decl.Length); 5952Assert.Equal(4, x9Ref.Length); 5961Assert.Equal(2, y10Ref.Length); 5970Assert.Equal(2, x14Decl.Length); 5971Assert.Equal(2, x14Ref.Length); 6027Assert.Equal(2, x1Ref.Length); 6034Assert.Equal(2, x2Ref.Length); 6108Assert.Equal(3, x1Ref.Length); 6113Assert.Equal(2, x2Decl.Length); 6114Assert.Equal(3, x2Ref.Length); 6120Assert.Equal(3, x3Ref.Length); 6125Assert.Equal(3, x4Ref.Length); 6195Assert.Equal(2, x4Ref.Length); 6206Assert.Equal(2, x8Ref.Length); 6211Assert.Equal(2, x14Decl.Length); 6282Assert.Equal(2, x4Ref.Length); 6293Assert.Equal(2, x8Ref.Length); 6298Assert.Equal(2, x14Decl.Length); 6352Assert.Equal(2, x1Ref.Length); 6359Assert.Equal(2, x2Ref.Length); 6422Assert.Equal(3, x1Ref.Length); 6427Assert.Equal(2, x2Decl.Length); 6428Assert.Equal(2, x2Ref.Length); 6434Assert.Equal(2, x3Ref.Length); 6439Assert.Equal(2, x4Ref.Length); 6480Assert.Equal(1, x1Ref.Length); 6596Assert.Equal(2, x4Ref.Length); 6607Assert.Equal(2, x8Ref.Length); 6612Assert.Equal(2, x14Decl.Length); 6685Assert.Equal(2, x4Ref.Length); 6696Assert.Equal(2, x8Ref.Length); 6701Assert.Equal(2, x14Decl.Length); 6757Assert.Equal(2, x1Ref.Length); 6764Assert.Equal(2, x2Ref.Length); 6832Assert.Equal(3, x1Ref.Length); 6840Assert.Equal(2, x2Decl.Length); 6841Assert.Equal(2, x2Ref.Length); 6847Assert.Equal(2, x3Ref.Length); 6852Assert.Equal(2, x4Ref.Length); 6891Assert.Equal(1, x1Ref.Length); 6932Assert.Equal(2, x1Ref.Length); 7089Assert.Equal(2, x1Ref.Length); 7094Assert.Equal(2, x2Ref.Length); 7099Assert.Equal(3, x4Ref.Length); 7105Assert.Equal(2, x6Ref.Length); 7110Assert.Equal(2, x7Ref.Length); 7116Assert.Equal(3, x8Ref.Length); 7122Assert.Equal(2, x9Decl.Length); 7123Assert.Equal(4, x9Ref.Length); 7128Assert.Equal(2, y10Ref.Length); 7137Assert.Equal(2, x14Decl.Length); 7138Assert.Equal(2, x14Ref.Length); 7220Assert.Equal(1, x1Ref.Length); 7411Assert.Equal(2, x1Ref.Length); 7416Assert.Equal(2, x2Ref.Length); 7421Assert.Equal(3, x4Ref.Length); 7427Assert.Equal(2, x6Ref.Length); 7432Assert.Equal(2, x7Ref.Length); 7438Assert.Equal(3, x8Ref.Length); 7444Assert.Equal(2, x9Decl.Length); 7445Assert.Equal(4, x9Ref.Length); 7450Assert.Equal(2, y10Ref.Length); 7459Assert.Equal(2, x14Decl.Length); 7460Assert.Equal(2, x14Ref.Length); 7543Assert.Equal(1, x1Ref.Length); 7726Assert.Equal(2, x1Ref.Length); 7731Assert.Equal(2, x2Ref.Length); 7736Assert.Equal(3, x4Ref.Length); 7742Assert.Equal(2, x6Ref.Length); 7747Assert.Equal(2, x7Ref.Length); 7753Assert.Equal(3, x8Ref.Length); 7759Assert.Equal(2, x9Decl.Length); 7760Assert.Equal(4, x9Ref.Length); 7765Assert.Equal(2, y10Ref.Length); 7774Assert.Equal(2, x14Decl.Length); 7775Assert.Equal(2, x14Ref.Length); 7955Assert.Equal(2, x1Ref.Length); 7960Assert.Equal(2, x2Ref.Length); 7965Assert.Equal(3, x4Ref.Length); 7971Assert.Equal(2, x6Ref.Length); 7976Assert.Equal(2, x7Ref.Length); 7982Assert.Equal(3, x8Ref.Length); 7988Assert.Equal(2, x9Decl.Length); 7989Assert.Equal(4, x9Ref.Length); 7994Assert.Equal(2, y10Ref.Length); 8003Assert.Equal(2, x14Decl.Length); 8004Assert.Equal(2, x14Ref.Length); 8205Assert.Equal(2, x1Ref.Length); 8211Assert.Equal(2, x2Ref.Length); 8217Assert.Equal(3, x4Ref.Length); 8224Assert.Equal(2, x6Ref.Length); 8230Assert.Equal(2, x7Ref.Length); 8236Assert.Equal(3, x8Ref.Length); 8243Assert.Equal(2, x9Decl.Length); 8244Assert.Equal(4, x9Ref.Length); 8251Assert.Equal(2, y10Ref.Length); 8260Assert.Equal(2, x14Decl.Length); 8261Assert.Equal(2, x14Ref.Length); 8445Assert.Equal(2, x1Ref.Length); 8450Assert.Equal(2, x2Ref.Length); 8455Assert.Equal(3, x4Ref.Length); 8461Assert.Equal(2, x6Ref.Length); 8466Assert.Equal(2, x7Ref.Length); 8472Assert.Equal(3, x8Ref.Length); 8478Assert.Equal(2, x9Decl.Length); 8479Assert.Equal(4, x9Ref.Length); 8484Assert.Equal(2, y10Ref.Length); 8493Assert.Equal(2, x14Decl.Length); 8494Assert.Equal(2, x14Ref.Length); 8677Assert.Equal(2, x1Ref.Length); 8682Assert.Equal(2, x2Ref.Length); 8687Assert.Equal(3, x4Ref.Length); 8693Assert.Equal(2, x6Ref.Length); 8698Assert.Equal(2, x7Ref.Length); 8704Assert.Equal(3, x8Ref.Length); 8710Assert.Equal(2, x9Decl.Length); 8711Assert.Equal(4, x9Ref.Length); 8716Assert.Equal(2, y10Ref.Length); 8725Assert.Equal(2, x14Decl.Length); 8726Assert.Equal(2, x14Ref.Length); 9024Assert.Equal(4, x8Decl.Length); 9025Assert.Equal(4, x8Ref.Length); 9033Assert.Equal(3, x9Decl.Length); 9034Assert.Equal(4, x9Ref.Length); 9041Assert.Equal(3, x10Decl.Length); 9042Assert.Equal(4, x10Ref.Length); 9050Assert.Equal(3, x11Decl.Length); 9051Assert.Equal(4, x11Ref.Length); 9059Assert.Equal(2, x12Decl.Length); 9060Assert.Equal(4, x12Ref.Length); 9067Assert.Equal(2, x13Decl.Length); 9068Assert.Equal(4, x13Ref.Length); 9076Assert.Equal(2, x14Decl.Length); 9077Assert.Equal(4, x14Ref.Length); 9085Assert.Equal(4, x15Ref.Length); 9136Assert.Equal(2, x1Ref.Length); 9141Assert.Equal(2, x2Decl.Length); 9142Assert.Equal(2, x2Ref.Length); 9308Assert.Equal(2, x1Ref.Length); 9313Assert.Equal(2, x2Ref.Length); 9318Assert.Equal(3, x4Ref.Length); 9324Assert.Equal(2, x6Ref.Length); 9329Assert.Equal(2, x7Ref.Length); 9335Assert.Equal(3, x8Ref.Length); 9341Assert.Equal(2, x9Decl.Length); 9342Assert.Equal(4, x9Ref.Length); 9347Assert.Equal(2, y10Ref.Length); 9356Assert.Equal(2, x14Decl.Length); 9357Assert.Equal(2, x14Ref.Length); 9363Assert.Equal(2, x15Ref.Length); 9517Assert.Equal(2, x1Ref.Length); 9522Assert.Equal(2, x2Ref.Length); 9527Assert.Equal(3, x4Ref.Length); 9535Assert.Equal(2, x6Ref.Length); 9540Assert.Equal(2, x7Ref.Length); 9546Assert.Equal(3, x8Ref.Length); 9551Assert.Equal(2, x9Decl.Length); 9552Assert.Equal(4, x9Ref.Length); 9557Assert.Equal(2, y10Ref.Length); 9566Assert.Equal(2, x14Decl.Length); 9567Assert.Equal(2, x14Ref.Length); 9649Assert.Equal(1, x1Ref.Length); 9803Assert.Equal(2, x1Ref.Length); 9808Assert.Equal(2, x2Ref.Length); 9813Assert.Equal(3, x4Ref.Length); 9819Assert.Equal(2, x6Ref.Length); 9824Assert.Equal(2, x7Ref.Length); 9830Assert.Equal(3, x8Ref.Length); 9836Assert.Equal(2, x9Decl.Length); 9837Assert.Equal(4, x9Ref.Length); 9842Assert.Equal(2, y10Ref.Length); 9851Assert.Equal(2, x14Decl.Length); 9852Assert.Equal(2, x14Ref.Length); 9932Assert.Equal(2, x1Ref.Length); 9939Assert.Equal(2, x2Ref.Length); 9944Assert.Equal(2, x3Ref.Length); 9951Assert.Equal(2, x4Decl.Length); 9952Assert.Equal(3, x4Ref.Length); 10080Assert.Equal(3, x1Decl.Length); 10081Assert.Equal(3, x1Ref.Length); 10096Assert.Equal(2, x4Ref.Length); 10103Assert.Equal(2, x5Ref.Length); 10108Assert.Equal(2, x8Decl.Length); 10109Assert.Equal(2, x8Ref.Length); 10110for (int i = 0; i < x8Decl.Length; i++) 10122Assert.Equal(2, x11Ref.Length); 10127Assert.Equal(2, x12Ref.Length); 10212Assert.Equal(1, x1Ref.Length); 10370Assert.Equal(2, x1Ref.Length); 10375Assert.Equal(3, x4Ref.Length); 10381Assert.Equal(2, x6Ref.Length); 10386Assert.Equal(2, x7Ref.Length); 10392Assert.Equal(3, x8Ref.Length); 10398Assert.Equal(2, x9Decl.Length); 10399Assert.Equal(4, x9Ref.Length); 10404Assert.Equal(2, y10Ref.Length); 10410Assert.Equal(2, x14Decl.Length); 10411Assert.Equal(2, x14Ref.Length); 10417Assert.Equal(2, x15Ref.Length); 10591Assert.Equal(3, x1Decl.Length); 10592Assert.Equal(3, x1Ref.Length); 10607Assert.Equal(2, x4Ref.Length); 10614Assert.Equal(2, x5Ref.Length); 10619Assert.Equal(2, x8Decl.Length); 10620Assert.Equal(2, x8Ref.Length); 10621for (int i = 0; i < x8Decl.Length; i++) 10637Assert.Equal(2, x11Ref.Length); 10642Assert.Equal(2, x12Ref.Length); 10728Assert.Equal(1, x1Ref.Length); 11004Assert.Equal(3, x1Decl.Length); 11005Assert.Equal(6, x1Ref.Length); 11006for (int i = 0; i < x1Decl.Length; i++) 11013Assert.Equal(2, x2Ref.Length); 11018Assert.Equal(2, x3Ref.Length); 11023Assert.Equal(4, x4Ref.Length); 11030Assert.Equal(3, x5Ref.Length); 11036Assert.Equal(2, x8Decl.Length); 11037Assert.Equal(3, x8Ref.Length); 11038for (int i = 0; i < x8Ref.Length; i++) 11046Assert.Equal(6, x9Ref.Length); 11055Assert.Equal(5, x11Ref.Length); 11063Assert.Equal(5, x12Ref.Length); 11071Assert.Equal(2, x13Decl.Length); 11072Assert.Equal(5, x13Ref.Length); 11078Assert.Equal(2, x14Decl.Length); 11079Assert.Equal(4, x14Ref.Length); 11085Assert.Equal(2, x15Decl.Length); 11086Assert.Equal(3, x15Ref.Length); 11087for (int i = 0; i < x15Ref.Length; i++) 11814Assert.Equal(2, x4Ref.Length); 11827Assert.Equal(2, x8Ref.Length); 11833Assert.Equal(2, x14Decl.Length); 11906Assert.Equal(2, x1Ref.Length); 11914Assert.Equal(2, x2Ref.Length); 11922Assert.Equal(2, x2Ref.Length); 11995Assert.Equal(3, x1Ref.Length); 12001Assert.Equal(2, x2Decl.Length); 12002Assert.Equal(2, x2Ref.Length); 12009Assert.Equal(2, x3Ref.Length); 12015Assert.Equal(2, x4Ref.Length); 12093Assert.Equal(3, x1Ref.Length); 12099Assert.Equal(2, x2Decl.Length); 12100Assert.Equal(2, x2Ref.Length); 12107Assert.Equal(2, x3Ref.Length); 12113Assert.Equal(2, x4Ref.Length); 12153Assert.Equal(1, x1Ref.Length); 12206Assert.Equal(2, x1Ref.Length); 12445Assert.Equal(2, x1Ref.Length); 12451Assert.Equal(2, x2Ref.Length); 12457Assert.Equal(3, x4Ref.Length); 12464Assert.Equal(2, x6Ref.Length); 12470Assert.Equal(2, x7Ref.Length); 12477Assert.Equal(3, x8Ref.Length); 12484Assert.Equal(2, x9Decl.Length); 12485Assert.Equal(4, x9Ref.Length); 12491Assert.Equal(2, y10Ref.Length); 12500Assert.Equal(2, x14Decl.Length); 12501Assert.Equal(2, x14Ref.Length); 12610Assert.Equal(4, x8Decl.Length); 12611Assert.Equal(4, x8Ref.Length); 12621Assert.Equal(3, x9Decl.Length); 12622Assert.Equal(4, x9Ref.Length); 12788Assert.Equal(2, x1Ref.Length); 12794Assert.Equal(2, x2Ref.Length); 12800Assert.Equal(3, x4Ref.Length); 12807Assert.Equal(2, x6Ref.Length); 12813Assert.Equal(2, x7Ref.Length); 12820Assert.Equal(3, x8Ref.Length); 12827Assert.Equal(2, x9Decl.Length); 12828Assert.Equal(4, x9Ref.Length); 12839Assert.Equal(2, y10Ref.Length); 12848Assert.Equal(2, x14Decl.Length); 12849Assert.Equal(2, x14Ref.Length); 12909Assert.Equal(2, x1Ref.Length); 12918Assert.Equal(2, x2Ref.Length); 13001Assert.Equal(3, x1Ref.Length); 13007Assert.Equal(2, x2Decl.Length); 13008Assert.Equal(3, x2Ref.Length); 13015Assert.Equal(3, x3Ref.Length); 13021Assert.Equal(3, x4Ref.Length); 13183Assert.Equal(2, x1Ref.Length); 13189Assert.Equal(2, x2Ref.Length); 13195Assert.Equal(3, x4Ref.Length); 13202Assert.Equal(2, x6Ref.Length); 13208Assert.Equal(2, x7Ref.Length); 13215Assert.Equal(3, x8Ref.Length); 13222Assert.Equal(2, x9Decl.Length); 13223Assert.Equal(4, x9Ref.Length); 13229Assert.Equal(2, y10Ref.Length); 13238Assert.Equal(2, x14Decl.Length); 13239Assert.Equal(2, x14Ref.Length); 13326Assert.Equal(2, x1Ref.Length); 13334Assert.Equal(2, x2Ref.Length); 13340Assert.Equal(2, x3Ref.Length); 13348Assert.Equal(2, x4Decl.Length); 13349Assert.Equal(3, x4Ref.Length); 13410Assert.Equal(2, x5Decl.Length); 13417Assert.Equal(2, x6Decl.Length); 13418Assert.Equal(2, x6Ref.Length); 13425Assert.Equal(3, x7Ref.Length); 13498Assert.Equal(2, x5Decl.Length); 13505Assert.Equal(2, x6Decl.Length); 13506Assert.Equal(2, x6Ref.Length); 13513Assert.Equal(3, x7Ref.Length); 13575Assert.Equal(2, x5Decl.Length); 13582Assert.Equal(2, x6Decl.Length); 13583Assert.Equal(2, x6Ref.Length); 13590Assert.Equal(3, x7Ref.Length); 13654Assert.Equal(2, x5Decl.Length); 13661Assert.Equal(2, x6Decl.Length); 13662Assert.Equal(2, x6Ref.Length); 13669Assert.Equal(3, x7Ref.Length); 13973Assert.Equal(3, x1Decl.Length); 13974Assert.Equal(3, x1Ref.Length); 13989Assert.Equal(2, x4Ref.Length); 13996Assert.Equal(2, x5Ref.Length); 14001Assert.Equal(2, x6Decl.Length); 14002Assert.Equal(2, x6Ref.Length); 14003for (int i = 0; i < x6Decl.Length; i++) 14019Assert.Equal(2, x9Ref.Length); 14024Assert.Equal(2, x10Ref.Length); 14030Assert.Equal(2, x11Ref.Length);
Semantics\PatternMatchingTests2.cs (5)
2168Assert.Equal(expected.Length, i); 2252Assert.Equal(4, patterns.Length); 2296Assert.Equal(3, patterns.Length); 2342Assert.Equal(5, patterns.Length); 2882for (int i = 0; i < switches.Length; i++)
Semantics\PatternMatchingTests3.cs (15)
50Assert.Equal(2, subpatterns.Length); 110Assert.Equal(2, subpatterns.Length); 161Assert.Equal(2, subpatterns.Length); 206Assert.Equal(2, subpatterns.Length); 257Assert.Equal(2, subpatterns.Length); 300Assert.Equal(2, subpatterns.Length); 347Assert.Equal(2, subpatterns.Length); 1890Assert.Equal(3, strDecl.Length); 1894Assert.Equal(3, arrDecl.Length); 1939Assert.Equal(1, x1Decl.Length); 1940Assert.Equal(1, x1Ref.Length); 1945Assert.Equal(1, x2Decl.Length); 1946Assert.Equal(1, x2Ref.Length); 4108Assert.Equal(31, patterns.Length); 4335Assert.Equal(31, patterns.Length);
Semantics\PatternMatchingTests4.cs (1)
1011for (int i = 0; i < dpcss.Length; i++)
Semantics\PatternMatchingTests5.cs (4)
1107Assert.Equal(2, subpatterns.Length); 1187Assert.Equal(2, subpatterns.Length); 1238Assert.Equal(2, subpatterns.Length); 1290Assert.Equal(2, subpatterns.Length);
Semantics\PrimaryConstructorTests.cs (8)
1004Assert.Equal(2, xs.Length); 1296Assert.Equal(2, yRef.Length); 1468Assert.Equal(2, xs.Length); 1527Assert.Equal(2, xs.Length); 1616Assert.Equal(2, xs.Length); 2188Assert.Equal(1, xxRef.Length); 8757Assert.Equal(8, p1s.Length); 9163Assert.Equal(4, p1s.Length);
Semantics\RecordTests.cs (6)
21370Assert.Equal(2, yRef.Length); 21542Assert.Equal(2, xs.Length); 21601Assert.Equal(2, xs.Length); 21690Assert.Equal(2, xs.Length); 22300Assert.Equal(1, xxRef.Length); 23139Assert.Equal(members.Length, values.Length);
src\Compilers\Core\MSBuildTask\MvidReader.cs (1)
100if (name!.Length == 8 && name[0] == '.' &&
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (2)
EndToEndTests.cs (1)
613Assert.Equal(200, literals.Length);
src\Compilers\Core\MSBuildTask\MvidReader.cs (1)
100if (name!.Length == 8 && name[0] == '.' &&
Microsoft.CodeAnalysis.CSharp.Features (10)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (3)
65if (array.Length > 0) 75for (var i = 0; i < array.Length - 1; i++) 319statementsOnBlockWithForEach[statementsOnBlockWithForEach.Length - 2] == forEachInfo.ForEachStatement)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
3069if (oldVariables.Length != newVariables.Length) 3074for (var i = 0; i < oldVariables.Length; i++)
GenerateType\CSharpGenerateTypeService.cs (1)
572if (containers.Length != 0)
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (2)
120if (statementArray.Length > 0) 127: statementArray.Length == 1
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
85var arrayLengthProperty = TryGetNoArgInt32Property(arrayType, nameof(Array.Length));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_ISymbolInitializer.cs (1)
34Assert.Equal(3, nodes.Length);
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (3)
ObjectFormatterTests.cs (3)
129Assert.Equal(1, attrsA.Length); 130Assert.Equal(1, attrsWE.Length); 131Assert.Equal(1, attrsE.Length);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (7)
InteractiveSessionTests.cs (6)
146Assert.Equal(2, result.Length); 147Assert.Equal(2, ((Array)result.GetValue(0)).Length); 148Assert.Equal(2, ((Array)result.GetValue(1)).Length); 199Assert.Equal(2, result.Length); 200Assert.Equal(2, ((Array)result.GetValue(0)).Length); 201Assert.Equal(2, ((Array)result.GetValue(1)).Length);
ScriptTests.cs (1)
1098bufferSize: bytes.Length,
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (174)
Semantics\BetterCandidates.cs (4)
1088Assert.Equal(5, invocations.Length); 1165Assert.Equal(1, invocations.Length); 1213Assert.Equal(1, invocations.Length); 1266Assert.Equal(1, invocations.Length);
Semantics\BindingAwaitTests.cs (1)
1900Assert.Equal(6, calls.Length);
Semantics\BindingTests.cs (1)
2784Assert.Equal(4, identifiers.Length);
Semantics\DeconstructionTests.cs (3)
5260Assert.Equal(2, tuples.Length); 5404Assert.Equal(2, tuples.Length); 5547Assert.Equal(2, tuples.Length);
Semantics\DelegateTypeTests.cs (4)
3604Assert.Equal(2, exprs.Length); 11087Assert.Equal(3, variables.Length); 11093Assert.Equal(3, identifiers.Length); 11171Assert.Equal(2, variables.Length);
Semantics\ExpressionBodiedMemberTests.cs (2)
1022Assert.Equal(6, nodes.Length); 1024for (int i = 0; i < nodes.Length; i++)
Semantics\ForEachTests.cs (1)
2182Assert.Equal(2, loopSyntaxes.Length);
Semantics\FunctionPointerTests.cs (11)
979Assert.Equal(3, variableDeclaratorSyntaxes.Length); 1047Assert.Equal(2, decls.Length); 1127Assert.Equal(8, decls.Length); 1272Assert.Equal(3, decls.Length); 1367Assert.Equal(8, decls.Length); 1508Assert.Equal(2, decls.Length); 1565Assert.Equal(2, decls.Length); 3377Assert.Equal(2, isPatterns.Length); 3529Assert.Equal(4, binaryExpressions.Length); 3682Assert.Equal(4, paramTypes.Length); 3955Assert.Equal(2, parameterDecls.Length);
Semantics\GlobalUsingDirectiveTests.cs (35)
3843Assert.Equal(2, ext.Length); 3845Assert.Equal(4, aliases.Length); 3869Assert.Equal(2, ext.Length); 3871Assert.Equal(3, aliases.Length); 3891Assert.Equal(1, aliases.Length); 3900Assert.Equal(2, ext.Length); 3902Assert.Equal(2, aliases.Length); 3919Assert.Equal(2, aliases.Length); 3933Assert.Equal(2, ext.Length); 3935Assert.Equal(2, aliases.Length); 3953Assert.Equal(2, ext.Length); 3955Assert.Equal(1, aliases.Length); 3969Assert.Equal(1, aliases.Length); 3978Assert.Equal(2, ext.Length); 3980Assert.Equal(0, aliases.Length); 3991Assert.Equal(2, aliases.Length); 4005Assert.Equal(0, ext.Length); 4007Assert.Equal(4, aliases.Length); 4025Assert.Equal(0, ext.Length); 4027Assert.Equal(3, aliases.Length); 4041Assert.Equal(1, aliases.Length); 4050Assert.Equal(0, ext.Length); 4052Assert.Equal(2, aliases.Length); 4063Assert.Equal(2, aliases.Length); 4077Assert.Equal(0, ext.Length); 4079Assert.Equal(2, aliases.Length); 4091Assert.Equal(0, ext.Length); 4093Assert.Equal(1, aliases.Length); 4101Assert.Equal(1, aliases.Length); 4112Assert.Equal(2, ext.Length); 4114Assert.Equal(2, aliases.Length); 4134Assert.Equal(2, ext.Length); 4136Assert.Equal(0, aliases.Length); 4150Assert.Equal(0, ext.Length); 4152Assert.Equal(2, aliases.Length);
Semantics\IndexAndRangeTests.cs (3)
1123Assert.Equal(4, expressions.Length); 1342Assert.Equal(4, expressions.Length); 1385Assert.Equal(4, expressions.Length);
Semantics\InheritanceBindingTests.cs (1)
8242Assert.Equal(expectedErrors.Length, actualErrors.Count());
Semantics\LambdaDiscardParametersTests.cs (3)
388Assert.Equal(2, lambdas.Length); 449Assert.Equal(3, underscores.Length); 514Assert.Equal(2, underscores.Length);
Semantics\LocalFunctionTests.cs (2)
4695Assert.Equal(3, refs.Length); 4736Assert.Equal(1, refs.Length);
Semantics\LookupPositionTests.cs (4)
3069int actualNumExpectedNames = expectedNames.Length; 3070int expectedNumExpectedNames = keyPositions.Length - 2 + 1; 3073for (int key = 0; key < keyPositions.Length - 1; key++) 3137int numRegions = deltas.Length;
Semantics\LookupTests.cs (1)
1726Assert.Equal(2, syntaxes.Length);
Semantics\NativeIntegerTests.cs (5)
4119Assert.Equal(3, nodes.Length); 9734if (expectedDiagnostics.Length == 0) 10111if (expectedDiagnostics.Length == 0) 10336if (expectedDiagnostics.Length == 0) 12385if (expectedDiagnostics.Length == 0)
Semantics\NullableContextTests.cs (3)
198if (expectedAnalyzedKeys.Length > 0) 247if (expectedAnalyzedKeys.Length > 0) 306if (expectedAnalyzedKeys.Length > 0)
Semantics\NullableReferenceTypesTests.cs (17)
97764Assert.Equal(2, localSyntaxes.Length); 99093Assert.Equal(1, localSyntaxes.Length); 113131for (int i = 0; i < m11.Length; i++) 113137for (int j = 0; j < m12.Length; j++) 113200Assert.Equal(2, arrays.Length); 123870Assert.Equal(31, baseline.Length); 123917for (int i = 0; i < baseline.Length; i++) 124178Assert.Equal(34, fieldsBaseline.Length); 124197Assert.Equal(12, typeParametersBaseline.Length); 124199for (int i = 0; i < typeParametersBaseline.Length; i++) 126856AssertEqual(expected, getResult, inputs.Length); 126872AssertEqual(expected, getResult, inputs.Length); 126888AssertEqual(expected, getResult, inputs.Length); 126903AssertEqual(expected, getResult, inputs.Length); 126919AssertEqual(expected, getResult, inputs.Length); 154808Assert.Equal(5, locals.Length); 154876Assert.Equal(5, locals.Length);
Semantics\ObjectAndCollectionInitializerTests.cs (4)
3809Assert.Equal(2, literals.Length); 3832Assert.Equal(2, literals.Length); 3856Assert.Equal(2, literals.Length); 4012Assert.Equal(6, nodes.Length);
Semantics\OperatorTests.cs (36)
48Assert.Equal(2, orNodes.Length); 7452for (int k = 0; k < operators.Length; k++) 7493for (int name = 0; name < typeNames.Length; name++) 7497if (name == typeNames.Length - 1) 7501else if (name == typeNames.Length - 2) 7525Assert.Equal(n, nodes.Length); 7708Assert.Equal(2, nodes.Length); 7725for (int i = 0; i < symbols1.Length; i++) 7828for (int k = 0; k < opTokens.Length; k++) 7857TypeSymbol[] types = new TypeSymbol[typeNames.Length]; 7859for (int i = 0; i < typeNames.Length - 3; i++) 7864Assert.Null(types[types.Length - 3]); 7865types[types.Length - 3] = compilation.DynamicType; 7867Assert.Null(types[types.Length - 2]); 7868types[types.Length - 2] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_Byte)); 7870Assert.Null(types[types.Length - 1]); 7871types[types.Length - 1] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_SByte)); 7903Assert.Equal(n, nodes.Length); 7988for (int k = 0; k < opTokens.Length; k++) 8017TypeSymbol[] types = new TypeSymbol[typeNames.Length]; 8019for (int i = 0; i < typeNames.Length - 3; i++) 8024Assert.Null(types[types.Length - 3]); 8025types[types.Length - 3] = compilation.DynamicType; 8027Assert.Null(types[types.Length - 2]); 8028types[types.Length - 2] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_Byte)); 8030Assert.Null(types[types.Length - 1]); 8031types[types.Length - 1] = compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_SByte)); 8063Assert.Equal(n, nodes.Length); 8558Assert.Equal(2, nodes.Length); 8591Assert.Equal(2, nodes.Length); 8608for (int i = 0; i < symbols1.Length; i++) 8637Assert.Equal(2, nodes.Length); 8658for (int i = 0; i < symbols1.Length; i++) 8687Assert.Equal(2, nodes.Length); 8708for (int i = 0; i < symbols1.Length; i++) 8761Assert.Equal(12, nodes.Length);
Semantics\RefFieldTests.cs (8)
12132Assert.Equal(2, decls.Length); 12420Assert.Equal(6, discard.Length); 12571Assert.Equal(6, decls.Length); 12600Assert.Equal(6, discard.Length); 12831Assert.Equal(8, discard.Length); 12978Assert.Equal(6, decls.Length); 13007Assert.Equal(6, discard.Length); 14875Assert.Equal(6, discard.Length);
Semantics\RefLocalsAndReturnsTests.cs (2)
5256Assert.Equal(3, decls.Length); 5295Assert.Equal(2, decls.Length);
Semantics\StackAllocInitializerTests.cs (6)
368Assert.Equal(3, expressions.Length); 444Assert.Equal(3, expressions.Length); 2360Assert.Equal(3, expressions.Length); 2466Assert.Equal(3, expressions.Length); 2566Assert.Equal(2, expressions.Length); 2650Assert.Equal(2, expressions.Length);
Semantics\TargetTypedDefaultTests.cs (5)
1722if (diagnostics.Length == 0) 1788if (diagnostics.Length == 0) 1859if (diagnostics.Length == 0) 3674Assert.Equal(4, defaultLiterals.Length); 3714Assert.Equal(7, parameters.Length);
Semantics\TopLevelStatementsTests.cs (5)
541Assert.Equal(2, localRefs.Length); 6035Assert.Equal(9, localRefs.Length); 8801Assert.Equal(nodes1.Length, nodes2.Length); 8803for (int i = 0; i < nodes1.Length; i++)
Semantics\UnsafeTests.cs (1)
10225Assert.Equal(numSymbols, dereferences.Length);
Semantics\VarianceTests.cs (2)
105int numFields = validAssignments.Length - 1; 218int numFields = validAssignments.Length - 1;
SourceGeneration\GeneratorDriverTests.cs (4)
2221Assert.Equal(generatedContent.Length, trees.Length); 2222for (int i = 0; i < generatedContent.Length; i++) 2364Assert.Equal(generatedContent.Length, trees.Length); 2365for (int i = 0; i < generatedContent.Length; i++)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (107)
Compilation\CSharpCompilationOptionsTests.cs (4)
457var options = new CSharpCompilationOptions[values.Length]; 459for (int i = 0; i < values.Length; i++) 465for (int i = 0; i < values.Length; i++) 469for (int j = 0; j < values.Length; j++)
Compilation\GetImportScopesTests.cs (1)
399if (aliases.Length == 0)
Compilation\GetSemanticInfoTests.cs (6)
336for (var from = 0; from < types.Length; from++) 338for (var to = 0; to < types.Length; to++) 3280for (int i = 0; i < threads.Length; i++) 4590Assert.Equal(2, memberAccesses.Length); 6046var symbol = model.GetDeclaredSymbol(typeParameters[typeParameters.Length - 1]); 6048symbol = model.GetDeclaredSymbol(typeParameters[typeParameters.Length - 2]);
Compilation\ReferenceManagerTests.cs (3)
840Debug.Assert(parts.Length >= 3); 842int dir = parts.Length - 2; 947Assert.Equal(3, mods.Length);
Compilation\SemanticModelAPITests.cs (3)
405Assert.Equal(1, nsArray.Length); 426Assert.Equal(1, nsArray.Length); 926Assert.Equal(2, exprs.Length);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
3924Assert.Equal(2, usingDirectives.Length);
Compilation\SemanticModelGetSemanticInfoTests_LateBound.cs (1)
636for (int i = 0; i < operators.Length; i++)
Compilation\UsedAssembliesTests.cs (3)
215for (int i = 0; i < input.Length; i++) 236System.Array.Copy(input, output = new DiagnosticDescription[input.Length], input.Length);
DocumentationComments\CrefTests.cs (4)
3048Assert.Equal(6, actualParameterTypes.Length); 5242Assert.Equal(8, crefs.Length); 6498Assert.Equal(2, crefs.Length); 6533Assert.Equal(2, crefs.Length);
SymbolDisplay\SymbolDisplayTests.cs (4)
3458if (expectedKinds.Length > 0) 6868Assert.Equal(2, declarations.Length); 6906Assert.Equal(2, declarations.Length); 6944Assert.Equal(2, declarations.Length);
Symbols\AnonymousTypesSemanticsTests.cs (1)
1407Assert.Equal(3, properties.Length);
Symbols\AnonymousTypesSymbolTests.cs (10)
258Assert.Equal(1, args.Length); 586for (int j = 0; j < tasks.Length; j++) 988int cnt = typeDescrs.Length; 989Assert.Equal(0, module.GlobalNamespace.GetMembers("<>f__AnonymousType" + cnt.ToString()).Length); 1004int fieldsCount = typeDescr.FieldNames.Length; 1030Assert.Equal(0, type.GetMembers("doesnotexist").Length); 1148Assert.Equal(attributes.Length, actual.Length); 1150for (int index = 0; index < attributes.Length; index++) 1156Assert.Equal(attr.ConstructorArguments.Length, actual[index].CommonConstructorArguments.Length); 1157for (int argIndex = 0; argIndex < attr.ConstructorArguments.Length; argIndex++)
Symbols\CompilationCreationTests.cs (2)
39int numTrees = expectedSyntaxTrees.Length; 2864Assert.Equal(0, diags.Length);
Symbols\ConversionTests.cs (2)
176for (int i = 0; i < types.Length; ++i) 178for (int j = 0; j < types.Length; ++j)
Symbols\CovariantReturnTests.cs (1)
358Assert.Equal(typeArguments.Length, genericType.Arity);
Symbols\DefaultInterfaceImplementationTests.cs (20)
9477compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9AcrossAssemblyBoundaries); 9485if (expectedAcrossAssemblyBoundaries.Length != 0) 14962compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9); 14971if (expectedAcrossAssemblyBoundaries.Length != 0) 15141compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9); 15150if (expectedAcrossAssemblyBoundaries.Length != 0) 15269if (expected.Length == 0) 15868compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9); 15876if (expectedAcrossAssemblyBoundaries.Length != 0) 15973if (expectedAcrossAssemblyBoundaries.Length != 0) 18499compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9); 18509if (expectedAcrossAssemblyBoundaries.Length != 0) 28505compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9); 28514if (expectedAcrossAssemblyBoundaries.Length != 0) 28646compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9); 28654if (expectedAcrossAssemblyBoundaries.Length != 0) 28772if (expected.Length == 0) 29380compilation3.VerifyDiagnostics(expectedAcrossAssemblyBoundaries.Length != 0 ? expectedAcrossAssemblyBoundaries : expectedIn9); 29388if (expectedAcrossAssemblyBoundaries.Length != 0) 38455if (expected.Length == 0)
Symbols\FunctionPointerTypeSymbolTests.cs (11)
130Assert.Equal(8, parameterDecls.Length); 210Assert.Equal(2, parameterDecls.Length); 340Assert.Equal(3, functionPointers.Length); 411Assert.Equal(6, parameterDecls.Length); 491Assert.Equal(4, parameterDecls.Length); 608Assert.Equal(9, parameterDecls.Length); 904var overallEquality = returnEquality | callingConventionEquality | (parameterEqualities.Length > 0 ? parameterEqualities.Aggregate((acc, cur) => acc | cur) : 0); 1432Assert.Equal(2, anonymousObjectCreations.Length); 1802Assert.Equal(3, ptrTypes.Length); 1842Assert.Equal(2, invocations.Length); 1928Assert.Equal(5, decls.Length);
Symbols\IndexerTests.cs (3)
213Assert.Equal(parameters.Length, expectedTypes.Length); 214for (int i = 0; i < expectedTypes.Length; i++) 2720Assert.Equal(3, receiverSyntaxes.Length);
Symbols\Metadata\PE\LoadingMethods.cs (7)
47Assert.Equal(6, varTC10.GetMembers().Length); 91Assert.Equal(0, localM6.Length); 105Assert.Equal(2, csharpC1.GetMembers("SameName2").Length); 106Assert.Equal(1, csharpC1.GetMembers("sameName2").Length); 108Assert.Equal(0, csharpC1.GetMembers("DoesntExist").Length); 131Assert.Equal(1, emptyStructure.GetMembers().Length); //synthesized parameterless constructor 132Assert.Equal(0, emptyStructure.GetMembers("NoMembersOrTypes").Length);
Symbols\Metadata\PE\MissingTypeReferences.cs (2)
359for (int i = 0; i < missingTypes1.Length; i++) 361for (int j = 0; j < missingTypes2.Length; j++)
Symbols\Metadata\PE\NoPia.cs (2)
176for (int i = 0; i < assemblies1.Length; i++) 503for (int i = 0; i < assemblies1.Length; i++)
Symbols\Metadata\PE\TypeForwarders.cs (3)
1511Assert.Equal(forwardedTypeFullNames.Length, metadataReader.GetTableRowCount(TableIndex.ExportedType)); 1780Assert.Equal(forwardedTypeFullNames.Length, peReader.GetTableRowCount(TableIndex.ExportedType)); 1795int numParts = split.Length;
Symbols\MethodEqualityTests.cs (1)
220Assert.Equal(6, invokedMethods.Length);
Symbols\Retargeting\NoPia.cs (3)
483for (int i = 0; i < assemblies1.Length; i++) 784for (int i = 0; i < assemblies1.Length; i++) 1088for (int i = 0; i < assemblies1.Length; i++)
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
114int expectedNumber = expectedSyntaxNodes.Length;
Symbols\Source\EnumTests.cs (3)
980Assert.Equal(4, decls.Length); 994if (expectedEnumValues.Length > 0) 1015Assert.Equal(expectedEnumValues.Length, fields.Count);
Symbols\Source\NullablePublicAPITests.cs (3)
4817Assert.Equal(2, memberAccesses.Length); 5401Assert.Equal(2, collectionExprs.Length); 5458Assert.Equal(2, collectionExprs.Length);
Symbols\TypeTests.cs (2)
1683Assert.Equal(6, locals.Length); 2632Assert.Equal(7, nestedTypes.Length);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (45)
IncrementalParsing\IncrementalParsingTests.cs (1)
115Assert.InRange(diffs.Length, 0, kinds.Length);
LexicalAndXml\LexicalTests.cs (18)
114Assert.Equal(1, trivia.Length); 133Assert.Equal(1, trivia.Length); 152Assert.Equal(1, trivia.Length); 192Assert.Equal(1, trivia.Length); 214Assert.Equal(1, trivia.Length); 236Assert.Equal(1, trivia.Length); 254Assert.Equal(1, trivia.Length); 276Assert.Equal(1, trivia.Length); 300Assert.Equal(1, trivia.Length); 324Assert.Equal(1, trivia.Length); 346Assert.Equal(1, trivia.Length); 368Assert.Equal(1, trivia.Length); 390Assert.Equal(1, trivia.Length); 410Assert.Equal(1, trivia.Length); 438Assert.Equal(1, trivia.Length); 545Assert.Equal(3, trivia.Length); 562Assert.Equal(2, tokens.Length); 602Assert.Equal(1, trivia.Length);
LexicalAndXml\PreprocessorTests.cs (10)
123Assert.Equal(expected.Length, directives.Count); 124if (expected.Length == 0) 146Assert.Equal(expected.Length, directives.Count); 327if (expected.WarningList == null || expected.WarningList.Length == 0) 333Assert.Equal(expected.WarningList.Length, pwd.ErrorCodes.Count); 361Assert.Equal(3, expected.FileGuidByte.Length); 392if ((expected.Length == 0) && (actual.Count == 0)) 398Assert.InRange(actual.Count, expected.Length, int.MaxValue); 401if (actual.Count < expected.Length) 438Assert.Equal(memberInfo.Length, node.Members.Count);
LexicalAndXml\SyntaxTokenParserTests.cs (2)
418Assert.Equal(expectedTrivia.Length, leadingTrivia.Count); 419for (int i = 0; i < expectedTrivia.Length; i++)
Parsing\DeclarationParsingTests.cs (2)
2696Assert.Equal(modifiers.Length, ms.Modifiers.Count); 2697for (int i = 0; i < modifiers.Length; ++i)
Parsing\ParserErrorMessageTests.cs (4)
6521Assert.Equal(1, actualErrors.Length); 6554Assert.Equal(1, actualErrors.Length); 6581Assert.Equal(1, actualErrors.Length); 6608Assert.Equal(1, actualErrors.Length);
Parsing\ScriptParsingTests.cs (2)
43if (errors == null || errors.Length == 0) 9651Assert.Equal(2, leading.Length);
Parsing\StatementParsingTests.cs (3)
3417Assert.True((tokens2.Length - tokens1.Length) > n); 3443Assert.True(tokens.Length > n);
Syntax\GreenNodeTests.cs (1)
21Assert.Equal(1, diags.Length);
Syntax\SyntaxNodeTests.cs (1)
398Assert.True(directiveKinds.Length > 0);
Syntax\SyntaxTests.cs (1)
307Assert.Equal(0, method.GetParameters().Length);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (17)
AttributeValidation.cs (1)
31Assert.Equal(2, isUnmanagedTypeAttributes.Length);
CompilationTestUtils.cs (5)
32Assert.Equal(descriptions.Length, symbols.Length); 38for (int i = 0; i < descriptions.Length; i++) 47Assert.Equal(descriptions.Length, symbols.Length); 53for (int i = 0; i < descriptions.Length; i++) 62Assert.Equal(descriptions.Length, symbols.Length);
CSharpTestBase.cs (2)
1096if (sources == null || (sources.Length == 1 && null == sources[0])) 1966for (int i = 0; i < result.Length; i++)
DiagnosticTestUtilities.cs (2)
101int expectedLength = expectedErrorDesp.Length; 179Assert.InRange(expectedErrorDesp.Length, 0, actualErrors.Count());
EmitMetadataTestBase.cs (1)
102var actualEntries = new List<DeclSecurityEntry>(expectedEntries.Length);
Extensions.cs (3)
103for (int i = 0; i < Math.Max(thisRefs.Length, thatRefs.Length); i++) 555for (var i = 0; i <= a.Length - 1; i++)
FunctionPointerUtilities.cs (2)
301Assert.Equal(argumentVerifiers.Length, signature.ParameterCount); 302for (int i = 0; i < argumentVerifiers.Length; i++)
TestOptions.cs (1)
153if (features.Length == 0)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (1)
PdbTests.cs (1)
70var pdbStream = new MemoryStream(pdbArray, 1, pdbArray.Length - 10);
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
Simplification\CSharpSimplificationService.Expander.cs (2)
175if (parameters.Length > 0 && parameters.Any(p => p.Type == null)) 185for (var i = 0; i < parameterSymbols.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
473for (var i = 0; i < originalSwitchLabels.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
304for (var i = 0; i < names.Length; i++)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Formatting\FormattingTests.cs (1)
9120for (var i = 0; i < lines.Length; i++)
Microsoft.CodeAnalysis.Debugging.Package (6)
CustomDebugInfoEncoder.cs (2)
156Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 160builder.WriteBytes(0, sizeof(byte) * (DynamicAttributeSize - info.Flags.Length));
CustomDebugInfoReader.cs (4)
73if (customDebugInfo.Length < CustomDebugInfoConstants.GlobalHeaderSize) 86while (offset <= customDebugInfo.Length - CustomDebugInfoConstants.RecordHeaderSize) 107if (offset > customDebugInfo.Length - bodySize || alignmentSize > 3 || alignmentSize > bodySize) 866return Encoding.UTF8.GetString(block, 0, block.Length);
Microsoft.CodeAnalysis.EditorFeatures (7)
EditorConfigSettings\Data\CodeStyleSetting`1.cs (2)
34Contract.ThrowIfFalse(possibleValues.Length == valueDescriptions.Length);
EditorConfigSettings\Data\NamingStyleSetting.cs (1)
87if (selectedIndex > -1 && selectedIndex < _allStyles.Length && Location is not null)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (2)
277return language.HasFlag(Language.CSharp) && !language.HasFlag(Language.VisualBasic) && splicedFileExtensions.Contains("cs") && splicedFileExtensions.Length == 1; 282return language.HasFlag(Language.VisualBasic) && !language.HasFlag(Language.CSharp) && splicedFileExtensions.Contains("vb") && splicedFileExtensions.Length == 1;
Shared\Extensions\IProjectionBufferFactoryServiceExtensions.cs (1)
245if (exposedLineSpans.Length > 0)
Shared\Utilities\ClassificationTypeMap.cs (1)
40_identityMap = new Dictionary<string, IClassificationType>(fields.Length, ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (15)
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (1)
58for (var i = 0; i < lines.Length; i++)
CommentSelection\AbstractToggleCommentTestBase.cs (1)
44for (var i = 0; i < expectedText.Length; i++)
Completion\AbstractCompletionProviderTests.cs (2)
745for (var i = 0; i < referencedTexts.Length; ++i) 756for (var i = 0; i < referencedTexts.Length; ++i)
QuickInfo\ToolTipAssert.cs (4)
133for (var i = 0; i < elements.Length; i++) 137if (i < elements.Length - 1) 159for (var i = 0; i < runs.Length; i++) 163if (i < runs.Length - 1)
Rename\RenamerTests.cs (4)
52for (var i = 0; i < startDocuments.Length; i++) 114if (splitPath.Length == 1) 119return splitPath.Take(splitPath.Length - 1).ToArray(); 185for (var i = 0; i < startDocuments.Length; i++)
Structure\AbstractSyntaxStructureProviderTests.cs (3)
54Assert.True(expectedRegions.Length == actualRegions.Length, $"Expected {expectedRegions.Length} regions but there were {actualRegions.Length}"); 56for (var i = 0; i < expectedRegions.Length; i++)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (20)
CodeFixes\ExtensionOrderingTests.cs (5)
44Assert.True(actualOrder.Length > 0); 51Assert.True(actualOrder.Length > 0); 80Assert.Equal(3, actualOrder.Length); 104Assert.True(actualOrder.Length > 0); 109Assert.True(actualOrder.Length > 0);
CodeGeneration\CodeGenerationTests.cs (1)
932var list = new FixedSizeArrayBuilder<SyntaxNode>(parts.Length);
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (4)
98Assert.True(expectedLines.Length % 2 == 0); 100for (var i = 0; i < expectedLines.Length; i += 2) 123if (expectedLines.Length == 0) 153if (expectedLines.Length == 0)
EmbeddedLanguages\StackFrame\StackFrameSyntaxFactory.cs (4)
69var separatedList = parameters.Length == 0 80for (var i = 1; i < parameters.Length; i++) 110for (var i = 0; i < identifiers.Length; i++) 118else if (i == identifiers.Length - 1)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
173Assert.Equal(0, diagnostics.Length);
StackTraceExplorer\StackTraceExplorerTests.cs (2)
67Assert.Equal(contents.Length, frames.Length); 68for (var i = 0; i < contents.Length; i++)
ValueTracking\AbstractBaseValueTrackingTests.cs (3)
45Assert.True(itemInfo.Length == items.Length, $"GetTrackedItemsAsync\n\texpected: [{string.Join(",", itemInfo.Select(p => p.text))}]\n\t actual: [{string.Join(",", items)}]"); 58Assert.True(childInfo.Length == children.Length, $"GetTrackedItemsAsync on [{item}]\n\texpected: [{string.Join(",", childInfo.Select(p => p.text))}]\n\t actual: [{string.Join(",", children)}]"); 60for (var i = 0; i < childInfo.Length; i++)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Lightup\LightupHelpers.cs (1)
256var method = type.GetTypeInfo().GetDeclaredMethods(methodName).Single(method => method.GetParameters().Length == 0);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (3)
Diagnostics\NamingStyles\NamingStyleTests.vb (2)
41Assert.Equal(expectedFixedNames.Length, actualFixedNames.Count) 42For i = 0 To expectedFixedNames.Length - 1
IntelliSense\CSharpCompletionCommandHandlerTests.vb (1)
9599Dim builder = ArrayBuilder(Of CompletionItem).GetInstance(items.Length)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (4)
PDB\MethodDebugInfo.Native.cs (2)
259if (childScopes.Length == 0) 271if (namespaces.Length == 0)
PDB\MethodDebugInfo.Portable.cs (2)
243return Encoding.UTF8.GetString(bytes, 0, bytes.Length); 262return Encoding.UTF8.GetString(bytes, 0, bytes.Length);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
MetadataResolver.cs (1)
169for (int index = parts.Length - 1; index >= 0; index--)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (2)
ParsingTestBase.cs (2)
44Assert.True(typeArguments.Length > 0); 60Assert.True(typeArguments.Length > 0);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (34)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\Compilers\Core\Portable\Xml\XmlCharType.cs (2)
1142Debug.Assert(startPos + len <= chars.Length); 1143Debug.Assert(startPos <= chars.Length);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ArrayExpansion.cs (1)
128var n = indices.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\MemberExpansion.cs (3)
281Debug.Assert(members.Length > 0); 304GetIntersection(startIndex, count, index, _members.Length, out startIndex2, out count2); 312index += _members.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TypeVariablesExpansion.cs (4)
34Debug.Assert(_typeParameters.Length == _typeArguments.Length); 52GetIntersection(startIndex, count, index, _typeArguments.Length, out startIndex2, out count2); 60index += _typeArguments.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (3)
199var numTypeArguments = hasTypeArguments ? typeArguments.Length : 0; 229int arity = hasTypeArguments ? containingType.GetGenericArguments().Length - typeArgumentOffset : 0; 402int nTypeArgs = typeArguments.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\CustomTypeInfoTypeArgumentMap.cs (4)
41int n = typeDefinition.GetGenericArguments().Length; 42Debug.Assert(dynamicFlagStartIndices == null || dynamicFlagStartIndices.Length == n + 1); 43Debug.Assert(tupleElementNameStartIndices == null || tupleElementNameStartIndices.Length == n + 1); 178Debug.Assert(typeArgs.Length > 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\MemberAndDeclarationInfo.cs (1)
236Debug.Assert(accessors.Length > 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (9)
277return (property.GetIndexParameters().Length == 0) 381if (typeArgs.Length == 1) 440int n = typeArguments.Length; 679if (typeArgs.Length != underlyingProxy.GetGenericArguments().Length) 702Debug.Assert(typeDef.GetGenericArguments().Length == typeArgs.Length); 861Debug.Assert(((PropertyInfo)member).GetIndexParameters().Length == 0); 862if (((PropertyInfo)candidate).GetIndexParameters().Length == 0)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeWalker.cs (1)
64var numChildren = children.Length;
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (44)
Debugger\Engine\DkmClrModuleInstance.cs (1)
55Debug.Assert(typeArguments.Count == type.GetGenericArguments().Length);
Debugger\Engine\DkmClrRuntimeInstance.cs (2)
89if (typeArguments.Length > 0) 122return assembly.GetReferencedAssemblies().Length == 0 && (object)assembly.GetType("System.Object") != null;
Debugger\Engine\DkmClrType.cs (1)
128var genericArgs = (typeArgs.Length == 0)
Debugger\Engine\DkmClrValue.cs (1)
278var trimmedFormatSpecifiers = ArrayBuilder<string>.GetInstance(rawFormatSpecifiers.Length);
Debugger\MemberInfo\AssemblyImpl.cs (1)
27Debug.Assert(Assembly.GetReferencedAssemblies().Length == 0, "If this fires, we have to actually implement this method.");
ResultProviderTestBase.cs (6)
35if (dynamicFlags == null || dynamicFlags.Length == 0) 40var builder = ArrayBuilder<bool>.GetInstance(dynamicFlags.Length); 227Assert.Equal(expectedSize, items.Length); 233while (items.Length > 0) 241Assert.Equal(items.Length, 0); 354Assert.Equal(expected.Length, n);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ArrayExpansion.cs (1)
128var n = indices.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\MemberExpansion.cs (3)
281Debug.Assert(members.Length > 0); 304GetIntersection(startIndex, count, index, _members.Length, out startIndex2, out count2); 312index += _members.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TypeVariablesExpansion.cs (4)
34Debug.Assert(_typeParameters.Length == _typeArguments.Length); 52GetIntersection(startIndex, count, index, _typeArguments.Length, out startIndex2, out count2); 60index += _typeArguments.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (3)
199var numTypeArguments = hasTypeArguments ? typeArguments.Length : 0; 229int arity = hasTypeArguments ? containingType.GetGenericArguments().Length - typeArgumentOffset : 0; 402int nTypeArgs = typeArguments.Length;
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\CustomTypeInfoTypeArgumentMap.cs (4)
41int n = typeDefinition.GetGenericArguments().Length; 42Debug.Assert(dynamicFlagStartIndices == null || dynamicFlagStartIndices.Length == n + 1); 43Debug.Assert(tupleElementNameStartIndices == null || tupleElementNameStartIndices.Length == n + 1); 178Debug.Assert(typeArgs.Length > 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\MemberAndDeclarationInfo.cs (1)
236Debug.Assert(accessors.Length > 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (9)
277return (property.GetIndexParameters().Length == 0) 381if (typeArgs.Length == 1) 440int n = typeArguments.Length; 679if (typeArgs.Length != underlyingProxy.GetGenericArguments().Length) 702Debug.Assert(typeDef.GetGenericArguments().Length == typeArgs.Length); 861Debug.Assert(((PropertyInfo)member).GetIndexParameters().Length == 0); 862if (((PropertyInfo)candidate).GetIndexParameters().Length == 0)
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeWalker.cs (1)
64var numChildren = children.Length;
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Editor\Shared\Utilities\FSharpClassificationTypeMap.cs (1)
32_identityMap = new Dictionary<string, IClassificationType>(fields.Length, ReferenceEqualityComparer.Instance);
Microsoft.CodeAnalysis.Features (42)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
588for (var i = 1; i < splicedFileExtensions.Length; i++) 624else if (splicedFileExtensions.Length == 1)
CodeFixes\Suppression\ExportConfigurationFixProviderAttribute.cs (1)
39if (languages.Length == 0)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
34private const string Length = nameof(Array.Length);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
72if (memberAccessName is not nameof(Array.Length) and not nameof(IList.Count))
Debugging\AbstractBreakpointResolver.cs (2)
175Debug.Assert(names.Length >= 2); 181for (var i = names.Length - 2; i >= 0; i--)
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
31Debug.Assert(Enum.GetNames(typeof(TriviaLocation)).Length == TriviaLocationsCount);
ExtractMethod\MethodExtractor.cs (1)
294var name = startingWithLetter.Length == 0 ? originalName : new string(startingWithLetter);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
483if (newTrailing.Length > 0)
MoveStaticMembers\MoveStaticMembersOptions.cs (1)
65NamespaceDisplay = string.Join(separator: ".", namespacesAndType.Take(namespacesAndType.Length - 1));
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
252var lookupTable = new bool[Enum.GetValues(typeof(DeclaredSymbolInfoKind)).Length];
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
135string.Join(PathSeparatorString, pathParts, refIndex + 1, pathParts.Length - refIndex - 1));
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (1)
65var stream = new MemoryStream(embeddedTextBytes, sizeof(int), embeddedTextBytes.Length - sizeof(int));
QuickInfo\Presentation\QuickInfoContentBuilder.cs (1)
22var result = new Dictionary<Glyph, QuickInfoGlyphElement>(capacity: glyphs.Length);
src\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (3)
71Debug.Assert(customTags.Length == tags.Length); 73for (var i = 0; i < tags.Length; i++)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (3)
89if (reformattedCopyrightTextParts.Length != fileHeaderCopyrightTextParts.Length) 95for (var i = 0; i < reformattedCopyrightTextParts.Length; i++)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (5)
58if (messageArgs == null || messageArgs.Length == 0) 232return Encoding.UTF8.GetString(jsonBytes, 0, jsonBytes.Length); 360_formatArguments = new string[formatArguments.Length]; 361for (var i = 0; i < formatArguments.Length; i++) 371? (_formatArguments.Length > 0 ? string.Format(formatProvider, messageFormat, _formatArguments) : messageFormat)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
777if (symbolParameters.Length != expectedParameters.Length) 782for (int i = 0; i < expectedParameters.Length; ++i)
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (2)
156Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 160builder.WriteBytes(0, sizeof(byte) * (DynamicAttributeSize - info.Flags.Length));
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (3)
73if (customDebugInfo.Length < CustomDebugInfoConstants.GlobalHeaderSize) 86while (offset <= customDebugInfo.Length - CustomDebugInfoConstants.RecordHeaderSize) 107if (offset > customDebugInfo.Length - bodySize || alignmentSize > 3 || alignmentSize > bodySize)
SymbolSearch\Windows\NativePatching.cs (3)
68var ds = new DeltaInput(pSourceBuf, sourceBytes.Length, true); 69var dp = new DeltaInput(pPatchBuf, patchBytes.Length, true); 79Marshal.Copy(output.pBuf, targetBytes, 0, targetBytes.Length);
SymbolSearch\Windows\SymbolSearchUpdateEngine.IOService.cs (1)
32fileStream.Write(bytes, 0, bytes.Length);
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (5)
357LogInfo($"Reading in local database completed. databaseBytes.Length={databaseBytes.Length}"); 446LogInfo($"Got patch. databaseBytes.Length={databaseBytes.Length} patchBytes.Length={patchBytes.Length}."); 452LogInfo($"Applying patch completed. finalBytes.Length={finalBytes.Length}"); 665LogInfo($"Parsing complete. bytes.length={bytes.Length}");
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
EditAndContinue\ActiveStatementsDescription.cs (1)
53var activeStatementCount = Math.Max(OldStatements.Length, (newActiveStatementMarkers.Length == 0) ? -1 : newActiveStatementMarkers.Max(m => m.Id));
EditAndContinue\EditAndContinueTestVerifier.cs (5)
112Assert.True(editScripts.Length == expectedResults.Length); 113var documentCount = expectedResults.Length; 121Debug.Assert(oldDocuments.Length == newDocuments.Length);
EditAndContinue\RudeEditDiagnosticDescription.cs (1)
76Assert.True(false, $"Message format string was not supplied enough arguments.\nRudeEditKind: {RudeEditKind}\nArguments supplied: {_arguments.Length}\nFormat string: {format}");
EditAndContinue\SourceMarkers.cs (1)
43select (int.Parse(parts[0]), (parts.Length > 1) ? int.Parse(parts[1]) : -1);
Snippets\AbstractSnippetProviderTests.cs (2)
71Assert.Equal(placeholderLocationsArray.Length, snippetPlaceholders.Length); 84for (var i = 0; i < placeholderLocationsArray.Length; i++)
Microsoft.CodeAnalysis.Features.UnitTests (4)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (3)
67var sourceTreeA1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesA1, sourceBytesA1.Length, encodingA, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileA.Path); 68var sourceTreeB1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesB1, sourceBytesB1.Length, encodingB, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileB.Path); 69var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path);
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
74for (var i = 0; i < markedSources.Length; i++)
Microsoft.CodeAnalysis.InteractiveHost (20)
Interactive\Core\InteractiveHost.RemoteService.cs (6)
126var buffer = new char[BaseLength + transcodingMarker.Length]; 149int additionalCharsToRead = transcodingMarkerStart + transcodingMarker.Length - charsRead; 155if (ArraysEqual(buffer, transcodingMarkerStart, transcodingMarker, 0, transcodingMarker.Length)) 181if (leftStart + length > left.Length || rightStart + length > right.Length) 200if (buffer.Length < newBufferLength)
Interactive\Core\InteractiveHost.Service.cs (1)
831stream.Write(data, 0, data.Length);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
558if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 566var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 583var remainingParts = directoryPathParts.Length - index; 593for (int i = index; i < fullPathParts.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
97var maxSize = Math.Min(maxItemsToHash, values.Length); 206for (int i = 0; i < data.Length; i++)
src\Dependencies\PooledObjects\ArrayBuilder.cs (2)
42for (var i = 0; i < result.Length; i++) 615Debug.Assert(start + length <= items.Length);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\ProjectTelemetry\VsReferenceHashingAlgorithm.cs (1)
109for (var j = 0; j < inputstream.Length; j++)
Microsoft.CodeAnalysis.LanguageServer.Protocol (31)
Handler\CodeActions\CodeActionHelpers.cs (1)
430for (var i = 0; i < codeActionPath.Length; i++)
Handler\CodeActions\CodeActionResolveHelper.cs (1)
291if (edits.Length > 0)
Handler\Completion\CompletionResultFactory.cs (1)
266for (var i = 0; i < completionList.Items.Length; i++)
Handler\Diagnostics\Public\PublicDocumentPullDiagnosticsHandler.cs (1)
69if (progressValues != null && progressValues.Length > 0)
Handler\DocumentChanges\DidChangeHandler.cs (1)
42for (var i = 1; i < contentChanges.Length; i++)
Handler\SemanticTokens\SemanticTokensHelpers.cs (2)
34if (ranges.Length == 0) 44var spans = new FixedSizeArrayBuilder<LinePositionSpan>(ranges.Length);
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (1)
199Contract.ThrowIfTrue(triplesIndex != triples.Length);
LspServices\LspServiceMetadataView.cs (1)
48while (index < methodHandlerData.Length)
Protocol\Internal\Efficiency\OptimizedVSCompletionListJsonConverter.cs (6)
42if (completionList.ContinueCharacters != null && completionList.ContinueCharacters.Length > 0) 64if (completionList.Items == null || completionList.Items.Length == 0) 120&& basicCommitCharacters.Length > 0) 132&& augmentedCommitCharacters.Length > 0) 210if (completionItem.AdditionalTextEdits != null && completionItem.AdditionalTextEdits.Length > 0) 216if (completionItem.CommitCharacters != null && completionItem.CommitCharacters.Length > 0)
Protocol\Internal\VSInternalIconMapping.cs (8)
61for (var i = 0; i < this.Images.Length; i++) 70for (var i = 0; i < this.Tags.Length; i++) 88current.Length == other.Length) 90for (var i = 0; i < current.Length; i++) 116current.Length == other.Length) 118for (var i = 0; i < current.Length; i++)
Protocol\Internal\VSInternalKindAndModifier.cs (4)
78for (var i = 0; i < this.Modifier.Length; i++) 99modifiers.Length == this.Modifier.Length) 101for (var i = 0; i < modifiers.Length; i++)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\MethodHandlerDetails.cs (3)
165if (parameters.Length != types.Length) 168for (int i = 0, n = parameters.Length; i < n; i++)
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\RequestExecutionQueue.cs (1)
355for (var i = 0; i < concurrentlyExecutingTasksArray.Length; i++)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
References\FindAllReferencesHandlerTests.cs (1)
336for (var i = 0; i < referenceItems.Length; i++)
SemanticTokens\AbstractSemanticTokensTests.cs (4)
70Assert.True(tokens.Length % 5 == 0); 72for (var i = 0; i < tokens.Length; i += 5) 119var convertedStringsBuilder = ImmutableArray.CreateBuilder<string>(data.Length / 5); 122for (var i = 0; i < data.Length; i += 5)
Symbols\DocumentSymbolsTests.cs (1)
51Assert.Equal(expected.Length, results.Length);
Microsoft.CodeAnalysis.PooledObjects.Package (5)
ArrayBuilder.cs (2)
42for (var i = 0; i < result.Length; i++) 615Debug.Assert(start + length <= items.Length);
ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
Microsoft.CodeAnalysis.Rebuild (4)
CompilationOptionsReader.cs (1)
210var stream = new MemoryStream(bytes, sizeof(int), bytes.Length - sizeof(int));
MetadataCompilationOptions.cs (3)
40if (optionValues.Length != 1) 52if (optionValues.Length != 1) 54throw new InvalidOperationException(string.Format(RebuildResources._0_exists_1_times_in_compilation_options, optionName, optionValues.Length));
Microsoft.CodeAnalysis.Rebuild.UnitTests (6)
BasicDeterministicKeyBuilderTests.cs (2)
69var count = fields.Length + properties.Length;
CSharpDeterministicKeyBuilderTests.cs (2)
68var count = fields.Length + properties.Length;
DeterministicKeyBuilderTests.cs (2)
53if (ignoreSections.Length > 0) 114if (ignoreProperties.Length > 0)
Microsoft.CodeAnalysis.Scripting (19)
Hosting\AssemblyLoader\DesktopAssemblyLoaderImpl.cs (2)
33peStream.TryReadAll(peImage, 0, peImage.Length); 38pdbStream.TryReadAll(pdbImage, 0, pdbImage.Length);
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (4)
402if (getter.GetParameters().Length > 0) 648if (array.Length == 0) 667int i = indices.Length - 1; 685i = indices.Length - 1;
Hosting\ObjectFormatter\CommonTypeNameFormatter.cs (3)
99if (typeArguments.Length == 0) 289int currentArgCount = (typeInfo.IsGenericTypeDefinition ? typeInfo.GenericTypeParameters.Length : typeInfo.GenericTypeArguments.Length) - genericArgIndex;
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (2)
207if (method.GetParameters().Length == 0) 215if (getter?.GetParameters().Length == 0)
Hosting\Resolvers\NuGetPackageResolver.cs (2)
25Debug.Assert(parts.Length > 0); 29switch (parts.Length)
ScriptExecutionState.cs (2)
160if (SubmissionStateCount >= _submissionStates.Length) 162Array.Resize(ref _submissionStates, Math.Max(SubmissionStateCount, _submissionStates.Length * 2));
src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (4)
197return Marshal.PtrToStringUni((IntPtr)p, (data.Length / 2) - 1); 367nameObject.SetProperty(propertyId, p, (uint)data.Length); 385if (value != null && value.Length == 0) 413bool hasPublicKey = publicKey != null && publicKey.Length != 0;
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (10)
GlobalAssemblyCacheTests.cs (10)
27Assert.True(names.Length >= 1, "At least 1 mscorlib"); 34Assert.True(names.Length >= 1, "At least one 32bit mscorlib"); 41Assert.True(names.Length >= 1, "At least 1 mscorlib"); 48Assert.True(names.Length >= 1, "At least System.Core"); 57Assert.True(names.Length >= 1, "At least System.Core"); 68Assert.True(names.Length >= 1, "At least System.Core"); 75Assert.Equal(0, names.Length); 78Assert.Equal(0, names.Length); 81Assert.Equal(0, names.Length); 85Assert.Equal(0, names.Length);
Microsoft.CodeAnalysis.Scripting.TestUtilities (2)
ObjectFormatterTestBase.cs (2)
28else if (i == expected.Length - 1) 40Assert.Equal(expected.Length, i);
Microsoft.CodeAnalysis.Test.Utilities (47)
Assert\AssertEx.cs (2)
974for (int index = assertions.Length - 1; index >= 0; --index) 990.AppendLine($"{exceptions.Count} out of {assertions.Length} assertions failed.")
Assert\AssertXml.cs (2)
173if (children1.Length != children2Count) 202if (children2Used.Count < children1.Length)
CommonTestBase.cs (4)
441Debug.Assert(sourceFileNames == null || sourceFileNames.Length == files.Length); 475var trees = new SyntaxTree[files.Length]; 476for (int i = 0; i < files.Length; i++)
Compilation\CompilationDifference.cs (1)
120var typeName = (signature.Length == 1) ? GetTypeName((SignatureTypeCode)signature[0]) : null;
Compilation\ControlFlowGraphVerifier.cs (1)
524AssertTrueWithGraph(referencesAfter.Length > 0 &&
Compilation\OperationTreeVerifier.cs (2)
165if (lines.Length <= 1 && text.Length < 25) 172var lastLine = lines[lines.Length - 1];
Compilation\TestOperationVisitor.cs (2)
1391Assert.Equal(2, children.Length); 1779Assert.Equal(index, children.Length);
CompilationVerifier.cs (3)
437|| errorArguments.Length == 0) 446for (int i = 0; i < x.Length; i++) 545for (int i = 0; i < qualifiedMethodNamesAndExpectedIL.Length;)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
371if (suppressionKinds?.Length > 0) 386if (overriddenEffectiveSeveritiesWithIndex.Length == 0)
Diagnostics\DiagnosticDescription.cs (2)
181if (_arguments != null && _arguments.Length == 0) 425if (i < _arguments.Length - 1)
Diagnostics\DiagnosticExtensions.cs (1)
239var builder = ArrayBuilder<DiagnosticDescription>.GetInstance(expectedDiagnostics.Length);
FX\EncodingUtilities.cs (3)
18byte[] bytes = new byte[preamble.Length + content.Length]; 20content.CopyTo(bytes, preamble.Length);
Metadata\ILValidation.cs (1)
97publicKeyBlob.CopyTo(CryptoBlobParser.s_publicKeyHeaderSize, publicKeyParams, 0, publicKeyParams.Length);
Metadata\MetadataReaderUtils.cs (1)
284var stream = new MemoryStream(bytes, sizeof(int), bytes.Length - sizeof(int));
Mocks\MoqExtensions.cs (1)
20for (int i = 0; i < expectedInvocations.Length; i++)
PDB\DeterministicBuildCompilationTestHelpers.cs (1)
94Assert.Equal(references.Length + frameworkReferences.Length, count);
Platform\Custom\MetadataSignatureHelper.cs (3)
54if (genericConstraints.Length > 0) 562if (propertyAccessors.Length > 0) 571if (indexParameters.Length > 0)
Platform\Custom\SigningTestHelpers.cs (1)
69strongName.StrongNameKeyInstall(keyName, (IntPtr)p, keyBlob.Length);
Platform\Desktop\CLRHelpers.cs (4)
114dispenser.OpenScopeOnMemory(buffer, (uint)peImage.Length, CorOpenFlags.ofRead, ref riid, out metaDataImport); 122ulMaxError: 10, token: 0, fileName: assemblyPath, pe: buffer, ulSize: (uint)peImage.Length); 206for (int i = 0; i < parts.Length; i++) 209if (i < (parts.Length - 1))
Platform\Desktop\RuntimeAssemblyManager.cs (3)
396var count = entryPoint.GetParameters().Length; 435if (output.Length > 0) 437if (modulesToVerify.Length > 1)
Syntax\SourceUtilities.cs (2)
19for (var i = 0; i < _buffer.Length; i++) 25public override char this[int position] => _buffer[position % _buffer.Length];
TestHelpers.cs (1)
159for (var i = 0; i < bytes.Length; i++)
Win32Res.cs (4)
118while (cbuffer[i] != '\0' && ++i < cbuffer.Length); 168Marshal.Copy(versionRsrc, entireResourceBytes, 0, entireResourceBytes.Length); 259for (int i = 0; i < key.Length; i++) 265for (int i = 0; i < value.Length; i++)
Microsoft.CodeAnalysis.UnitTests (216)
AnalyzerAssemblyLoaderTests.cs (4)
423Assert.Equal(expectedCopyCount ?? expected.Length, shadowLoader.CopyCount); 808Assert.Equal(2, alcs.Length); 1123Assert.Equal(1, alcs1.Length); 1132Assert.Equal(1, alcs2.Length);
Analyzers\AnalyzerConfigTests.cs (7)
1235Assert.Equal(expected.Length, options.Length); 1237for (int i = 0; i < expected.Length; i++) 1256Assert.Equal(expected.Length, options.Length); 1258for (int i = 0; i < expected.Length; i++) 1267Assert.Equal(expected[i].Length, treeOptions.Count);
Analyzers\AnalyzerFileReferenceTests.cs (6)
520Assert.Equal(4, csharpAnalyzers.Length); 527Assert.Equal(4, vbAnalyzers.Length); 535Assert.Equal(8, allAnalyzers.Length); 553Assert.Equal(10, csharpGenerators.Length); 566Assert.Equal(5, vbGenerators.Length); 575Assert.Equal(12, allGenerators.Length);
Collections\DebuggerAttributes.cs (7)
108if (attrs.Length != 1) 120if (genericTypeArguments.Length > 0) 136if (attrs.Length != 1) 147if (segments.Length % 2 == 0) 152if (segments.Length == 1) 159for (int i = 0; i < segments.Length; i += 2) 164if (i + 1 < segments.Length)
Collections\EnumerableExtensionsTests.cs (1)
41public int Count => _items.Length;
Collections\IdentifierCollectionTests.cs (4)
40Assert.Equal(strings.Length, idcol.Count); 48var copy = new string[strings.Length]; 57Assert.Equal(strings.Length, idcol.Count); 65var copy = new string[strings.Length];
Collections\ImmutableDictionaryTestBase.nonnetstandard.cs (4)
175for (int i = 0; i < inputs.Length; i++) 180Assert.Equal(inputs.Length, map.Count); 181for (int i = 0; i < inputs.Length; i++) 186for (int i = 0; i < inputs.Length; i++)
Collections\ImmutableListTestBase.cs (3)
99CopyToImpl(list, 0, array, 0, array.Length); 100Assert.Equal(enumerable.Take(array.Length), array); 124for (int i = 0; i < hitTest.Length; i++)
Collections\ImmutableSegmentedListTest.cs (1)
802var createMethod = typeof(ImmutableSegmentedList).GetMethods().Where(m => m.Name == "Create" && m.GetParameters().Length == 0).Single().MakeGenericMethod(dummType!.AsType());
Collections\ImmutableSetTest.cs (1)
269Assert.Equal(expectedValues.Length, set.Count);
Collections\ImmutablesTestBase.cs (2)
182for (int i = 0; i < inputs.Length; i++) 194Assert.Equal(length, inputs.Length);
Collections\List\ICollection.NonGeneric.Tests.cs (1)
239if (count > 0 && count < enumArr.Length)
Collections\List\IEnumerable.Generic.Tests.cs (10)
197expectedItems.Length, 210bool needToMatchAllExpectedItems = count - startIndex == expectedItems.Length; 233: expectedItems.Length, 565Assert.Equal(items.Length, iterations); 600items.Length / 2, 882items.Length / 2, 893items.Length / 2, 894items.Length - (items.Length / 2), 931items.Length / 2,
Collections\List\SegmentedList.Generic.Tests.Capacity.cs (8)
71var oldSegmentCount = oldSegments.Length; 76var resizedSegmentCount = resizedSegments.Length; 84Assert.Equal(resizedSegments[i].Length, SegmentedArray<object>.TestAccessor.SegmentSize); 87Assert.Equal(resizedSegments[resizedSegmentCount - 1].Length, oldSegments[oldSegmentCount - 1].Length); 104Assert.Equal(1, oldSegments.Length); 105Assert.Equal(1, resizedSegments.Length); 107Assert.Equal(segmented.Capacity, resizedSegments[0].Length);
Collections\List\SegmentedList.Generic.Tests.Misc.cs (72)
51Assert.Equal(list.Count, items.Length + repeat); //"Expect to be the same." 72int[] bad = new int[] { items.Length + 1, items.Length + 2, int.MaxValue, -1, -2, int.MinValue }; 73for (int i = 0; i < bad.Length; i++) 90Assert.Equal(list.Count, items.Length + repeat); //"Expected them to be equal." 112int[] bad = new int[] { items.Length + 1, items.Length + 2, int.MaxValue, -1, -2, int.MinValue }; 113for (int i = 0; i < bad.Length; i++) 138Assert.Equal(list.Count, itemsX.Length + (itemsY.Length * repeat)); //"Should have the same result." 145for (int i = index; i < index + (itemsY.Length * repeat); i++) 147Assert.Equal(list[i], itemsY[(i - index) % itemsY.Length]); //"Should have the same result." 150for (int i = index + (itemsY.Length * repeat); i < list.Count; i++) 152Assert.Equal(list[i], itemsX[i - (itemsY.Length * repeat)]); //"Should have the same result." 163Assert.Equal(list.Count, itemsX.Length + (itemsX.Length)); //"Should have the same result." 170for (int i = index; i < index + (itemsX.Length); i++) 172Assert.Equal(list[i], itemsX[(i - index) % itemsX.Length]); //"Should have the same result." 175for (int i = index + (itemsX.Length); i < list.Count; i++) 177Assert.Equal(list[i], itemsX[i - (itemsX.Length)]); //"Should have the same result." 184int[] bad = new int[] { items.Length + 1, items.Length + 2, int.MaxValue, -1, -2, int.MinValue }; 185for (int i = 0; i < bad.Length; i++) 225for (int i = 0; i < items.Length; i++) 243for (int i = 0; i < items.Length; i++) 274int[] bad = new int[] { /**/items.Length,1, 276items.Length+1,0, 278items.Length+1,1, 280items.Length,2, 282items.Length/2,items.Length/2+1, 284items.Length-1,2, 286items.Length-2,3, 2881,items.Length, 2900,items.Length+1, 2921,items.Length+1, 2942,items.Length, 296items.Length/2+1,items.Length/2, 2982,items.Length-1, 3003,items.Length-2 303for (int i = 0; i < bad.Length; i++) 330for (int i = 0; i < bad.Length; i++) 356for (int i = 0; i < items.Length; ++i) 370for (int i = 0; i < items.Length; ++i) 374for (int i = 0; i < items.Length; ++i) 383Assert.True((0 < items.Length) == list.Exists((T? item) => { return true; }), 403if (0 < items.Length) 405for (int i = 0; i < items.Length; ++i) 408for (int i = 0; i < items.Length && i < 2; ++i) 417if (1 < items.Length) 438for (int i = 0; i < items.Length; i++) 448for (int i = 0; i < itemsY.Length; i++) 457for (int i = 0; i < items.Length; i++) 467for (int i = 0; i < items.Length; i++) 482list.Add(items[items.Length / 2]); 487Assert.True(list.Contains(items[items.Length / 2])); //"Should contain item." 488list.Remove(items[items.Length / 2]); 490Assert.False(list.Contains(items[items.Length / 2])); //"Should not contain item" 509for (int i = 0; i < items.Length; i++) 520for (int i = 0; i < itemsY.Length; i++) 530for (int i = 0; i < items.Length; i++) 541for (int i = 0; i < items.Length; i++) 557list.Add(items[items.Length / 2]); 562Assert.True(_ilist.Contains(items[items.Length / 2])); //"Should contain item." 563list.Remove(items[items.Length / 2]); 565Assert.False(_ilist.Contains(items[items.Length / 2])); //"Should not contain item" 677for (int i = 0; i < items.Length; ++i) 681for (int i = 0; i < items.Length; ++i) 692Assert.True((0 == items.Length) == list.TrueForAll(delegate (T item) { return false; }), 693"Err_30848ahidi Verify TrueForAll returns " + (0 == items.Length) + " if the match returns false on every item FAILED\n"); 713for (int i = 0; i < items.Length; i++)
Collections\SegmentedArrayTests.cs (6)
110Assert.Equal(length, items.Sum(item => item.Length)); 112for (var i = 0; i < items.Length - 1; i++) 114Assert.Equal(SegmentedArray<IntPtr>.TestAccessor.SegmentSize, items[i].Length); 115Assert.True(items[i].Length <= SegmentedArray<IntPtr>.TestAccessor.SegmentSize); 195Assert.True(SegmentedCollectionsMarshal.AsSegments(data).Length > 10); 237for (int i = 0; i < array.Length; i++)
Collections\TemporaryArrayTests.cs (2)
242if (values.Length == 0) 248doPermute(0, values.Length - 1);
Collections\TopologicalSortTests.cs (1)
170int length = data.Length;
CommonCommandLineParserTests.cs (5)
24Assert.Equal(expected.Length, actual.Length); 25for (int i = 0; i < actual.Length; ++i) 37for (int i = 1; i <= otherSources.Length; i++) 43if (otherSources.Length != 0)
CryptoBlobParserTests.cs (4)
64Assert.True(key.Skip(HEADER_LEN + MOD_LEN * 2 + HALF_LEN * 5).ToArray().Length == 0); 107Assert.True(key.Skip(HEADER_LEN + MOD_LEN * 2 + HALF_LEN * 5).ToArray().Length == 0); 150var buf = new byte[snBlob.Length - CryptoBlobParser.s_publicKeyHeaderSize]; 151Array.Copy(snBlob, CryptoBlobParser.s_publicKeyHeaderSize, buf, 0, buf.Length);
Diagnostics\SarifErrorLoggerTests.cs (1)
130Encoding.UTF8.GetString(buffer, 0, buffer.Length),
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
29Assert.True(analyzers != null && analyzers.Length > 0, "Must specify at least one diagnostic analyzer to test suppression");
EmbeddedTextTests.cs (14)
117var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1); 118var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(bytes, 0, bytes.Length)); 132var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1); 133var text = EmbeddedText.FromBytes("pathToSmall", new ArraySegment<byte>(paddedBytes, 1, bytes.Length)); 159var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithms.Default); 160var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(bytes, 0, bytes.Length), SourceHashAlgorithms.Default); 165AssertEx.Equal(BitConverter.GetBytes(bytes.Length), text.Blob.Take(4)); 174var checksum = SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithms.Default); 175var text = EmbeddedText.FromBytes("pathToLarge", new ArraySegment<byte>(paddedBytes, 1, bytes.Length), SourceHashAlgorithms.Default); 180AssertEx.Equal(BitConverter.GetBytes(bytes.Length), text.Blob.Take(4)); 193AssertEx.Equal(BitConverter.GetBytes(Encoding.Unicode.GetPreamble().Length + LargeSource.Length * sizeof(char)), text.Blob.Take(4)); 237SourceText.From(bytes, bytes.Length, Encoding.ASCII, SourceHashAlgorithm.Sha1, canBeEmbedded: true); 242AssertEx.Equal(SourceText.CalculateChecksum(bytes, 0, bytes.Length, SourceHashAlgorithm.Sha1), source.GetChecksum()); 244AssertEx.Equal(BitConverter.GetBytes(bytes.Length), text.Blob.Take(4));
Emit\CustomDebugInfoTests.cs (1)
569Array.Copy(array, 0, result, 0, array.Length);
InternalUtilities\OneOrManyTests.cs (1)
18Assert.Equal(actual.Count, expected.Length);
InternalUtilities\StreamExtensionsTests.cs (5)
39Assert.Equal(sourceArray.Length, stream.TryReadAll(destArray, 0, sourceArray.Length)); 53if (offset + count > buf.Length) 84Assert.Throws<IOException>(() => stream.TryReadAll(destArray, 0, sourceArray.Length)); 109Assert.Throws<IOException>(() => stream.TryReadAll(destArray, 0, sourceArray.Length));
MetadataReferences\FusionAssemblyIdentityTests.cs (1)
35if (publicKey != null && publicKey.Length != 0)
MetadataReferences\MetadataHelpersTests.cs (10)
111var typeNamesToDecode = new string[typeNameConfigs.Length]; 112expectedDecodeNames = new MetadataHelpers.AssemblyQualifiedTypeName[typeNameConfigs.Length]; 114for (int index = 0; index < typeNameConfigs.Length; index++) 141var genericArityStr = "`" + genericParamsToDecode.Length.ToString(); 154for (int i = 0; i < genericParamsToDecode.Length; i++) 249for (int i = 0; i < decodedTypeArguments.Length; i++) 276Assert.Equal(namesToDecode.Length, expectedDecodedNames.Length); 278for (int i = 0; i < namesToDecode.Length; i++) 454Assert.Equal(3, array.Length);
src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (4)
197return Marshal.PtrToStringUni((IntPtr)p, (data.Length / 2) - 1); 367nameObject.SetProperty(propertyId, p, (uint)data.Length); 385if (value != null && value.Length == 0) 413bool hasPublicKey = publicKey != null && publicKey.Length != 0;
Text\LargeTextTests.cs (3)
89for (int i = destOffset; i < buffer.Length; i++) 94Array.Clear(buffer, 0, buffer.Length); 101for (int i = 3; i < buffer.Length; i++)
Text\SourceTextStreamTests.cs (2)
54Assert.Equal(baseText.Length, stream.Read(buffer, 0, buffer.Length)); 57Assert.Equal(3, stream.Read(buffer, 0, buffer.Length));
Text\SourceTextTests.cs (11)
60Assert.Same(s_unicode, SourceText.From(bytes, bytes.Length, s_unicode).Encoding); 61Assert.Equal(utf8NoBOM, SourceText.From(bytes, bytes.Length, null).Encoding); 74Assert.Equal(utf8BOM, SourceText.From(bytes, bytes.Length, s_unicode).Encoding); 75Assert.Equal(utf8BOM, SourceText.From(bytes, bytes.Length, null).Encoding); 88Assert.Equal(SourceHashAlgorithm.Sha1, SourceText.From(bytes, bytes.Length).ChecksumAlgorithm); 102Assert.Equal(algorithm, SourceText.From(bytes, bytes.Length, checksumAlgorithm: algorithm).ChecksumAlgorithm); 136verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, null, checksumAlgorithm), checksumBOM, expectedContentHash); 137verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, encodingNoBOM, checksumAlgorithm), checksumBOM, expectedContentHash); 138verifyChecksumAndContentHash(SourceText.From(bytesBOM, bytesBOM.Length, encodingBOM, checksumAlgorithm), checksumBOM, expectedContentHash); 343Assert.Throws<InvalidDataException>(() => SourceText.From(bytes, bytes.Length, throwIfBinaryDetected: true)); 386TestTryReadByteOrderMark(expectedEncoding, expectedPreambleLength, data, data == null ? 0 : data.Length);
Text\StringTextDecodingTests.cs (4)
30byte[] buffer = new byte[bytes.Length + 10]; 33using (var stream = new MemoryStream(buffer, 0, bytes.Length, writable: true, publiclyVisible: true)) 46byte[] buffer = new byte[bytes.Length + 10]; 49using (var stream = new MemoryStream(buffer, 0, bytes.Length, writable: true, publiclyVisible: true))
Text\StringTextTest_BigEndianUnicode.cs (1)
20using (var stream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true))
Text\StringTextTest_Unicode.cs (1)
20using (var stream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true))
Text\StringTextTest_Utf8.cs (1)
20using (var stream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true))
Text\StringTextTest_Utf8NoBOM.cs (1)
20using (var stream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true))
Text\StringTextTests_Default.cs (1)
29using (var stream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true))
Text\TextChangeTests.cs (4)
225Assert.Throws<ArgumentOutOfRangeException>(() => newText.CopyTo(0, destination, destination.Length - 1, 2)); 245Assert.Equal(changes.Length, result.Count); 246for (int i = 0; i < changes.Length; i++) 615var writer = new LargeTextWriter(largeText.Encoding, largeText.ChecksumAlgorithm, chunk1.Length * 4);
Microsoft.CodeAnalysis.VisualBasic (101)
Analysis\FlowAnalysis\AlwaysAssignedWalker.vb (1)
42If (i >= variableBySlot.Length) Then
Analysis\FlowAnalysis\DataFlowPass.vb (1)
511If slot >= variableBySlot.Length Then
Analysis\FlowAnalysis\DefinitelyAssignedWalker.vb (1)
68If slot < variableBySlot.Length Then
Binding\Binder_AnonymousTypes.vb (2)
213Dim fieldsCount As Integer = Me._fields.Length 295For index = 0 To Me._fields.Length - 1
Binding\Binder_Delegates.vb (1)
1191For parameterIndex = 0 To lambdaSymbolParameters.Length - 1
Binding\Binder_Expressions.vb (5)
1734For i As Integer = 0 To newArguments.Length - 1 4120Dim inferredArrayType = ArrayTypeSymbol.CreateVBArray(inferredElementType, Nothing, knownSizes.Length, Compilation) 4128Dim rank = knownSizes.Length 4131For i As Integer = 0 To knownSizes.Length - 1 4244Dim rank As Integer = knownSizes.Length
Binding\Binder_Invocation.vb (1)
2986For i = 0 To argsArr.Length - 1
Binding\Binder_Lambda.vb (6)
95Dim minCount As Integer = Math.Min(parameters.Length, targetSignature.ParameterTypes.Length) 123If parameters.Length <> targetSignature.ParameterTypes.Length Then 127For i As Integer = minCount To parameters.Length - 1 Step 1 826For i As Integer = 0 To Math.Min(target.ParameterTypes.Length, commonParameterTypes.Length) - 1 836For i As Integer = 0 To Math.Min(target.ParameterTypes.Length, commonParameterTypes.Length) - 1 845For i As Integer = 0 To commonParameterTypes.Length - 1
Binding\Binder_Query.vb (8)
247Dim fields = New AnonymousTypeField(selectors.Length - 1) {} 1995Dim resultSelector As TypeSymbol = method.Parameters(groupByArguments.Length - 1).Type 2069Dim resultSelector As TypeSymbol = method.Parameters(groupJoinArguments.Length - 1).Type 2785For i As Integer = 0 To rangeVariables.Length - 1 3804fields = New AnonymousTypeField(selectors.Length - 1) {} 3814fields = New AnonymousTypeField(selectors.Length - 1) {} 3833fields = New AnonymousTypeField(selectors.Length - 1) {} 3869Debug.Assert(selectors.Length > 1)
Binding\Binder_Statements.vb (1)
2083For i = 0 To boundStatements.Length - 1
CodeGen\EmitStatement.vb (1)
1087Dim genHashTableSwitch As Boolean = SwitchStringJumpTableEmitter.ShouldGenerateHashTableSwitch(caseLabels.Length)
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (2)
518If loadedElements IsNot Nothing AndAlso loadedElements.Length > 0 Then 525If result.Length > 0 Then
Declarations\DeclarationTreeBuilder.vb (1)
151For i = fullName.Length - 2 To 0 Step -1
Emit\EditAndContinue\VisualBasicDefinitionMap.vb (1)
208For i = 0 To result.Length - 1
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (1)
73For parameterIndex = 0 To lambdaSymbolParameters.Length - 1
Lowering\LocalRewriter\LocalRewriter_XmlLiterals.vb (2)
260ConstantValue.Create(rewrittenCallArguments.Length), 268Debug.Assert(rewrittenCallArguments.Length = 1)
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (1)
199For i = 0 To params.Length - 1
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.vb (1)
49For i = 0 To params.Length - 1
Lowering\SyntheticBoundNodeFactory.vb (5)
666Debug.Assert(parts IsNot Nothing AndAlso parts.Length > 0) 668Dim statements(parts.Length - 1 - 1) As BoundExpression 669For i = 0 To parts.Length - 1 - 1 673Dim lastExpression = parts(parts.Length - 1) 807Dim ctor = Me.CurrentMethod.MeParameter.Type.BaseTypeNoUseSiteDiagnostics.InstanceConstructors.Single(Function(c) c.ParameterCount = args.Length)
Parser\Parser.vb (1)
326triviaToMove.CopyTo(0, newNonZeroWidthTokenTrivia, 0, newNonZeroWidthTokenTrivia.Length)
Parser\ParserExtensions.vb (1)
24For i = 0 To kinds.Length - 1
Parser\ParseStatement.vb (1)
1302If diagnostics IsNot Nothing AndAlso diagnostics.Length > 0 Then
Scanner\KeywordTable.vb (1)
257For i As Integer = 0 To keywordInitData.Length - 1 Step 2
Scanner\QuickTokenAccumulator.vb (2)
142Debug.Assert(s_charProperties.Length = s_CHARPROP_LENGTH) 189limit = Math.Min(limit, pageArr.Length)
Scanner\Scanner.vb (1)
141Array.Clear(_pages, 0, _pages.Length)
Semantics\OverloadResolution.vb (4)
2985For i As Integer = 0 To conversionKinds.Length - 1 3049For i As Integer = 0 To conversionKinds.Length - 1 3133For i As Integer = 0 To conversionKinds.Length - 1 3160For i As Integer = 0 To conversionBackKinds.Length - 1
Symbols\AnonymousTypes\CRC32.vb (1)
16Debug.Assert(names.Length > 0)
Symbols\AssemblySymbol.vb (2)
561Debug.Assert(parts.Length > 0) 573While i < parts.Length
Symbols\IndexedTypeParameterSymbol.vb (6)
38If index >= s_parameterPool.Length Then 47While count > initialPool.Length 51Array.Copy(initialPool, newPool, initialPool.Length) 53For i As Integer = initialPool.Length To newPool.Length - 1 74If count > s_parameterPool.Length Then
Symbols\Metadata\PE\MemberRefMetadataDecoder.vb (1)
185Dim numParams As Integer = targetParamInfo.Length - 1
Symbols\Metadata\PE\PEMethodSymbol.vb (1)
1015Dim count As Integer = paramInfo.Length - 1
Symbols\Metadata\PE\PENamedTypeSymbol.vb (1)
862For i = 0 To ownedParams.Length - 1
Symbols\Metadata\PE\PEPropertySymbol.vb (3)
446If propertyParams.Length < 2 Then 450Dim parameters(propertyParams.Length - 2) As ParameterSymbol 451For i As Integer = 0 To propertyParams.Length - 2
Symbols\ReducedExtensionMethodSymbol.vb (2)
245For i = 0 To curryTypeArguments.Length - 1 252If j = curriedTypeParameters.Length Then
Symbols\ReferenceManager.vb (3)
346Debug.Assert(bindingResult.Length = allAssemblyData.Length) 372For i As Integer = 1 To bindingResult.Length - 1 Step 1 586Debug.Assert(newIndex = filteredReferencedAssemblies.Length)
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (2)
1060For i As Integer = 0 To parameters.Length - 1 1690For i As Integer = 0 To parameters.Length - 1
Symbols\Source\SourceNamedTypeSymbol_GroupClass.vb (7)
47For i As Integer = 0 To Math.Min(baseTypeNames.Length, createMethods.Length) - 1 56If i < disposeMethods.Length Then 60If i < defaultInstances.Length Then 101If(current.Value < disposeMethods.Length, 104If(current.Value < defaultInstances.Length, 212If nextPart = nameParts.Length Then
Symbols\Source\SynthesizedEventAccessorSymbol.vb (1)
380While i < tmps.Length
Symbols\SpecialMembers.vb (1)
59For i As Integer = 0 To specialTypeMembers.Length - 1
Symbols\Symbol.vb (1)
1353Dim builder = ArrayBuilder(Of TypeSymbol).GetInstance(typeArguments.Length)
Symbols\SynthesizedSymbols\GeneratedNameParser.vb (1)
115If parts.Length = 5 Then
Symbols\TypeSubstitution.vb (1)
684Debug.Assert(countOfMeaningfulPairs = pairs.Length)
Symbols\UnboundGenericType.vb (2)
447For i As Integer = 0 To arguments.Length - 1 529For i As Integer = 0 To members.Length - 1
Symbols\WellKnownMembers.vb (1)
318For i As Integer = 0 To wellKnownTypeMembers.Length - 1
Syntax\InternalSyntax\SyntaxNodeExtensions.vb (2)
61If ((current Is Nothing) OrElse (current.Length = 0)) Then 619If diagnostics IsNot Nothing AndAlso diagnostics.Length > 0 Then
Syntax\SyntaxNodeRemover.vb (2)
19If nodesToRemove.Length = 0 Then 58While i < nodes.Length
Syntax\SyntaxTreeDiagnosticEnumerator.vb (3)
134If Me._count >= Me._stack.Length Then 135Dim tmp As NodeIteration() = New NodeIteration((Me._stack.Length * 2) - 1) {} 136Array.Copy(Me._stack, tmp, Me._stack.Length)
Syntax\VisualBasicSyntaxNode.vb (1)
302Dim length As Integer = errorInfos.Length
Syntax\VisualBasicSyntaxTree.vb (1)
120If changes.Length = 1 AndAlso changes(0).Span = New TextSpan(0, Me.Length) AndAlso changes(0).NewLength = newText.Length Then
Syntax\VisualBasicWarningStateMap.vb (1)
96For i As Integer = 0 To entries.Length - 2
VisualBasicExtensions.vb (1)
408Dim builder = New SyntaxTokenListBuilder(list.Count + items.Length)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SyntaxKindExtensions.vb (1)
38For i = start To kinds.Length - 1
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (8)
CommandLineTests.vb (8)
789Assert.Equal(expectedImportStrings.Length, actualImports.Count) 790For i = 0 To expectedImportStrings.Length - 1 2198Assert.Equal(symbols.Length, parsedArgs.ParseOptions.PreprocessorSymbols.Length) 2203For i = 0 To symbols.Length - 1 2451Assert.Equal(2, resolvedSourceFiles.Length) 2456Assert.Equal(2, resolvedSourceFiles.Length) 4114Assert.InRange(fileContents.Length, 4, Integer.MaxValue) 5356Assert.Equal(1 + paths.Length, refPaths.Length)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (35)
Attributes\AttributeTests_MarshalAs.vb (2)
616{"SafeArray9", New Byte() {&H1D, &H24, CByte(aqn.Length)}.Append(aqn)}, 617{"SafeArray10", New Byte() {&H1D, &H24, CByte(openGenericAqn.Length)}.Append(openGenericAqn)}
Attributes\AttributeTests_Tuples.vb (2)
723Assert.Equal(tupleNames.Length, argsReader.ReadInt32()) 829Assert.Equal(tupleNames.Length, argsReader.ReadInt32())
Attributes\AttributeTests_WellKnownAttributes.vb (4)
1523Assert.Equal(2, methodDefs.Length) ' ctor, M 1941Assert.Equal(cases.Length, reader.GetTableRowCount(TableIndex.ImplMap)) 2460For i As Integer = 0 To methods.Length - 1 2783Assert.Equal(2, methodDefs.Length) ' ctor, M
CodeGen\AnonymousTypesCodeGenTests.vb (1)
165For jj = 0 To tasks.Length - 1
CodeGen\CodeGenTuples.vb (3)
3392If parts.Length > 0 Then 3393Assert.Equal(literal.Arguments.Count, parts.Length) 3395For i As Integer = 0 To parts.Length - 1
Emit\CompilationEmitTests.vb (19)
275Assert.True(mdOnlyImage.Length > 0, "no metadata emitted") 298Assert.True(output.ToArray().Length > 0, "no metadata emitted") 332Assert.True(mdOnlyImage.Length > 0, "no metadata emitted") 378Assert.True(mdOnlyImage.Length > 0, "no metadata emitted") 427Assert.True(mdOnlyImage.Length > 0, "no metadata emitted") 474Assert.True(mdOnlyImage.Length > 0, "no metadata emitted") 523Assert.True(mdOnlyImage.Length > 0, "no metadata emitted") 572Assert.True(mdOnlyImage.Length > 0, "no metadata emitted") 2465For i As Integer = 0 To Math.Max(expectedGlobalMembers.Length, actualGlobalMembers.Length) - 1 2483For i As Integer = 0 To Math.Max(expectedAMembers.Length, actualAMembers.Length) - 1 2490For i As Integer = 0 To Math.Max(expectedBMembers.Length, actualBMembers.Length) - 1 2498For i As Integer = 0 To Math.Max(expectedCMembers.Length, actualCMembers.Length) - 1 2521For i As Integer = 0 To Math.Max(expectedAMembers.Length, actualAMembers.Length) - 1 2528For i As Integer = 0 To Math.Max(expectedBMembers.Length, actualBMembers.Length) - 1 2535For i As Integer = 0 To Math.Max(expectedCMembers.Length, actualCMembers.Length) - 1 2551Assert.Equal(expectedEntries.Length, metadataReader.DeclarativeSecurityAttributes.Count) 4343For i = 0 To pattern.Length - 1 4350Dim [end] = buffer.Length - pattern.Length
Emit\DynamicAnalysis\DynamicAnalysisResourceTests.vb (1)
832Dim expectedSpanSpellings As ArrayBuilder(Of String) = ArrayBuilder(Of String).GetInstance(expected.Length)
Emit\EditAndContinue\SymbolMatcherTests.vb (1)
66For j = 0 To tasks.Length - 1
Emit\EmitMetadata.vb (1)
591Assert.Equal(2, typeDefs.Length)
Emit\NoPiaEmbedTypes.vb (1)
1307Assert.Equal(1, paramInfo.Length)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
EvaluationContext.vb (1)
600Dim numParts = nameParts.Length
Microsoft.CodeAnalysis.VisualBasic.Features (5)
Completion\KeywordRecommenders\Types\BuiltInTypesKeywordRecommender.vb (4)
104Debug.Assert(s_intrinsicKeywordNames.Length = s_intrinsicSpecialTypes.Length) 108Dim recommendedKeywords(s_intrinsicKeywordNames.Length - 1) As RecommendedKeyword 109For i = 0 To s_intrinsicKeywordNames.Length - 1
GenerateType\VisualBasicGenerateTypeService.vb (1)
430If containers.Length <> 0 Then
Microsoft.CodeAnalysis.VisualBasic.ResultProvider (1)
src\Compilers\VisualBasic\Portable\Scanner\KeywordTable.vb (1)
257For i As Integer = 0 To keywordInitData.Length - 1 Step 2
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (35)
Binding\LookupTests.vb (5)
1921For i As Integer = 1 To nodes.Length - 1 2092For i As Integer = 1 To nodes.Length - 1 2234For i As Integer = 1 To nodes.Length - 1 2592For i As Integer = 1 To nodes.Length - 1 2725For i As Integer = 1 To nodes.Length - 1
Compilation\VisualBasicCompilationOptionsTests.vb (2)
350Assert.Equal(importStrings.Length, opt.GlobalImports.Count) 351For i = 0 To importStrings.Length - 1
Diagnostics\CompilationEventTests.vb (1)
49If unexpected OrElse expected.Count <> 0 OrElse expectedEvents.Length <> actual.Count Then
Diagnostics\DiagnosticAnalyzerTests.vb (4)
70Assert.Equal(diags.Length, effectiveDiags.Length) 98Assert.Equal(diags.Length, effectiveDiags.Length) 874For i = 0 To autoGeneratedPrefixes.Length - 1 1616For i As Integer = 0 To expectedFlowGraphs.Length - 1
ExtensionMethods\SemanticModelTests.vb (8)
421For i As Integer = 0 To Math.Max(sortedMethodGroup.Length, expected.Length) - 1 542For i As Integer = 0 To Math.Max(sortedMethodGroup.Length, expected.Length) - 1 669For i As Integer = 0 To Math.Max(sortedMethodGroup.Length, expected.Length) - 1 795For i As Integer = 0 To Math.Max(sortedMethodGroup.Length, expected.Length) - 1 922For i As Integer = 0 To Math.Max(sortedMethodGroup.Length, expected.Length) - 1 1053Assert.Equal(expected.Length, Aggregate name In expected Join symbol In actual_lookupSymbols 1173Assert.Equal(expected.Length, Aggregate name In expected Join symbol In actual_lookupSymbols 1292Assert.Equal(expected.Length, Aggregate name In expected Join symbol In actual_lookupSymbols
Semantics\BinaryOperators.vb (4)
975Dim types(typeNames.Length - 1) As NamedTypeSymbol 977For i As Integer = 0 To typeNames.Length - 2 981Assert.Null(types(types.Length - 1)) 982types(types.Length - 1) = compilation.GetSpecialType(SpecialType.System_String)
Semantics\Conversions.vb (2)
2077For i As Integer = 0 To types.Length - 1 Step 1 2078For j As Integer = 0 To types.Length - 1 Step 1
Semantics\FieldInitializerBindingTests.vb (1)
1074Assert.Equal(3, actual.Length)
Semantics\ForLoopTest.vb (1)
561For i As Integer = 0 To names.Length \ 2 - 1
Semantics\GetExtendedSemanticInfoTests.vb (4)
9063Assert.Equal(2, sortedMethodGroup.Length) 9070Assert.Equal(2, sortedMethodGroup.Length) 9256Assert.Equal(2, sortedMethodGroup.Length) 9263Assert.Equal(2, sortedMethodGroup.Length)
Semantics\MyBaseMyClassTests.vb (2)
4022For Each ns In nameParts.Take(nameParts.Length - 1) 4027Return DirectCast(nsSymbol.GetTypeMember(nameParts(nameParts.Length - 1)), NamedTypeSymbol)
Semantics\OverloadResolution.vb (1)
2514For i As Integer = 0 To numericTypesPrecedence.Length - 1 Step 1
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (95)
DocumentationComments\DocCommentTests.vb (45)
5458Assert.Equal(6, names.Length) 5510Assert.Equal(1, names.Length) 5514Assert.Equal(3, names.Length) 5520Assert.Equal(3, names.Length) 5666Assert.Equal(2, names.Length) 5671Assert.Equal(32, names.Length) 5846Assert.Equal(2, names.Length) 5851Assert.Equal(32, names.Length) 6044Assert.Equal(8, names.Length) 6055Assert.Equal(6, names.Length) 6064Assert.Equal(20, names.Length) 6206Assert.Equal(8, names.Length) 6217Assert.Equal(6, names.Length) 6226Assert.Equal(22, names.Length) 6459Assert.Equal(13, names.Length) 6475Assert.Equal(2, names.Length) 6480Assert.Equal(10, names.Length) 6493Assert.Equal(13, names.Length) 6509Assert.Equal(6, names.Length) 6518Assert.Equal(1, names.Length) 6522Assert.Equal(1, names.Length) 6526Assert.Equal(2, names.Length) 6531Assert.Equal(1, names.Length) 6535Assert.Equal(1, names.Length) 6607Assert.Equal(6, names.Length) 6616Assert.Equal(4, names.Length) 6623Assert.Equal(2, names.Length) 6628Assert.Equal(2, names.Length) 6680Assert.Equal(1, names.Length) 6713Assert.Equal(1, names.Length) 6723Assert.Equal(3, names.Length) 6870Assert.Equal(1, names.Length) 6949Assert.Equal(1, names.Length) 7287Assert.Equal(2, names.Length) 7335Assert.Equal(2, names.Length) 10076Assert.Equal(expected.Length, names.Count) 10086If e.Symbols.Length = 0 Then 10088ElseIf e.Symbols.Length = 1 Then 10098If e.Types.Length = 0 Then 10101ElseIf e.Types.Length = 1 Then 11891Assert.Equal(expected.Length, names.Count) 11957If expected.Length = 0 Then 11959ElseIf expected.Length = 1 Then 12036If expected.Length = 0 Then 12040ElseIf expected.Length = 1 Then
SymbolDisplay\SymbolDisplayTests.vb (1)
6076If (kinds.Length > 0) Then
SymbolsTests\AnonymousTypes\AnonymousTypesEmittedSymbolsTests.vb (2)
742For Each ns In nameParts.Take(nameParts.Length - 1) 747Return DirectCast(nsSymbol.GetTypeMember(nameParts(nameParts.Length - 1)), NamedTypeSymbol)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (2)
2033For Each ns In nameParts.Take(nameParts.Length - 1) 2036Return DirectCast(nsSymbol.GetTypeMember(nameParts(nameParts.Length - 1)), NamedTypeSymbol)
SymbolsTests\CompilationCreationTests.vb (1)
2214Dim numTrees = expectedSyntaxTrees.Length
SymbolsTests\InstantiatingGenerics.vb (1)
206For i = 0 To a.Length - 1
SymbolsTests\Metadata\PE\HasUnsupportedMetadata.vb (2)
553builder.AddRange(bytes.Skip(index + before.Length)) 559Dim m = pattern.Length
SymbolsTests\Metadata\PE\MissingTypeReferences.vb (2)
462For i As Integer = 0 To missingTypes1.Length - 1 463For j As Integer = 0 To missingTypes2.Length - 1
SymbolsTests\Metadata\PE\TypeForwarders.vb (1)
1222Dim numParts As Integer = split.Length
SymbolsTests\MyBaseMyClassSemanticsTests.vb (2)
182For Each ns In nameParts.Take(nameParts.Length - 1) 185Return DirectCast(nsSymbol.GetTypeMember(nameParts(nameParts.Length - 1)), NamedTypeSymbol)
SymbolsTests\Source\EnumTests.vb (1)
1367Assert.Equal(expectedEnumValues.Length, fields.Count - 1)
SymbolsTests\Source\GroupClassTests.vb (20)
125Assert.Equal(expected.Length, members.Length) 252Assert.Equal(expected15.Length, members.Length) 269Assert.Equal(expected16.Length, members.Length) 319Assert.Equal(expected15.Length, members.Length) 646Assert.Equal(expected.Length, members.Length) 703Assert.Equal(expected.Length, members.Length) 756Assert.Equal(expected.Length, members.Length) 809Assert.Equal(expected.Length, members.Length) 859Assert.Equal(expected.Length, members.Length) 909Assert.Equal(expected.Length, members.Length) 960Assert.Equal(expected.Length, members.Length) 1003Assert.Equal(expected.Length, members.Length) 1049Assert.Equal(expected.Length, members.Length) 1098Assert.Equal(expected.Length, members.Length) 1143Assert.Equal(expected.Length, members.Length) 1203Assert.Equal(expected.Length, members.Length) 1266Assert.Equal(expected.Length, members.Length) 1627Assert.Equal(expected.Length, members.Length) 1675Assert.Equal(expected.Length, members.Length) 3706Assert.Equal(expected15.Length, members.Length)
SymbolsTests\Source\PropertyTests.vb (3)
2884Assert.Equal(parameters.Length, names.Length) 2885For i = 0 To names.Length - 1 8176For index = 0 To expectedParams.Length
SymbolsTests\Source\SourceSymbolTests.vb (10)
339Assert.Equal(2, locs.Length) 348Assert.Equal(2, locs.Length) 357Assert.Equal(2, locs.Length) 365Assert.Equal(1, locs.Length) 371Assert.Equal(1, locs.Length) 377Assert.Equal(1, locs.Length) 384Assert.Equal(2, locs.Length) 393Assert.Equal(2, locs.Length) 402Assert.Equal(2, locs.Length) 411Assert.Equal(3, locs.Length)
SymbolsTests\WithStatementSymbolsTests.vb (2)
335For Each ns In nameParts.Take(nameParts.Length - 1) 338Return DirectCast(nsSymbol.GetTypeMember(nameParts(nameParts.Length - 1)), NamedTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (9)
Parser\ParseStatements.vb (3)
8405Assert.Equal(expected.Length, actual.Length) 8406For i = 0 To actual.Length - 1
Scanner\ScannerTests.vb (1)
1046Assert.Equal(tokens.Length, kinds.Length)
Syntax\SyntaxFactsTest.vb (1)
1269If method.ReturnType = GetType(IEnumerable(Of SyntaxKind)) AndAlso method.GetParameters().Length = 0 Then
TestSyntaxNodes.vb (4)
953Assert.Equal(expectedErrorCodes.Length, errorList.Count) 956If expectedErrorCodes.Length > 0 Then 975Assert.Equal(expectedErrorCodes.Length, errorList.Count) 978If expectedErrorCodes.Length > 0 Then
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (6)
CompilationTestUtils.vb (3)
1207Assert.Equal(symbols.Length, descriptions.Length) 1213For i = 0 To descriptions.Length - 1 1241Assert.Equal(symbols.Length, descriptions.Length)
ParserTestUtilities.vb (2)
38For i = 0 To expectedDiagnostics.Length - 1 306Assert.InRange(i, 0, expected.Length - 1)
TestOptions.vb (1)
59If features.Length = 0 Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CodeCleanup\Providers\ReduceTokensCodeCleanupProvider.vb (2)
258If parts.Length() > 1 Then 268Dim exponentPartOpt As String = If(partsAfterDot.Length > 1, "E" + partsAfterDot(1), "")
LinkedFiles\BasicLinkedFileMergeConflictCommentAdditionService.vb (2)
67Debug.Assert(newlines.Count = lines.Length - 1) 71For i = 0 To lines.Length - 2
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SyntaxKindExtensions.vb (1)
38For i = start To kinds.Length - 1
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.vb (1)
3142Assert.Equal(expectedNames.Length, actualNames.Length)
Microsoft.CodeAnalysis.Workspaces (178)
CodeCleanup\Providers\ExportCodeCleanupProvider.cs (1)
24if (languages.Length == 0)
CodeFixes\ExportCodeFixProviderAttribute.cs (2)
86var languages = new string[additionalLanguages.Length + 1]; 88for (var index = 0; index < additionalLanguages.Length; index++)
CodeFixesAndRefactorings\EnumArrayConverter.cs (2)
14var enums = new FixedSizeArrayBuilder<TEnum>(strings.Length); 15for (var i = 0; i < strings.Length; i++)
CodeRefactorings\ExportCodeRefactoringProviderAttribute.cs (2)
81var languages = new string[additionalLanguages.Length + 1]; 83for (var index = 0; index < additionalLanguages.Length; index++)
Differencing\LongestCommonSubsequence.cs (1)
114Debug.Assert(start + length <= _array.Length);
Differencing\Match.cs (3)
104Debug.Assert(nodes1.Length == nodes2.Length); 137for (var l = 0; l < nodes1.Length; l++)
Log\HistogramLogAggregator.cs (1)
86for (var i = 1; i < _buckets.Length; ++i)
PatternMatching\ContainerPatternMatcher.cs (6)
32_invalidPattern = _patternSegments.Length == 0 || _patternSegments.Any(s => s.IsInvalid); 67var relevantDotSeparatedSegmentLength = _patternSegments.Length; 68if (_patternSegments.Length > containerParts.Length) 78for (int i = _patternSegments.Length - 1, j = containerParts.Length - 1;
PatternMatching\PatternMatcher.PatternSegment.cs (1)
43public readonly bool IsInvalid => this.SubWordTextChunks.Length == 0;
Serialization\SerializerService_Reference.cs (1)
471stream.Write(content, 0, content.Length);
Shared\Extensions\INamedTypeSymbolExtensions.cs (1)
15for (var i = containers.Length - 1; i >= 0; i--)
Shared\Extensions\SourceTextExtensions.cs (7)
199Contract.ThrowIfTrue(buffer.Length != CharArrayLength); 205var numberOfChunks = 1 + (length / buffer.Length); 214var count = Math.Min(buffer.Length, length - offset); 272Contract.ThrowIfTrue(currentChunk.Length != CharArrayLength); 332if (index < 0 || index >= buffer.Length) 335if (count < 0 || (index + count) > buffer.Length) 352var charsToCopy = Math.Min(chunk.Length - chunkStartOffset, count);
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (1)
239if (featureNames == null || featureNames.Length == 0)
Shared\Utilities\BloomFilter_Serialization.cs (1)
75for (var i = 0; i < bytes.Length; i++)
Shared\Utilities\DocumentationComment.cs (1)
214for (var i = 0; i < lines.Length; i++)
src\Compilers\Core\Portable\Collections\BitVector.cs (12)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 71for (int i = 0; i < _bits.Length; i++) 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 114for (int i = 0, n = _bits?.Length ?? 0; i < n; i++) 135for (int i = 0; i < _bits.Length; i++) 216if (_bits is null || _bits.Length == 0) 236for (int i = 0; i < _bits.Length; i++) 266int otherLength = other._bits.Length; 268int thisLength = thisBits.Length; 328for (int i = 0; i < other._bits.Length; i++) 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (1)
775int last = copy.Length - 1;
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
558if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 566var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 583var remainingParts = directoryPathParts.Length - index; 593for (int i = index; i < fullPathParts.Length; i++)
src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
119int read = stream.Read(buffer, 0, buffer.Length);
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length); 19if (start + length > array.Length) 21length = array.Length - start; 31T[] newArray = new T[array.Length + 1]; 37if (position < array.Length) 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 48return InsertAt(array, array.Length, item); 53T[] newArray = new T[array.Length + items.Length]; 59if (position < array.Length) 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 70return InsertAt(array, array.Length, items); 80if (position + length > array.Length) 82length = array.Length - position; 85T[] newArray = new T[array.Length - length]; 91if (position < newArray.Length) 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 101T[] newArray = new T[array.Length]; 102Array.Copy(array, newArray, array.Length); 114ReverseContents(array, 0, array.Length); 132var high = array.Length - 1; 165if (first == null || second == null || first.Length != second.Length) 170for (var i = 0; i < first.Length; i++) 191int high = array.Length - 1;
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
327return source.Length == 0;
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
97var maxSize = Math.Min(maxItemsToHash, values.Length); 206for (int i = 0; i < data.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
353if (array.Length < index + Count)
src\Dependencies\Collections\SegmentedArray.cs (6)
61if (length > destinationArray.Length) 493var remainingInSegment = firstSegment.Length - offset; 596var remainingInFirstSegment = firstSegment.Length - firstOffset; 597var remainingInSecondSegment = secondSegment.Length - secondOffset; 735var remainingInSegment = segment.Length - offset; 784var remainingInSegment = segment.Length - offset;
src\Dependencies\Collections\SegmentedArray`1.cs (11)
81for (var i = 0; i < _items.Length - 1; i++) 90var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 92_items[_items.Length - 1] = new T[lastPageSize]; 145for (var i = 0; i < items.Length; i++) 155for (var i = 0; i < _items.Length; i++) 163for (var i = 0; i < _items.Length; i++) 239for (var i = 0; i < _items.Length; i++) 254for (var i = 0; i < _items.Length; i++) 392if (_items.Length == 0) 395if (_nextItemIndex == _items[_nextItemSegment].Length) 397if (_nextItemSegment == _items.Length - 1)
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
363if ((uint)index > (uint)array.Length) 368if (array.Length - index < Count) 868if ((uint)index > (uint)array.Length) 873if (array.Length - index < Count) 1296if (index < 0 || index > array.Length) 1301if (array.Length - index < _dictionary.Count) 1363if ((uint)index > (uint)array.Length) 1368if (array.Length - index < _dictionary.Count) 1504if ((uint)index > array.Length) 1509if (array.Length - index < _dictionary.Count) 1571if ((uint)index > (uint)array.Length) 1576if (array.Length - index < _dictionary.Count)
src\Dependencies\Collections\SegmentedHashSet`1.cs (2)
814if (arrayIndex > array.Length || count > array.Length - arrayIndex)
src\Dependencies\Collections\SegmentedList`1.cs (2)
96if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 153var oldSegmentCount = segments.Length;
src\Dependencies\PooledObjects\ArrayBuilder.cs (2)
42for (var i = 0; i < result.Length; i++) 615Debug.Assert(start + length <= items.Length);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
666=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
692if (trivia.Length == 0) 726if (trivia.Length == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
117if (trivia.Length == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
184Contract.ThrowIfFalse(lines.Length > 0); 188if (0 < lines.Length - 1) 194for (var i = 1; i < lines.Length; i++) 205if (i < lines.Length - 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
118where nameSplit.Length == 3
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
274WriteArrayLength(array.Length); 354for (var offset = 0; offset < spanLength; offset += buffer.Length) 356var segmentLength = Math.Min(buffer.Length, spanLength - offset); 489Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
199var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (8)
101_wordSpans = new TextSpan[distinctValues.Length]; 104for (var i = 0; i < distinctValues.Length; i++) 117_builderNodes = new BuilderNode[distinctValues.Length]; 118_compactEdges = new Edge[distinctValues.Length * CompactEdgeAllocationSize]; 123for (var i = 0; i < _wordSpans.Length; i++) 128var nodes = ImmutableArray.CreateBuilder<Node>(_builderNodes.Length); 132var edges = ImmutableArray.CreateBuilder<Edge>(Math.Max(0, _builderNodes.Length - 1)); 142for (var i = 0; i < _builderNodes.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (6)
23=> CreateReadableStream(bytes, bytes.Length); 81for (long c = 0; c < chunks.Length; c++) 218Read(this.chunks, 0, this.length, array, 0, array.Length); 232var copyCount = Math.Min(chunk.Length, count); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
58if (taskArray.Length == 0) 62for (var i = 0; i < taskArray.Length; i++) 73var result = new T[taskArray.Length]; 74for (var i = 0; i < taskArray.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
60if (typeArguments.Length == 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (4)
32Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 33Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
13=> array == null || array.Length == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
446if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Mef\FileExtensionsMetadata.cs (1)
25if (extensions?.Length == 0)
Storage\SQLite\v2\Interop\SqlConnection.cs (3)
411utf8z.FromPtrLen(databaseNamePtr, databaseNameBytes.Length - 1), 412utf8z.FromPtrLen(tableNamePtr, tableNameBytes.Length - 1), 413utf8z.FromPtrLen(columnNamePtr, columnNameBytes.Length - 1),
Storage\SQLite\v2\SQLitePersistentStorage_Helpers.cs (2)
50return (bytes, bytes.Length, fromPool: false); 106Array.Clear(bytes, 0, bytes.Length);
TemporaryStorage\TemporaryStorageService.cs (1)
161var count = stream.Read(buffer, 0, buffer.Length);
TemporaryStorage\TemporaryStorageService.DirectMemoryAccessStreamReader.cs (2)
56if (index < 0 || index >= buffer.Length) 61if (count < 0 || (index + count) > buffer.Length)
Utilities\Documentation\XmlDocumentationProvider.cs (3)
129if (_xmlDocCommentBytes.Length != other._xmlDocCommentBytes.Length) 134for (var i = 0; i < _xmlDocCommentBytes.Length; i++)
Workspace\Host\EventListener\ExportEventListenerAttribute.cs (1)
30if (workspaceKinds?.Length == 0)
Workspace\Host\Mef\ExportDynamicFileInfoProviderAttribute.cs (1)
30if (extensions?.Length == 0)
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (1)
52using var _ = ArrayBuilder<byte>.GetInstance(capacity: (assemblyNameToHash.Length + 1 + generatorIdentity.TypeName.Length + 1 + hintName.Length) * 2 + projectIdBytes.Length, out var hashInput);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
MSBuild\MSBuildProjectLoader.Worker.cs (3)
464if (pathNames.Length > 0) 466folders = pathNames.Length > 1 467? pathNames.Take(pathNames.Length - 1).ToImmutableArray()
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (113)
MSBuild\ProjectFile\ProjectFile.cs (1)
72var results = new FixedSizeArrayBuilder<ProjectFileInfo>(targetFrameworks.Length);
Rpc\RpcServer.cs (6)
119var lastParameterIsCancellationToken = methodParameters.Length > 0 && methodParameters[^1].ParameterType == typeof(CancellationToken); 122Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length - 1, $"The arguments list should contain every parameter for {request.Method} except the final CancellationToken."); 124Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length, $"The arguments list should contain every parameter for {request.Method}."); 126var arguments = new object?[methodParameters.Length]; 128for (var i = 0; i < methodParameters.Length; i++) 132if (i == methodParameters.Length - 1 && lastParameterIsCancellationToken)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (1)
775int last = copy.Length - 1;
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
558if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 566var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 583var remainingParts = directoryPathParts.Length - index; 593for (int i = index; i < fullPathParts.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (26)
17Debug.Assert(start <= array.Length); 19if (start + length > array.Length) 21length = array.Length - start; 31T[] newArray = new T[array.Length + 1]; 37if (position < array.Length) 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 48return InsertAt(array, array.Length, item); 53T[] newArray = new T[array.Length + items.Length]; 59if (position < array.Length) 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 70return InsertAt(array, array.Length, items); 80if (position + length > array.Length) 82length = array.Length - position; 85T[] newArray = new T[array.Length - length]; 91if (position < newArray.Length) 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 101T[] newArray = new T[array.Length]; 102Array.Copy(array, newArray, array.Length); 114ReverseContents(array, 0, array.Length); 132var high = array.Length - 1; 165if (first == null || second == null || first.Length != second.Length) 170for (var i = 0; i < first.Length; i++) 191int high = array.Length - 1;
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
51: this(array.Length)
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
327return source.Length == 0;
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
97var maxSize = Math.Min(maxItemsToHash, values.Length); 206for (int i = 0; i < data.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs (3)
40if (parameters.Length != 1 || parameters[0].ParameterType != typeof(CultureInfo)) 72if ((object?)currentThreadGetter == null || !currentThreadGetter.IsStatic || currentThreadGetter.ContainsGenericParameters || currentThreadGetter.ReturnType != type || currentThreadGetter.GetParameters().Length != 0) 86if (parameters.Length != 1 || parameters[0].ParameterType != typeof(CultureInfo))
src\Compilers\Core\Portable\InternalUtilities\WeakList.cs (17)
27Debug.Assert(_size == _items.Length); 28Debug.Assert(_items.Length == 0 || _items.Length >= MinimalNonEmptySize); 30int alive = _items.Length; 32for (int i = 0; i < _items.Length; i++) 45if (alive < _items.Length / 4) 51else if (alive >= 3 * _items.Length / 4) 55var newItems = new WeakReference<T>[GetExpandedSize(_items.Length)]; 63Array.Copy(_items, 0, newItems, 0, _items.Length); 64Debug.Assert(_size == _items.Length); 76Debug.Assert(_items.Length > 0 && _size < 3 * _items.Length / 4, "length: " + _items.Length + " size: " + _size); 82var newItems = (newSize == _items.Length) ? _items : new WeakReference<T>[newSize]; 152if (_size == _items.Length) 157Debug.Assert(_size < _items.Length); 211else if (_alive < _weakList._items.Length / 4)
src\Dependencies\Collections\ImmutableSegmentedHashSet`1.cs (1)
353if (array.Length < index + Count)
src\Dependencies\Collections\SegmentedArray.cs (6)
61if (length > destinationArray.Length) 493var remainingInSegment = firstSegment.Length - offset; 596var remainingInFirstSegment = firstSegment.Length - firstOffset; 597var remainingInSecondSegment = secondSegment.Length - secondOffset; 735var remainingInSegment = segment.Length - offset; 784var remainingInSegment = segment.Length - offset;
src\Dependencies\Collections\SegmentedArray`1.cs (11)
81for (var i = 0; i < _items.Length - 1; i++) 90var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 92_items[_items.Length - 1] = new T[lastPageSize]; 145for (var i = 0; i < items.Length; i++) 155for (var i = 0; i < _items.Length; i++) 163for (var i = 0; i < _items.Length; i++) 239for (var i = 0; i < _items.Length; i++) 254for (var i = 0; i < _items.Length; i++) 392if (_items.Length == 0) 395if (_nextItemIndex == _items[_nextItemSegment].Length) 397if (_nextItemSegment == _items.Length - 1)
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
363if ((uint)index > (uint)array.Length) 368if (array.Length - index < Count) 868if ((uint)index > (uint)array.Length) 873if (array.Length - index < Count) 1296if (index < 0 || index > array.Length) 1301if (array.Length - index < _dictionary.Count) 1363if ((uint)index > (uint)array.Length) 1368if (array.Length - index < _dictionary.Count) 1504if ((uint)index > array.Length) 1509if (array.Length - index < _dictionary.Count) 1571if ((uint)index > (uint)array.Length) 1576if (array.Length - index < _dictionary.Count)
src\Dependencies\Collections\SegmentedHashSet`1.cs (2)
814if (arrayIndex > array.Length || count > array.Length - arrayIndex)
src\Dependencies\Collections\SegmentedList`1.cs (2)
96if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 153var oldSegmentCount = segments.Length;
src\Dependencies\PooledObjects\ArrayBuilder.cs (2)
42for (var i = 0; i < result.Length; i++) 615Debug.Assert(start + length <= items.Length);
src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
171for (var i = 0; i < items.Length; i++) 218for (var i = 0; i < items.Length; i++) 280for (var i = 0; i < items.Length; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (6)
23=> CreateReadableStream(bytes, bytes.Length); 81for (long c = 0; c < chunks.Length; c++) 218Read(this.chunks, 0, this.length, array, 0, array.Length); 232var copyCount = Math.Min(chunk.Length, count); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
NetCoreTests.cs (1)
386Assert.Equal(2, projects.Length);
NewlyCreatedProjectsFromDotNetNew.cs (1)
149if (ignoredDiagnostics?.Length > 0)
src\Workspaces\Core\MSBuild.BuildHost\Rpc\RpcServer.cs (6)
119var lastParameterIsCancellationToken = methodParameters.Length > 0 && methodParameters[^1].ParameterType == typeof(CancellationToken); 122Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length - 1, $"The arguments list should contain every parameter for {request.Method} except the final CancellationToken."); 124Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length, $"The arguments list should contain every parameter for {request.Method}."); 126var arguments = new object?[methodParameters.Length]; 128for (var i = 0; i < methodParameters.Length; i++) 132if (i == methodParameters.Length - 1 && lastParameterIsCancellationToken)
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (5)
Workspaces\TestWorkspace_XmlConsumption.cs (3)
299var value = split.Length == 2 ? split[1] : "true"; 883references = new List<MetadataReference>(TestBase.WinRtRefs.Length); 898references = new List<MetadataReference>(TestBase.PortableRefsMinimal.Length);
Workspaces\TestWorkspace_XmlCreation.cs (2)
40Contract.ThrowIfTrue(fileContainingFolders.Length != files.Length, "Please specify containing folder for each file.");
Microsoft.CodeAnalysis.Workspaces.UnitTests (35)
FindAllDeclarationsTests.TestSolutionsAndProject.cs (5)
33var expectedResultCount = expectedResults.Length; 50var expectedResultCount = expectedResults.Length; 67for (var i = 0; i < expectedResults.Length; i++) 99for (var i = 0; i < sourceTexts.Length; i++) 112for (var i = 0; i < sourceTexts.Length; i++)
ObjectSerializationTests.cs (4)
129if (seq1.Length != seq2.Length) 134for (var i = 0; i < seq1.Length; i++) 253for (var i = 0; i < data.Length; i++)
SolutionTests\ProjectDependencyGraphTests.cs (2)
686if (projectDefinitionParts.Length == 2) 690else if (projectDefinitionParts.Length != 1)
SolutionTests\SolutionTests.cs (1)
2925for (var i = 0; i < projectIds.Length; i++)
UtilityTest\BKTreeTests.cs (3)
63Assert.NotEqual(testValues.Length, items.Length); 76Assert.NotEqual(testValues.Length, items.Length); 90Assert.NotEqual(testValues.Length, items.Length);
UtilityTest\EditDistanceTests.cs (5)
221for (var i = 0; i < Top1000.Length; i++) 224for (var j = 0; j < Top1000.Length; j++) 269for (var i = 0; i < top.Length; i++) 271for (var j = 0; j < top.Length; j++) 278for (var k = 0; k < top.Length; k++)
UtilityTest\NameGeneratorTests.cs (2)
76var isFixed = Enumerable.Repeat(true, names.Length).ToArray(); 103isFixedBuilder.AddRange(isFixed ?? Enumerable.Repeat(false, names.Length));
UtilityTest\SerializableBytesTests.cs (6)
57while ((count = stream.Read(bytes, 0, bytes.Length)) > 0) 136while ((count = stream.Read(bytes, 0, bytes.Length)) > 0) 243expected.Write(array, 0, array.Length); 244stream.Write(array, 0, array.Length); 250for (var j = 0; j < temp.Length; j++) 271var count = random.Next(read1.Length) + 1;
WorkspaceServiceTests\TemporaryStorageServiceTests.cs (1)
225while ((count = stream.Read(bytes, 0, bytes.Length)) > 0)
XxHash128Tests.cs (6)
53Assert.False(XxHash128.TryHash(input, destination.AsSpan(0, destination.Length - 1), out int bytesWritten, test.Seed)); 59Array.Clear(destination, 0, destination.Length); 64Array.Clear(destination, 0, destination.Length); 72Array.Clear(destination, 0, destination.Length); 76Array.Clear(destination, 0, destination.Length); 131Array.Clear(destination, 0, destination.Length);
Microsoft.CommonLanguageServerProtocol.Framework.Package (4)
MethodHandlerDetails.cs (3)
165if (parameters.Length != types.Length) 168for (int i = 0, n = parameters.Length; i < n; i++)
RequestExecutionQueue.cs (1)
355for (var i = 0; i < concurrentlyExecutingTasksArray.Length; i++)
Microsoft.CSharp (126)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (11)
31Expression[] parameters = new Expression[args.Length]; 37for (int index = 0; index < args.Length; ++index) 160for (int i = 0; i < arguments.Length; ++i) 289Debug.Assert(args.Length != 0); 307if (sourceTail?.Length != 0) 309T[] array = new T[sourceTail.Length + 1]; 320if (sourceMiddle?.Length != 0) 322T[] array = new T[sourceMiddle.Length + 2]; 324array[array.Length - 1] = sourceLast; 448for (int i = 0; i < typeArgs.Length; i++) 461for (int i = 0; i < argInfos.Length; i++)
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (1)
84Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (1)
35Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetIndexBinder.cs (3)
26Expr indexerArguments = runtimeBinder.CreateArgumentListEXPR(arguments, locals, 1, arguments.Length); 77_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (3)
26Debug.Assert(arguments.Length == 1); 93_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeBinder.cs (2)
90_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeConstructorBinder.cs (4)
79TypeArguments.Length != otherBinder.TypeArguments.Length || 80_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeMemberBinder.cs (5)
47CSharpArgumentInfo[] array = new CSharpArgumentInfo[_argumentInfo.Length]; 102TypeArguments.Length != otherBinder.TypeArguments.Length || 103_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpSetIndexBinder.cs (2)
96_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpSetMemberBinder.cs (2)
97_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (1)
70Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (4)
174int numberOfArguments = args.Length; 175Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch."); 215object[] argsWithSite = new object[args.Length + 1];
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (3)
16string[] prgpsz = new string[args.Length]; 17int[] prgiarg = new int[args.Length]; 25for (int iarg = 0; iarg < args.Length; iarg++)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (19)
76Debug.Assert(args.Length >= 1); 152int arity = callPayload.TypeArguments?.Length ?? 0; 177DynamicMetaObject[] newArgs = new DynamicMetaObject[args.Length - 1]; 178Array.Copy(args, 1, newArgs, 0, args.Length - 1); 251ArgumentObject[] array = new ArgumentObject[parameters.Length]; 252for (int i = 0; i < parameters.Length; i++) 335LocalVariableSymbol[] locals = new LocalVariableSymbol[parameterExpressions.Length]; 337for (int i = 0; i < parameterExpressions.Length; i++) 601TypeArray typeArgumentsAsTypeArray = typeArguments?.Length > 0 732int arity = payload.TypeArguments?.Length ?? 0; 819BindingFlag.BIND_RVALUEREQUIRED | BindingFlag.BIND_STMTEXPRONLY, memGroup, CreateArgumentListEXPR(arguments, locals, 1, arguments.Length)) as ExprCall; 832if (conditions.Length > 0) 945Debug.Assert(arguments.Length == 1); 985Debug.Assert(arguments.Length == 2); 1193Debug.Assert(arguments.Length == 1); 1228Debug.Assert(arguments.Length == 1); 1251Debug.Assert(arguments.Length >= 2); 1264indexerArguments = CreateArgumentListEXPR(arguments, locals, 1, arguments.Length - 1); 1276int indexOfLast = arguments.Length - 1;
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (10)
47if (method1.GetGenericArguments().Length != method2.GetGenericArguments().Length) 83if (pis1.Length != pis2.Length) 88for (int i = 0; i < pis1.Length; ++i) 187if (args1.Length == args2.Length) 194for (int i = 0; i < args1.Length; i++) 239args.Length > position && 348if (p.Name == name && p.GetIndexParameters().Length != 0)
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (2)
321if (o.Length == 1) 335if (o.Length == 1)
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (2)
196for (int ibos = 0; ibos < s_binopSignatures.Length; ibos++) 1403for (int index = 0; index < s_rguos.Length; index++)
Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs (2)
262for (int iTypeArg = 0; iTypeArg < typeArgs.Length; iTypeArg++) 282for (int i = 0; i < ptypes.Length; i++)
Microsoft\CSharp\RuntimeBinder\Semantics\SubstitutionContext.cs (2)
38public bool IsNop => ClassTypes.Length == 0 & MethodTypes.Length == 0;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (2)
57m.GetParameters().Length == genericParams.Count && 125Debug.Assert(c.GetParameters() == null || c.GetParameters().Length == genericInstanceParams.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (1)
53(p.GetIndexParameters() == null || p.GetIndexParameters().Length == genericInstanceParams.Count));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (1)
318for (int i = 0; i < systemTypeArgs.Length; i++)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (12)
54if (other._hashCode != _hashCode || otherTypes.Length != types.Length) 59for (int i = 0; i < types.Length; i++) 92public int Count => Items.Length; 127if (types?.Length > 0) 146if (prgtype1.Length == 0) 152if (prgtype2.Length == 0) 157CType[] combined = new CType[prgtype1.Length + prgtype2.Length]; 158Array.Copy(prgtype1, combined, prgtype1.Length); 159Array.Copy(prgtype2, 0, combined, prgtype1.Length, prgtype2.Length);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (10)
205for (int i = 0; i < srcs.Length; i++) 211CType[] dsts = new CType[srcs.Length]; 214while (++i < srcs.Length) 299if (index < pctx.MethodTypes.Length) 308return index < pctx.ClassTypes.Length ? pctx.ClassTypes[index] : type; 439Debug.Assert(tvs.GetIndexInTotalParameters() < pctx.MethodTypes.Length); 440if (index < pctx.MethodTypes.Length) 447Debug.Assert(index < pctx.ClassTypes.Length); 448if (index < pctx.ClassTypes.Length) 685for (int i = 0; i < newTypeArgsTemp.Length; i++)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (20)
241list = new List<Type>(ifaces.Length + 2) 304CType[] ctypes = new CType[genericArguments.Length]; 305for (int i = 0; i < genericArguments.Length; i++) 312for (int i = 0; i < genericArguments.Length; i++) 336for (int i = 0; i < genericArguments.Length; i++) 469if (parentType.GetGenericArguments() == null || pos >= parentType.GetGenericArguments().Length) 475while (parentType.GetGenericArguments().Length > pos) 483if (nextParent?.GetGenericArguments()?.Length > pos) 813int length = types.Length; 820for (int i = 0; i < types.Length; i++) 1153bool isIndexer = property.GetIndexParameters().Length != 0 1439if (parameters.Length > 0) 1442if (parameters[parameters.Length - 1].GetCustomAttribute<ParamArrayAttribute>(false) != null) 1448for (int i = 0; i < parameters.Length; i++) 1612CType[] types = new CType[isVarArg ? parameters.Length + 1 : parameters.Length]; 1614for (int i = 0; i < parameters.Length; i++) 1621types[types.Length - 1] = ArgumentListType.Instance; 1658if (parameters.Length == 0) 1663ParameterInfo p = parameters[parameters.Length - 1];
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (1)
154for (int i = 0; i < oldEntries.Length; i++)
Microsoft.Data.Analysis (33)
DataFrame.IDataView.cs (2)
48if (column.Index < activeColumns.Length) 83for (int i = 0; i < _getters.Length; i++)
DataFrame.IO.cs (4)
63IEnumerable<string> lines = read.Select(line => col < line.Line.Length ? line.Line[col] : throw new FormatException(string.Format(Strings.LessColumnsThatExpected, line.LineNumber + 1))); 381int numberOfColumns = dataTypes?.Length ?? 0; 396for (int i = 0; i < fields.Length; i++) 425numberOfColumns = Math.Max(numberOfColumns, fields.Length);
DataFrame.Join.cs (5)
182if (retainedJoinColumnNames.Length != supplemetaryJoinColumnNames.Length) 202for (int colNameIndex = 0; colNameIndex < retainedJoinColumnNames.Length; colNameIndex++) 213var newRetainedIndicesReverseMapping = new Dictionary<long, long>(shrinkedRetainedIndices.Length); 215for (int i = 0; i < shrinkedRetainedIndices.Length; i++)
DataFrameColumns\StringDataFrameColumn.cs (4)
226IntrospectiveSort(array, array.Length, sortIndices, comparer); 233while (value == null && ++startIndex < bufferSortIndices[stringBufferIndex].Length) 262GetBufferSortIndex getBufferSortIndex = new GetBufferSortIndex((int bufferIndex, int sortIndex) => (bufferSortIndices[bufferIndex][sortIndex]) + bufferIndex * bufferSortIndices[0].Length); 264GetBufferLengthAtIndex getBufferLengthAtIndex = new GetBufferLengthAtIndex((int bufferIndex) => bufferSortIndices[bufferIndex].Length);
GroupBy.cs (1)
128if (columnNames == null || columnNames.Length == 0)
IDataView.Extension.cs (2)
52if (selectColumns != null && selectColumns.Length > 0) 141for (int i = 0; i < activeColumnDelegates.Length; i++)
PrimitiveDataFrameColumn.Sort.cs (1)
41for (int i = 0; i < sortIndices.Length; i++)
TextFieldParser.cs (14)
340for (int i = 0; i < whitespaceCodes.Length; i++) 489StringBuilder builder = new StringBuilder(_buffer.Length); 630int BufferLength = _buffer.Length; 645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range"); 648int bufferLength = _buffer.Length; 665int bufferSize = _buffer.Length + DEFAULT_BUFFER_LENGTH; 671Array.Copy(_buffer, tempArray, _buffer.Length); 672int charsRead = _reader.Read(tempArray, _buffer.Length, DEFAULT_BUFFER_LENGTH); 888int length = _fieldWidths.Length; 949if (_fieldWidths.Length == 0) 955int widthBound = _fieldWidths.Length - 1; 973int bound = widths.Length - 1; 989if (_delimiters.Length == 0) 993int length = _delimiters.Length;
Microsoft.Data.Analysis.Tests (52)
ArrayComparer.cs (2)
66Assert.Equal(expectedArray.Data.Children.Length, array.Data.Children.Length);
DataFrame.IOTests.cs (1)
1241var row = new object[columns.Length];
DataFrameTests.cs (1)
1225Assert.Equal(values.Length, newCol.Length);
DataFrameTests.Merge.cs (20)
154for (long i = 0; i < matchedFullRows.Length; i++) 161for (long i = 0; i < matchedLeftOrRightRowsNullOtherRows.Length; i++) 215for (long i = 0; i < mergeRows.Length; i++) 265for (long i = 0; i < mergeRows.Length; i++) 275for (long i = 0; i < mergeRows.Length; i++) 284for (long i = 0; i < mergeRows.Length; i++) 348Assert.Equal(expectedMerged.Length, merge.Rows.Count); 351for (long i = 0; i < expectedMerged.Length; i++) 407Assert.Equal(expectedMerged.Length, merge.Rows.Count); 410for (long i = 0; i < expectedMerged.Length; i++) 465Assert.Equal(expectedMerged.Length, merge.Rows.Count); 468for (long i = 0; i < expectedMerged.Length; i++) 521Assert.Equal(expectedMerged.Length, merge.Rows.Count); 524for (long i = 0; i < expectedMerged.Length; i++) 581Assert.Equal(expectedMerged.Length, merge.Rows.Count); 584for (long i = 0; i < expectedMerged.Length; i++) 637Assert.Equal(expectedMerged.Length, merge.Rows.Count); 640for (long i = 0; i < expectedMerged.Length; i++) 693Assert.Equal(expectedMerged.Length, merge.Rows.Count); 696for (long i = 0; i < expectedMerged.Length; i++)
PrimitiveDataFrameColumnTests.cs (4)
409Assert.Equal(indicesMap.Length, clonedColumn.Length); 411for (int i = 0; i < indicesMap.Length; i++) 430Assert.Equal(indicesMap.Length, clonedColumn.Length); 432for (int i = 0; i < indicesMap.Length; i++)
src\Microsoft.Data.Analysis\TextFieldParser.cs (14)
340for (int i = 0; i < whitespaceCodes.Length; i++) 489StringBuilder builder = new StringBuilder(_buffer.Length); 630int BufferLength = _buffer.Length; 645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range"); 648int bufferLength = _buffer.Length; 665int bufferSize = _buffer.Length + DEFAULT_BUFFER_LENGTH; 671Array.Copy(_buffer, tempArray, _buffer.Length); 672int charsRead = _reader.Read(tempArray, _buffer.Length, DEFAULT_BUFFER_LENGTH); 888int length = _fieldWidths.Length; 949if (_fieldWidths.Length == 0) 955int widthBound = _fieldWidths.Length - 1; 973int bound = widths.Length - 1; 989if (_delimiters.Length == 0) 993int length = _delimiters.Length;
StringDataFrameColumnTests.cs (10)
40Assert.Equal(mapIndices.Length, clonedColumn.Length); 43for (int i = 0; i < mapIndices.Length; i++) 56Assert.Equal(mapIndices.Length, clonedColumn.Length); 59for (int i = 0; i < mapIndices.Length; i++) 60Assert.Equal(stringColumn[mapIndices[mapIndices.Length - 1 - i]], clonedColumn[i]); 72Assert.Equal(mapIndices.Length, clonedColumn.Length); 75for (int i = 0; i < mapIndices.Length; i++) 89Assert.Equal(mapIndices.Length, clonedColumn.Length); 91for (int i = 0; i < mapIndices.Length; i++) 92Assert.Equal(stringColumn[mapIndices[mapIndices.Length - 1 - i]], clonedColumn[i]);
Microsoft.DotNet.Arcade.Sdk (5)
src\GetLicenseFilePath.cs (2)
66if (matches.Length == 0) 70else if (matches.Length > 1)
src\ValidateLicense.cs (3)
57if (normalizedActual.Length != normalizedExpected.Length) 62for (int i = 0; i < normalizedActual.Length; i++)
Microsoft.DotNet.Arcade.Sdk.Tests (1)
RepoWithConditionalProjectsToBuildTests.cs (1)
53Assert.Equal(expectedPackages, nupkgFiles.Length);
Microsoft.DotNet.AsmDiff (10)
AssemblySet.cs (6)
46IsEmpty = includedAssembliesSorted.Length == 0 && dependencies.Length == 0; 73if (string.IsNullOrEmpty(name) && (assemblies == null || assemblies.Length == 0)) 79name = assemblies.Length == 1 111if (string.IsNullOrEmpty(name) && assemblyArray.Length == 0 && allPaths.Any()) 114name = allPaths.Length == 1
DiffCSharpWriter.cs (4)
357while (t1Start < t1.Length && t2Start < t2.Length) 372merged.AddRange(ListMerger.Merge(t1, t1Start, t1.Length, t2, t2Start, t2.Length));
Microsoft.DotNet.Build.Tasks.Feed (3)
src\common\UploadToAzure.cs (2)
70if (Items.Length == 0) 128Log.LogMessage("Upload to Azure is complete, a total of {0} items were uploaded.", Items.Length);
src\ConfigureInputFeed.cs (1)
36for (int i = 0; i < EnableFeeds.Length; i++)
Microsoft.DotNet.Build.Tasks.Feed.Tests (2)
PublishArtifactsInManifestTests.cs (2)
206if (_callIndex < _maxStreamBytesReturned.Length) 211int bytesToWrite = Math.Min(Math.Min(_streamBytes.Length - _position, count), maxStreamBytesThisCall);
Microsoft.DotNet.Build.Tasks.Installers (18)
src\ArWriter.cs (2)
26_stream.Write(magic, 0, magic.Length); 56_stream.Write(data, 0, data.Length);
src\CreateControlFile.cs (1)
65if (Depends.Length > 0)
src\GenerateGuidFromName.cs (6)
31var streamToHash = new byte[namespaceBytes.Length + nameBytes.Length]; 33Array.Copy(namespaceBytes, streamToHash, namespaceBytes.Length); 34Array.Copy(nameBytes, 0, streamToHash, namespaceBytes.Length, nameBytes.Length); 40Array.Copy(hashResult, res, res.Length);
src\HexConverter.cs (1)
19StringBuilder hexString = new(byteArray.Length * 2);
src\RpmHeader.cs (5)
116stream.ReadExactly(indexBytes, 0, indexBytes.Length); 125stream.ReadExactly(store, 0, store.Length); 282BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), strings.Length); 308BinaryPrimitives.WriteInt32BigEndian(indexInfoBytes.AsSpan(12), contents.Length); 311for (int i = 0; i < contents.Length; i++)
src\StabilizeWixFileId.cs (2)
76if (matchingFileElements.Length != 1) 79$"Expected 1 match for '{file.ItemSpec}', found {matchingFileElements.Length}: " +
src\StreamHelpers.cs (1)
27stream.Write(buffer, 0, buffer.Length);
Microsoft.DotNet.Build.Tasks.Packaging (33)
ApplyBaseLine.cs (1)
47if (PackageIndexes != null && PackageIndexes.Length > 0)
ApplyPreReleaseSuffix.cs (2)
52if (null == OriginalPackages || OriginalPackages.Length == 0) 64if (PackageIndexes != null && PackageIndexes.Length > 0)
CreateTrimDependencyGroups.cs (1)
62if (PackageIndexes == null && PackageIndexes.Length == 0)
FilterUnknownPackages.cs (1)
39if (PackageIndexes != null && PackageIndexes.Length > 0)
GenerateNuSpec.cs (1)
362if (packageTypeSplitInPart.Length > 1)
GenerateRuntimeDependencies.cs (1)
49if (Dependencies == null || Dependencies.Length == 0)
GetApplicableAssetsFromPackageReports.cs (1)
50if (PackageReports == null || PackageReports.Length == 0)
GetApplicableAssetsFromPackages.cs (3)
70if (PackageAssets == null || PackageAssets.Length == 0) 76if (TargetMonikers == null || TargetMonikers.Length == 0) 85if (RuntimeTargetMonikers != null && RuntimeTargetMonikers.Length > 0)
GetAssemblyReferences.cs (1)
40if (Assemblies == null || Assemblies.Length == 0)
GetInboxFrameworks.cs (1)
43if (PackageIndexes == null && PackageIndexes.Length == 0)
GetLastStablePackage.cs (2)
55if (LatestPackages == null || LatestPackages.Length == 0) 60if (PackageIndexes != null && PackageIndexes.Length > 0)
GetLayoutFiles.cs (1)
70if (targetParts.Length > 1)
GetPackageDescription.cs (1)
126if (metadata.CommonTypes != null && metadata.CommonTypes.Length > 0)
GetPackageFromModule.cs (1)
42if (PackageIndexes != null && PackageIndexes.Length > 0)
GetPackageVersion.cs (1)
30if (Files == null || Files.Length == 0)
HarvestPackage.cs (3)
132if (Frameworks != null && Frameworks.Length > 0) 582if (parts.Length >= 2) 590if (parts.Length >= 4 &&
NuGetPack.cs (1)
137if (Nuspecs == null || Nuspecs.Length == 0)
PackageIndex.cs (1)
682if (parts.Length > 1)
PackageReport.cs (3)
126public bool ShouldSerializeCompileAssets() { return CompileAssets != null && CompileAssets.Length != 0; } 127public bool ShouldSerializeRuntimeAssets() { return RuntimeAssets != null && RuntimeAssets.Length != 0; } 128public bool ShouldSerializeNativeAssets() { return NativeAssets != null && NativeAssets.Length != 0; }
PromoteDependencies.cs (3)
36if (PackageIndexes == null && PackageIndexes.Length == 0) 58if (libFxs.Length > 0) 72if (refFxs.Length > 0)
SplitReferences.cs (2)
51if (References == null || References.Length == 0) 54if (PackageIndexes == null && PackageIndexes.Length == 0)
ValidatePackage.cs (1)
373if (PackageIndexes == null || PackageIndexes.Length == 0)
Microsoft.DotNet.Build.Tasks.Packaging.Tests (2)
HarvestPackageTests.cs (2)
109task.SupportedFrameworks.Should().HaveCount(_frameworks.Length); 167task.SupportedFrameworks.Should().HaveCount(_frameworks.Length);
Microsoft.DotNet.Build.Tasks.TargetFramework (2)
ChooseBestP2PTargetFrameworkTask.cs (1)
63List<ITaskItem> assignedProjects = new(AnnotatedProjectReferences.Length);
ChooseBestTargetFrameworksTask.cs (1)
31List<ITaskItem> bestTargetFrameworkList = new(BuildTargetFrameworks!.Length);
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\GetPkgDefAssemblyDependencyGuid.cs (1)
63Debug.Assert(reducedHash.Length == targetBlockSize);
Microsoft.DotNet.Build.Tasks.Workloads (5)
StringExtensions.cs (1)
42if ((replacementStrings is not null) && (replacementStrings.Length > 0))
Utils.cs (3)
141byte[] hashBuffer = new byte[namespaceBytes.Length + nameBytes.Length]; 147Buffer.BlockCopy(nameBytes, 0, hashBuffer, 16, nameBytes.Length);
WorkloadPackageBase.cs (1)
290string prerelease = (preleaseParts.Length > 1) ?
Microsoft.DotNet.Build.Tasks.Workloads.Tests (1)
SwixComponentTests.cs (1)
192Assert.Equal(2, componentSwr.Split(new[] { "vs.dependency" }, StringSplitOptions.None).Length);
Microsoft.DotNet.CodeAnalysis (3)
Analyzers\PinvokeAnalyzer.cs (3)
84if (splitCount.Length == 2 || splitCount.Length == 3) 87if (splitCount.Length == 3)
Microsoft.DotNet.GenFacades (1)
NotSupportedAssemblyGenerator.cs (1)
33if (SourceFiles == null || SourceFiles.Length == 0)
Microsoft.DotNet.Helix.Client (1)
generated-code\PagedResponse.cs (1)
101if (parts.Length < 2)
Microsoft.DotNet.Helix.JobSender (1)
Payloads\SingleFilePayload.cs (1)
42await entryStream.WriteAsync(Content, 0, Content.Length, cancellationToken);
Microsoft.DotNet.Helix.Sdk (1)
CheckAzurePipelinesTestResults.cs (1)
29if (ExpectedTestFailures?.Length > 0)
Microsoft.DotNet.Helix.Sdk.Tests (11)
CreateXHarnessAndroidWorkItemsTests.cs (5)
57_task.WorkItems.Length.Should().Be(0); 75_task.WorkItems.Length.Should().Be(1); 114_task.WorkItems.Length.Should().Be(2); 144_task.WorkItems.Length.Should().Be(2); 177_task.WorkItems.Length.Should().Be(1);
CreateXHarnessAppleWorkItemsTests.cs (6)
59_task.WorkItems.Length.Should().Be(0); 78_task.WorkItems.Length.Should().Be(1); 124_task.WorkItems.Length.Should().Be(2); 156_task.WorkItems.Length.Should().Be(1); 185_task.WorkItems.Length.Should().Be(2); 229_task.WorkItems.Length.Should().Be(1);
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
DependencyInjectionValidation.cs (2)
98.OrderBy(c => c.GetParameters().Length) 101if (constructors.Length == 0)
Microsoft.DotNet.NuGetRepack.Tasks (2)
src\ReplacePackageParts.cs (2)
88int partCount = Parts?.Length ?? 0; 90if (partCount != (ReplacementFiles?.Length ?? 0))
Microsoft.DotNet.NuGetRepack.Tests (3)
VersionUpdaterTests.cs (3)
40Assert.Equal(expectedParts.Length, actualParts.Length); 41for (int i = 0; i < expectedParts.Length; i++)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.DotNet.PackageTesting (6)
VerifyClosure.cs (4)
47if (Sources == null || Sources.Length == 0) 129if (IgnoredReferences == null || IgnoredReferences.Length == 0) return; 311existingCycle.Length > cycle.Length)
VerifyTypes.cs (2)
38if (Sources == null || Sources.Length == 0) 127if (IgnoredTypes == null || IgnoredTypes.Length == 0) return;
Microsoft.DotNet.RemoteExecutor (4)
Program.cs (4)
23if (args.Length < 4) 34string[] additionalArgs = args.Length > 4 ? 35args.Subarray(4, args.Length - 4) : 89if (additionalArgs.Length > 0)
Microsoft.DotNet.SharedFramework.Sdk (12)
src\CreateFrameworkListFile.cs (5)
124if (pathParts.Length > 1 && pathParts[1].Contains("_")) 147if (pathParts.Length < 3 || !pathParts[1].Equals("dotnet", StringComparison.Ordinal) || pathParts.Length > 4) 152if (pathParts.Length > 3) 186int len = publicKeyToken.Length;
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (4)
47if (Sources == null || Sources.Length == 0) 129if (IgnoredReferences == null || IgnoredReferences.Length == 0) return; 311existingCycle.Length > cycle.Length)
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
38if (Sources == null || Sources.Length == 0) 127if (IgnoredTypes == null || IgnoredTypes.Length == 0) return;
src\ValidateFileVersions.cs (1)
85$"Missing FileVersion in {versionlessFiles.Length} shared framework files:" +
Microsoft.DotNet.SignCheck (3)
SignCheckTask.cs (3)
124if(matchedFiles.Length == 1) 128else if(matchedFiles.Length == 0) 132else if (matchedFiles.Length > 1)
Microsoft.DotNet.SignCheckLibrary (4)
Verification\Exclusion.cs (1)
84if ((_exclusionParts != null) && (index >= 0) && (index < _exclusionParts.Length))
Verification\Exclusions.cs (1)
82if ((e.ParentFiles.Length == 0) || (e.ParentFiles.All(pf => String.IsNullOrEmpty(pf))) || IsMatch(e.ParentFiles, parent))
Verification\VsixVerifier.cs (2)
76(uint)binaryTimestamp.Length, 78(uint)packageSignature.SignatureValue.Length,
Microsoft.DotNet.SignTool (16)
src\BatchSignUtil.cs (6)
126signedCount = filesToSign.Length; 127if (filesToSign.Length == 0) return true; 129_log.LogMessage(MessageImportance.High, $"Round {round}: Signing {filesToSign.Length} files."); 155signedCount = enginesToSign.Length; 156if (enginesToSign.Length == 0) 161_log.LogMessage(MessageImportance.High, $"Round {round}: Signing {enginesToSign.Length} engines.");
src\ByteSequenceComparer.cs (3)
48if (left == null || right == null || left.Length != right.Length) 53for (var i = 0; i < left.Length; i++)
src\ContentUtil.cs (1)
114return (pktBytes == null || pktBytes.Length == 0) ?
src\Hash.cs (2)
76var maxSize = Math.Min(maxItemsToHash, values.Length); 166for (int i = 0; i < data.Length; i++)
src\SignToolTask.cs (4)
319if (ItemsToSign.Length == 0) 342if (result == null || result.Length == 0) 352int min = Math.Min(dir1.Length, dir2.Length);
Microsoft.DotNet.SignTool.Tests (5)
FakeSignTool.cs (4)
31var buffer = new byte[_stamp.Length]; 32return stream.TryReadAll(buffer, 0, buffer.Length) == buffer.Length && 59stream.Write(_stamp, 0, _stamp.Length);
SignToolTests.cs (1)
340actualXmlElementsPerSigningRound.Count().Should().Be(expectedXmlElementsPerSigningRound.Length);
Microsoft.DotNet.SourceBuild.Tasks (4)
src\UsageReport\ValidateUsageAgainstBaseline.cs (3)
91$"{diff.Added.Length} new pre-builts discovered! Detailed usage " + 109$"{diff.Removed.Length} packages in baseline weren't used!"); 118$"{diff.Unchanged.Length} packages used as expected in the baseline.");
src\UsageReport\WriteUsageReports.cs (1)
98if (segments.Length > 2 &&
Microsoft.DotNet.SourceBuild.Tasks.Tests (2)
ValidateUsageAgainstBaselineTests.cs (2)
108Assert.Equal(baseline.IgnorePatterns.Length, data.ActualUsageData.IgnorePatterns.Length);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (5)
HelperFactory.cs (2)
223m.GetParameters().Length == 2 && 252for (int i = 0; i < parameters.Length; i++)
Languages\angular\Angular.cs (3)
29if (args.Length > 0) 120if (args.Length > 0) 209if (args.Length > 0)
Microsoft.DotNet.VersionTools (12)
BuildManifest\BuildManifestClient.cs (1)
278if (remainingSemaphores.Length == joinGroup.ParallelSemaphorePaths.Count())
BuildManifest\Model\OrchestratedBuildModel.cs (2)
31if (feeds.Length != 1) 34$"1 orchestrated blob feed must exist, but found {feeds.Length}.");
BuildManifest\VersionIdentifier.cs (2)
55for (int i = pathSegments.Length - 1; i >= 0; i--) 224for (int i = 0; i < pathSegments.Length; i++)
Dependencies\BuildManifest\OrchestratedBuildIdentityMatch.cs (2)
24if (matches.Length > 1) 27$"Expected only 1 build matching '{buildName}', but found {matches.Length}: " +
Dependencies\Submodule\LatestCommitSubmoduleUpdater.cs (2)
50if (matchingInfos.Length != 1) 58$"but found {matchingInfos.Length}/{allSubmoduleInfoCount}: " +
Dependencies\Submodule\SubmoduleDependencyInfo.cs (3)
29if (remoteRefLines.Length != 1) 32if (remoteRefLines.Length > 1) 40$"Matched {remoteRefLines.Length}{allRefs}. ");
Microsoft.DotNet.VersionTools.Tests (19)
BuildManifest\BuildManifestClientTests.cs (2)
66objects.Length == 2 && 132objects.Length == 1 &&
BuildManifest\ManifestModelTests.cs (16)
40if (infos.Length % 2 != 0) 49for (int i = 0; i < infos.Length / 2; i++) 91if (infos.Length % 2 != 0) 101for (int i = 0; i < infos.Length / 2; i++) 145if (infos.Length % 4 != 0) 152for (int i = 0; i < infos.Length / 4; i++) 221if (infos.Length % 4 != 0) 231for (int i = 0; i < infos.Length / 4; i++) 256if (infos.Length % 2 != 0) 263for (int i = 0; i < infos.Length / 2; i++) 296if (infos.Length % 2 != 0) 306for (int i = 0; i < infos.Length / 2; i++) 333if (infos.Length % 3 != 0) 340for (int i = 0; i < infos.Length / 3; i++) 374if (infos.Length % 3 != 0) 384for (int i = 0; i < infos.Length / 3; i++)
BuildManifest\VersionIdentiferTests.cs (1)
69for (int i = 0; i < assets.Length; i++)
Microsoft.DotNet.XliffTasks (5)
Tasks\GatherTranslatedSource.cs (2)
22ITaskItem[] outputs = new ITaskItem[XlfFiles.Length]; 46Release.Assert(index == XlfFiles.Length);
Tasks\GatherXlf.cs (3)
29ITaskItem[] outputs = new ITaskItem[Sources.Length * Languages.Length]; 47Release.Assert(index == outputs.Length);
Microsoft.DotNet.XUnitExtensions (5)
Discoverers\ConditionalTestDiscoverer.cs (5)
52if (symbols.Length == 2) 131if (mi != null && mi.IsStatic && mi.GetParameters().Length == 0 && mi.ReturnType == typeof(bool)) 135if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0) 150if (conditionArguments == null || conditionArguments.Length == 0) return true; 155if (conditionArguments.Length < 2)
Microsoft.Extensions.AI (11)
CachingHelpers.cs (1)
36if (flag && jsonKeyBytes.Length > 0)
ChatCompletion\FunctionInvokingChatClient.cs (2)
208if (functionCallContents.Length == 0) 223if (functionCallContents.Length == response.Message.Contents.Count)
ChatCompletion\OpenTelemetryChatClient.cs (1)
535ToolCalls = toolCalls.Length > 0 ? toolCalls : null,
Functions\AIFunctionFactory.cs (6)
188_parameterMarshallers = new Func<IReadOnlyDictionary<string, object?>, AIFunctionContext?, object?>[parameters.Length]; 190for (int i = 0; i < parameters.Length; i++) 228object?[] args = paramMarshallers.Length != 0 ? new object?[paramMarshallers.Length] : []; 231arguments is null || args.Length == 0 ? EmptyReadOnlyDictionary<string, object?>.Instance : 243for (int i = 0; i < args.Length; i++)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Extensions.AI.Abstractions (6)
Embeddings\EmbeddingGeneratorExtensions.cs (1)
116for (int i = 0; i < results.Length; i++)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (4)
155if (parameters?.Length > 0) 157Dictionary<ParameterLookupKey, ParameterInfo> dict = new(parameters.Length); 348if (constructors.Length == 1) 365else if (constructor.GetParameters().Length == 0)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Embeddings\EmbeddingGeneratorExtensionsTests.cs (1)
56Assert.Equal(count, results.Length);
Microsoft.Extensions.AI.AzureAIInference (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Extensions.AI.Ollama (4)
OllamaChatClient.cs (1)
223if (message.ToolCalls is { Length: > 0 })
OllamaEmbeddingGenerator.cs (2)
118if (response.Embeddings is null || response.Embeddings.Length != inputs.Length) 120throw new InvalidOperationException($"Ollama generated {response.Embeddings?.Length ?? 0} embeddings but {inputs.Length} were expected.");
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Extensions.AI.OpenAI (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
70while (i < expectedUpdates.Length)
Microsoft.Extensions.ApiDescription.Client (2)
artifacts\obj\Microsoft.Extensions.ApiDescription.Client\Release\netstandard2.0\Microsoft.Extensions.ApiDescription.Client.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
GetOpenApiReferenceMetadata.cs (1)
52var outputs = new List<ITaskItem>(Inputs.Length);
Microsoft.Extensions.ApiDescription.Client.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.Extensions.ApiDescription.Tool.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.Extensions.AsyncState.Tests (1)
AsyncContextTests.cs (1)
252for (int i = 0; i < tasks.Length; i++)
Microsoft.Extensions.Caching.Abstractions (2)
DistributedCacheExtensions.cs (2)
121return Encoding.UTF8.GetString(data, 0, data.Length); 138return Encoding.UTF8.GetString(data, 0, data.Length);
Microsoft.Extensions.Caching.Hybrid (12)
Internal\BufferChunk.cs (2)
31_lengthAndPoolFlag = array!.Length; 39Debug.Assert(Length == array.Length, "array length not respected");
Internal\DefaultHybridCache.L2.cs (3)
82if (arr.Length != buffer.Length) 135if (payload.Length > MaximumPayloadBytes) 137ThrowPayloadLengthExceeded(payload.Length);
Internal\RecyclableArrayBufferWriter.cs (7)
47public int FreeCapacity => _buffer.Length - _index; 74if (tmp.Length != 0) 87if (_index > _buffer.Length - count) 120Debug.Assert(_buffer.Length > _index, "should have some space"); 127Debug.Assert(_buffer.Length > _index, "should have some space"); 163var currentLength = _buffer.Length; 193if (oldArray.Length != 0)
Microsoft.Extensions.Caching.Hybrid.Tests (6)
DistributedCacheTests.cs (5)
292payload = new(arr, 5, arr.Length - 10); 340Assert.Equal(size, segment.Array.Length); 348Assert.NotEqual(size, segment.Array.Length); 361Memory = new(arr, 5, arr.Length - 10); 379public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
LogCollector.cs (1)
39if (errorIds.Length == _items.Count)
Microsoft.Extensions.Caching.Memory (1)
MemoryDistributedCache.cs (1)
82memoryCacheEntryOptions.Size = value.Length;
Microsoft.Extensions.Caching.MicroBenchmarks (10)
DistributedCacheBenchmarks.cs (10)
69for (int i = 0; i < keys.Length; i++) 122total += _backend.Get(RandomKey())?.Length ?? 0; 138total += (pendingBlobs[i].Result)?.Length ?? 0; 150total += (await _backend.GetAsync(RandomKey()))?.Length ?? 0; 166total += (await pendingBlobs[i])?.Length ?? 0; 177total += _backend.Get(FixedKey())?.Length ?? 0; 193total += (pendingBlobs[i].Result)?.Length ?? 0; 204total += (await _backend.GetAsync(FixedKey()))?.Length ?? 0; 220total += (await pendingBlobs[i])?.Length ?? 0; 227private string RandomKey() => keys[random.Next(keys.Length)];
Microsoft.Extensions.Caching.SqlServer (2)
DatabaseOperations.cs (1)
337read = (int)source.GetBytes(ordinal, dataIndex, lease, 0, lease.Length);
SqlParameterCollectionExtensions.cs (1)
38if (value.Offset == 0 & value.Count == value.Array!.Length) // right-sized array
Microsoft.Extensions.Caching.StackExchangeRedis (6)
RedisCache.cs (6)
404if (results.Length >= 2) 413if (results.Length >= 3 && !results[2].IsNull) 443if (results.Length >= 2) 452if (results.Length >= 3 && !results[2].IsNull) 722if (metadata.Length >= 2) 769if (metadata.Length >= 2)
Microsoft.Extensions.Compliance.Abstractions.Tests (3)
Redaction\RedactorTest.cs (3)
106for (int i = 0; i < buffer.Length; i++) 143for (int i = 0; i < buffer.Length; i++) 182for (int i = 0; i < buffer.Length; i++)
Microsoft.Extensions.Compliance.Testing.Tests (5)
FakeRedactorTests.cs (5)
72for (var i = 0; i < iterations.Length; i++) 86var r = fakeRedactorProvider.GetRedactor(dc[iteration % dc.Length]); 90Assert.Equal(fakeRedactorProvider.Collector.AllRedactorRequests.Count, iterations.Length); 98Assert.Equal(numbersSetRedacted.Count, iterations.Length); 99Assert.Equal(numbersSetRequested.Count, iterations.Length);
Microsoft.Extensions.Configuration.Binder (8)
ConfigurationBinder.cs (8)
280property.GetMethod.GetParameters().Length > 0) 295property.GetMethod.GetParameters().Length > 0) 513type.IsValueType || constructors.Any(ctor => ctor.GetParameters().Length == 0); 515if (!type.IsValueType && constructors.Length == 0) 520if (constructors.Length > 1 && !hasParameterlessConstructor) 525if (constructors.Length == 1 && !hasParameterlessConstructor) 543object?[] parameterValues = new object?[parameters.Length]; 545for (int index = 0; index < parameters.Length; index++)
Microsoft.Extensions.Configuration.KeyPerFile.Tests (1)
ConfigurationProviderTestBase.cs (1)
403for (var i = 0; i < AsArray.Length; i++)
Microsoft.Extensions.DependencyInjection (34)
CallSiteJsonFormatter.cs (3)
32if (constructorCallSite.ParameterCallSites.Length > 0) 87argument.WriteProperty("size", enumerableCallSite.ServiceCallSites.Length); 89if (enumerableCallSite.ServiceCallSites.Length > 0)
ServiceLookup\CallSiteFactory.cs (16)
59if (serviceTypeGenericArguments.Length != implementationTypeGenericArguments.Length) 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 107for (int i = 0; i < serviceTypeGenericArguments.Length; i++) 318for (int i = _descriptors.Length - 1; i >= 0; i--) 328for (int i = _descriptors.Length - 1; i >= 0; i--) 341for (var i = 0; i < callSites.Length; ++i) 471if (constructors.Length == 0) 475else if (constructors.Length == 1) 479if (parameters.Length == 0) 495(a, b) => b.GetParameters().Length.CompareTo(a.GetParameters().Length)); 499for (int i = 0; i < constructors.Length; i++) 572var parameterCallSites = new ServiceCallSite[parameters.Length]; 574for (int index = 0; index < parameters.Length; index++)
ServiceLookup\CallSiteRuntimeResolver.cs (5)
44if (constructorCallSite.ParameterCallSites.Length == 0) 50parameterValues = new object?[constructorCallSite.ParameterCallSites.Length]; 51for (int index = 0; index < parameterValues.Length; index++) 167enumerableCallSite.ServiceCallSites.Length); 169for (int index = 0; index < enumerableCallSite.ServiceCallSites.Length; index++)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (4)
136if (callSite.ServiceCallSites.Length == 0) 174if (callSite.ParameterCallSites.Length == 0) 180parameterExpressions = new Expression[callSite.ParameterCallSites.Length]; 181for (int i = 0; i < parameterExpressions.Length; i++)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (3)
212if (enumerableCallSite.ServiceCallSites.Length == 0) 222argument.Generator.Emit(OpCodes.Ldc_I4, enumerableCallSite.ServiceCallSites.Length); 224for (int i = 0; i < enumerableCallSite.ServiceCallSites.Length; i++)
ServiceLookup\ServiceProviderEngineScope.cs (1)
234string debugText = $"ServiceDescriptors = {RootProvider.CallSiteFactory.Descriptors.Length}";
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.DependencyInjection.Abstractions (46)
ActivatorUtilities.cs (44)
95for (int i = 0; i < constructors.Length; i++) 101for (int j = i + 1; j < constructors.Length; j++) 109InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 125for (int i = 0; i < constructors.Length; i++) 129InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 173if (parameters.Length == 0) 179argumentTypes = new Type[parameters.Length]; 180for (int i = 0; i < argumentTypes.Length; i++) 189InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 198for (int i = 0; i < constructors.Length; i++) 200max = int.Max(max, constructors[i].Parameters.Length); 255ConstructorInfoEx[]? value = new ConstructorInfoEx[constructors.Length]; 256for (int i = 0; i < constructors.Length; i++) 402var constructorArguments = new Expression[constructorParameters.Length]; 404for (int i = 0; i < constructorParameters.Length; i++) 458if (constructorParameters.Length == 0) 465bool useFixedValues = constructorParameters.Length <= FixedArgumentThreshold; 469for (int i = 0; i < constructorParameters.Length; i++) 498if (matchedArgCount == constructorParameters.Length) 527FactoryParameterContext[] parameters = new FactoryParameterContext[constructorParameters.Length]; 528for (int i = 0; i < constructorParameters.Length; i++) 588for (int i = 0; i < constructorExs.Length; i++) 690parameterMap = new int?[constructorParameters.Length]; 692for (int i = 0; i < argumentTypes.Length; i++) 697for (int j = 0; j < constructorParameters.Length; j++) 746for (int i = 0; i < Parameters.Length; i++) 753_parameterKeys ??= new object?[Parameters.Length]; 820for (int givenIndex = 0; givenIndex < givenParameters.Length; givenIndex++) 825for (int applyIndex = 0; applyIndex < _constructor.Parameters.Length; applyIndex++) 843for (int i = 0; i < _constructor.Parameters.Length; i++) 859return _constructor.Parameters.Length; 864for (int index = 0; index < _constructor.Parameters.Length; index++) 888return _constructor.Invoker.Invoke(_parameterValues.Slice(0, _constructor.Parameters.Length)); 905for (int i = 0; i < _constructor.Parameters.Length; i++) 932Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 938switch (parameters.Length) 975object?[] arguments = new object?[parameters.Length]; 976for (int i = 0; i < parameters.Length; i++) 991Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 999switch (parameters.Length) 1130object?[] constructorArguments = new object?[parameters.Length]; 1131for (int i = 0; i < parameters.Length; i++)
ServiceDescriptor.cs (2)
302Debug.Assert(typeArguments.Length == 2); 321Debug.Assert(typeArguments.Length == 3);
Microsoft.Extensions.DependencyModel (10)
CompilationLibrary.cs (1)
60if (customResolvers?.Length > 0)
DependencyContextJsonReader.cs (7)
81Debug.Assert(rented.Length >= utf8Bom.Length); 100if (rented.Length == written) 103rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2)); 104Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length); 109lastRead = stream.Read(rented, written, rented.Length - written); 792if (groupRuntimeAssemblies.Length != 0) 804if (groupNativeLibraries.Length != 0)
DependencyContextPaths.cs (1)
50string? application = files != null && files.Length > 0 ? files[0] : null;
Resolution\PackageCompilationAssemblyResolver.cs (1)
81if (_nugetPackageDirectories == null || _nugetPackageDirectories.Length == 0 ||
Microsoft.Extensions.Diagnostics (1)
Metrics\MetricsSubscriptionManager.cs (1)
22for (int i = 0; i < _listeners.Length; i++)
Microsoft.Extensions.Diagnostics.Abstractions (2)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.Diagnostics.HealthChecks (4)
HealthCheckPublisherHostedService.cs (4)
64if (_publishers.Length == 0) 87if (_publishers.Length == 0) 195var tasks = new Task[publishers.Length]; 196for (var i = 0; i < publishers.Length; i++)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (4)
HealthCheckPublisherHostedServiceTest.cs (4)
432for (var i = 0; i < publishers.Length; i++) 639for (var i = 0; i < publishers.Length; i++) 655for (var i = 0; i < publishers.Length; i++) 768for (var i = 0; i < publishers.Length; i++)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (8)
CircularBuffer.cs (3)
23for (var i = 0; i < _elements.Length; i++) 40firstElementCursor += _elements.Length; 48var cursor = (_bufferCursor + 1) % _elements.Length;
src\Shared\BufferWriterPool\BufferWriter.cs (5)
70get => _buffer.Length; 121_ = Throw.IfOutOfRange(count, 0, _buffer.Length - WrittenCount); 171var avail = _buffer.Length - WrittenCount; 174var targetCapacity = _buffer.Length == 0 ? DefaultCapacity : _buffer.Length * 2;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (10)
Linux\LinuxUtilizationParserCgroupV1Tests.cs (1)
386for (int i = 0; i < tasks.Length; i++)
Linux\LinuxUtilizationParserCgroupV2Tests.cs (1)
501for (int i = 0; i < tasks.Length; i++)
Linux\OSFileSystemTests.cs (3)
102file.Write(fileBytes, 0, fileBytes.Length); 150file.Write(fileBytes, 0, fileBytes.Length); 198file.Write(fileBytes, 0, fileBytes.Length);
ResourceMonitoringServiceTests.cs (5)
63Assert.Equal(2, publishers.Length); 156Assert.Equal(2, publishers.Length); 461for (int i = 0; i < snapshotsSequence.Length; i++) 482Assert.Equal(0, cpuValuesWithHighSpikes[cpuValuesWithHighSpikes.Length - 1]); 568for (int i = 0; i < snapshotsSequence.Length; i++)
Microsoft.Extensions.Diagnostics.Testing (2)
Metrics\CollectedMeasurement.cs (2)
100public bool MatchesTags(params KeyValuePair<string, object?>[] tags) => ContainsTags(tags) && (Tags.Count == tags.Length); 107public bool MatchesTags(params string[] tags) => ContainsTags(Throw.IfNull(tags)) && (Tags.Count == tags.Length);
Microsoft.Extensions.FileProviders.Embedded (3)
EmbeddedFileProvider.cs (3)
155for (var i = 0; i < resources.Length; i++) 265for (var i = 1; i < subNames.Length; i++) 294for (var i = 1; i < subNames.Length; i++)
Microsoft.Extensions.FileProviders.Physical (6)
PollingWildCardChangeToken.cs (6)
165Debug.Assert(previousHash.Length == currentHash.Length); 172if (_byteBuffer == null || byteCount > _byteBuffer.Length) 179sha256.AppendData(Separator, 0, Separator.Length); 181Debug.Assert(_byteBuffer.Length > sizeof(long)); 190sha256.AppendData(Separator, 0, Separator.Length);
Microsoft.Extensions.FileSystemGlobbing (2)
Abstractions\DirectoryInfoWrapper.cs (2)
84if (dirs.Length == 1) 88else if (dirs.Length == 0)
Microsoft.Extensions.Hosting (1)
HostingHostBuilderExtensions.cs (1)
267if (args is { Length: > 0 })
Microsoft.Extensions.Http (3)
DefaultHttpClientFactory.cs (1)
151for (int i = _filters.Length - 1; i >= 0; i--)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.Http.Diagnostics (6)
src\Shared\BufferWriterPool\BufferWriter.cs (5)
70get => _buffer.Length; 121_ = Throw.IfOutOfRange(count, 0, _buffer.Length - WrittenCount); 171var avail = _buffer.Length - WrittenCount; 174var targetCapacity = _buffer.Length == 0 ? DefaultCapacity : _buffer.Length * 2;
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Latency\Internal\HttpCheckpointsTest.cs (1)
15Assert.True(HttpCheckpoints.Checkpoints.Length > 0);
Latency\Internal\HttpRequestLatencyListenerTest.cs (4)
155for (int i = 0; i < events.Length; i++) 178int numHttpEvents = httpEvents.Length; 191int numSocketEvents = socketEvents.Length; 204int numDnsEvents = dnsEvents.Length;
Microsoft.Extensions.Http.Polly (1)
artifacts\obj\Microsoft.Extensions.Http.Polly\Release\netstandard2.0\Microsoft.Extensions.Http.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.Extensions.Http.Resilience.Tests (2)
Routing\RoutingStrategyTest.cs (2)
65Assert.Equal(routes.Length, urls.Length);
Microsoft.Extensions.Identity.Core (25)
artifacts\obj\Microsoft.Extensions.Identity.Core\Release\net462\Microsoft.Extensions.Identity.Core.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Base32.cs (2)
56for (int offset = 0; offset < input.Length;) 88while (outputIndex < output.Length)
PasswordHasher.cs (17)
80if (a == null || b == null || a.Length != b.Length) 85for (var i = 0; i < a.Length; i++) 148var outputBytes = new byte[13 + salt.Length + subkey.Length]; 153Buffer.BlockCopy(salt, 0, outputBytes, 13, salt.Length); 154Buffer.BlockCopy(subkey, 0, outputBytes, 13 + saltSize, subkey.Length); 174if (decodedHashedPassword.Length == 0) 228if (hashedPassword.Length != 1 + SaltSize + Pbkdf2SubkeyLength) 234Buffer.BlockCopy(hashedPassword, 1, salt, 0, salt.Length); 237Buffer.BlockCopy(hashedPassword, 1 + salt.Length, expectedSubkey, 0, expectedSubkey.Length); 268Buffer.BlockCopy(hashedPassword, 13, salt, 0, salt.Length); 271int subkeyLength = hashedPassword.Length - 13 - salt.Length; 277Buffer.BlockCopy(hashedPassword, 13 + salt.Length, expectedSubkey, 0, expectedSubkey.Length);
Rfc6238AuthenticationService.cs (4)
60var offset = hash[hash.Length - 1] & 0xf; 61Debug.Assert(offset + 4 < hash.Length); 72var combined = new byte[checked(input.Length + modifierBytes.Length)]; 74Buffer.BlockCopy(modifierBytes, 0, combined, input.Length, modifierBytes.Length);
UserManager.cs (1)
2064uint range = (uint)AllowedChars.Length - 1;
Microsoft.Extensions.Localization (1)
artifacts\obj\Microsoft.Extensions.Localization\Release\net462\Microsoft.Extensions.Localization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.Extensions.Localization.RootNamespace.Tests (1)
artifacts\obj\Microsoft.Extensions.Localization.RootNamespace.Tests\Release\net10.0\LocalizationTest.Abc.Resources.Controllers.ValuesController.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.Extensions.Localization.Tests (2)
LocalizationServiceCollectionExtensionsTest.cs (2)
53if (matches.Length == 0) 57else if (matches.Length > 1)
Microsoft.Extensions.Logging (10)
Logger.cs (8)
36for (int i = 0; i < loggers.Length; i++) 76for (; i < loggers.Length; i++) 95return i < loggers.Length ? true : false; 125if (loggers.Length == 1) 130var scope = new Scope(loggers.Length); 132for (int i = 0; i < loggers.Length; i++) 191if (messageLoggers is null || messageLoggers.Length == 0) 314int count = _disposable.Length;
LoggerFactory.cs (2)
186int newLoggerIndex = loggerInformation.Length; 187Array.Resize(ref loggerInformation, loggerInformation.Length + 1);
Microsoft.Extensions.Logging.Abstractions (9)
FormattedLogValues.cs (1)
33if (values != null && values.Length != 0 && format != null)
LogValuesFormatter.cs (6)
142for (int i = 0; i < values.Length; i++) 148formattedValues = new object[values.Length]; 151for (; i < values.Length; i++) 168for (int i = 0; i < values.Length; i++) 238var valueArray = new KeyValuePair<string, object?>[values.Length + 1]; 244valueArray[valueArray.Length - 1] = new KeyValuePair<string, object?>("{OriginalFormat}", OriginalFormat);
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.Logging.Console (10)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (10)
56Debug.Assert(_index <= _rentedBuffer.Length); 75return _rentedBuffer.Length; 84return _rentedBuffer.Length - _index; 106Debug.Assert(_index <= _rentedBuffer.Length); 141Debug.Assert(_index <= _rentedBuffer.Length - count); 175int currentLength = _rentedBuffer.Length; 204Debug.Assert(oldBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length >= _index); 213Debug.Assert(_rentedBuffer.Length - _index > 0); 214Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
Microsoft.Extensions.Logging.EventSource (3)
LoggingEventSource.cs (3)
422if (ruleStrings.Length > 0 && ruleStrings[0].Equals(UseAppFilters, StringComparison.OrdinalIgnoreCase)) 432for (int i = ruleStringsStartIndex; i < ruleStrings.Length; i++) 448if (parts.Length == 2)
Microsoft.Extensions.ObjectPool.Tests (3)
ThreadingTest.cs (3)
34for (var i = 0; i < threads.Length; i++) 39for (var i = 0; i < threads.Length; i++) 48for (var i = 0; i < threads.Length; i++)
Microsoft.Extensions.Options (1)
OptionsFactory.cs (1)
74if (_validations.Length > 0)
Microsoft.Extensions.Options.Contextual (2)
Internal\ContextualOptionsFactory.cs (2)
78var loadTasks = ArrayPool<ValueTask<IConfigureContextualOptions<TOptions>>>.Shared.Rent(_loaders.Length); 132if (_validations.Length > 0)
Microsoft.Extensions.Options.DataAnnotations (1)
DataAnnotationValidateOptions.cs (1)
99if (propertyInfo.GetMethod is null || propertyInfo.GetMethod.GetParameters().Length > 0)
Microsoft.Extensions.Options.SourceGeneration (5)
Emitter.cs (4)
161for (var i = 0; i < staticValidationAttributes.Length; i++) 183if (i != staticValidationAttributes.Length - 1) 786for (var i = 0; i < propertiesOrderedByKey.Length; i++) 789var notLast = i != propertiesOrderedByKey.Length - 1;
EmitterBase.cs (1)
31for (int i = 0; i < padding.Length; i++)
Microsoft.Extensions.Primitives (10)
StringValues.cs (10)
109return Unsafe.As<string?[]>(value).Length; 195return values.Length switch 207for (int i = 0; i < values.Length; i++) 227for (int i = 0; i < strings.Length; i++) 317for (int i = 0; i < values.Length; i++) 363Array.Copy(values, 0, array, arrayIndex, values.Length); 377if (array.Length - arrayIndex < 1) 431return values.Length switch 748for (int i = 0; i < values.Length; i++) 806if ((uint)index < (uint)values.Length)
Microsoft.Extensions.SecretManager.Tools.Tests (4)
InitCommandTest.cs (2)
106var lineCountWithoutSecret = projectDocumentWithoutSecret.ToString().Split(Environment.NewLine).Length; 111var lineCountWithSecret = projectDocumentWithSecret.ToString().Split(Environment.NewLine).Length;
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.Extensions.ServiceDiscovery (2)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
145var minIndex = _schemes.Length;
ServiceDiscoveryOptions.cs (1)
39if (schemes is string[] array && array.Length > 0)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
DnsSrvServiceEndpointProviderFactory.cs (1)
104if (components.Length > 1)
Microsoft.Extensions.Telemetry (19)
Http\HttpRouteFormatter.cs (2)
60for (var i = 0; i < routeSegments.Segments.Length; i++) 82if (i < routeSegments.Segments.Length - 1)
Http\HttpRouteParser.cs (1)
40if (httpRouteParameters == null || httpRouteParameters.Length < paramCount)
Latency\Internal\CheckpointTracker.cs (1)
49Array.Clear(_checkpointAdded, 0, _checkpointAdded.Length);
Latency\Internal\Registry.cs (2)
32int c = OrderedKeys.Length; 57public int KeyCount => OrderedKeys.Length;
Logging\ExtendedLogger.cs (8)
60if (loggers.Length == 0) 64else if (loggers.Length == 1) 69var scope = new Scope(loggers.Length); 71for (int i = 0; i < loggers.Length; i++) 97for (; i < loggers.Length; i++) 121return i < loggers.Length; 264for (int i = 0; i < loggers.Length; i++) 348for (int i = 0; i < loggers.Length; i++)
Logging\ExtendedLogger.LegacyTagJoiner.cs (1)
68public int Count => _incomingTagCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLogger.ModernTagJoiner.cs (1)
78public int Count => _incomingTagsCount + _redactedTagsCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLogger.Scope.cs (1)
52int count = _disposable.Length;
Logging\ExtendedLoggerFactory.cs (2)
167int newLoggerIndex = loggerInformation.Length; 168Array.Resize(ref loggerInformation, loggerInformation.Length + 1);
Microsoft.Extensions.Telemetry.Abstractions (4)
Logging\LoggerMessageState.cs (4)
47int avail = _tags.Length - TagsCount; 50var need = _tags.Length + (count - avail); 66int avail = _classifiedTags.Length - ClassifiedTagsCount; 69var need = _classifiedTags.Length + (count - avail);
Microsoft.Extensions.Telemetry.Abstractions.Tests (4)
Latency\LatencyDataTests.cs (3)
58for (int i = 0; i < checkpoints.Length; i++) 69for (int i = 0; i < measures.Length; i++) 80for (int i = 0; i < tags.Length; i++)
Logging\LoggerMessageStateTests.cs (1)
58Assert.Equal(2, lms.TagArray.Length);
Microsoft.Extensions.Telemetry.Tests (19)
Latency\Internal\CheckpointTrackerTests.cs (7)
29for (int i = 0; i < names.Length; i++) 35Assert.True(c.Count == names.Length); 37for (int i = 0; i < names.Length; i++) 70for (int i = 0; i < names.Length; i++) 76Assert.True(c.Count == names.Length); 82for (int i = 0; i < names.Length; i++) 88Assert.True(c.Count == names.Length);
Latency\Internal\MeasureTrackerTests.cs (6)
31for (int i = 0; i < names.Length; i++) 40Assert.True(measures.Count == names.Length); 43for (int i = 0; i < names.Length; i++) 59for (int i = 0; i < names.Length; i++) 68Assert.True(measures.Length == names.Length); 70for (int i = 0; i < names.Length; i++)
Latency\Internal\RegistryTests.cs (5)
48for (int i = 0; i < ok1.Length; i++) 59Assert.True(ok.Length == 4); 62for (int i = 0; i < ok.Length; i++) 76Assert.True(ok.Length == 4); 86Assert.True(ok.Length == 4);
Logging\ExtendedLoggerTests.cs (1)
934var a = new KeyValuePair<string, string>[_values.Length];
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
TimerTests.cs (1)
363for (int i = 0; i < triggers.Length; i++)
Microsoft.Gen.ComplianceReports (1)
src\Generators\Shared\EmitterBase.cs (1)
26for (int i = 0; i < padding.Length; i++)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Gen.ContextualOptions (1)
src\Generators\Shared\EmitterBase.cs (1)
26for (int i = 0; i < padding.Length; i++)
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Gen.Logging (1)
src\Generators\Shared\EmitterBase.cs (1)
26for (int i = 0; i < padding.Length; i++)
Microsoft.Gen.Logging.Generated.Tests (1)
LoggerMessageAttributeTests.cs (1)
160Assert.Equal(expectedState.Length, collector.LatestRecord.StructuredState!.Count);
Microsoft.Gen.Logging.Unit.Tests (2)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
SymbolLoaderTests.cs (1)
52x => x(It.IsAny<DiagnosticDescriptor>(), It.IsAny<Location?>(), It.Is<object?[]?>(p => p != null && p.Length > 0)),
Microsoft.Gen.Metrics (1)
src\Generators\Shared\EmitterBase.cs (1)
26for (int i = 0; i < padding.Length; i++)
Microsoft.Gen.Metrics.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Gen.MetricsReports (4)
MetricDefinitionEmitter.cs (3)
55if (metricClass.Methods.Length > 0) 59for (int j = 0; j < metricClass.Methods.Length; j++) 65if (j < metricClass.Methods.Length - 1)
src\Generators\Shared\EmitterBase.cs (1)
26for (int i = 0; i < padding.Length; i++)
Microsoft.Gen.MetricsReports.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
66if (optionKeyAndValue.Length != 2 || optionKeyAndValue[1].Length < 3)
Microsoft.Interop.JavaScript.JSImportGenerator (41)
JSGeneratorFactory.cs (37)
172case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes.Length == 0 && jsTypeArguments[0] == JSTypeFlags.Void: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Void)); 173case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Byte)); 174case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Boolean && jsTypeArguments[0] == JSTypeFlags.Boolean: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Boolean)); 175case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Char && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Char)); 176case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int16 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int16)); 177case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int32)); 178case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int64 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Int52)); 179case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int64 && jsTypeArguments[0] == JSTypeFlags.BigInt: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.BigInt64)); 180case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.IntPtr && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.IntPtr)); 181case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Double)); 182case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Single && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Single)); 183case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.JSObject)); 184case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.String)); 185case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Exception && jsTypeArguments[0] == JSTypeFlags.Error: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Exception)); 186case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.DateTime && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.DateTime)); 187case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.DateTimeOffset && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.DateTimeOffset)); 188case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Object)); 191case KnownManagedType.Task when jsType == JSTypeFlags.Missing && argumentTypes.Length == 0: return ResolvedGenerator.Resolved(new TaskJSGenerator(info, context, MarshalerType.Void)); 211case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1: 215case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Byte)); 216case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.String)); 217case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Double)); 218case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Int32)); 219case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.JSObject)); 220case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new ArrayJSGenerator(info, context, MarshalerType.Object)); 228case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1: 236case KnownManagedType.Span when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0: 252case KnownManagedType.ArraySegment when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0: 267case KnownManagedType.Function when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length: 268case KnownManagedType.Action when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length: 270for (int i = 0; i < argumentTypes.Length; i++) 272var isReturn = marshaledType == KnownManagedType.Function && i == jsTypeArguments.Length - 1; 289if (argsMarshallerTypes.Length > maxArgs) 301for (int i = 0; i < argumentTypes.Length; i++)
Marshaling\FuncJSGenerator.cs (4)
77for (int i = 0; i < info.ArgsTypeInfo.Length; i++) 80if (!_isAction && i + 1 == info.ArgsTypeInfo.Length) 98for (int i = 0; i < info.ArgsTypeInfo.Length; i++) 101if (!_isAction && i + 1 == info.ArgsTypeInfo.Length)
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
66if (optionKeyAndValue.Length != 2 || optionKeyAndValue[1].Length < 3)
Microsoft.Interop.SourceGeneration (2)
ManualTypeMarshallingHelper.cs (1)
156if (attrs is null || attrs.Length == 0)
TypeSymbolExtensions.cs (1)
336for (int i = typeNameParts.Length - 1; i >= 0; i--)
Microsoft.JSInterop (17)
Infrastructure\DotNetDispatcher.cs (9)
217if (parameterTypes.Length == 0) 235var suppliedArgs = new object?[parameterTypes.Length]; 238while (index < parameterTypes.Length && reader.Read() && reader.TokenType != JsonTokenType.EndArray) 250if (index < parameterTypes.Length) 253throw new ArgumentException($"The call to '{methodIdentifier}' expects '{parameterTypes.Length}' parameters, but received '{index}'."); 259throw new JsonException($"Unexpected JSON token {reader.TokenType}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters."); 467if (parameters.Length == 0) 472var parameterTypes = new Type[parameters.Length]; 473for (var i = 0; i < parameters.Length; i++)
JSRuntime.cs (1)
126var argsJson = args is not null && args.Length != 0 ?
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
Microsoft.ML.AutoML (102)
API\AutoCatalog.cs (3)
835if (numericFeatureColumnNames.Length > 0) 840if (booleanFeatureColumnNames.Length > 0) 845if (catalogFeatureColumnNames.Length > 0)
API\ExperimentBase.cs (2)
366var preprocessorTransforms = new ITransformer[trainDatasets.Length]; 367for (var i = 0; i < trainDatasets.Length; i++)
AutoMlUtils.cs (3)
34if (inputs.Length != outputs.Length) 40for (int i = 0; i != inputs.Length; ++i)
ColumnInference\ColumnGroupingInference.cs (1)
136for (int i = 1; i < indices.Length; i++)
ColumnInference\TextFileSample.cs (20)
52get { return _buffer.Length; } 107int count = stream.Read(firstChunk, 0, firstChunk.Length); 120long approximateRowCount = (long)(lineCount * fileSize * 1.0 / firstChunk.Length); 125Double averageLineLength = 2.0 * (firstChunk.Length - firstNewline) / (lineCount * 2 - 1); 132int maxChunkCount = (int)Math.Floor((double)(fileSize - firstChunk.Length) / chunkSize); 139long fileSizeRemaining = fileSize - firstChunk.Length - ((long)chunkSize) * chunkCount; 144.Select((spot, i) => (long)(spot + firstChunk.Length + i * chunkSize)) 165int readCount = stream.Read(buf, 0, buf.Length); 167long? multiplier = stream.CanSeek ? (int?)(stream.Length / buf.Length) : null; 187for (int i = 0; i < chunks.Length; i++) 190int iLim = (wholeFile && i == chunks.Length - 1) 191? chunks[i].Length 204if (resultBuffer.Length == 0) 221if (buffer.Length >= 4 && buffer[0] == 0x00 && buffer[1] == 0x00 && buffer[2] == 0xFE && buffer[3] == 0xFF) 226if (buffer.Length >= 4 && buffer[0] == 0xFF && buffer[1] == 0xFE && buffer[2] == 0x00 && buffer[3] == 0x00) 231if (buffer.Length >= 2 && buffer[0] == 0xFE && buffer[1] == 0xFF) 236if (buffer.Length >= 2 && buffer[0] == 0xFF && buffer[1] == 0xFE) 241if (buffer.Length >= 3 && buffer[0] == 0xEF && buffer[1] == 0xBB && buffer[2] == 0xBF) 246if (buffer.Length >= 3 && buffer[0] == 0x2b && buffer[1] == 0x2f && buffer[2] == 0x76) 253int sniffLim = Math.Min(1000, buffer.Length);
EstimatorExtensions\EstimatorExtensions.cs (10)
110var pairs = new InputOutputColumnPair[inColumns.Length]; 111for (var i = 0; i < inColumns.Length; i++) 137var pairs = new InputOutputColumnPair[inColumns.Length]; 138for (var i = 0; i < inColumns.Length; i++) 185var cols = new InputOutputColumnPair[inColumns.Length]; 186for (var i = 0; i < cols.Length; i++) 216var cols = new InputOutputColumnPair[inColumns.Length]; 217for (var i = 0; i < cols.Length; i++) 263var cols = new InputOutputColumnPair[inColumns.Length]; 264for (var i = 0; i < cols.Length; i++)
Experiment\Runners\CrossValRunner.cs (1)
53for (var i = 0; i < _trainDatasets.Length; i++)
Experiment\Runners\CrossValSummaryRunner.cs (2)
58for (var i = 0; i < _trainDatasets.Length; i++) 176for (int i = 0; i < arr.Length; i++)
Sweepers\ISweeper.cs (2)
268var result = new float[_metricDistribution.Length]; 269Array.Copy(_metricDistribution, result, _metricDistribution.Length);
Sweepers\Parameters.cs (4)
301return _gridValues.Length; 419return _gridValues.Length; 463return new StringParameterValue(_args.Name, _args.Values[(int)(_args.Values.Length * normalizedValue)]); 478return _args.Values.Length;
Sweepers\SmacSweeper.cs (16)
125Runtime.Contracts.Assert(data.GetRowCount() == targets.Length, "This data view will have as many rows as there have been evaluations"); 160ParameterSet[] randomChallengers = _randomSweeper.ProposeSweeps(numOfCandidates - eiChallengers.Length, previousRuns); 164ParameterSet[] configs = new ParameterSet[eiChallengers.Length + randomChallengers.Length]; 165Array.Copy(eiChallengers, 0, configs, 0, eiChallengers.Length); 166Array.Copy(randomChallengers, 0, configs, eiChallengers.Length, randomChallengers.Length); 197Runtime.Contracts.Assert(randomConfigs.Length == randomEIs.Length); 199for (int i = 0; i < randomConfigs.Length; i++) 264for (int i = 0; i < _sweepParameters.Length; i++) 334VBuffer<Float> features = new VBuffer<Float>(transformedParams.Length, transformedParams); 369double[][] meansAndStdDevs = new double[leafValues.Length][]; 370for (int i = 0; i < leafValues.Length; i++) 430double[] eis = new double[forestStatistics.Length]; 431for (int i = 0; i < forestStatistics.Length; i++)
Sweepers\SweeperProbabilityUtils.cs (5)
67Runtime.Contracts.Assert(ps.Count == sweepParams.Length); 71for (int i = 0; i < sweepParams.Length; i++) 127Runtime.Contracts.Assert(array.Length == sweepParams.Length); 131for (int i = 0; i < sweepParams.Length; i++)
TransformInference\TransformInference.cs (2)
34if (PipelineNode.OutColumns.Length > 1) 36for (var i = 0; i < PipelineNode.OutColumns.Length; i++)
Tuner\CostFrugalTuner.cs (3)
108for (int i = 0; i != config.Length; ++i) 126var res = new double[_lsBoundMax.Length]; 127for (int i = 0; i != _lsBoundMax.Length; ++i)
Tuner\PipelineProposer.cs (1)
119for (i = 0; i != _pipelineSchemas.Length; ++i)
Tuner\SmacTuner.cs (2)
178var randomChallengers = Enumerable.Range(0, numOfCandidates - eiChallengers.Length).Select(i => _randomTuner.Propose(new TrialSettings())); 325var features = new VBuffer<float>(transformedParams.Length, transformedParams);
Utils\ArrayMath.cs (19)
22for (int i = 1; i < array.Length; i++) 36return Enumerable.Range(0, array.Length).OrderBy(index => array[index]).ToArray(); 60double[] ret = new double[array.Length + 1]; 63Array.Copy(array, index, ret, index + 1, array.Length - index); 128if (truth.Length != pred.Length) 130throw new ArgumentException($"length doesn't match, {truth.Length} != {pred.Length}"); 133var diff = Enumerable.Range(0, truth.Length).Select(i => truth[i] - pred[i]).ToArray(); 143if (truth.Length != pred.Length) 145throw new ArgumentException($"length doesn't match, {truth.Length} != {pred.Length}"); 148var diff = Enumerable.Range(0, truth.Length).Select(i => truth[i] - pred[i]).ToArray(); 157if (truth.Length != pred.Length) 159throw new ArgumentException($"length doesn't match, {truth.Length} != {pred.Length}"); 162var diff = Enumerable.Range(0, truth.Length).Select(i => Math.Abs(truth[i] - pred[i])).ToArray();
Utils\DatasetColumnInfo.cs (1)
32for (var i = 0; i < cols.Length; i++)
Utils\RandomNumberGenerator.cs (3)
55for (int i = 0; i < possibility.Length; i++) 61return possibility.Length - 1; 67for (int i = 0; i < ret.Length; i++)
Utils\SweepableParamAttributes.cs (2)
67if (!Frozen && 0 <= val && val < Options.Length) 74for (int i = 0; i < Options.Length; i++)
Microsoft.ML.AutoML.Tests (10)
AutoFitTests.cs (2)
451for (int i = 0; i < experimentResults.Length; i++) 498for (int i = 0; i < experimentResults.Length; i++)
ColumnInferenceTests.cs (1)
36Assert.False(col.Source.Length > 1 || col.Source[0].Min != col.Source[0].Max);
DatasetDimensionsTests.cs (3)
34Assert.Equal(2, dimensions.Length); 54Assert.Equal(2, dimensions.Length); 85Assert.Equal(2, dimensions.Length);
SuggestedPipelineBuilderTests.cs (1)
57for (var i = 0; i < cacheBeforeTrainerSettings.Length; i++)
TextFileSampleTests.cs (2)
37for (var k = 0; k < row.Length; k++) 45stream.Write(eol, 0, eol.Length);
Utils\MLNetUtils\MLNetUtils.cs (1)
16if (col.Index < result.Length)
Microsoft.ML.CodeGenerator (5)
CodeGenerator\CSharp\TransformGenerators.cs (5)
51for (int i = 0; i < InputColumns.Length; i++) 187for (int i = 0; i < InputColumns.Length; i++) 221for (int i = 0; i < InputColumns.Length; i++) 256for (int i = 0; i < InputColumns.Length; i++) 314for (int i = 0; i < InputColumns.Length; i++)
Microsoft.ML.Core (237)
CommandLine\CmdParser.cs (28)
312if (settings == null || settings.Length == 0) 493if (nicks.Length == 0 || nicks.Length == 1 && nicks[0].ToLowerInvariant() == name.ToLowerInvariant()) 565for (int i = 0; i < strs.Length; i++) 588if (value == null && i + 2 < strs.Length && strs[i + 1] == "=") 610hadError |= !info.ArgDef.SetValue(this, ref values[info.Args.Length], str, "", destination); 616if (value == null && i + 2 < strs.Length && strs[i + 1] == "=") 623Contracts.Assert(0 <= arg.Index && arg.Index < info.Args.Length); 634if (i + 2 < strs.Length && strs[i + 1] == "=") 641else if (i + 1 < strs.Length) 660if (!IsCurlyGroup(value) && i + 1 < strs.Length && IsCurlyGroup(strs[i + 1])) 671if (!IsCurlyGroup(value) && i + 1 < strs.Length && IsCurlyGroup(strs[i + 1])) 757var values = new ArgValue[info.Args.Length + 1]; 761for (int i = 0; i < info.Args.Length; i++) 768hadError |= info.ArgDef.Finish(this, values[info.Args.Length], destination); 1258Arg[] args = Utils.BuildArray(argumentInfo.Args.Length, i => new Arg(argumentInfo.Args[i])); 1259Array.Sort(args, 0, args.Length, Comparer<Arg>.Create((x, y) => x.SortOrder.CompareTo(y.SortOrder))); 1344Contracts.Assert(map.Count >= args.Length); 1479if (_infoCustom.ArgDef == null && _infoCustom.Args.Length == 0) 1498if (type.GenericTypeArguments.Length != 2) 1593for (int i = 0; i < arr.Length; i++) 1628for (int i = 0; i < arr.Length; i++) 1636for (int i = 0; i < res.Length; i++) 1646for (int i = 0; i < res.Length; i++) 2310switch (factoryType.GenericTypeArguments.Length) 2340if (settings == null || (settings.Length == 1 && string.IsNullOrEmpty(settings[0]))) 2354if (string.IsNullOrEmpty(Name) && Settings.Length == 0) 2357if (Settings.Length == 0)
ComponentModel\ComponentCatalog.cs (8)
129internal int ExtraArgCount => ArgType == null ? CtorTypes.Length : CtorTypes.Length - 1; 231Contracts.Assert(ArgType == null || CtorTypes.Length > 0 && CtorTypes[0] == ArgType); 236Contracts.Assert(Utils.Size(ctorArgs) == CtorTypes.Length + ((RequireEnvironment) ? 1 : 0)); 356if (parameters.Length != 2 && parameters.Length != 3) 357throw Contracts.Except("Method '{0}' has {1} parameters, but must have 2 or 3", method.Name, parameters.Length); 955name = component.Aliases != null && component.Aliases.Length > 0 ? component.Aliases[0] : component.Name;
ComponentModel\LoadableClassAttribute.cs (8)
188types = new Type[1 + parms.Length]; 191else if (parms.Length > 0) 192types = new Type[parms.Length]; 196for (int itype = 0; itype < parms.Length; itype++) 204for (int i = 1; i < sigTypes.Length; i++) 215Contracts.CheckParam(parms.Length + itypeBase == types.Length, nameof(sigTypes), "LoadableClass signatures must have the same number of parameters"); 216for (int itype = 0; itype < parms.Length; itype++)
Data\LinkedRowRootCursorBase.cs (1)
27Ch.Check(active == null || active.Length == schema.Count);
Data\ModelHeader.cs (4)
326Contracts.CheckDecode(headerBytes.Length == ModelHeader.Size); 514for (int i = 0; i < offsets.Length; i++) 577for (int ich = 0; ich < chars.Length; ich++) 602for (int ich = 0; ich < chars.Length; ich++)
Data\ProgressReporter.cs (7)
80for (int iDst = 0; iDst < entry.Metrics.Length && iSrc < n;) 83for (int iDst = 0; iDst < entry.Progress.Length && iSrc < n;) 86for (int iDst = 0; iDst < entry.ProgressLim.Length && iSrc < n;) 525Contracts.Check(0 <= index && index < Progress.Length); 536Contracts.Check(0 <= index && index < Progress.Length); 537Contracts.Assert(0 <= index && index < Progress.Length); 547Contracts.Check(0 <= index && index < Metrics.Length);
Data\ReadOnlyMemoryUtils.cs (4)
41if (separators == null || separators.Length == 0) 48if (separators.Length == 1) 125if (memory.IsEmpty || separators == null || separators.Length == 0) 133if (separators.Length == 1)
EntryPoints\ModuleArgs.cs (3)
339if (!Frozen && 0 <= val && val < Options.Length) 346for (int i = 0; i < Options.Length; i++) 353for (int i = 0; i < Options.Length; i++)
Utilities\ArrayUtils.cs (1)
18return x == null ? 0 : x.Length;
Utilities\BigArray.cs (1)
266Contracts.Assert(_entries.Length == 1);
Utilities\BinFinder.cs (11)
82for (int i = 1; i < bounds.Length; i++) 91for (int i = 1; i < bounds.Length; i++) 95bounds[bounds.Length - 1] = Single.PositiveInfinity; 98for (int i = 1; i < bounds.Length; i++) 160for (int i = 1; i < bounds.Length; i++) 169for (int i = 1; i < bounds.Length; i++) 173bounds[bounds.Length - 1] = Double.PositiveInfinity; 176for (int i = 1; i < bounds.Length; i++) 188Contracts.Check(path.Length >= cbin + 1); 333Contracts.Assert(path.Length >= CountBins + 1); 571Contracts.Assert(path.Length >= CountBins + 1);
Utilities\CharUtils.cs (2)
20for (int i = 0; i < lower.Length; i++) 29for (int i = 0; i < upper.Length; i++)
Utilities\CmdIndenter.cs (4)
40for (var i = 0; i < tokens.Length;) 43if (i + 1 == tokens.Length || tokens[i + 1] != "=") 52if (i >= tokens.Length) 55if (i + 1 < tokens.Length && tokens[i + 1].StartsWith("{") && tokens[i + 1].EndsWith("}"))
Utilities\DoubleParser.cs (18)
235else if (exp > _mpe10Dbl.Length) 245if (-exp > _mpne10Dbl.Length) 344if (exp > _mpe10Man.Length) 364if (-exp > _mpne10Man.Length) 934Contracts.Assert(_mpe10Man.Length == _mpe10e2.Length); 935Contracts.Assert(_mpne10Man.Length == _mpne10ne2.Length); 939Contracts.Assert(_mpe10Dbl.Length <= _mpe10Man.Length); 940for (int i = 0; i < _mpe10Dbl.Length; i++) 957Contracts.Assert((Single)_mpe10Dbl[_mpe10Dbl.Length - 1] == Single.PositiveInfinity); 958Contracts.Assert((Single)_mpe10Dbl[_mpe10Dbl.Length - 2] < Single.PositiveInfinity); 963Contracts.Assert(_mpne10Dbl.Length <= _mpne10Man.Length); 964for (int i = 0; i < _mpne10Dbl.Length; i++) 975Contracts.Assert((Single)(_mpne10Dbl[_mpne10Dbl.Length - 1] * two64) == 0); 976Contracts.Assert((Single)(_mpne10Dbl[_mpne10Dbl.Length - 2] * two64) > 0);
Utilities\FixedSizeQueue.cs (12)
34Contracts.Assert(0 <= _startIndex && _startIndex < _array.Length); 35Contracts.Assert(0 <= _count && _count <= _array.Length); 52return _array.Length; 61return _count == _array.Length; 71return _array[(_startIndex + index) % _array.Length]; 78if (_count == _array.Length) 82_startIndex = (_startIndex + 1) % _array.Length; 86_array[(_startIndex + _count) % _array.Length] = item; 104return _array[(_startIndex + _count - 1) % _array.Length]; 113_startIndex = (_startIndex + 1) % _array.Length; 123int lastIndex = (_startIndex + _count - 1) % _array.Length; 135_array[(_startIndex + i) % _array.Length] = default(T);
Utilities\FuncInstanceMethodInfo1`2.cs (1)
66Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`3.cs (1)
67Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo1`4.cs (1)
68Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo2`4.cs (1)
68Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`3.cs (1)
67Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncInstanceMethodInfo3`4.cs (1)
68Contracts.CheckParam(methodCallExpression.Method.GetParameters().Length == 2, nameof(expression), "Unexpected expression form");
Utilities\FuncMethodInfo1`1.cs (1)
33Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 1, nameof(methodInfo),
Utilities\FuncMethodInfo1`2.cs (1)
34Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 1, nameof(methodInfo),
Utilities\FuncMethodInfo1`3.cs (1)
35Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 1, nameof(methodInfo),
Utilities\FuncMethodInfo2`3.cs (1)
35Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 2, nameof(methodInfo),
Utilities\FuncMethodInfo3`2.cs (1)
34Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 3, nameof(methodInfo),
Utilities\FuncMethodInfo3`3.cs (1)
35Contracts.CheckParam(GenericMethodDefinition.GetGenericArguments().Length == 3, nameof(methodInfo),
Utilities\HashArray.cs (12)
53for (int i = 0; i < _rgit.Length; i++) 74return (int)((uint)hash % _rgit.Length); 100Contracts.Assert(0 <= iit && iit < _rgit.Length); 151Contracts.Assert(0 <= iit && iit < _rgit.Length); 158Contracts.Assert(_ct < _entries.Length); 164if (++_ct >= _rgit.Length) 178Contracts.Assert(size >= _rgit.Length); 179if (size <= _rgit.Length) 208for (int i = 0; i < _rgit.Length; i++) 223for (int i = 0; i < _rgit.Length; i++) 228Console.WriteLine("Table: {0} out of {1}", c, _rgit.Length); 264for (int i = 0; i < Primes.Length; i++)
Utilities\HybridMemoryStream.cs (3)
84stream.ReadBlock(bytes, 0, bytes.Length); 215Contracts.CheckParam(0 <= offset && offset <= buffer.Length, nameof(offset)); 216Contracts.CheckParam(0 <= count && count <= buffer.Length - offset, nameof(count));
Utilities\MathUtils.cs (9)
61Contracts.Check(x.Length == y.Length, "Input and output must be same length."); 63int m = x.Length; 673Contracts.Assert(src.Length == dst.Length); 674ApplySoftMax(src, dst, 0, src.Length); 682Contracts.Assert(src.Length == dst.Length); 683Contracts.Assert(0 <= start && start <= end && end <= src.Length);
Utilities\MatrixTransposeOps.cs (4)
34Contracts.Assert(src.Length <= m * n); 35Contracts.Assert(dst.Length <= m * n); 85Contracts.Assert(src.Length <= m * n); 86Contracts.Assert(dst.Length <= m * n);
Utilities\NormStr.cs (10)
62for (int i = 0; i < _rgins.Length; i++) 73Contracts.Assert(_rgins.Length == _mask + 1); 223else if (_cns >= _rgns.Length) 225Contracts.Assert(_cns == _rgns.Length); 226int size = checked(_rgns.Length / 2 + _rgns.Length); 230Contracts.Assert(_cns < _rgns.Length); 238if (++_cns >= _rgins.Length) 262int size = checked(2 * _rgins.Length); 265for (int i = 0; i < _rgins.Length; i++)
Utilities\Random.cs (1)
209for (int i = 0; i < buffer.Length; i++)
Utilities\ReservoirSampler.cs (17)
66public int Size { get { return _numSampled <= _cache.Length ? (int)_numSampled : _cache.Length; } } 89if (_numSampled <= _cache.Length) 91else if (_rnd.NextDouble() * _numSampled < _cache.Length) 94int ind = _rnd.Next(_cache.Length); 114if (i == _cache.Length) 145public int Size { get { return _numSampled <= _cache.Length ? (int)_numSampled : _cache.Length; } } 169if (_numSampled <= _cache.Length) 174if (_numSampled == _cache.Length) 176for (int i = 0; i < _cache.Length; i++) 178_reservoir[i] = _rnd.Next(_cache.Length); 186int k = Stats.SampleFromBinomial(_rnd, _cache.Length, 1.0 / _numSampled); 190int ind = _rnd.Next(_reservoir.Length); 207var next = _rnd.Next(_reservoir.Length); 230if (!_locked && _numSampled < _reservoir.Length) 233for (int i = 0; i < _cache.Length; i++)
Utilities\Stats.cs (5)
128Contracts.Check(alphas.Length == result.Length, 132for (int i = 0; i < alphas.Length; i++) 137for (int i = 0; i < alphas.Length; i++) 258if (k < _fctab.Length)
Utilities\Stream.cs (7)
48(read = source.Read(buffer, 0, (int)Math.Min(buffer.Length, remaining))) != 0) 123writer.Write(values.Length); 279writer.Write(bytes, 0, bytes.Length); 509Contracts.Assert(0 <= start && start < array.Length); 510Contracts.Assert(0 < count && count <= array.Length - start); 525long bufferSizeInBytes = ((long)array.Length - start) * sizeof(float); 818Contracts.CheckDecode(bytes.Length == size);
Utilities\SupervisedBinFinder.cs (8)
108Contracts.Assert(boundaries.Length == 1 && boundaries[0] == 0 || boundaries[0] > 0, "boundaries are exclusive, can't have 0"); 109Contracts.Assert(boundaries[boundaries.Length - 1] == _distinctValueCount); 112var numUpperBounds = boundaries.Length; 186Contracts.Assert(boundaries.Length == 1 && boundaries[0] == 0 || boundaries[0] > 0, "boundaries are exclusive, can't have 0"); 187Contracts.Assert(boundaries[boundaries.Length - 1] == _distinctValueCount); 190var numUpperBounds = boundaries.Length; 213for (int i = 1; i < result.Length; i++) 222for (int i = 1; i < result.Length; i++)
Utilities\TextReaderStream.cs (4)
134Contracts.Assert(0 < _buffLim && _buffLim <= _buff.Length); 143Contracts.Assert(0 < _buffLim && _buffLim <= _buff.Length); 151Contracts.CheckParam(0 <= offset && offset <= buffer.Length, nameof(offset), "invalid for this sized array"); 152Contracts.CheckParam(0 <= count && count <= buffer.Length - offset, nameof(count), "invalid for this sized array");
Utilities\Utils.cs (33)
63return x == null ? 0 : x.Length; 69return x == null ? 0 : x.Length; 233return FindIndexSorted(input, 0, input.Length, value); 358Contracts.Assert(0 <= min && min <= lim && lim <= input.Length); 393Contracts.Assert(0 <= min && min <= lim && lim <= input.Length); 426Contracts.Assert(0 <= min && min <= lim && lim <= input.Length); 490var res = new int[perm.Length]; 491for (int i = 0; i < perm.Length; i++) 494Contracts.Assert(0 <= j && j < perm.Length); 517if (arr1.Length != arr2.Length) 520for (int i = 0; i < arr1.Length; i++) 534if (arr1.Length != arr2.Length) 537for (int i = 0; i < arr1.Length; i++) 559if (arr1.Length != arr2.Length) 562for (int i = 0; i < arr1.Length; i++) 576if (arr1.Length != arr2.Length) 579for (int i = 0; i < arr1.Length; i++) 735if (col.Index < result.Length) 748for (int i = 0; i < result.Length; i++) 862if (a.Length == 0) 864if (b.Length == 0) 866var res = new T[a.Length + b.Length]; 867Array.Copy(a, res, a.Length); 868Array.Copy(b, 0, res, a.Length, b.Length); 884checked { size += a.Length; } 897if (size == ne.Length) 1190Contracts.CheckParam(meth.GetGenericArguments().Length == 1, nameof(func),
Microsoft.ML.Core.Tests (38)
UnitTests\CoreBaseTestClass.cs (1)
343Func<bool>[] idComps = new Func<bool>[cursors.Length];
UnitTests\TestEntryPoints.cs (2)
3320xfNames != null ? xfNames.Length + 1 : 1 6890Assert.Equal(10, ndcgArray.Length);
UnitTests\TestUtilities.cs (16)
176x[0] = x[x.Length - 1]; 181var xLengthTemp = x[x.Length - 1]; 182x[x.Length - 1] = x[0]; 184x[x.Length - 1] = xLengthTemp; 212x[0] = x[x.Length - 1]; 217var xLengthTemp = x[x.Length - 1]; 218x[x.Length - 1] = x[0]; 220x[x.Length - 1] = xLengthTemp; 248x[0] = x[x.Length - 1]; 253var xLengthTemp = x[x.Length - 1]; 254x[x.Length - 1] = x[0]; 256x[x.Length - 1] = xLengthTemp; 284x[0] = x[x.Length - 1]; 289var xLengthTemp = x[x.Length - 1]; 290x[x.Length - 1] = x[0]; 292x[x.Length - 1] = xLengthTemp;
UnitTests\TestVBuffer.cs (19)
236for (var j = 0; j < multResExpected.Length; j++) 262for (var j = 0; j < multResExpected.Length; j++) 294Assert.Equal(expectedValues.Length, actualValues.Length); 295for (int i = 0; i < expectedValues.Length; i++) 328T2[] values = new T2[indices.Length]; 330for (int ii = 0; ii < indices.Length; ++ii) 340b = new VBuffer<T2>(a.Length, indices.Length, values, indices); 373T2[] values = new T2[indices.Length]; 375for (int ii = 0; ii < indices.Length; ++ii) 382b = new VBuffer<T2>(a.Length, indices.Length, values, indices); 505TDst[] values = new TDst[indices.Length]; 508for (int i = 0; i < indices.Length; ++i) 514dst = new VBuffer<TDst>(a.Length, indices.Length, values, indices); 981for (int i = count; i < indices.Length; ++i) 983if (indices.Length == 0 && rgen.Next(2) == 0) 987for (int i = 0; i < values.Length; ++i) 989if (values.Length == 0 && rgen.Next(2) == 0) 1099Contracts.Assert(cases == Enum.GetValues(typeof(GenLogic)).Length);
Microsoft.ML.CpuMath (19)
AlignedArray.cs (2)
73for (int i = _base + _size; i < Items.Length; i++) 177Contracts.Assert(0 <= iposMin && iposMin <= iposLim && iposLim <= rgposSrc.Length);
AlignedMatrix.cs (12)
152Contracts.Assert(0 <= ivDst && ivDst <= dst.Length - _size); 168Contracts.Assert(0 <= count && count <= dst.Length); 170Contracts.Assert(0 <= ivDst && ivDst <= dst.Length - count); 182Contracts.Assert(0 <= index && index <= src.Length - _size); 198Contracts.Assert(0 <= count && count <= src.Length); 200Contracts.Assert(0 <= ivSrc && ivSrc <= src.Length - count); 433Contracts.Assert(0 <= ivDst && ivDst <= dst.Length - ValueCount); 462Contracts.Assert(0 <= ivSrc && ivSrc <= src.Length - ValueCount); 540Contracts.Assert(0 <= ivDst && ivDst <= dst.Length - ColCount); 603Contracts.Assert(0 <= ivDst && ivDst <= dst.Length - ValueCount); 622Contracts.Assert(0 <= ivDst && ivDst <= dst.Length - ColCount); 636Contracts.Assert(0 <= ivSrc && ivSrc <= src.Length - ValueCount);
CpuMathUtils.netcoreapp.cs (2)
461ZeroItemsU(destination, destination.Size, indices, indices.Length); 465ZeroMatrixItemsCore(destination, destination.Size, ccol, cfltRow, indices, indices.Length);
EigenUtils.cs (1)
18var count = a.Length;
ProbabilityFunctions.cs (2)
77for (int k = 1; k < c.Length; ++k) 88for (int k = 0; k < c.Length; ++k)
Microsoft.ML.CpuMath.UnitTests (32)
UnitTests.cs (32)
68for (int i = 0; i < testMatrix2.Length; i++) 358for (int i = 0; i < expected.Length; i++) 384for (int i = 0; i < expected.Length; i++) 411for (int i = 0; i < expected.Length; i++) 416CpuMathUtils.Scale(defaultScale, src, dst, dst.Length); 437for (int i = 0; i < expected.Length; i++) 465for (int i = 0; i < expected.Length; i++) 470CpuMathUtils.AddScale(defaultScale, src, dst, dst.Length); 522for (int i = 0; i < expected.Length; i++) 527CpuMathUtils.AddScaleCopy(defaultScale, src, dst, result, dst.Length); 549for (int i = 0; i < dst.Length; i++) 554for (int i = 0; i < expected.Length; i++) 559CpuMathUtils.Add(src, dst, dst.Length); 611for (int i = 0; i < src2.Length; i++) 618for (int i = 0; i < expected.Length; i++) 623CpuMathUtils.MulElementWise(src1, src2, dst, dst.Length); 642for (int i = 0; i < src.Length; i++) 665for (int i = 0; i < src.Length; i++) 691for (int i = 0; i < src.Length; i++) 713for (int i = 0; i < src.Length; i++) 739for (int i = 0; i < src.Length; i++) 763for (int i = 0; i < src.Length; i++) 792for (int i = 0; i < src.Length; i++) 818for (int i = 0; i < dst.Length; i++) 824for (int i = 0; i < dst.Length; i++) 829var actual = CpuMathUtils.DotProductDense(src, dst, dst.Length); 851for (int i = 0; i < dst.Length; i++) 883for (int i = 0; i < dst.Length; i++) 889for (int i = 0; i < dst.Length; i++) 895var actual = CpuMathUtils.L2DistSquared(src, dst, dst.Length); 945for (int i = 0; i < expected.Length; i++) 951CpuMathUtils.SdcaL1UpdateDense(defaultScale, src.Length, src, defaultScale, v, w);
Microsoft.ML.Data (1155)
Commands\CrossValidationCommand.cs (4)
208for (int i = 0; i < tasks.Length; i++) 230if (variableSizeVectorColumnNames.Length > 0) 237ch.Assert(perInstance.Length == 1); 317for (int i = 0; i < metrics.Length; i++)
Commands\DataCommand.cs (1)
199newAverageMetric.Add(pair.Key, pair.Value / metricValues.Length);
Commands\TypeInfoCommand.cs (1)
118for (int i = 0; i < kinds.Length; ++i)
Data\BufferBuilder.cs (7)
75Contracts.Assert(_values.Length >= _count); 119if (_values.Length < _length) 180if (_values.Length <= _count) 182if (_indices.Length <= _count) 208if (_values.Length <= _count) 210if (_indices.Length <= _count) 322if (_values.Length < _length)
Data\DataViewUtils.cs (42)
130if (inputs.Length == 1) 230if (cursors.Length == 1) 234for (int i = 1; i < cursors.Length; ++i) 243for (int i = 1; i < cursors.Length; ++i) 262if (inputs.Length == 1) 333if (inputs.Length == 1) 351OutPipe[] outPipes = new OutPipe[activeToCol.Length + (int)ExtraIndex._Lim]; 352for (int i = 0; i < activeToCol.Length; ++i) 359int idIdx = activeToCol.Length + (int)ExtraIndex.Id; 365var batchColumnPool = new MadeObjectPool<BatchColumn[]>(() => new BatchColumn[outPipes.Length]); 366Task[] workers = new Task[inputs.Length]; 367MinWaiter waiter = new MinWaiter(workers.Length); 370for (int t = 0; t < workers.Length; ++t) 387InPipe[] inPipes = new InPipe[outPipes.Length]; 388for (int i = 0; i < activeToCol.Length; ++i) 403for (int i = 0; i < inPipes.Length; ++i) 527InPipe[] inPipes = new InPipe[activeToCol.Length + (int)ExtraIndex._Lim]; 531outPipes[i] = new OutPipe[inPipes.Length]; 534for (int c = 0; c < activeToCol.Length; ++c) 547int idIdx = activeToCol.Length + (int)ExtraIndex.Id; 553var batchColumnPool = new MadeObjectPool<BatchColumn[]>(() => new BatchColumn[inPipes.Length]); 573for (int c = 0; c < inPipes.Length; ++c) 658Contracts.Assert(0 <= poolIdx && poolIdx < _cachePools.Length); 833Contracts.Assert(Utils.Size(pipes) == _batchColumns.Length); 834for (int p = 0; p < _batchColumns.Length; ++p) 1037Ch.Assert(colToActive.Length == schema.Count); 1038Ch.Assert(activeToCol.Length + (int)ExtraIndex._Lim == pipes.Length); 1045_getters = new Delegate[pipes.Length]; 1046for (int i = 0; i < activeToCol.Length; ++i) 1048_idGetter = (ValueGetter<DataViewRowId>)_pipes[activeToCol.Length + (int)ExtraIndex.Id].GetGetter(); 1112Ch.CheckParam(column.Index < _colToActive.Length, nameof(column)); 1126Ch.CheckParam(column.Index < _colToActive.Length, nameof(column), "requested column is not active or valid for the Schema."); 1191_getters = new Delegate[_activeToCol.Length]; 1192for (int i = 0; i < _activeToCol.Length; ++i) 1203for (int i = 0; i < _cursors.Length; ++i) 1231ValueGetter<DataViewRowId>[] idGetters = new ValueGetter<DataViewRowId>[_cursors.Length]; 1232for (int i = 0; i < _cursors.Length; ++i) 1249ValueGetter<T>[] getters = new ValueGetter<T>[_cursors.Length]; 1251for (int i = 0; i < _cursors.Length; ++i) 1303Ch.CheckParam(column.Index < _colToActive.Length, nameof(column)); 1317Ch.CheckParam(column.Index < _colToActive.Length, nameof(column), "requested column not active or is invalid for the schema. ");
Data\RowCursorUtils.cs (2)
498if (col.Index >= indicesRequested.Length) 556Ch.Assert(active.Length == parent.Schema.Count);
Data\SchemaDefinition.cs (4)
166.Where(x => x.CanRead && x.CanWrite && x.GetGetMethod() != null && x.GetSetMethod() != null && x.GetIndexParameters().Length == 0) 172if (cursorChannelAttrMembers.Length == 0) 175ectx.Check(cursorChannelAttrMembers.Length == 1, 343x.GetIndexParameters().Length == 0);
DataDebuggerPreview.cs (3)
41for (int i = 0; i < columns.Length; i++) 54for (int i = 0; i < setters.Length; i++) 92=> $"{Values.Length} columns";
DataLoadSave\Binary\BinaryLoader.cs (28)
512ectx.Assert(args.Length == 1); 643for (int i = 0; i < _aliveColumns.Length; ++i) 1256Utils.BuildSubsetMaps(toc.Length, columnsNeeded, out activeIndices, out _colToActivesIndex); 1257_actives = new TableOfContentsEntry[activeIndices.Length]; 1258for (int i = 0; i < activeIndices.Length; ++i) 1264_pipes = new ReadPipe[parent.RowCount > 0 ? _actives.Length : 0]; 1265_pipeGetters = new Delegate[_actives.Length]; 1285if (_pipes.Length == 0) 1291for (int c = 0; c < _pipeGetters.Length; ++c) 1301int pipeBuffers = 2 * ((_parent._threads + _pipes.Length - 1) / _pipes.Length); 1303for (int c = 0; c < _pipes.Length; ++c) 1354for (int c = 0; c < _pipes.Length; ++c) 1385long decompressSequenceLim = (long)_numBlocks * _actives.Length; 1386for (int w = 0; w < pipeWorkers.Length; ++w) 1395int pipeIndex = (int)(seq % _pipes.Length); 1426for (int c = 0; c < _pipes.Length; ++c) 1431for (int c = 0; c < _pipes.Length; ++c) 1969Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column)); 1977for (int c = 0; c < _pipes.Length; ++c) 2013if (!more && _pipes.Length > 0) 2037Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column), "requested column not active."); 2075for (int i = 1; i < _blockShuffleOrder.Length; ++i) 2090Ch.Assert(pos / _rowsPerBlock < _blockShuffleOrder.Length); 2198isLiveAndCol.Key ? "" : " (DEAD!)", typeDesc, blockLookups.Length, col.RowsPerBlock); 2211string deadDisc = deadMtoc.Length > 0 ? string.Format(" ({0} dead)", deadMtoc.Length) : ""; 2213mtoc.Length, deadDisc, metadataTocSize, metadataSize);
DataLoadSave\Binary\BinarySaver.cs (22)
411var blockLookups = new List<BlockLookup>[activeColumns.Length]; 412for (int c = 0; c < blockLookups.Length; ++c) 414var deadLookups = new int[activeColumns.Length]; 469long[] lookupOffsets = new long[blockLookups.Length]; 474for (int c = 0; c < blockLookups.Length; ++c) 496long[] metadataTocOffsets = new long[activeColumns.Length]; 497for (int c = 0; c < activeColumns.Length; ++c) 552ColumnCount = activeColumns.Length 589WritePipe[] pipes = new WritePipe[activeColumns.Length]; 590for (int c = 0; c < activeColumns.Length; ++c) 592for (int c = 0; c < pipes.Length; ++c) 601for (int c = 0; c < pipes.Length; ++c) 605for (int c = 0; c < pipes.Length; ++c) 619for (int c = 0; c < pipes.Length; ++c) 664if (activeColumns.Length > 0) 668for (int i = 0; i < compressionThreads.Length; ++i) 671() => CompressionWorker(toCompress, toWrite, activeColumns.Length, waiter, exMarshaller)); 700ch.Info("Wrote {0} rows across {1} columns in {2}", _rowCount, activeColumns.Length, sw.Elapsed); 716for (int c = 0; c < colIndices.Length; ++c) 748var writers = new IValueWriter[actives.Length]; 749var estimators = new Func<long>[actives.Length]; 750for (int c = 0; c < actives.Length; ++c)
DataLoadSave\Binary\Codecs.cs (3)
212int sublen = Math.Min(byteLength, _buffer.Length); 272int sublen = Math.Min(byteLength, _buffer.Length); 366for (int i = 1; i < _boundaries.Length; ++i)
DataLoadSave\Binary\MemoryStreamPool.cs (1)
63Contracts.Assert(0 <= index && index < _pools.Length);
DataLoadSave\Database\DatabaseLoader.cs (16)
111.Where(x => x.CanRead && x.GetGetMethod() != null && x.GetIndexParameters().Length == 0); 115if (memberInfos.Length == 0) 120for (int index = 0; index < memberInfos.Length; index++) 421var order = Utils.GetIdentityPermutation(segs.Length); 423if ((segs.Length != 0) && (segs[0].Name is null)) 444for (int i = 0; i < segs.Length; i++) 449Contracts.Assert(size >= segs.Length); 478Infos = new ColInfo[cols.Length]; 481var nameToInfoIndex = new Dictionary<string, int>(Infos.Length); 483for (int iinfo = 0; iinfo < Infos.Length; iinfo++) 507segs = new Segment[col.Source.Length]; 509for (int i = 0; i < segs.Length; i++) 635ctx.Writer.Write(Infos.Length); 636for (int iinfo = 0; iinfo < Infos.Length; iinfo++) 654ctx.Writer.Write(info.Segments.Length); 671for (int i = 0; i < Infos.Length; ++i)
DataLoadSave\Database\DatabaseLoaderCursor.cs (8)
38Ch.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 46_getters = new Delegate[_bindings.Infos.Length]; 47for (int i = 0; i < _getters.Length; i++) 100Contracts.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 147Ch.Check(column.Index < _bindings.Infos.Length); 160Ch.CheckParam(column.Index < _getters.Length, nameof(column), "requested column not valid."); 767if ((segs is null) || (segs.Length == 0)) 772Contracts.Check(segs.Length == 1);
DataLoadSave\DataOperationsCatalog.cs (1)
198for (int i = 0; i < prefetch.Length; i++)
DataLoadSave\EstimatorChain.cs (6)
43Contracts.Assert((_estimators.Length > 0) == (LastEstimator != null)); 64var xfs = new ITransformer[_estimators.Length]; 65for (int i = 0; i < _estimators.Length; i++) 73if (_needCacheAfter[i] && i < _estimators.Length - 1) 112if (_estimators.Length == 0) 122newNeedCache[newNeedCache.Length - 1] = true;
DataLoadSave\EstimatorExtensions.cs (2)
157Array.Copy(array, result, result.Length - 1); 158result[result.Length - 1] = element;
DataLoadSave\LegacyCompositeDataLoader.cs (4)
428View = transforms[transforms.Length - 1].Transform; 435for (int i = 1; i < transforms.Length; i++) 552ctx.Writer.Write(transforms.Length); 560for (int i = 0; i < transforms.Length; i++)
DataLoadSave\MultiFileSource.cs (2)
41if (paths == null || (paths.Length == 1 && paths[0] == null)) 67get { return _paths.Length; }
DataLoadSave\Text\TextLoader.cs (29)
155if (rgstr.Length < 2 || rgstr.Length > 3) 161if (rgstr.Length == 3) 181ranges = new Range[strs.Length]; 182for (int i = 0; i < strs.Length; i++) 640var order = Utils.GetIdentityPermutation(segs.Length); 662for (int i = 0; i < segs.Length; i++) 673Contracts.Assert(size >= segs.Length || size >= segs.Length - 1 && isegVar >= 0); 754Infos = new ColInfo[cols.Length]; 757var nameToInfoIndex = new Dictionary<string, int>(Infos.Length); 759for (int iinfo = 0; iinfo < Infos.Length; iinfo++) 784var segs = new Segment[col.Source.Length]; 785for (int i = 0; i < segs.Length; i++) 845ch.Assert(0 <= isegOther && isegOther < segsOther.Length); 849for (int iinfo = 0; iinfo < Infos.Length; iinfo++) 860for (int i = 0; i < segsOther.Length; i++) 895_slotNames = new VBuffer<ReadOnlyMemory<char>>[Infos.Length]; 927var nameToInfoIndex = new Dictionary<string, int>(Infos.Length); 988_slotNames = new VBuffer<ReadOnlyMemory<char>>[Infos.Length]; 1015ctx.Writer.Write(Infos.Length); 1016for (int iinfo = 0; iinfo < Infos.Length; iinfo++) 1027ctx.Writer.Write(info.Segments.Length); 1046for (int i = 0; i < Infos.Length; ++i) 1211if (options.Separators.Length > 1 || options.Separators[0] != '\t') 1238if (_separators.Length == 0) 1579.Where(x => x.CanRead && x.GetGetMethod() != null && x.GetIndexParameters().Length == 0); 1583if (memberInfos.Length == 0) 1588for (int index = 0; index < memberInfos.Length; index++)
DataLoadSave\Text\TextLoaderCursor.cs (19)
51Contracts.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 57for (int i = 0; i < bindings.Infos.Length; i++) 89Ch.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 112_getters = new Delegate[_bindings.Infos.Length]; 113for (int i = 0; i < _getters.Length; i++) 143Contracts.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 160Contracts.Assert(active == null || active.Length == parent._bindings.OutputSchema.Count); 175for (int i = 0; i < cursors.Length; i++) 232for (int i = 0; i < batch.Infos.Length; i++) 306Ch.Check(column.Index < _bindings.Infos.Length); 319Ch.CheckParam(column.Index < _getters.Length, nameof(column), "requested column not valid."); 676for (int i = 1; i < _separators.Length; i++) 764if (++index >= infos.Length) 919for (int tid = 0; tid < _threads.Length; tid++) 951Contracts.Assert(0 <= tid && tid < _threads.Length); 1003Contracts.Assert(lines.Infos.Length <= BlockSize); 1005var batch = new RowBatch(iblk * BlockSize, iblk * BlockSize + lines.Infos.Length, lines.Total); 1032blk += _threads.Length; 1033iblk += _threads.Length;
DataLoadSave\Text\TextLoaderParser.cs (37)
120Contracts.Assert(0 <= index && index < _creatorsOne.Length); 127Contracts.Assert(0 <= index && index < _creatorsOne.Length); 271Contracts.Assert(0 <= irow && irow < _values.Length); 278Contracts.Assert(0 <= irow && irow < _values.Length); 337Contracts.Assert(_count <= _values.Length); 344Contracts.Assert(_count <= _indices.Length); 369if (_values.Length <= _count) 371if (_indices.Length <= _count) 382if (_values.Length >= _size) 386if (_values.Length > _count) 387Array.Clear(_values, _count, _values.Length - _count); 448for (int i = 0; i < _values.Length; i++) 456Contracts.Assert(0 <= irow && irow < _values.Length); 463Contracts.Assert(0 <= irow && irow < _values.Length); 622Contracts.Assert(0 <= Count && Count <= Indices.Length && Indices.Length <= Spans.Length); 639if (Count >= Indices.Length) 642if (Spans.Length < size) 678_creator = new Func<RowSet, ColumnPipe>[_infos.Length]; 695for (int i = 0; i < _creator.Length; i++) 774Contracts.Assert(infos.Length == slotNames.Length); 790for (int iinfo = 0; iinfo < infos.Length; iinfo++) 798for (int i = 0; i < info.Segments.Length; i++) 831Contracts.Assert(active == null || active.Length == _creator.Length); 833RowSet rows = new RowSet(stats, count, _creator.Length); 834for (int i = 0; i < rows.Pipes.Length; i++) 865Contracts.Assert(active == null || Utils.Size(active) == _infos.Length); 939_sep1 = _seps.Length > 1 ? _seps[1] : '\0'; 964for (int i = 1; i < _seps.Length; i++) 1312if (_seps.Length == 1) 1323else if (_seps.Length == 2) 1367Contracts.Assert(active == null || Utils.Size(active) == _infos.Length); 1371for (int iinfo = 0; iinfo < _infos.Length; iinfo++) 1406for (int i = 0; i < info.Segments.Length; i++)
DataLoadSave\Text\TextLoaderSaverCatalog.cs (1)
313if (!File.Exists(path) && StreamUtils.ExpandWildCards(path).Length < 1)
DataLoadSave\Text\TextSaver.cs (24)
399for (int i = 0; i < cols.Length; i++) 410for (int i = 0; i < cols.Length; i++) 430var pipes = new ValueWriter[cols.Length]; 431for (int i = 0; i < cols.Length; i++) 474for (int i = 0; i < pipes.Length; i++) 487if (type is VectorDataViewType vectorType && !vectorType.IsKnownSize && i != pipes.Length - 1) 568_mpcoldst = new int[_pipes.Length + 1]; 569_mpcolslot = new int[_pipes.Length + 1]; 587while (_col < _pipes.Length) 603while (_col < _pipes.Length) 647Contracts.Assert(0 <= _col && _col < _pipes.Length); 661while (cch > _rgch.Length) 662Array.Resize(ref _rgch, checked(_rgch.Length * 2)); 663if (_mpslotdst.Length <= _slotLim) 664Array.Resize(ref _mpslotdst, checked(_mpslotdst.Length * 2)); 665if (_mpslotichLim.Length <= _slotLim) 666Array.Resize(ref _mpslotichLim, checked(_mpslotichLim.Length * 2)); 678Contracts.Assert(_col < _pipes.Length); 689Contracts.Assert(_col == _pipes.Length); 702for (int col = 1; col <= _pipes.Length; col++) 720colBest = _pipes.Length; 729if (colBest >= _pipes.Length) 761Contracts.Assert(_col == _pipes.Length); 779Contracts.Assert(col < _pipes.Length);
DataLoadSave\TransformerChain.cs (8)
93Contracts.Check((_transformers.Length > 0) == (LastTransformer != null)); 94Contracts.Check(_transformers.Length == _scopes.Length); 169for (int i = 0; i < _transformers.Length; i++) 192ctx.Writer.Write(_transformers.Length); 194for (int i = 0; i < _transformers.Length; i++) 246IRowToRowMapper[] mappers = new IRowToRowMapper[_transformers.Length]; 248for (int i = 0; i < mappers.Length; ++i)
DataLoadSave\Transpose\TransposeLoader.cs (10)
415for (int c = 0; c < _entries.Length; ++c) 448for (int c = 0; c < _entries.Length; ++c) 478for (int c = 0; c < _entries.Length; ++c) 771_transCursors = new SlotCursor[_actives.Length]; 772_getters = new Delegate[_actives.Length]; 774for (int i = 0; i < _actives.Length; ++i) 784for (int i = 0; i < _transCursors.Length; ++i) 857for (int i = 0; i < _transCursors.Length; ++i) 871Ch.CheckParam(column.Index <= _colToActivesIndex.Length, nameof(column)); 884Ch.CheckParam(column.Index <= _colToActivesIndex.Length && IsColumnActive(column), nameof(column), "requested column not active");
DataLoadSave\Transpose\TransposeSaver.cs (3)
117header.ColumnCount = cols.Length; 126stream.Write(headerBytes, 0, headerBytes.Length); 164ch.Assert(offsets.Count == cols.Length + 2);
DataView\AppendRowsDataView.cs (18)
63if (sources.Length == 1) 75_host.Assert(sources.Length >= 2); 83_counts = new int[_sources.Length]; 84for (int i = 0; i < _sources.Length; i++) 120for (int i = startingSchemaIndex; i < _sources.Length; i++) 191Ch.CheckParam(column.Index <= Getters.Length && IsColumnActive(column), nameof(column), "requested column not active"); 258Ch.Assert(0 <= _currentSourceIndex && _currentSourceIndex < Sources.Length); 275if (++_currentSourceIndex >= Sources.Length) 320Ch.Assert(Sources.Length == counts.Length); 321_cursorSet = new DataViewRowCursor[counts.Length]; 322for (int i = 0; i < counts.Length; i++) 336ValueGetter<DataViewRowId>[] idGetters = new ValueGetter<DataViewRowId>[_cursorSet.Length]; 337for (int i = 0; i < _cursorSet.Length; ++i) 350ValueGetter<TValue>[] getSrc = new ValueGetter<TValue>[_cursorSet.Length]; 355Ch.Assert(0 <= _currentSourceIndex && _currentSourceIndex < Sources.Length); 371Ch.Assert(pos < _cursorSet.Length); 436for (int i = 0; i < _rowsLeft.Length && _batchEnd < BatchSize; i++)
DataView\ArrayDataViewBuilder.cs (6)
55if (_columns.Count > 0 && values.Length != _columns[0].Length) 56throw _host.Except("Previous inputs were of length {0}, but new input is of length {1}", _columns[0].Length, values.Length); 219for (int i = 0; i < _columns.Length; i++) 391public override int Length { get { return _values.Length; } } 413Contracts.Assert(0 <= index && index < _values.Length); 471for (int i = 1; i < values.Length; ++i)
DataView\BatchDataViewMapperBase.cs (1)
48Contracts.Assert(active.Length == SchemaBindings.ColumnCount);
DataView\CacheDataView.cs (31)
120else if (prefetch.Length > 0) 122var tmp = new int[prefetch.Length]; 123Array.Copy(prefetch, tmp, prefetch.Length); 126if (prefetch.Length > 0 && (prefetch[0] < 0 || prefetch[prefetch.Length - 1] >= schema.Count)) 135env.Assert(ip == prefetch.Length || c <= prefetch[ip]); 147if (ip < prefetch.Length && prefetch[ip] == c) 156while (ip < prefetch.Length && prefetch[ip] == c) 161env.Assert(ip == prefetch.Length || c < prefetch[ip]); 163env.Assert(ip == prefetch.Length); 184int inputIndexLim = _inputToSubsetColIndex == null ? _subsetInput.Schema.Count : _inputToSubsetColIndex.Length; 337for (int ic = 0; ic < columns.Length; ++ic) 354if (caches.Length > 0) 395ch.Trace("Begin cache of {0} columns", caches.Length); 397if (caches.Length > 0) 404for (int ic = 0; ic < caches.Length; ++ic) 424for (int ic = 0; ic < caches.Length; ++ic) 430ch.Trace("End cache of {0} columns", caches.Length); 655public bool IsTrivial => _waiters.Length == 0; 833Contracts.Assert(0 <= _curr && _curr < _perm.Length); 850if (++_curr < _perm.Length) 1075Contracts.Assert(0 <= _curr && _curr < _perm.Length); 1098if (_curr >= _perm.Length || _curr < 0) 1105_currMax = Math.Min(_perm.Length - 1, _curr + _batchMask); 1169_getters = new Delegate[actives.Length]; 1170for (int ic = 0; ic < actives.Length; ++ic) 1186Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column)); 1206Ch.CheckParam(column.Index <= _colToActivesIndex.Length && IsColumnActive(column), nameof(column), "requested column not active"); 1207Ch.Check(_colToActivesIndex[column.Index] < _getters.Length); 1219Ch.Assert(0 <= col && col < _colToActivesIndex.Length); 1226Ch.Assert(0 <= col && col < _colToActivesIndex.Length);
DataView\CompositeRowToRowMapper.cs (7)
38OutputSchema = Utils.Size(mappers) > 0 ? mappers[mappers.Length - 1].OutputSchema : inputSchema; 46for (int i = InnerMappers.Length - 1; i >= 0; --i) 59if (InnerMappers.Length == 0) 77IEnumerable<DataViewSchema.Column>[] deps = new IEnumerable<DataViewSchema.Column>[InnerMappers.Length]; 78deps[deps.Length - 1] = OutputSchema.Where(c => activeIndices.Contains(c.Index)); 79for (int i = deps.Length - 1; i >= 1; --i) 83for (int i = 0; i < InnerMappers.Length; ++i)
DataView\DataViewConstructionUtils.cs (8)
155var peeks = new Delegate[schemaDef.Columns.Length]; 156for (var i = 0; i < peeks.Length; i++) 223Host.Assert(schema.Count == schemaDef.Columns.Length); 224Host.Assert(schema.Count == peeks.Length); 431Host.CheckParam(column.Index <= _getters.Length && IsColumnActive(column), nameof(column), "requested column not active"); 471int n = schemaDefn.Columns.Length; 809var columns = new DataViewSchema.DetachedColumn[schemaDefn.Columns.Length]; 810for (int i = 0; i < columns.Length; i++)
DataView\EmptyDataView.cs (1)
70public override bool IsColumnActive(DataViewSchema.Column column) => column.Index < _active.Length && _active[column.Index];
DataView\InternalSchemaDefinition.cs (1)
113Contracts.Assert(parameterTypes.Length == 3);
DataView\LambdaFilter.cs (3)
137var cursors = new DataViewRowCursor[inputs.Length]; 138for (int i = 0; i < inputs.Length; i++) 148for (int i = 0; i < active.Length; i++)
DataView\RowToRowMapperTransform.cs (6)
154Contracts.Assert(activeInput.Length == _bindings.InputSchema.Count); 171Contracts.Assert(active.Length == _bindings.Schema.Count); 207if (inputs.Length == 1 && n > 1 && _bindings.AddedColumnIndices.Any(predicate)) 211var cursors = new DataViewRowCursor[inputs.Length]; 212for (int i = 0; i < inputs.Length; i++) 260Host.Assert(column.Index < activeArr.Length, $"The columns {activeColumns.Select(c => c.Name)} are not suitable for the OutputSchema.");
DataView\SimpleRow.cs (2)
57Contracts.CheckParam(column.Index < _getters.Length, nameof(column), "Invalid col value in GetGetter"); 69Contracts.Check(column.Index < _getters.Length);
DataView\Transposer.cs (48)
105_cols = new DataViewSchema.Column[columns.Length]; 112for (int c = 0; c < columns.Length; ++c) 132for (int c = 0; c < _cols.Length; ++c) 149_splitLim = new int[_cols.Length]; 153for (int c = 0; c < _cols.Length; ++c) 172ch.Trace("{0} of {1} input columns sliced into {2} columns", slicedCount, _cols.Length, toSave.Count); 210int[] indices = new int[columns.Length]; 211for (int c = 0; c < columns.Length; ++c) 225for (int c = 0; c < columns.Length; ++c) 247_host.Assert(0 <= tcol && tcol < _cols.Length); 502_rbuffIndices = new int[_rbuff.Length]; 523int maxPossibleSize = _rbuff.Length * vecLen; 526Array.Clear(_rbuffIndices, 0, _rbuffIndices.Length); 553var heap = new Heap<KeyValuePair<int, int>>((p1, p2) => p1.Key > p2.Key || (p1.Key == p2.Key && p1.Value > p2.Value), _rbuff.Length); 644if (++irbuff == _rbuff.Length) 670Ch.Assert(_indices[s].Length == _len); 671Ch.Assert(_values[s].Length == _len); 748_splitters = new Splitter[toSlice.Length]; 749_incolToLim = new int[toSlice.Length]; 754for (int c = 0; c < toSlice.Length; ++c) 775for (int c = 0; c < _splitters.Length; ++c) 787_host.Assert(outputColumnCount == _colToSplitIndex.Length); 791for (int c = 0; c < _splitters.Length; ++c) 813_host.Assert(0 <= incol && incol < _incolToLim.Length); 826_host.Assert(0 <= col && col < _colToSplitIndex.Length); 853for (int i = 0; i < result.Length; ++i) 870activeSplitters = new bool[_splitters.Length]; 873for (int i = 0; i < activeSplitters.Length; ++i) 941for (int i = 0; i < ends.Length; ++i) 947for (int i = 0; i < ends.Length; ++i) 950ends[ends.Length - 1] = vectorSize; 1078public override int ColumnCount { get { return _lims.Length; } } 1101Contracts.Assert(lims[lims.Length - 1] == type.Size); 1104_types = new VectorDataViewType[_lims.Length]; 1106for (int c = 1; c < _lims.Length; ++c) 1111for (int c = 0; c < _lims.Length; ++c) 1144_srcIndicesLims = new int[Lims.Length]; 1146_getters = new ValueGetter<VBuffer<T>>[Lims.Length]; 1147for (int c = 0; c < _getters.Length; ++c) 1169Contracts.Check(IsColumnActive(column) && column.Index < _getters.Length); 1227Contracts.Assert(_inputValue.Length == Parent._lims[Parent._lims.Length - 1]); 1237Array.Clear(_srcIndicesLims, 0, _srcIndicesLims.Length); 1242for (int i = 0; i < Lims.Length; ++i) 1274Ch.Assert(Utils.Size(activeSplitters) == slicer._splitters.Length); 1277_sliceRows = new DataViewRow[_slicer._splitters.Length]; 1278var activeSrc = new bool[slicer._splitters.Length]; 1285for (int i = 0; i < activeSplitters.Length; ++i) 1375ctx.Assert(genTypeArgs.Length == 1);
DataView\TypedCursor.cs (7)
123_host.Assert(_columns.Length == _columnIndices.Length); 125int n = _columns.Length; 211if (inputs.Length == 1 && n > 1) 342int n = parent._pokes.Length; 343Ch.Assert(n == parent._columns.Length); 344Ch.Assert(n == parent._columnIndices.Length);
DataView\ZipBinding.cs (8)
29_cumulativeColCounts = new int[_sources.Length + 1]; 32for (int i = 0; i < sources.Length; i++) 44public int ColumnCount => _cumulativeColCounts[_cumulativeColCounts.Length - 1]; 54var result = new Func<int, bool>[_sources.Length]; 55for (int i = 0; i < _sources.Length; i++) 69Contracts.CheckParam(0 <= col && col < _cumulativeColCounts[_cumulativeColCounts.Length - 1], nameof(col), "Column index out of range"); 75if (!Utils.TryFindIndexSorted(_cumulativeColCounts, 0, _cumulativeColCounts.Length, col, out srcIndex)) 77Contracts.Assert(0 <= srcIndex && srcIndex < _cumulativeColCounts.Length);
DataView\ZipDataView.cs (2)
40if (srcArray.Length == 1) 134for (int i = _cursors.Length - 1; i >= 0; i--)
Deprecated\Instances\HeaderSchema.cs (17)
314public override int NonDefaultCount => _names.Length; 319return index < _names.Length ? _names[index] : null; 324for (int i = 0; i < _names.Length; i++) 326for (int i = _names.Length; i < _count; i++) 335for (int index = 0; index < _names.Length; index++) 346for (int i = 0; i < _names.Length; i++) 380int size = Math.Min(names.Length, count); 412Contracts.Assert(indices.Length == names.Length); 413Contracts.Assert(indices.Length <= count); 431if (iv < _indices.Length && _indices[iv] < index) 433if (++iv < _indices.Length && _indices[iv] < index) 434iv = _indices.FindIndexSorted(iv + 1, _indices.Length, index); 444if (iv < _names.Length && _indices[iv] == index) 455if (ii < _indices.Length && _indices[ii] == i) 467for (int iv = 0; iv < _names.Length; iv++) 478for (int i = 0; i < _indices.Length; i++)
Deprecated\Vector\VectorUtils.cs (18)
27return CpuMathUtils.DotProductDense(a, b, a.Length); 305Contracts.Check(0 <= offset && offset <= a.Length); 306Contracts.Check(b.Length <= a.Length - offset, "VBuffer b must be no longer than a.Length - offset."); 420return L2DistSquaredHalfSparse(a.AsSpan(0, a.Length), b.GetValues(), b.GetIndices()); 430Contracts.CheckParam(src.Length == dst.Length, nameof(dst), "Arrays must have the same dimensionality."); 431if (src.Length == 0) 433CpuMathUtils.Add(src, dst, src.Length); 471Contracts.Check(0 <= offset && offset <= dst.Length); 472Contracts.Check(src.Length <= dst.Length - offset, "Vector src must be no longer than dst.Length - offset."); 499Contracts.Check(src.Length == dst.Length, "Arrays must have the same dimensionality."); 504CpuMathUtils.AddScale(c, src, dst, src.Length); 520if (a == null || a.Length == 0) 538Array.Clear(dst, 0, dst.Length); 543Contracts.Check(a.Length == b.Length, "Arrays must have the same dimensionality."); 546for (int i = 0; i < a.Length; i++)
Dirty\ChooseColumnsByIndexTransform.cs (7)
95Contracts.Check(sources.Length > 0, "Choose columns by index has no output column."); 105for (int i = 0; i < _sources.Length; ++i) 162for (int i = 0; i < _sources.Length; i++) 167return col => 0 <= col && col < active.Length && active[col]; 272var cursors = new DataViewRowCursor[inputs.Length]; 273for (int i = 0; i < inputs.Length; i++) 287Ch.Assert(active == null || active.Length == bindings.OutputSchema.Count);
Dirty\PredictionUtils.cs (3)
70for (int i = 0; i < args.Length; i++) 97if (a.Length == 0) 100for (int i = 1; i < a.Length; i++)
EntryPoints\EntryPointNode.cs (2)
499if (missing.Length > 0) 806_host.Assert(_inputBuilder.GetMissingValues().Length == 0);
EntryPoints\InputBuilder.cs (10)
89_wasSet = new bool[_fields.Length]; 106for (int i = 0; i < _attrs.Length; i++) 153for (int i = 0; i < _fields.Length; i++) 224for (int i = 0; i < _fields.Length; i++) 498if (inputBuilder._fields.Length == 0) 511if (missing.Length > 0) 572if (missing.Length > 0) 583for (int i = 0; i < array.Length; i++) 694for (int i = 0; i < _attrs.Length; i++) 721for (int i = 0; i < _fields.Length; i++)
Evaluators\AnomalyDetectionEvaluator.cs (2)
182overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray()); 197topKdvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, topKStratCol.ToArray());
Evaluators\BinaryClassifierEvaluator.cs (8)
337overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray()); 358confDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, confStratCol.ToArray()); 363dst = new VBuffer<ReadOnlyMemory<char>>(aggregator.ClassNames.Length, aggregator.ClassNames); 378dvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, prStratCol.ToArray()); 1454for (int i = 0; i < metrics.Length; i++) 1460if (metrics.Length != 1) 1461idv = EvaluateUtils.AddFoldIndex(Host, idv, i, metrics.Length); 1466if (metrics.Length != 1)
Evaluators\ClusteringEvaluator.cs (11)
204overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray()); 259for (int j = 0; j < _confusionMatrix[i].Length; j++) 288var clusterCount = _distancesToCentroids.Length; 355_confusionMatrix.Add(new Double[scores.Length]); 361for (int i = 0; i < clusterCentroids.Length; i++) 433Host.Check(_scores.Length == _scoresArr.Length); 453foreach (var index in Enumerable.Range(0, _scoresArr.Length).OrderBy(i => _scoresArr[i])) 473Host.Check(_scores.Length == _scoresArr.Length); 479foreach (var index in Enumerable.Range(0, _scoresArr.Length).OrderBy(i => _scoresArr[i])) 500Host.Assert(score.Type.GetVectorSize() == _scoresArr.Length); 672foreach (var index in Enumerable.Range(0, scoresArr.Length).OrderBy(i => scoresArr[i]))
Evaluators\EvaluatorBase.cs (2)
213var editor = VBufferEditor.Create(ref dst, dictionaries.Length); 214for (int i = 0; i < dictionaries.Length; i++)
Evaluators\EvaluatorUtils.cs (16)
465var numIdvs = views.Length; 525for (int j = 0; j < map.Length; j++) 528for (int j = 0; j < mappedIndices.Length; j++) 559var dvCount = schemas.Length; 607var dvCount = views.Length; 651for (int i = 0; i < views.Length; i++) 677var dvCount = views.Length; 768return AddFoldIndex(env, perInst, i, perInstance.Length); 792if (metrics.Length == 1) 796for (int i = 0; i < metrics.Length; i++) 1299env.Assert(vectorMetrics.Length > 0); 1300for (int j = 0; j < vectorMetrics.Length; j++) 1306for (int j = 0; j < vectorStdevMetrics.Length; j++) 1310for (int j = 0; j < names.Length; j++) 1411for (int i = 0; i < labelIndexToConfIndexMap.Length; i++) 1576for (int i = 0; i < metrics.Length; i++)
Evaluators\Metrics\ConfusionMatrix.cs (6)
77_host.Assert(precision.Length == confusionTableCounts.Length); 78_host.Assert(recall.Length == confusionTableCounts.Length); 79_host.Assert(labelNames.Count == confusionTableCounts.Length); 87NumberOfClasses = confusionTableCounts.Length;
Evaluators\MulticlassClassificationEvaluator.cs (16)
211overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray()); 226dst = new VBuffer<ReadOnlyMemory<char>>(allTopK.First().Length, Enumerable.Range(1, allTopK.First().Length).Select(i => new ReadOnlyMemory<char>(i.ToString().ToCharArray())).ToArray()); 235confDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, confStratCol.ToArray()); 240dst = new VBuffer<ReadOnlyMemory<char>>(aggregator.ClassNames.Length, aggregator.ClassNames); 320var res = new double[_totalPerClassLogLoss.Length]; 321for (int i = 0; i < _totalPerClassLogLoss.Length; i++) 335for (int i = 0; i < ConfusionTable.Length; i++) 418Host.Assert(score.Type.GetVectorSize() == _scoresArr.Length); 445Host.Check(_scores.Length == _scoresArr.Length); 470if (intLabel < _scoresArr.Length) 500for (int i = 0; i < _scoresArr.Length; i++) 535var editor = VBufferEditor.Create(ref slotNames, ClassNames.Length); 536for (int i = 0; i < ClassNames.Length; i++) 736foreach (var index in Enumerable.Range(0, scoresArr.Length).OrderByDescending(i => scoresArr[i])) 956for (int i = 0; i < metrics.Length; i++)
Evaluators\MultiOutputRegressionEvaluator.cs (10)
148overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray()); 190var res = new double[_l1Loss.Length]; 193for (int i = 0; i < _l1Loss.Length; i++) 203var res = new double[_l2Loss.Length]; 206for (int i = 0; i < _l2Loss.Length; i++) 216var res = new double[_l2Loss.Length]; 219for (int i = 0; i < _l2Loss.Length; i++) 229var res = new double[_fnLoss.Length]; 232for (int i = 0; i < _fnLoss.Length; i++) 250Contracts.Assert(length == _l1Loss.Length);
Evaluators\QuantileRegressionEvaluator.cs (1)
313_quantiles = new VBuffer<ReadOnlyMemory<char>>(quantiles.Length, quantiles);
Evaluators\RankingEvaluator.cs (11)
86for (int i = 0; i < gains.Length; i++) 216overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray()); 227groupDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, groupStratCol.ToArray()); 780var editor = VBufferEditor.Create(ref dst, src.Length); 922if (metrics.Length == 1) 927for (int i = 0; i < metrics.Length; i++) 933idv = EvaluateUtils.AddFoldIndex(Host, idv, i, metrics.Length); 971for (int i = 0; i < discountMap.Length; i++) 987if (truncationLevel <= discountMap.Length) 1001int relevancyLevel = labelGains.Length; 1017int topLabel = labelGains.Length - 1;
Evaluators\RegressionEvaluatorBase.cs (1)
97overallDvBldr.AddColumn(MetricKinds.ColumnNames.StratCol, GetKeyValueGetter(dictionaries), (ulong)dictionaries.Length, stratCol.ToArray());
Model\ModelOperationsCatalog.cs (1)
236if (accessor.Transformers.Length == 1)
Model\Pfa\BoundPfaContext.cs (2)
208var names = new string[vars.Length]; 209for (int i = 0; i < vars.Length; ++i)
Model\Pfa\PfaContext.cs (3)
156if (locals.Length == 0) 165if (sets.Count == 0 || locals.Length == sets.Count) 171var lets = new List<KeyValuePair<string, JToken>>(locals.Length - sets.Count);
Prediction\Calibrator.cs (4)
1122ch.Check(cOutputs.Length > 0, "Calibrator trained on zero instances."); 1279int binIdx = GetBinIdx(output, Min, BinSize, _binProbs.Length); 1323var numBinsMinusOneVar = ctx.AddInitializer(_binProbs.Length - 1, "NumBinsMinusOne"); 1328var binProbabilitiesVar = ctx.AddInitializer(_binProbs, new long[] { _binProbs.Length, 1 }, "BinProbabilities");
Scorers\PredictedLabelScorerBase.cs (2)
344for (int i = 0; i < outColNames.Length; ++i) 417for (int iinfo = delta; iinfo < getters.Length; iinfo++)
Scorers\PredictionTransformer.cs (2)
830if (att.LoadType.IsGenericType && att.LoadType.GetGenericArguments().Length == modelType.GetGenericArguments().Length)
Scorers\QuantileRegressionScorer.cs (1)
65Contracts.CheckUserArg(quantilesArray.Length > 0, nameof(Arguments.Quantiles), "There must be at least one quantile.");
Scorers\RowToRowScorerBase.cs (12)
91Contracts.Assert(active.Length == bindings.ColumnCount); 94Contracts.Assert(activeInput.Length == bindings.Input.Count); 104var activeInCols = bindings.Input.Where(c => c.Index < activeInput.Length && activeInput[c.Index]); 155if (inputs.Length == 1 && n > 1 && WantParallelCursors(predicate) && (Source.GetRowCount() ?? int.MaxValue) > n) 159var cursors = new DataViewRowCursor[inputs.Length]; 160for (int i = 0; i < inputs.Length; i++) 196for (int col = 0; col < getters.Length; col++) 247Ch.Assert(active.Length == _bindings.ColumnCount); 353DerivedColumnCount = namesDerived.Length; 369int count = namesDerived.Length + schema.Count; 372for (int i = 0; i < namesDerived.Length; i++) 478Contracts.Assert(active.Length == ColumnCount);
Scorers\SchemaBindablePredictorWrapper.cs (2)
713var quantiles = new float[_quantiles.Length]; 714for (int i = 0; i < quantiles.Length; i++)
Scorers\ScoreSchemaFactory.cs (4)
87var partialSchema = Create(new VectorDataViewType(scoreType as PrimitiveDataViewType, quantiles.Length), AnnotationUtils.Const.ScoreColumnKind.QuantileRegression); 91metadataBuilder.AddSlotNames(quantiles.Length, (ref VBuffer<ReadOnlyMemory<char>> value) => 93var bufferEditor = VBufferEditor.Create(ref value, quantiles.Length); 94for (int i = 0; i < quantiles.Length; ++i)
Training\TrainerUtils.cs (4)
656if (inputs.Length > 1) 657signal = new AndAccumulator(SignalCore, inputs.Length).Signal; 661var res = new TCurs[inputs.Length]; 662for (int i = 0; i < res.Length; i++)
Transforms\ColumnBindingsBase.cs (20)
207if (Source.Length == 1 && Source[0] == Name) 311_nameToInfoIndex = new Dictionary<string, int>(names.Length); 320for (int iinfo = 0; iinfo < names.Length; iinfo++) 341Contracts.Assert(_nameToInfoIndex.Count == names.Length); 352colMap = new int[input.Count + names.Length]; 353mapIinfoToCol = new int[names.Length]; 354for (int iinfo = 0; iinfo < names.Length; iinfo++) 370int colDst = colMap.Length; 371for (int iinfo = names.Length; --iinfo >= 0;) 387Contracts.Assert(0 <= iinfo && iinfo < names.Length); 398public int ColumnCount => _colMap.Length; 405public int InfoCount => _mapIinfoToCol.Length; 419Contracts.Assert(0 <= col && col < _colMap.Length); 608for (int dst = 0; dst < _colMap.Length; dst++) 695for (int i = 0; i < addedColumns.Length; i++) 717Contracts.Assert(indices.Count == addedColumns.Length + input.Count); 725var addedIndices = new int[addedColumns.Length]; 726for (int i = 0; i < _colMap.Length; i++) 749Contracts.Assert(0 <= col && col < _colMap.Length); 775for (int dst = 0; dst < _colMap.Length; dst++)
Transforms\ColumnConcatenatingEstimator.cs (3)
58_host.CheckParam(inputColumnNames.Length > 0, nameof(inputColumnNames), "Input columns not specified"); 91var cols = new SchemaShape.Column[sources.Length]; 104for (int i = 0; i < sources.Length; ++i)
Transforms\ColumnConcatenatingTransformer.cs (35)
186Contracts.Assert(_sources.Length > 0); 187ctx.Writer.Write(_sources.Length); 274Contracts.Assert(_columns.Length > 0); 275ctx.Writer.Write(_columns.Length); 342var length = inputs[i].Length; 376for (int i = 0; i < options.Columns.Length; i++) 396for (int i = 0; i < options.Columns.Length; i++) 433_columns = new BoundColumn[_parent._columns.Length]; 434for (int i = 0; i < _parent._columns.Length; i++) 443Contracts.Assert(0 <= iinfo && iinfo < _parent._columns.Length); 497Contracts.Assert(typeCat.Length > 0); 498catCount += typeCat.Length; 559_isIdentity = SrcIndices.Length == 1 && _inputSchema[SrcIndices[0]].Type is VectorDataViewType; 596for (int i = 0; i < SrcIndices.Length; i++) 606Contracts.Assert(values.Length > 0 && values.Length % 2 == 0); 608for (int j = 0; j < values.Length; j++) 632for (int i = 0; i < _srcTypes.Length; i++) 685Contracts.Assert(SrcIndices.Length == 1); 691var srcGetterOnes = new ValueGetter<T>[SrcIndices.Length]; 692var srcGetterVecs = new ValueGetter<VBuffer<T>>[SrcIndices.Length]; 694for (int j = 0; j < SrcIndices.Length; j++) 705VBuffer<T>[] tmpBufs = new VBuffer<T>[SrcIndices.Length]; 710for (int i = 0; i < SrcIndices.Length; i++) 739for (int j = 0; j < SrcIndices.Length; j++) 786for (int j = 0; j < SrcIndices.Length; j++) 814string[] srcTokens = new string[SrcIndices.Length]; 815bool[] srcPrimitive = new bool[SrcIndices.Length]; 816for (int i = 0; i < SrcIndices.Length; ++i) 838for (int i = 0; i < srcTokens.Length && srcPrimitive[i]; ++i) 849for (int i = min; i < srcTokens.Length; ++i) 860for (int i = 0; i < _columns.Length; i++) 888for (int iinfo = 0; iinfo < _columns.Length; ++iinfo) 908for (int iinfo = 0; iinfo < _columns.Length; ++iinfo) 922for (int i = 0; i < boundCol.SrcIndices.Length; ++i)
Transforms\ColumnCopying.cs (3)
216Host.Assert(0 <= iinfo && iinfo < _columns.Length); 229var result = new DataViewSchema.DetachedColumn[_columns.Length]; 230for (int i = 0; i < _columns.Length; i++)
Transforms\ColumnSelecting.cs (6)
452var length = _selectedColumns.Length; 545_host.Assert(0 <= outputIndex && outputIndex < OutputToInputMap.Length); 705var cursors = new DataViewRowCursor[inputs.Length]; 706for (int i = 0; i < inputs.Length; i++) 722return _mapper.InputSchema.Where(col => col.Index < active.Length && active[col.Index]); 739for (int i = 0; i < outputToInputMap.Length; i++)
Transforms\GenerateNumberTransform.cs (10)
117var names = new string[options.Columns.Length]; 118var useCounter = new bool[options.Columns.Length]; 119var states = new TauswortheHybrid.State[options.Columns.Length]; 120for (int i = 0; i < options.Columns.Length; i++) 236Contracts.Assert(active.Length == Input.Count); 237return col => 0 <= col && col < active.Length && active[col]; 366if (inputs.Length != 1) 368var cursors = new DataViewRowCursor[inputs.Length]; 369for (int i = 0; i < inputs.Length; i++) 395Ch.CheckParam(active == null || active.Length == bindings.ColumnCount, nameof(active));
Transforms\Hashing.cs (20)
196var types = new DataViewType[_columns.Length]; 200for (int i = 0; i < _columns.Length; i++) 233for (int i = 0; i < helpers.Length; ++i) 245for (int i = 0; i < helpers.Length; ++i) 248_keyValues = new VBuffer<ReadOnlyMemory<char>>[_columns.Length]; 249_kvTypes = new VectorDataViewType[_columns.Length]; 250for (int i = 0; i < helpers.Length; ++i) 264Host.Assert(0 <= iinfo && iinfo < _columns.Length); 291var columnsLength = ColumnPairs.Length; 311Host.Assert(_columns.Length == ColumnPairs.Length); 315TextModelHelper.SaveAll(Host, ctx, _columns.Length, _keyValues); 334var cols = new HashingEstimator.ColumnOptions[options.Columns.Length]; 335for (int i = 0; i < cols.Length; i++) 1320_srcTypes = new DataViewType[_parent._columns.Length]; 1321_dstTypes = new DataViewType[_parent._columns.Length]; 1322for (int i = 0; i < _dstTypes.Length; i++) 1331var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 1332for (int i = 0; i < _parent.ColumnPairs.Length; i++) 1459for (int iinfo = 0; iinfo < _parent._columns.Length; ++iinfo)
Transforms\InvertHashUtils.cs (1)
264return new VBuffer<ReadOnlyMemory<char>>(values.Length, values);
Transforms\KeyToValue.cs (10)
173var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 174for (int i = 0; i < _parent.ColumnPairs.Length; i++) 190for (int iinfo = 0; iinfo < _parent.ColumnPairs.Length; ++iinfo) 215Host.Assert(0 <= iinfo && iinfo < _types.Length); 223types = new DataViewType[_parent.ColumnPairs.Length]; 224kvMaps = new KeyToValueMap[_parent.ColumnPairs.Length]; 225for (int iinfo = 0; iinfo < types.Length; iinfo++) 250Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 294Parent.Host.Assert(0 <= iinfo && iinfo < Parent._types.Length); 582for (int iinfo = 0; iinfo < _parent.ColumnPairs.Length; ++iinfo)
Transforms\KeyToVector.cs (20)
155Host.Assert(_columns.Length == ColumnPairs.Length); 156for (int i = 0; i < _columns.Length; i++) 179var columnsLength = ColumnPairs.Length; 200var cols = new KeyToVectorMappingEstimator.ColumnOptions[options.Columns.Length]; 201for (int i = 0; i < cols.Length; i++) 248_types = new VectorDataViewType[_parent.ColumnPairs.Length]; 255for (int i = 0; i < _parent.ColumnPairs.Length; i++) 277var infos = new ColInfo[_parent.ColumnPairs.Length]; 278for (int i = 0; i < _parent.ColumnPairs.Length; i++) 291var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 292for (int i = 0; i < _parent.ColumnPairs.Length; i++) 366Host.Assert(0 <= iinfo && iinfo < _infos.Length); 428Host.Assert(0 <= iinfo && iinfo < _infos.Length); 440for (int i = 2; i < ranges.Length; i += 2) 446dst = new VBuffer<int>(ranges.Length, ranges); 452Host.Assert(0 <= iinfo && iinfo < _infos.Length); 618for (int iinfo = 0; iinfo < _infos.Length; ++iinfo) 638for (int iinfo = 0; iinfo < _infos.Length; ++iinfo) 663Contracts.Assert(0 <= iinfo && iinfo < _infos.Length);
Transforms\LabelConvertTransform.cs (7)
86Contracts.Assert(Infos.Length == Utils.Size(args.Columns)); 139Contracts.Assert(0 <= iinfo && iinfo < Infos.Length); 146for (int iinfo = 0; iinfo < Infos.Length; iinfo++) 162Contracts.Assert(0 <= iinfo && iinfo < Infos.Length); 174Contracts.Assert(0 <= iinfo && iinfo < Infos.Length); 185Host.Assert(0 <= iinfo && iinfo < Infos.Length); 198Host.Assert(0 <= iinfo && iinfo < Infos.Length);
Transforms\LabelIndicatorTransform.cs (8)
138Host.Assert(Infos.Length == Utils.Size(options.Columns)); 139_classIndex = new int[Infos.Length]; 141for (int iinfo = 0; iinfo < Infos.Length; ++iinfo) 153_classIndex = new int[Infos.Length]; 155for (int iinfo = 0; iinfo < Infos.Length; ++iinfo) 163Host.Assert(0 <= iinfo && iinfo < Infos.Length); 172ch.Assert(0 <= iinfo && iinfo < Infos.Length); 183ch.Assert(0 <= iinfo && iinfo < Infos.Length);
Transforms\MetadataDispatcher.cs (5)
36public int GetterCount { get { return _getters.Length; } } 144protected int ColCount { get { return _infos.Length; } } 176Contracts.CheckParam(0 <= index && index < _infos.Length, nameof(index), "Out of range"); 196Contracts.CheckParam(0 <= index && index < _infos.Length, nameof(index)); 278ectx.Check(0 <= index && index < _infos.Length);
Transforms\NAFilter.cs (13)
101_infos = new ColInfo[args.Columns.Length]; 102_srcIndexToInfoIndex = new Dictionary<int, int>(_infos.Length); 105for (int i = 0; i < _infos.Length; i++) 139_srcIndexToInfoIndex = new Dictionary<int, int>(_infos.Length); 180Host.Assert(_infos.Length > 0); 181ctx.Writer.Write(_infos.Length); 231var cursors = new DataViewRowCursor[inputs.Length]; 232for (int i = 0; i < inputs.Length; i++) 242for (int i = 0; i < active.Length; i++) 244for (int i = 0; i < _infos.Length; i++) 390_values = new Value[_parent._infos.Length]; 391for (int i = 0; i < _parent._infos.Length; i++) 439for (int i = 0; i < _parent._infos.Length; i++)
Transforms\NormalizeColumn.cs (10)
487Host.Assert(Offset == null || Offset.Length == Scale.Length); 498Host.Check(typeSrc.GetVectorSize() == Scale.Length); 507var src = new VBuffer<TFloat>(Scale.Length, Scale); 514var src = new VBuffer<TFloat>(Offset.Length, Offset); 608Host.Assert(mean.Length == stddev.Length); 618Host.Check(typeSrc.GetVectorSize() == Mean.Length); 627var src = new VBuffer<TFloat>(Mean.Length, Mean); 633var src = new VBuffer<TFloat>(Stddev.Length, Stddev);
Transforms\NormalizeColumnDbl.cs (77)
51Contracts.Assert(offsets == null || offsets.Length == scales.Length); 54Contracts.Assert(scales.Length == numFeatures); 59Contracts.Assert(indices.Length < numFeatures); 60Contracts.Assert(scales.Length == indices.Length); 79for (int ii = 0; ii < indices.Length; ii++) 131for (int iv = 0; iv < scales.Length; iv++) 164for (int iiv = 0; iiv < indicesMorph.Length; iiv++) 187Contracts.Assert(indicesMorph == null || indicesMorph.Length == scalesSparse.Length); 188Contracts.Assert(offsetsSparse == null || offsetsSparse.Length == scalesSparse.Length); 209ctx.Writer.Write(binUpperBounds.Length); 218writer.WriteLine("NumNormalizationFeatures={0}", binUpperBounds.Length); 219for (int i = 0; i < binUpperBounds.Length; i++) 222for (int j = 0; j < binUpperBounds[i].Length - 1; j++) 257for (int j = 1; j < curUpperBounds.Length; j++) 259Contracts.CheckDecode(curUpperBounds[curUpperBounds.Length - 1] == TFloat.PositiveInfinity); 276ctx.Writer.Write(mean.Length); 278ctx.Writer.WriteDoublesNoCount(stddev.AsSpan(0, mean.Length)); 283writer.WriteLine("NumNormalizationFeatures={0}", mean.Length); 285for (int i = 0; i < mean.Length; i++) 355var size = _min.Length; 387var size = _min.Length; 468var size = _mean.Length; 498for (int i = 0; i < _mean.Length; i++) 678host.Assert(scales.Length == cfeat); 679host.Assert(offsets == null || offsets.Length == cfeat); 743host.Assert(scales.Length == cfeat); 744host.Assert(offsets == null || offsets.Length == cfeat); 754AffineNormSerializationUtils.SaveModel(ctx, Scale.Length, null, Scale, Offset, saveText: true); 793Contracts.Check(dst.Length == Scale.Length); 803Contracts.Check(dst.Length == Scale.Length); 813Contracts.Check(dst.Length == Scale.Length); 825Contracts.Assert(input.Length == scale.Length); 826int size = scale.Length; 855Contracts.Assert(input.Length == scale.Length); 856int size = scale.Length; 899Contracts.Assert(input.Length == scale.Length); 901int size = scale.Length; 933Contracts.Assert(inz < nz.Length && ivDst == nz[inz] || inz == nz.Length && ivDst == size); 940ivDst = ++inz < nz.Length ? nz[inz] : size; 958ivDst = ++inz < nz.Length ? nz[inz] : size; 959Contracts.Assert((inz == nz.Length) == (ivDst >= size)); 963Contracts.Assert(inz == nz.Length); 1088Host.Check(dst.Length == Mean.Length); 1099Contracts.Assert(input.Length == mean.Length); 1100int size = mean.Length; 1167_den = Math.Max(1, _binUpperBounds.Length - 1); 1189if (binUpperBounds.Length != 1) 1190throw host.Except("Normalizer expected {0} slots, but the input data column has 1 slot.", binUpperBounds.Length); 1240_den = new TFloat[_binUpperBounds.Length]; 1241for (int i = 0; i < _binUpperBounds.Length; i++) 1242_den[i] = Math.Max(1, _binUpperBounds[i].Length - 1); 1245_offset = new TFloat[_binUpperBounds.Length]; 1247for (int i = 0; i < _binUpperBounds.Length; i++) 1275if (binUpperBounds.Length != cv) 1276throw host.Except("Normalizer expected {0} slots, but the input data column has {1} slots.", binUpperBounds.Length, cv); 1302Host.Check(dst.Length == _binUpperBounds.Length); 1310Contracts.Assert(input.Length == _binUpperBounds.Length); 1311int size = _binUpperBounds.Length; 1499int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input); 1500Contracts.Check(binIdx < binUpperBounds.Length); 1510int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input); 1511Contracts.Check(binIdx < binUpperBounds.Length); 1585var size = Aggregator.Min.Length; 1612var cv = Aggregator.Min.Length; 1782int cv = _aggregator.Mean.Length; 1831int cv = _aggregator.Mean.Length; 1933int size = _values.Length; 1962var count = _values.Length; 2145for (int i = 0; i < _medianAggregators.Length; i++) 2165double[] scale = new double[_medianAggregators.Length]; 2166double[] median = new double[_medianAggregators.Length]; 2169for (int i = 0; i < _medianAggregators.Length; i++)
Transforms\NormalizeColumnSng.cs (77)
51Contracts.Assert(offsets == null || offsets.Length == scales.Length); 54Contracts.Assert(scales.Length == numFeatures); 59Contracts.Assert(indices.Length < numFeatures); 60Contracts.Assert(scales.Length == indices.Length); 79for (int ii = 0; ii < indices.Length; ii++) 131for (int iv = 0; iv < scales.Length; iv++) 164for (int iiv = 0; iiv < indicesMorph.Length; iiv++) 187Contracts.Assert(indicesMorph == null || indicesMorph.Length == scalesSparse.Length); 188Contracts.Assert(offsetsSparse == null || offsetsSparse.Length == scalesSparse.Length); 209ctx.Writer.Write(binUpperBounds.Length); 218writer.WriteLine("NumNormalizationFeatures={0}", binUpperBounds.Length); 219for (int i = 0; i < binUpperBounds.Length; i++) 222for (int j = 0; j < binUpperBounds[i].Length - 1; j++) 257for (int j = 1; j < curUpperBounds.Length; j++) 259Contracts.CheckDecode(curUpperBounds[curUpperBounds.Length - 1] == TFloat.PositiveInfinity); 276ctx.Writer.Write(mean.Length); 278ctx.Writer.WriteSinglesNoCount(stddev.AsSpan(0, mean.Length)); 283writer.WriteLine("NumNormalizationFeatures={0}", mean.Length); 285for (int i = 0; i < mean.Length; i++) 355var size = _min.Length; 388var size = _min.Length; 469var size = _mean.Length; 500for (int i = 0; i < _mean.Length; i++) 836host.Assert(scales.Length == cfeat); 837host.Assert(offsets == null || offsets.Length == cfeat); 900host.Assert(scales.Length == cfeat); 901host.Assert(offsets == null || offsets.Length == cfeat); 911AffineNormSerializationUtils.SaveModel(ctx, Scale.Length, null, Scale, Offset, saveText: true); 950Contracts.Check(dst.Length == Scale.Length); 960Contracts.Check(dst.Length == Scale.Length); 970Contracts.Check(dst.Length == Scale.Length); 982Contracts.Assert(input.Length == scale.Length); 983int size = scale.Length; 1013Contracts.Assert(input.Length == scale.Length); 1014int size = scale.Length; 1058Contracts.Assert(input.Length == scale.Length); 1060int size = scale.Length; 1093Contracts.Assert(inz < nz.Length && ivDst == nz[inz] || inz == nz.Length && ivDst == size); 1100ivDst = ++inz < nz.Length ? nz[inz] : size; 1118ivDst = ++inz < nz.Length ? nz[inz] : size; 1119Contracts.Assert((inz == nz.Length) == (ivDst >= size)); 1123Contracts.Assert(inz == nz.Length); 1248Host.Check(dst.Length == Mean.Length); 1259Contracts.Assert(input.Length == mean.Length); 1260int size = mean.Length; 1328_den = Math.Max(1, _binUpperBounds.Length - 1); 1350if (binUpperBounds.Length != 1) 1351throw host.Except("Normalizer expected {0} slots, but the input data column has 1 slot.", binUpperBounds.Length); 1401_den = new TFloat[_binUpperBounds.Length]; 1402for (int i = 0; i < _binUpperBounds.Length; i++) 1403_den[i] = Math.Max(1, _binUpperBounds[i].Length - 1); 1406_offset = new TFloat[_binUpperBounds.Length]; 1408for (int i = 0; i < _binUpperBounds.Length; i++) 1436if (binUpperBounds.Length != cv) 1437throw host.Except("Normalizer expected {0} slots, but the input data column has {1} slots.", binUpperBounds.Length, cv); 1463Host.Check(dst.Length == _binUpperBounds.Length); 1471Contracts.Assert(input.Length == _binUpperBounds.Length); 1472int size = _binUpperBounds.Length; 1662int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input); 1663Contracts.Check(binIdx < binUpperBounds.Length); 1673int binIdx = binUpperBounds.FindIndexSorted(0, binUpperBounds.Length - 1, input); 1674Contracts.Check(binIdx < binUpperBounds.Length); 1748var size = Aggregator.Min.Length; 1775var cv = Aggregator.Min.Length; 1945int cv = _aggregator.Mean.Length; 1994int cv = _aggregator.Mean.Length; 2096int size = _values.Length; 2126var count = _values.Length; 2307for (int i = 0; i < _medianAggregators.Length; i++) 2327TFloat[] scale = new TFloat[_medianAggregators.Length]; 2328TFloat[] median = new TFloat[_medianAggregators.Length]; 2331for (int i = 0; i < _medianAggregators.Length; i++)
Transforms\Normalizer.cs (13)
539var srcCols = new int[columns.Length]; 540var srcTypes = new DataViewType[columns.Length]; 541for (int i = 0; i < columns.Length; i++) 555var functionBuilders = new IColumnFunctionBuilder[columns.Length]; 556var needMoreData = new bool[columns.Length]; 566for (int i = 0; i < columns.Length; i++) 583for (int i = 0; i < columns.Length; i++) 601var result = new ColumnOptions[columns.Length]; 602for (int i = 0; i < columns.Length; i++) 621var cols = new ColumnOptions[ColumnPairs.Length]; 623for (int iinfo = 0; iinfo < ColumnPairs.Length; iinfo++) 642var cols = new ColumnOptions[ColumnPairs.Length]; 644for (int iinfo = 0; iinfo < ColumnPairs.Length; iinfo++)
Transforms\OneToOneTransformerBase.cs (4)
66ctx.Writer.Write(ColumnPairs.Length); 67for (int i = 0; i < ColumnPairs.Length; i++) 77Contracts.Assert(0 <= col && col < ColumnPairs.Length); 102for (int i = 0; i < _parent.ColumnPairs.Length; i++)
Transforms\PerGroupTransformBase.cs (3)
84return col => 0 <= col && col < active.Length && active[col]; 176var activeCols = Source.Schema.Where(x => activeInput.Length > x.Index && activeInput[x.Index]); 187Contracts.Assert(active.Length == bindings.ColumnCount);
Transforms\RangeFilter.cs (3)
233var cursors = new DataViewRowCursor[inputs.Length]; 234for (int i = 0; i < inputs.Length; i++) 254for (int i = 0; i < active.Length; i++)
Transforms\RowShufflingTransformer.cs (16)
440Contracts.Assert(0 <= idx && idx < Buffer.Length); 450Contracts.Assert(0 <= idx && idx < Buffer.Length); 530_pipes[ia] = ShufflePipe.Create(_pipeIndices.Length, 534var idPipe = _pipes[numActive + (int)ExtraIndex.Id] = ShufflePipe.Create(_pipeIndices.Length, RowIdDataViewType.Instance, input.GetIdGetter()); 539_pipeIndex = _circularIndex = _pipeIndices.Length - 1; 586Ch.Assert(0 <= circularIndex && circularIndex < _pipeIndices.Length); 590Ch.Assert(0 <= pipeIndex && pipeIndex < _pipeIndices.Length); 591for (int c = 0; c < _pipes.Length; ++c) 593if (circularIndex == _pipeIndices.Length) 620Ch.Assert(0 <= _circularIndex && _circularIndex < _pipeIndices.Length); 622if (++_circularIndex == _pipeIndices.Length) 659int circularSwapIndex = (_rand.Next(Math.Min(_liveCount, _poolRows)) + _circularIndex) % _pipeIndices.Length; 671Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column)); 678Ch.Assert(0 <= col && col < _colToActivesIndex.Length); 685Ch.Assert(0 <= col && col < _colToActivesIndex.Length); 714Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column));
Transforms\RowToRowTransformerBase.cs (1)
85int n = OutputColumns.Value.Length;
Transforms\SlotsDroppingTransformer.cs (54)
83Slots = new Range[strs.Length]; 84for (int i = 0; i < strs.Length; i++) 218Slots = (slots.Length > 0) ? slots : new (int min, int? max)[1]; 293var size = ColumnPairs.Length; 300SlotsMax[i] = ctx.Reader.ReadIntArray(SlotsMin[i].Length); 343for (int i = 0; i < ColumnPairs.Length; i++) 345Host.Assert(SlotsMin[i].Length == SlotsMax[i].Length); 353slotsMin = new int[col.Slots.Length]; 354slotsMax = new int[col.Slots.Length]; 355for (int j = 0; j < col.Slots.Length; j++) 367for (int j = 1; j < col.Slots.Length; j++) 382slotsMin = new int[columns.Length][]; 383slotsMax = new int[columns.Length][]; 384for (int i = 0; i < columns.Length; i++) 387slotsMin[i] = new int[slots.Length]; 388slotsMax[i] = new int[slots.Length]; 389for (int j = 0; j < slots.Length; j++) 400for (int j = 1; j < slots.Length; j++) 422if (slotsMin.Length != slotsMax.Length) 424for (int iinfo = 0; iinfo < slotsMin.Length; iinfo++) 427for (int i = 0; i < slotsMin[iinfo].Length; i++) 473_cols = new int[_parent.ColumnPairs.Length]; 474_srcTypes = new DataViewType[_parent.ColumnPairs.Length]; 475_dstTypes = new DataViewType[_parent.ColumnPairs.Length]; 476_slotDropper = new SlotDropper[_parent.ColumnPairs.Length]; 477_suppressed = new bool[_parent.ColumnPairs.Length]; 478_categoricalRanges = new int[_parent.ColumnPairs.Length][]; 480for (int i = 0; i < _parent.ColumnPairs.Length; i++) 525Host.Assert(slotsMin.Length == slotsMax.Length); 526Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 533suppressed = slotsMin.Length > 0 && slotsMin[0] == 0; 552Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 570Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 572Host.Assert(slotsMax.Length == slotsMin.Length); 574Contracts.Assert(catRanges.Length > 0 && catRanges.Length % 2 == 0); 576var ranges = new int[catRanges.Length]; 598while (dropSlotsIndex < slotsMin.Length && rangesIndex < ranges.Length) 681Contracts.Assert(rangesIndex < ranges.Length - 1); 694for (int i = rangesIndex; i < ranges.Length; i++) 699Contracts.Assert(0 <= droppedSlotsCount && droppedSlotsCount <= slotsMax[slotsMax.Length - 1] + 1); 722Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 741Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 762Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 783Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 810Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 826var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 827for (int i = 0; i < _parent.ColumnPairs.Length; i++) 883for (int iinfo = 0; iinfo < _cols.Length; ++iinfo)
Transforms\TransformBase.cs (21)
337var names = new string[column.Length]; 338var infos = new ColInfo[column.Length]; 339for (int i = 0; i < names.Length; i++) 421ctx.Writer.Write(Infos.Length); 447return Input.Where(col => col.Index < active.Length && active[col.Index]); 508Metadata = new MetadataDispatcher(Infos.Length); 522Metadata = new MetadataDispatcher(Infos.Length); 536Metadata = new MetadataDispatcher(Infos.Length); 560Metadata = new MetadataDispatcher(Infos.Length); 581for (int iinfo = 0; iinfo < Infos.Length; ++iinfo) 608for (int iinfo = 0; iinfo < Infos.Length; ++iinfo) 662Host.Assert(0 <= iinfo && iinfo < Infos.Length); 670Host.Assert(0 <= iinfo && iinfo < Infos.Length); 682Host.Assert(0 <= iinfo && iinfo < Infos.Length); 697Host.Assert(0 <= iinfo && iinfo < Infos.Length); 756if (inputs.Length == 1 && n > 1 && WantParallelCursors(predicate)) 760var cursors = new DataViewRowCursor[inputs.Length]; 762for (int i = 0; i < inputs.Length; i++) 857Ch.Assert(active == null || active.Length == parent._bindings.ColumnCount); 861_getters = new Delegate[parent.Infos.Length]; 865for (int iinfo = 0; iinfo < _getters.Length; iinfo++)
Transforms\TypeConverting.cs (11)
220for (int i = 0; i < _columns.Length; i++) 253var columnsLength = ColumnPairs.Length; 302var cols = new TypeConvertingEstimator.ColumnOptions[options.Columns.Length]; 303for (int i = 0; i < cols.Length; i++) 396_types = new DataViewType[_parent._columns.Length]; 397_srcCols = new int[_parent._columns.Length]; 398for (int i = 0; i < _parent._columns.Length; i++) 436var result = new DataViewSchema.DetachedColumn[_parent._columns.Length]; 437for (int i = 0; i < _parent._columns.Length; i++) 470Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 481for (int iinfo = 0; iinfo < _parent._columns.Length; ++iinfo)
Transforms\ValueMapping.cs (10)
216var editor = VBufferEditor.Create(ref dst, keys.Length); 217for (int i = 0; i < keys.Length; i++) 307dataViewBuilder.AddColumn(valueColumnName, GetKeyValueGetter(metaKeys), (ulong)metaKeys.Length, indices); 312dataViewBuilder.AddColumn(valueColumnName, GetKeyValueGetter(metaKeys), (ulong)metaKeys.Length, indices); 755int cb = rdr.Read(rgb, 0, rgb.Length); 756ectx.CheckDecode(cb == rgb.Length); 1051Host.Assert(0 <= iinfo && iinfo < _columns.Length); 1063for (int iinfo = 0; iinfo < _parent.ColumnPairs.Length; ++iinfo) 1280var result = new DataViewSchema.DetachedColumn[_columns.Length]; 1281for (int i = 0; i < _columns.Length; i++)
Transforms\ValueToKeyMappingTransformer.cs (34)
231var infos = new ColInfo[ColumnPairs.Length]; 232for (int i = 0; i < ColumnPairs.Length; i++) 258_textMetadata = new bool[_unboundMaps.Length]; 259for (int iinfo = 0; iinfo < columns.Length; ++iinfo) 261ch.Assert(_unboundMaps.Length == columns.Length); 274var cols = new ValueToKeyMappingEstimator.ColumnOptions[options.Columns.Length]; 286for (int i = 0; i < cols.Length; i++) 322var columnsLength = ColumnPairs.Length; 525var termMap = new TermMap[infos.Length]; 526int[] lims = new int[infos.Length]; 530for (int iinfo = 0; iinfo < infos.Length; iinfo++) 537if (!terms.IsEmpty || (termsArray != null && termsArray.Length > 0)) 595for (int iinfo = 0; iinfo < infos.Length; ++iinfo) 604ch.Assert(itrainer == trainer.Length); 617while (tmin < trainer.Length && cursor.MoveNext()) 621for (int t = tmin; t < trainer.Length; ++t) 633for (itrainer = 0; itrainer < trainer.Length; ++itrainer) 661Host.Assert(_unboundMaps.Length == _textMetadata.Length); 662Host.Assert(_textMetadata.Length == ColumnPairs.Length); 679c.Writer.Write(_unboundMaps.Length); 695Contracts.Assert(0 <= iinfo && iinfo < _unboundMaps.Length); 721_types = new DataViewType[_parent.ColumnPairs.Length]; 722for (int i = 0; i < _parent.ColumnPairs.Length; i++) 733_termMap = new BoundTermMap[_parent.ColumnPairs.Length]; 734for (int iinfo = 0; iinfo < _parent.ColumnPairs.Length; ++iinfo) 742var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 743for (int i = 0; i < _parent.ColumnPairs.Length; i++) 759Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 906for (int iinfo = 0; iinfo < _infos.Length; ++iinfo) 931for (int iinfo = 0; iinfo < _infos.Length; ++iinfo) 956Contracts.Assert(0 <= iinfo && iinfo < _infos.Length);
Transforms\ValueToKeyMappingTransformerImpl.cs (3)
454env.Assert(0 <= iinfo && iinfo < infos.Length); 827_host.Assert(0 <= iinfo && iinfo < infos.Length); 839host.Assert(0 <= iinfo && iinfo < infos.Length);
Utilities\ComponentCreation.cs (2)
295if (classes.Length == 0) 297if (classes.Length > 1)
Utilities\SlotDropper.cs (13)
44Contracts.CheckParam(slotsMin.Length == slotsMax.Length, 52Contracts.Check(SlotsMin.Length == _lengthReduction.Length); 70int[] lengthReduction = new int[SlotsMax.Length]; 73for (int i = 0; i < SlotsMax.Length; i++) 131for (int i = 0; i < SlotsMax.Length && iSrc < src.Length; i++) 194while (++iRange < SlotsMax.Length && SlotsMax[iRange] < index) 196if (SlotsMax.Length - iRange >= threshold1 && 199iRange = SlotsMax.FindIndexSorted(iRange + threshold2, SlotsMax.Length, index); 200Contracts.Assert(iRange == SlotsMax.Length || 205if (iRange < SlotsMax.Length) 224for (int i = 1; i < SlotsMin.Length; i++)
Utilities\StreamUtils.cs (5)
105for (int i = 0; i < files.Length; i++) 113for (var i = subs.Length - 1; i >= 0; i--) 136for (int i = 0; i < files.Length; i++) 204if ((uint)count > buffer.Length - offset) 213Debug.Assert(minimumBytes <= buffer.Length);
Utils\SequencePool.cs (22)
131Contracts.Assert(_buckets.Length == _mask + 1); 235if (_idLim + 1 >= _start.Length) 237Contracts.Check(_start.Length != Utils.ArrayMaxSize, "Cannot allocate memory for the sequence pool"); 238Contracts.Assert(_idLim + 1 == _start.Length); 239long newSize = (long)_start.Length + _start.Length / 2; 244Contracts.Assert(_hash.Length >= _next.Length); 245if (_idLim >= _next.Length) 247Contracts.Check(_next.Length != Utils.ArrayMaxSize, "Cannot allocate memory for the sequence pool"); 248Contracts.Assert(_idLim == _next.Length); 249long newSize = (long)_next.Length + _next.Length / 2; 257if (ibLim > _bytes.Length - cbMax) 259Contracts.Check(_bytes.Length != Utils.ArrayMaxSize, "Cannot allocate memory for the sequence pool"); 260long newSize = Math.Max((long)_bytes.Length + _bytes.Length / 2, ibLim + cbMax); 264Contracts.Assert(_idLim < _next.Length); 265Contracts.Assert(ibLim <= _bytes.Length - cbMax); 275if (_idLim >= _buckets.Length) 285int size = checked(2 * _buckets.Length); 309Contracts.Assert(bytes.Length >= ib + 5 * (lim - min));
Microsoft.ML.DataView (7)
DataViewSchema.cs (6)
27public int Count => _columns.Length; 52if (!(0 <= columnIndex && columnIndex < _columns.Length)) 198Debug.Assert(schema.Count == getters.Length); 223if (column.Index >= _getters.Length) 436for (int i = 0; i < columns.Length; i++) 454for (int i = 0; i < _columns.Length; i++)
src\Microsoft.ML.Core\Utilities\ArrayUtils.cs (1)
18return x == null ? 0 : x.Length;
Microsoft.ML.Ensemble (88)
EntryPoints\CreateEnsemble.cs (6)
101for (int i = 0; i < input.Models.Length; i++) 366if (dataZipEntryNames.Length != dataSerialized.Length) 383ch.Check(dataSerialized.Length == Utils.Size(entries)); 385for (int i = 0; i < dataSerialized.Length; i++) 388int len = dataSerialized[i].Length;
EntryPoints\PipelineEnsemble.cs (3)
47var summaries = new IDataView[ensemble.PredictorModels.Length]; 48var stats = new IDataView[ensemble.PredictorModels.Length]; 49for (int i = 0; i < ensemble.PredictorModels.Length; i++)
OutputCombiners\BaseAverager.cs (2)
55for (int i = 0; i < src.Length; i++) 66for (int i = 0; i < src.Length; i++)
OutputCombiners\BaseMultiAverager.cs (3)
47weightTotal = src.Length; 48for (int i = 0; i < src.Length; i++) 54for (int i = 0; i < src.Length; i++)
OutputCombiners\BaseMultiCombiner.cs (1)
86for (int i = 0; i < values.Length; i++)
OutputCombiners\BaseScalarStacking.cs (1)
27int len = src.Length;
OutputCombiners\BaseStacking.cs (4)
136for (int i = 0; i < maps.Length; i++) 179TOutput[] predictions = new TOutput[maps.Length]; 180var vBuffers = new VBuffer<Single>[maps.Length]; 183Parallel.For(0, maps.Length, i =>
OutputCombiners\Median.cs (1)
85dst = MathUtils.GetMedianInPlace(src, src.Length);
OutputCombiners\MultiMedian.cs (1)
86int count = src.Length;
OutputCombiners\MultiStacking.cs (2)
86for (int i = 0; i < src.Length; i++) 92for (int i = 0; i < src.Length; i++)
OutputCombiners\Voting.cs (1)
84for (int i = 0; i < src.Length; i++)
PipelineEnsemble.cs (21)
52for (int i = 0; i < Parent._inputCols.Length; i++) 61Mappers = new ISchemaBoundRowMapper[Parent.PredictorModels.Length]; 62BoundPipelines = new IRowToRowMapper[Parent.PredictorModels.Length]; 63ScoreCols = new int[Parent.PredictorModels.Length]; 64for (int i = 0; i < Mappers.Length; i++) 134var getters = new ValueGetter<T>[Mappers.Length]; 135for (int i = 0; i < Mappers.Length; i++) 151var buffer = new T[Mappers.Length]; 155for (int i = 0; i < Mappers.Length; i++) 164Parent.Host.Assert(0 <= i && i < Mappers.Length); 176Parent.Host.Assert(0 <= i && i < Mappers.Length); 414for (int i = 0; i < predictors.Length; i++) 443Host.Check(nonHiddenCols == _inputCols.Length, 467for (int i = 0; i < PredictorModels.Length; i++) 500ctx.Writer.Write(PredictorModels.Length); 502for (int i = 0; i < PredictorModels.Length; i++) 510ctx.Writer.Write(_inputCols.Length); 571for (int i = 0; i < PredictorModels.Length; i++) 631for (int i = 1; i < models.Length; i++) 655for (int i = 1; i < models.Length; i++) 708for (int i = 0; i < PredictorModels.Length; i++)
Selector\DiversityMeasure\BaseDisagreementDiversityMeasure.cs (1)
29for (int k = 0; k < modelXOutputs.Length; k++)
Trainer\EnsembleDistributionModelParameters.cs (12)
86mappers = new IValueMapperDist[Models.Length]; 88for (int i = 0; i < Models.Length; i++) 147var predictions = new Single[_mappers.Length]; 148var probabilities = new Single[_mappers.Length]; 149var vBuffers = new VBuffer<Single>[_mappers.Length]; 157Parallel.For(0, maps.Length, i => 185var predictions = new Single[_mappers.Length]; 186var probabilities = new Single[_mappers.Length]; 187var vBuffers = new VBuffer<Single>[_mappers.Length]; 195Parallel.For(0, maps.Length, i => 218var maps = new ValueMapper<VBuffer<Single>, Single, Single>[_mappers.Length]; 219for (int i = 0; i < _mappers.Length; i++)
Trainer\EnsembleModelParameters.cs (7)
76mappers = new IValueMapper[Models.Length]; 78for (int i = 0; i < Models.Length; i++) 136var predictions = new Single[_mappers.Length]; 137var buffers = new VBuffer<Single>[_mappers.Length]; 138var maps = new ValueMapper<VBuffer<Single>, Single>[_mappers.Length]; 139for (int i = 0; i < _mappers.Length; i++) 149Parallel.For(0, maps.Length, i =>
Trainer\EnsembleModelParametersBase.cs (6)
33Host.Check(weights == null || weights.Length == models.Length); 104ctx.Writer.Write(Models.Length); 108for (int i = 0; i < Models.Length; i++) 134for (int i = 0; i < Models.Length; i++) 148for (int i = 0; i < Models.Length; i++)
Trainer\EnsembleTrainerBase.cs (9)
88(predictorFactories.Length == 1 ? DefaultNumModels : predictorFactories.Length); 98for (int i = 0; i < Trainers.Length; i++) 99Trainers[i] = predictorFactories[i % predictorFactories.Length].CreateComponent(Host); 144ch.Info("Training {0} learners for the batch {1}", Trainers.Length, batchNumber++); 145var batchModels = new FeatureSubsetModel<TOutput>[Trainers.Length]; 151ch.Info("Beginning training model {0} of {1}", index + 1, Trainers.Length); 170index + 1, Trainers.Length, ex.Message); 172ch.Info("Trainer {0} of {1} finished in {2}", index + 1, Trainers.Length, sw.Elapsed);
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (7)
67mappers = new IValueMapper[Models.Length]; 70for (int i = 0; i < Models.Length; i++) 116var features = new VBuffer<Single>[_mappers.Length]; 117var predictions = new VBuffer<Single>[_mappers.Length]; 118var maps = new ValueMapper<VBuffer<Single>, VBuffer<Single>>[_mappers.Length]; 119for (int i = 0; i < _mappers.Length; i++) 134Parallel.For(0, maps.Length, i =>
Microsoft.ML.EntryPoints (22)
CrossValidationMacro.cs (3)
373if (variableSizeVectorColumnNames.Length > 0) 385overall = EvaluateUtils.CombineFoldMetricsDataViews(env, overall, input.OverallMetrics.Length); 392for (int i = 0; i < input.ConfusionMatrix.Length; i++)
JsonUtils\ExecuteGraphCommand.cs (2)
192for (int i = 0; i < array.Length; i++) 201for (int i = 0; i < array.Length; i++)
MacroUtils.cs (2)
129for (int i = 0; i < predModelVars.Length; i++) 152for (int i = 0; i < vars.Length; i++)
ModelOperations.cs (4)
92TransformModel model = input.Models[input.Models.Length - 1]; 93for (int i = input.Models.Length - 2; i >= 0; i--) 108TransformModel model = input.TransformModels[input.TransformModels.Length - 1]; 109for (int i = input.TransformModels.Length - 2; i >= 0; i--)
PermutationFeatureImportance.cs (10)
105Contracts.Assert(slotNames.Length == permutationMetrics.Length, 162Contracts.Assert(slotNames.Length == permutationMetrics.Length, 192ConvertVectorToKnownSize(nameof(metric.PerClassLogLoss), metric.PerClassLogLoss.Length, ref schema); 193ConvertVectorToKnownSize(nameof(metric.PerClassLogLossStdErr), metric.PerClassLogLossStdErr.Length, ref schema); 221Contracts.Assert(slotNames.Length == permutationMetrics.Length, 275Contracts.Assert(slotNames.Length == permutationMetrics.Length, 297ConvertVectorToKnownSize(nameof(metric.DiscountedCumulativeGains), metric.DiscountedCumulativeGains.Length, ref schema); 298ConvertVectorToKnownSize(nameof(metric.NormalizedDiscountedCumulativeGains), metric.NormalizedDiscountedCumulativeGains.Length, ref schema); 299ConvertVectorToKnownSize(nameof(metric.DiscountedCumulativeGainsStdErr), metric.DiscountedCumulativeGainsStdErr.Length, ref schema); 300ConvertVectorToKnownSize(nameof(metric.NormalizedDiscountedCumulativeGainsStdErr), metric.NormalizedDiscountedCumulativeGainsStdErr.Length, ref schema);
ScoreColumnSelector.cs (1)
77if (labelNames != null && labelNames.Length == 2)
Microsoft.ML.FastTree (488)
BinFile\BinFinder.cs (7)
68Contracts.Assert(valueBuffer.Length >= explicitValuesCount); 136Contracts.Assert(0 <= numValues && numValues <= distinctValues.Length); 137Contracts.Assert(numValues <= counts.Length); 162for (int i = 1; i < binUpperBounds.Length; i++) 164binUpperBounds[binUpperBounds.Length - 1] = double.PositiveInfinity; 173for (int i = 1; i < binUpperBounds.Length; i++) 175binUpperBounds[binUpperBounds.Length - 1] = double.PositiveInfinity;
Dataset\Dataset.cs (45)
54_flockToFirstFeature = new int[_flocks.Length]; 55if (_flocks.Length > 0) 57for (int i = 1; i < _flocks.Length; ++i) 62var lastFlock = _flocks[_flocks.Length - 1]; 64int numFeatures = _flockToFirstFeature[_flockToFirstFeature.Length - 1] + lastFlock.Count; 67for (int flock = 0; flock < _flockToFirstFeature.Length; ++flock) 234get { return _flocks.Length; } 242get { return _featureToFlock.Length; } 247Contracts.Assert(0 <= feature && feature < _featureToFlock.Length); 263int numParts = fraction.Length; 298int[] boundaries = new int[uniqueQueryIds.Length + 1]; 301for (int q = 1; q < queryIndices.Length; ++q) 306boundaries[uniqueQueryIds.Length] = queryIndices.Length; 377for (int i = 0; i < docAssignment.Length; ++i) 391Contracts.Assert(activeFeatures == null || activeFeatures.Length >= NumFeatures); 410qdd.Data = Array.CreateInstance(arrayDataType, docArray.Length); 411for (int i = 0; i < docArray.Length; ++i) 461ActualTargets = new double[_ratings.Length]; 462for (int i = 0; i < ActualTargets.Length; i++) 475_docToQuery = new int[docIds.Length]; 476for (int q = 0; q < queryIds.Length; ++q) 507Contracts.Check(Ratings.Length == DocIds.Length, "Length of label array does not match length of docID array"); 508Contracts.Check(Boundaries.Length == QueryIds.Length + 1, "Length of boundaries array does not match length of queryID array"); 509Contracts.Check(Utils.Size(MaxDcg) == 0 || Utils.Size(MaxDcg[0]) == QueryIds.Length, "Length of MaxDCG does not match number of queries"); 530get { return DocIds.Length; } 535get { return QueryIds.Length; } 585int numParts = fraction.Length; 644int numParts = queries.Length; 647int[][] boundaries = queries.Select(q => new int[q.Length + 1]).ToArray(numParts); 651for (int q = 0; q < queries[p].Length; ++q) 683Array newData = Array.CreateInstance(arrayDataType, mapping.Length); 684for (int i = 0; i < mapping.Length; ++i) 712for (int p = 0; p < parts.Length; ++p) 748double[][] maxAtN = Enumerable.Range(0, trunc).Select(x => new double[boundaries.Length - 1]).ToArray(trunc); 749int relevancyLevel = _labelMap.Length; 752for (int q = 0; q < boundaries.Length - 1; ++q) 814DatasetSkeletonQueryDocData[] partsDatas = new DatasetSkeletonQueryDocData[parts.Length]; 819for (int p = 0; p < parts.Length; ++p) 851for (int i = 0; i < lengths.Length; ++i) 869if (array.Length != shouldHaveLength) 873name, array.Length, shouldHaveLength); 959Contracts.Assert(active == null || active.Length == dataset.NumFeatures);
Dataset\DatasetUtils.cs (2)
34short maxLab = ratings.Length > 0 ? ratings.Max() : (short)0; 36ratings.Length, IntArrayType.Dense, IntArrayBits.Bits8, ratings.Select(x => (int)x));
Dataset\DenseIntArray.cs (3)
58return IntArray.New(itemIndices.Length, IntArrayType.Dense, BitsPerItem, itemIndices.Select(x => this[x])); 63int numParts = assignment.Length; 68newArrays[p] = IntArray.New(assignment[p].Length, IntArrayType.Dense, BitsPerItem, assignment[p].Select(x => this[x]));
Dataset\Feature.cs (11)
296if (parts.Length == 1) 298bitsPerItem = IntArray.NumBitsNeeded(parts[0].ValueMap.Length); 307bitsPerItem = IntArray.NumBitsNeeded(concatValueMap.Length); 315int[] binMap = new int[oldValueMap.Length]; 317for (int j = 0; j < oldValueMap.Length; ++j) 333IntArrayBits bitsPerItem = IntArray.NumBitsNeeded(concatValueMap.Length); 338for (int partIndex = 0; partIndex < parts.Length; ++partIndex) 342if (concatValueMap.Length == parts[partIndex].ValueMap.Length) 373int[] binMap = new int[oldValueMap.Length]; 375for (int j = 0; j < oldValueMap.Length; ++j)
Dataset\FeatureFlock.cs (15)
113Contracts.Assert(_active.Length == Flock.Count); 117for (int f = 0; f < _active.Length; ++f) 121Array.Copy(active, featureOffset, _active, 0, _active.Length); 150Contracts.Assert(_active.Length == other._active.Length); 154for (int f = 0; f < _active.Length; ++f) 618catFeatureCount += 1 + binStats.SubFeatures.Length; 840catFeatureCount += 1 + binStats.SubFeatures.Length; 1172Contracts.Assert(Utils.Size(hotFeatureStarts) == binUpperBounds.Length + 1); // One more than number of features. 1175Contracts.Assert(bins.Max() < hotFeatureStarts[hotFeatureStarts.Length - 1]); 1183Contracts.Assert(AllBinUpperBounds.Select((b, f) => HotFeatureStarts[f + 1] - HotFeatureStarts[f] + 1 == b.Length).All(i => i)); 1201return AllBinUpperBounds[featureIndex].Length; 1207+ sizeof(double) * (AllBinUpperBounds.Length - 1 + HotFeatureStarts[HotFeatureStarts.Length - 1]) 1208+ sizeof(int) * HotFeatureStarts.Length;
Dataset\FeatureHistogram.cs (3)
116Array.Clear(SumTargetsByBin, 0, SumTargetsByBin.Length); 121Array.Clear(SumWeightsByBin, 0, SumWeightsByBin.Length); 124Array.Clear(CountByBin, 0, CountByBin.Length);
Dataset\IntArray.cs (2)
232|| featureBin >= histogram.SumTargetsByBin.Length 252|| featureBin >= histogram.SumTargetsByBin.Length
Dataset\NHotFeatureFlock.cs (4)
57if (_flock._deltas.Length > 0) 72if (++_pos < _flock._deltas.Length) 80Contracts.Assert(_pos < _flock._deltas.Length); 92} while (++p < _flock._deltas.Length && _flock._deltas[p] == 0);
Dataset\RepeatIntArray.cs (4)
122for (int i = 0; i < _deltas.Length; ++i) 140if (array._deltas.Length > 0) 188return new DeltaRepeatIntArray(itemIndices.Length, BitsPerItem, itemIndices.Select(i => indexer[i])); 201return new DeltaRepeatIntArray(a.Length, BitsPerItem, a.Select(i => indexer[i]));
Dataset\SegmentIntArray.cs (8)
99SegmentFindOptimalPath.Value(vals, vals.Length, maxbits, out bits, out transitions); 100var b = FromWorkArray(vals, vals.Length, bits, transitions); 199for (int i = 0; i < ivalues.Length; ++i) 250for (int i = ivalues.Length - 1; i >= 0; --i) 269for (int s = 0; s < _segType.Length; ++s) 308return new SegmentIntArray(a.Length, a.Select(i => ind[i])); 321return new SegmentIntArray(itemIndices.Length, itemIndices.Select(i => indexer[i])); 340if (_array._segType.Length > 0)
Dataset\SingletonFeatureFlock.cs (4)
27Contracts.Assert(bins.Length == 0 || bins.Max() < binUpperBounds.Length); 35return _bins.SizeInBytes() + sizeof(double) * _binUpperBounds.Length; 52return _binUpperBounds.Length; 117_hist = new FeatureHistogram(_flock._bins, _flock._binUpperBounds.Length, hasWeights);
Dataset\SparseIntArray.cs (15)
104Contracts.Assert(values.Length == deltas.Length); 194public int DeltaLength => _deltas.Length; 202IntArray[] parts = new IntArray[assignment.Length]; 203for (int i = 0; i < assignment.Length; ++i) 206parts[i] = IntArray.New(assignment[i].Length, IntArrayType.Sparse, BitsPerItem, assignment[i].Select(x => indexer[x])); 221return IntArray.New(itemIndices.Length, IntArrayType.Sparse, BitsPerItem, itemIndices.Select(x => indexer[x])); 347int currentPos = _deltas.Length > 0 ? _deltas[iSparse] : _length; 357if (++iSparse >= _deltas.Length) 377if (++iSparse >= _deltas.Length) 406int currentPos = _deltas.Length > 0 ? _deltas[iSparse] : _length; 417if (++iSparse >= _deltas.Length) 440if (++iSparse >= _deltas.Length) 474SumupCPlusPlusSparse(input, histogram, (byte*)pValues, pDeltas2, _deltas.Length, 535if (_array._deltas.Length > 0) 589for (int i = 0; i < _deltas.Length; ++i)
FastTree.cs (60)
445for (int i = 0; i < TestSets.Length; ++i) 833for (int t = 0; t < TestSets.Length; ++t) 868Contracts.Check(scores.Length == initScores.Length, "Length of initscores and scores mismatch"); 869for (int i = 0; i < scores.Length; i++) 881for (int i = 0; TestSets != null && i < TestSets.Length; i++) 1048for (int i = 1; i < hotFeatureStarts.Length; ++i) 1049hotFeatureStarts[i] = hotFeatureStarts[i - 1] + BinUpperBounds[features[i - 1]].Length - 1; 1050IntArrayBits flockBits = IntArray.NumBitsNeeded(hotFeatureStarts[hotFeatureStarts.Length - 1] + 1); 1060for (int i = 0; i < lastOn.Length; ++i) 1082ch.Assert(bub.Length > 1); 1084ch.Assert(0 < bin && bin < bub.Length); // If 0, should not have been considered "on", so what the heck? 1093for (int f = 0; f < hotFeatureStarts.Length; ++f) 1124for (int i = 1; i < hotFeatureStarts.Length; ++i) 1125hotFeatureStarts[i] = hotFeatureStarts[i - 1] + BinUpperBounds[features[i - 1]].Length - 1; 1126IntArrayBits flockBits = IntArray.NumBitsNeeded(hotFeatureStarts[hotFeatureStarts.Length - 1] + 1); 1135for (int i = 0; i < lastOn.Length; ++i) 1156ch.Assert(bub.Length == 2); 1167for (int f = 0; f < hotFeatureStarts.Length; ++f) 1195ch.Assert(binnedValues.Length == values.Length); 1207var numBitsNeeded = IntArray.NumBitsNeeded(binUpperBounds.Length); 1252double firstBinFrac = (double)firstBinCount / binnedValues.Length; 1254bins = IntArray.New(values.Length, arrayType, IntArray.NumBitsNeeded(binUpperBounds.Length), binnedValues); 1405pch.SetHeader(new ProgressHeader("features"), e => e.SetProgress(0, iFeature, features.Length)); 1413Host.Assert(iFeature < features.Length); 1478for (int i = 0; i < lastOn.Length; ++i) 1486if (catRangeIndex < CategoricalFeatureIndices.Length && 1496if (bup.Length == 1) 1551if (upperBounds.Length == 1) 1566if (upperBounds.Length == 1) 1575FeatureMap = Enumerable.Range(0, NumFeatures).Where(f => BinUpperBounds[f].Length > 1).ToArray(); 1621boundaries = new int[qids.Length + 1]; 1622for (int i = 0; i < qids.Length; ++i) 1627boundaries[boundaries.Length - 1] = numExamples; 1766for (int i = 0; i < _instanceList.Length; i++) 1939ch.Trace("{0} features stored in {1} flocks.", NumFeatures, flocks.Length); 1951for (int i = 1; i < hotFeatureStarts.Length; ++i) 1952hotFeatureStarts[i] = hotFeatureStarts[i - 1] + BinUpperBounds[features[i - 1]].Length - 1; 1953IntArrayBits flockBits = IntArray.NumBitsNeeded(hotFeatureStarts[hotFeatureStarts.Length - 1] + 1); 1976for (int i = 0; i < kvEnums.Length; ++i) 2030for (int f = 0; f < hotFeatureStarts.Length; ++f) 2040FeatureMap = Enumerable.Range(0, NumFeatures).Where(f => BinUpperBounds[f].Length > 1).ToArray(); 2045Contracts.Assert(iFeature + flock.Count <= FeatureMap.Length); 2047int lim = iFeature + flock.Count == FeatureMap.Length 2056ch.Assert(iFeature == FeatureMap.Length); 2080if (bup.Length == 1) // Trivial. 2096for (int i = 0; i < lastOn.Length; ++i) 2102if (catRangeIndex < CategoricalFeatureIndices.Length) 2112if (bup.Length == 1) 2188for (int i = 0; i < lastOn.Length; ++i) 2232if (bup.Length == 1) 2239if (countBins > Utils.ArrayMaxSize - (bup.Length - 1)) 2252countBins += bup.Length - 1; 2558IntArrayBits numBitsNeeded = IntArray.NumBitsNeeded(binUpperBounds.Length); 2646Contracts.Assert(0 <= featureIndex && featureIndex < _featureIndices.Length); 2696Contracts.Assert(Utils.IsIncreasing(0, features, values.Length)); 2700Utils.EnsureSize(ref workArray, _featureIndices.Length, keepOld: false); 2703Array.Clear(_perFeaturePosition, 0, _featureIndices.Length); 2705_lastRow = new int[features.Length]; 2706for (int i = 0; i < _lastRow.Length; ++i)
FastTreeClassification.cs (1)
279for (int t = 0; t < TestSets.Length; ++t)
FastTreeRanking.cs (11)
135return GetLabelGains().Length - 1; 147var maxLabel = GetLabelGains().Length - 1; 175if (gains.Length < 5) 179gains.Length); 290for (int t = 0; TestSets != null && t < TestSets.Length; ++t) 583int relevancyLevel = DcgCalculator.LabelGainMap.Length; 685if (dupeIds == null || dupeIds.Length == 0) 824pScores[i] = pScores[i] * (1.0 - pLabels[i] * 1.0 / (20.0 * Dataset.DatasetSkeleton.LabelGainMap.Length)); 842pSigmoidTable, _minScore, _maxScore, _sigmoidTable.Length, _scoreToSigmoidTableFactor, 992Contracts.Assert(scores.Length - numDocs >= shift); 993Contracts.Assert(labels.Length - numDocs >= shift);
FastTreeRegression.cs (4)
177Contracts.Assert(dlabels.Length == set.NumDocs); 179return dlabels.Select(x => (float)x).ToArray(dlabels.Length); 224for (int t = 0; t < TestSets.Length; ++t) 280if (FastTreeTrainerOptions.PrintTrainValidGraph && _testRegressionTest == null && TestSets != null && TestSets.Length > 0)
FastTreeTweedie.cs (5)
190Contracts.Assert(dlabels.Length == set.NumDocs); 192return Utils.BuildArray(dlabels.Length, i => (float)dlabels[i]); 230for (int t = 0; t < TestSets.Length; ++t) 259if (FastTreeTrainerOptions.PrintTrainValidGraph && _testRegressionTest == null && TestSets != null && TestSets.Length > 0) 390for (int i = 0; i < _labels.Length; ++i)
GamClassification.cs (5)
120bool[] boolArray = new bool[targets.Length]; 121int innerLoopSize = 1 + targets.Length / BlockingThreadPool.NumThreads; 122var actions = new Action[(int)Math.Ceiling(1.0 * targets.Length / innerLoopSize)]; 124for (int d = 0; d < targets.Length; d += innerLoopSize) 127var toDoc = Math.Min(d + innerLoopSize, targets.Length);
GamModelParameters.cs (34)
69Host.CheckParam(binUpperBounds.Length == binEffects.Length, nameof(binUpperBounds), "Must have same number of features as binEffects"); 70Host.CheckParam(binEffects.Length > 0, nameof(binEffects), "Must have at least one entry"); 72Host.CheckParam(shapeToInputMap == null || shapeToInputMap.Length == binEffects.Length, nameof(shapeToInputMap), "Must have same number of features as binEffects"); 78NumberOfShapeFunctions = binEffects.Length; 89Host.CheckParam(binUpperBounds[i].Length == binEffects[i].Length, nameof(binEffects), "Array contained wrong number of effect values"); 104_inputFeatureToShapeFunctionMap = new Dictionary<int, int>(_shapeToInputMap.Length); 105for (int i = 0; i < _shapeToInputMap.Length; i++) 142_binUpperBounds[i] = reader.ReadDoubleArray(_binEffects[i].Length); 177int diff = _binEffects.Sum(e => e.Take(e.Length - 1).Select((ef, i) => ef != e[i + 1] ? 1 : 0).Sum()); 178int bound = _binEffects.Sum(e => e.Length - 1); 183Host.Assert(_binUpperBounds[i].Length == _binEffects[i].Length); 291var binUpperBounds = new double[_binUpperBounds[j].Length]; 307binUpperBounds[i] = new double[_binUpperBounds[j].Length]; 329var binEffects = new double[_binEffects[j].Length]; 345binEffects[i] = new double[_binEffects[j].Length]; 392for (int i = 0; i < effects.Length; ++i) 446Host.Check(effects.Length == binThresholds.Length, "Effects array must be same length as binUpperBounds array."); 447var numLeaves = effects.Length; 4890, binIndices.Length - 1, internalNodeIndices, lteChild, gtChild, ref internalNodeId); 643var numFeatures = _pred._binEffects.Length; 647var binDocList = new List<int>[_pred._binEffects[f].Length]; 648for (int e = 0; e < _pred._binEffects[f].Length; e++) 675ch.Assert(_scores.Length == _labels.Length); 676if (_labels.Length > 0 && eval != null) 701if (bin < 0 || bin > effects.Length) 820UpperBounds = up.Take(up.Length - 1); 826if (catsMap != null && index < catsMap[catsMap.Length - 1]) 828for (int i = 0; i < catsMap.Length; i += 2)
GamTrainer.cs (12)
264Host.Assert(FeatureMap == null || FeatureMap.Length == TrainSet.NumFeatures); 362_leafSplitCandidates.Targets.Length, sumTargets, sumWeights, 405for (int featureIndex = 0; featureIndex < _subGraph.Splits.Length; featureIndex++) 497var meanEffects = new double[BinEffects.Length]; 503for (int featureIndex = 0; featureIndex < BinEffects.Length; featureIndex++) 526for (int featureIndex = 0; featureIndex < BinEffects.Length; featureIndex++) 533for (int bin = 0; bin < BinEffects[featureIndex].Length; ++bin) 553for (int j = 0; j < BinEffects[i].Length; j++) 564newBinBoundaries.Add(binUpperBound[BinEffects[i].Length - 1]); 565newBinEffects.Add(BinEffects[i][BinEffects[i].Length - 1]); 585_histogram = new SufficientStatsBase[TrainSet.Flocks.Length]; 586for (int i = 0; i < TrainSet.Flocks.Length; i++)
RandomForestRegression.cs (18)
57Contracts.Check(weights == null || weights.Length == data.Length, "weights"); 76if (_data.Length == 0) 79if (p == 0 || _data.Length == 1) 82return _data[_data.Length - 1]; 89if (h >= _data.Length) 90return _data[_data.Length - 1]; 101float weightedLength = _data.Length; 107_weightedSums = new float[_weights.Length]; 109for (int i = 1; i < _weights.Length; i++) 113weightedLength = _weightedSums[_weightedSums.Length - 1]; 135for (int i = 0; i < _data.Length; i++) 140for (int i = 0; i < _data.Length; i++) 253var editor = VBufferEditor.Create(ref dst, quantiles.Length); 254for (int i = 0; i < quantiles.Length; i++) 527Contracts.Assert(_labels.Length == trainData.NumDocs); 551for (int i = 0; i < _labels.Length; ++i) 572for (int i = 0; i < _labels.Length; ++i)
SumupPerformanceCommand.cs (9)
156pch.SetHeader(new ProgressHeader("arrays"), e => e.SetProgress(0, created, arrays.Length)); 175ParallelEnumerable.Range(0, arrays.Length).ForAll(i => 273arrays.Select(bins => new FeatureHistogram(bins, _bins, false)).ToArray(arrays.Length); 275ch.Info("Created {0} int arrays taking {1} bytes", arrays.Length, bytes); 289for (int t = 0; t < threadPool.Length; ++t) 296for (int s = 0; s < partitionProportion.Length; s++) 300for (int f = w; ; f = f + threadPool.Length < arrays.Length ? f + threadPool.Length : w)
Training\Applications\GradientWrappers.cs (5)
50double[] weightedTargets = new double[gradient.Length]; 52for (int i = 0; i < gradient.Length; ++i) 70double[] weightedTargets = new double[gradient.Length]; 71double[] weights = new double[gradient.Length]; 73for (int i = 0; i < gradient.Length; ++i)
Training\BaggingProvider.cs (1)
129Array.Copy(tmpTrainQueryIndices, currentTrainQueryIndices, currentTrainQueryIndices.Length);
Training\DcgCalculator.cs (7)
37for (int i = 0; i < DiscountMap.Length; i++) 102double[] maxDcg = new double[boundaries.Length - 1]; 104for (int q = 0; q < boundaries.Length - 1; ++q) 127Array.Clear(labelCounts, 0, LabelMap.Length); 135int topLabel = LabelMap.Length - 1; 364int truncation = dataset.MaxDcg.Length; 413int truncation = maxDcg.Length;
Training\DocumentPartitioning.cs (10)
101.Select(leaf => Enumerable.Range(0, perChunkDocumentLists.Length) 110Contracts.Assert(_documents.Length == _leafBegin[tree.NumLeaves - 1] + _leafCount[tree.NumLeaves - 1]); 119for (int chunkIndex = 0; chunkIndex < perChunkDocumentLists.Length; chunkIndex++) 138get { return _documents.Length; } 151Array.Clear(_leafCount, 0, _leafCount.Length); 153_leafCount[0] = _documents.Length; 156for (int d = 0; d < _documents.Length; ++d) 161for (int d = 0; d < _documents.Length; ++d) 206_tempDocuments = new int[_documents.Length]; 252_tempDocuments = new int[_documents.Length];
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (1)
137int length = scores.Length;
Training\OptimizationAlgorithms\GradientDescent.cs (7)
43_droppedScores = new double[TrainingScores.Scores.Length]; 45Array.Clear(_droppedScores, 0, _droppedScores.Length); 47_scores = new double[TrainingScores.Scores.Length]; 51_numberOfDroppedTrees = droppedTrees.Length; 56_numberOfDroppedTrees = droppedTrees.Length; 63for (int j = 0; j < _droppedScores.Length; j++) 70for (int j = 0; j < _scores.Length; j++)
Training\ScoreTracker.cs (6)
44if (Scores == null || Scores.Length != scores1.Scores.Length) 50Array.Copy(scores1.Scores, Scores, Scores.Length); 64Array.Clear(Scores, 0, Scores.Length); 68if (initScores.Length != Dataset.NumDocs) 90for (int i = 0; i < Scores.Length; ++i)
Training\Test.cs (8)
348Contracts.Check(scoreTracker.Dataset.NumDocs == labels.Length, "Mismatch between dataset and labels"); 357for (int i = 0; i < ndcg.Length; i++) 528Contracts.Check(scoreTracker.Dataset.NumDocs == _labels.Length, "Mismatch between dataset and labels"); 602Contracts.Check(scoreTracker.Dataset.NumDocs == binaryLabels.Length, "Mismatch between dataset and labels"); 616int chunkSize = 1 + binaryLabels.Length / BlockingThreadPool.NumThreads; // Minimizes the number of repeat computations in sparse array to have each thread take as big a chunk as possible 619var actions = new Action[(int)Math.Ceiling(1.0 * binaryLabels.Length / chunkSize)]; 621for (int documentStart = 0; documentStart < binaryLabels.Length; documentStart += chunkSize) 624var endDoc = Math.Min(documentStart + chunkSize - 1, binaryLabels.Length - 1);
Training\TreeLearners\FastForestLeastSquaresTreeLearner.cs (1)
58for (int i = 1; i < infos.Length; ++i)
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (14)
468for (int flock = 0; flock < leafSplitCandidates.FlockToBestFeature.Length; ++flock) 477for (int f = 1; f < infos.Length; ++f) 529for (int i = 0; i < smallStats.IsSplittable.Length; ++i) 535Array.Copy(ParentHistogramArray[flock].IsSplittable, smallStats.IsSplittable, smallStats.IsSplittable.Length); 896+ SplitInfo.SizeInBytes(maxCatSplitPoints) * FeatureSplitInfo.Length 897+ sizeof(int) * _docIndices.Length 898+ sizeof(FloatType) * Targets.Length 1007_numDocsInLeaf = targets.Length; 1075for (int f = 0; f < FeatureSplitInfo.Length; f++) 1082for (int f = 0; f < FlockToBestFeature.Length; ++f) 1135Contracts.Check(0 <= offset && offset + size <= buffer.Length); 1152Contracts.Check(CategoricalSplitRange.Length == 2); 1162Contracts.Check(0 <= offset && offset + size <= buffer.Length); 1180Contracts.Check(CategoricalSplitRange.Length == 2);
TreeEnsemble\InternalQuantileRegressionTree.cs (3)
81Contracts.Check(sampleCount == _labelsDistribution.Length / NumLeaves, "Bad quantile sample count"); 82Contracts.Check(_instanceWeights == null || sampleCount == _instanceWeights.Length / NumLeaves, "Bad quantile weight count"); 116var sampleCountPerLeaf = _labelsDistribution != null ? _labelsDistribution.Length / NumLeaves : 1;
TreeEnsemble\InternalRegressionTree.cs (56)
134Contracts.Assert(indices.Length <= NumNodes); 151Contracts.Assert(indices.Length <= NumNodes); 210CategoricalSplitFeatureRanges = new int[CategoricalSplitFeatures.Length][]; 211for (int i = 0; i < CategoricalSplitFeatures.Length; ++i) 213if (CategoricalSplitFeatures[i] != null && CategoricalSplitFeatures[i].Length > 0) 283if (categoricalNodeIndices?.Length > 0) 377Contracts.Assert(CategoricalSplit.Length >= NumNodes); 394CategoricalSplitFeatures[indexLocal].Length > 0); 397CategoricalSplitFeatureRanges[indexLocal].Length == 2); 443checker(GtChild != null && GtChild.Length == numMaxNodes, "bad gtchild"); 444checker(LteChild != null && LteChild.Length == numMaxNodes, "bad ltechild"); 445checker(SplitFeatures != null && SplitFeatures.Length == numMaxNodes, "bad split feature length"); 447(CategoricalSplit.Length == numMaxNodes || CategoricalSplit.Length == NumNodes), "bad categorical split length"); 452(CategoricalSplitFeatures.Length == NumNodes || 453CategoricalSplitFeatures.Length == numMaxNodes), 457(CategoricalSplitFeatureRanges.Length == NumNodes || 458CategoricalSplitFeatureRanges.Length == numMaxNodes), 461checker(CategoricalSplitFeatureRanges.All(x => x == null || x.Length == 0 || x.Length == 2), 464for (int index = 0; index < CategoricalSplit.Length; index++) 469checker(CategoricalSplitFeatures[index].Length > 0, 475checker(CategoricalSplitFeatureRanges[index].Length == 2, 479for (int featureIndex = 0; featureIndex < CategoricalSplitFeatures[index].Length; featureIndex++) 496checker(Utils.Size(Thresholds) == 0 || Thresholds.Length == numMaxNodes, "bad threshold length"); 497checker(Utils.Size(RawThresholds) == 0 || RawThresholds.Length == NumLeaves - 1, "bad rawthreshold length"); 500checker(Utils.Size(_splitGain) == 0 || _splitGain.Length == numMaxNodes, "bad splitgain length"); 501checker(Utils.Size(_gainPValue) == 0 || _gainPValue.Length == numMaxNodes, "bad gainpvalue length"); 502checker(Utils.Size(_previousLeafValue) == 0 || _previousLeafValue.Length == numMaxNodes, "bad previous leaf value length"); 503checker(LeafValues != null && LeafValues.Length == numMaxLeaves, "bad leaf value length"); 517CategoricalSplit.Length * sizeof(bool) + 534CategoricalSplit.Length.ToByteArray(buffer, ref position); 541for (int i = 0; i < CategoricalSplitFeatures.Length; i++) 558if (LeafValues.Length != tree.LeafValues.Length) 563for (int node = 0; node < LeafValues.Length; ++node) 565if (node < LeafValues.Length - 1 && 613public int MaxNumLeaves => LeafValues.Length; 618public int MaxNumNodes => LteChild.Length; 675for (int node = 0; node < LeafValues.Length; ++node) 684for (int i = 0; i < LeafValues.Length; ++i) 948if (CategoricalSplitFeatures[node].TryFindIndexSorted(0, CategoricalSplitFeatures[node].Length, index, out int ii)) 1115uint numBins = (uint)dataset.Flocks[flock].BinUpperBounds(subfeature).Length; 1136Contracts.Assert(0 <= SplitFeatures[n] && SplitFeatures[n] < oldToNewFeatures.Length); 1142(CategoricalSplitFeatureRanges[n].Length == 2 || CategoricalSplitFeatureRanges[n].Length == 0)); 1144for (int i = 0; i < CategoricalSplitFeatures[n].Length; i++) 1147for (int i = 0; i < CategoricalSplitFeatureRanges[n].Length; i++) 1246CategoricalSplitFeatures.Length == 0 || 1255Contracts.Assert(CategoricalSplitFeatures.Length == NumNodes); 1257for (int i = 0; i < CategoricalSplitFeatures.Length; ++i) 1266int numNonLeaves = CategoricalSplitFeatures[i].Length; 1427int innerLoopSize = 1 + docIndices.Length / BlockingThreadPool.NumThreads; // +1 is to make sure we don't have a few left over at the end 1430var actions = new Action[(int)Math.Ceiling(1.0 * docIndices.Length / innerLoopSize)]; 1432for (int d = 0; d < docIndices.Length; d += innerLoopSize) 1435var toDoc = Math.Min(d + innerLoopSize, docIndices.Length);
TreeEnsemble\InternalTreeEnsemble.cs (1)
205for (; i < trainingParamsList.Length; ++i)
TreeEnsembleFeaturizer.cs (2)
293for (int i = 0; i < trees.Length; i++) 467var numTrees = trees.Length;
Utils\Algorithms.cs (15)
23if (val.CompareTo(array[array.Length - 1]) > 0) 29int upper = array.Length - 1; 62if (val.CompareTo(array[array.Length - 1]) >= 0) 63return array.Length - 1; 67int upper = array.Length - 1; 102int k = topK.Length < length ? topK.Length : length; 132for (int i = 1; i < array.Length; ++i) 151int maxLength = arrays.Sum(x => x.Length); 153int[] begins = new int[arrays.Length + 1]; 155for (int i = 0; i < arrays.Length; ++i) 158Array.Copy(arrays[i], 0, working, begin, arrays[i].Length); 159begin += arrays[i].Length; 161begins[arrays.Length] = begin; 163int length = MergeSortedUniqued(begins, 0, arrays.Length, working, tmp);
Utils\BufferPoolManager.cs (3)
81if (buffer != null && buffer.Length * Marshal.SizeOf(typeof(T)) >= MinBufferSizeInBytes) 95if (!availableBuffers.TryGetValue(buffer.Length, out buffers)) 98availableBuffers.Add(buffer.Length, buffers);
Utils\CompressUtils.cs (3)
47if (block.Offset > 0 && block.Offset + block.Length + loadSize > block.Buffer.Length) 54if (block.Offset + block.Length + loadSize > block.Buffer.Length) 75block.Length = buffer.Length - offset;
Utils\LinqExtensions.cs (6)
15if (arr.Length == 0) 18for (int i = 1; i < arr.Length; i++) 41int length = arr.Length < prefix ? arr.Length : prefix; 55int length = arr.Length < prefix ? arr.Length : prefix;
Utils\MappedObjectPool.cs (6)
30_inverseMap = Enumerable.Range(0, _pool.Length).Select(x => -1).ToArray(_pool.Length); 31_lastAccessTime = new int[_pool.Length]; 84Array.Clear(_lastAccessTime, 0, _lastAccessTime.Length); 86for (int i = 0; i < _map.Length; ++i) 88for (int i = 0; i < _inverseMap.Length; ++i)
Utils\PseudorandomFunction.cs (1)
29val ^= data[(int)(seed % (ulong)(data.Length))];
Utils\RegressionTreeBaseUtils.cs (8)
85categoricalSplitFeatures.Add(new VBuffer<int>(categoricalSplitFeaturesArray.Length, categoricalSplitFeaturesArray)); 86var len = trees[i].GetCategoricalSplitFeaturesAt(j).ToArray().Length; 90categoricalCategoricalSplitFeatureRange.Add(new VBuffer<int>(categoricalCategoricalSplitFeatureRangeArray.Length, categoricalCategoricalSplitFeatureRangeArray)); 91len = trees[i].GetCategoricalCategoricalSplitFeatureRangeAt(j).ToArray().Length; 129leafSamples.Add(new VBuffer<double>(leafSamplesArray.Length, leafSamplesArray)); 130var len = quantileTrees[i].GetLeafSamplesAt(j).ToArray().Length; 133leafSampleWeights.Add(new VBuffer<double>(leafSampleWeightsArray.Length, leafSampleWeightsArray)); 134len = quantileTrees[i].GetLeafSampleWeightsAt(j).ToArray().Length;
Utils\StreamExtensions.cs (1)
105stream.WriteCompressed(array, 0, array.Length);
Utils\ThreadTaskManager.cs (1)
51for (int i = 0; i < _actions.Length; i++)
Utils\Timer.cs (3)
131TickTotals = new long[Enum.GetValues(typeof(TimerEvent)).Length]; 132CountTotals = new long[Enum.GetValues(typeof(CountEvent)).Length]; 135NumCalls = new int[TickTotals.Length];
Utils\ToByteArrayExtensions.cs (20)
255bytes.Length.ToByteArray(buffer, ref position); 256Array.Copy(bytes, 0, buffer, position, bytes.Length); 257position += bytes.Length; 263byte[] allBytes = new byte[bytes.Length + sizeof(int)]; 265bytes.Length.ToByteArray(allBytes, ref position); 266Array.Copy(bytes, 0, allBytes, position, bytes.Length); 287a.Length.ToByteArray(buffer, ref position); 288Array.Copy(a, 0, buffer, position, a.Length); 289position += a.Length; 311int length = a.Length; 350int length = a.Length; 433int length = a.Length; 472int length = a.Length; 511int length = a.Length; 550int length = a.Length; 589int length = a.Length; 630a.Length.ToByteArray(buffer, ref position); 631for (int i = 0; i < a.Length; ++i) 641for (int i = 0; i < a.Length; ++i) 673for (int i = 0; i < a.Length; ++i)
Utils\VectorUtils.cs (17)
24int length = vector.Length; 41int length = vector.Length; 65int length = vector.Length; 80return GetDotProduct(vector1, vector2, vector1.Length); 85return GetDotProduct(vector1, vector2, vector1.Length); 125int length = vector.Length; 142int length = vector.Length; 164int length = vector.Length; 182int length = vector.Length; 205int length = vector1.Length; 221int length = vector1.Length; 241int length = vector1.Length; 258int length = vector.Length; 274int length = vector.Length; 290int length = vector.Length; 307int length = vector1.Length; 336for (int f = 0; f < vector.Length; f++)
Microsoft.ML.GenAI.Core (3)
Module\Attention.cs (2)
188Contract.Assert(attnWeights.shape.Length == 4); 197Contract.Assert(attentionMask.shape.Length == 4);
Pipeline\CausalLMPipeline.cs (1)
174var lastN = inputIds[.., ^stopSequence.Length..];
Microsoft.ML.ImageAnalytics (20)
ImageLoader.cs (2)
313count = imageBuffer.Length; 340while ((bytesRead = stream.Read(readBuffer, 0, readBuffer.Length)) > 0)
ImagePixelExtractor.cs (7)
202var columns = new ImagePixelExtractingEstimator.ColumnOptions[options.Columns.Length]; 203for (int i = 0; i < columns.Length; i++) 233_columns = new ImagePixelExtractingEstimator.ColumnOptions[ColumnPairs.Length]; 234for (int i = 0; i < _columns.Length; i++) 297Contracts.Assert(0 <= iinfo && iinfo < _parent._columns.Length); 454var types = new VectorDataViewType[_parent._columns.Length]; 455for (int i = 0; i < _parent._columns.Length; i++)
ImageResizer.cs (5)
159var cols = new ImageResizingEstimator.ColumnOptions[args.Columns.Length]; 160for (int i = 0; i < cols.Length; i++) 199_columns = new ImageResizingEstimator.ColumnOptions[ColumnPairs.Length]; 200for (int i = 0; i < ColumnPairs.Length; i++) 275Contracts.Assert(0 <= iinfo && iinfo < _parent._columns.Length);
VectorToImageTransform.cs (6)
226var columns = new VectorToImageConvertingEstimator.ColumnOptions[args.Columns.Length]; 227for (int i = 0; i < columns.Length; i++) 247_columns = new VectorToImageConvertingEstimator.ColumnOptions[ColumnPairs.Length]; 248for (int i = 0; i < _columns.Length; i++) 287for (int i = 0; i < _columns.Length; i++) 328Host.Assert(0 <= iinfo && iinfo < _parent._columns.Length);
Microsoft.ML.IntegrationTests (28)
Common.cs (7)
26Assert.Equal(toyClassProperties.Length, testTypeDataset.Schema.Count); 90Assert.Equal(array1.Length, array2.Length); 92for (int i = 0; i < array1.Length; i++) 309Assert.Equal(array1.Length, array2.Length); 312for (int i = 0; i < array1.Length; i++)
DataTransformation.cs (2)
185for (int i = 0; i < row.Features.Length; i++) 213for (int i = 0; i < row.Features.Length; i++)
Explainability.cs (12)
75Assert.Equal(HousingRegression.Features.Length, permutationMetrics.Length); 105Assert.Equal(HousingRegression.Features.Length, weights.Count); 132Assert.Equal(HousingRegression.Features.Length, weights.Length); 159Assert.Equal(HousingRegression.Features.Length, weights.Length); 195Assert.Equal(HousingRegression.Features.Length, row.FeatureContributions.Length); 232Assert.Equal(HousingRegression.Features.Length, row.FeatureContributions.Length); 269Assert.Equal(HousingRegression.Features.Length, row.FeatureContributions.Length); 307Assert.Equal(HousingRegression.Features.Length, row.FeatureContributions.Length);
IntrospectiveTraining.cs (3)
372for (int i = 0; i < Adult.CategoricalFeatures.Length; i++) 409Assert.Equal(4, centroids.Length); 414Assert.Equal(3, weights.Length);
SchemaDefinitionTests.cs (4)
53Assert.Equal((engine1.OutputSchema["Features"].Type as VectorDataViewType).Size, prediction.Features.Length); 56Assert.Equal((engine2.OutputSchema["Features"].Type as VectorDataViewType).Size, prediction.Features.Length); 81dst.Features = new float[src.Features.Length * 2]; 82for (int i = 0; i < src.Features.Length; i++)
Microsoft.ML.InternalCodeAnalyzer (4)
ContractsCheckAnalyzer.cs (1)
127if (0 <= index && index < args.Length && args[index] == null)
NameAnalyzer.cs (3)
37if (args == null || args.Length == 0) 39var newArgs = new object[args.Length + 1]; 40Array.Copy(args, 0, newArgs, 1, args.Length);
Microsoft.ML.KMeansClustering (22)
KMeansModelParameters.cs (4)
282Contracts.Assert(_centroids.Length == _k); 323var shapeC = new long[] { _centroids.Length, _centroids[0].Length }; 330var shapeC2 = new long[] { _centroidL2s.Length }; 343var dataViewType = new VectorDataViewType(NumberDataViewType.Single, _centroids.Length);
KMeansPlusPlusTrainer.cs (18)
907ch.Assert(clusterCount == clusters.Length); 933for (int i = 0; i < workStateWeights.Length; i++) 949for (int i = 0; i < workStateWeights.Length; i++) 950for (int j = 0; j < workStateWeights[i].Length; j++) 955for (int i = 0; i < totalWeights.Length; i++) 958ch.Assert(totalWeights.Length == clusters.Length); 963if (clusters.Length == k) 1153for (int i = 0; i < workChunkArr.Length; i++) 1161for (int j = 0; j < reducedState.ClusterSizes.Length; j++) 1339for (int j = 0; j < centroids.Length; j++) 1383Action[] ops = new Action[set.Length]; 1384for (int i = 0; i < ops.Length; i++) 1655for (int i = 0; i < heaps.Length; i++) 1721int numCursors = set.Length; 1760FindBestCluster(in features, centroids, centroidL2s, centroids.Length, false, out discard1, out cluster, out discard2, out discard3); 1792Contracts.Assert(centroids.Length >= centroidCount && centroidL2s.Length >= centroidCount && centroidCount > 0);
Microsoft.ML.LightGbm (24)
LightGbmMulticlassTrainer.cs (2)
312for (int i = 0; i < labels.Length; ++i) 346if (labels.Length >= _minDataToUseSoftmax)
LightGbmTrainerBase.cs (7)
547if (j < categoricalFeatures.Length && curFidx == categoricalFeatures[j]) 778numRow = labels.Length; 805for (int i = 0; i < labels.Length; ++i) 1071if (numElem + cursor.Features.GetValues().Length > features.Length) 1111ch.Assert(features.Length >= numElem + catMetaData.NumCol); 1153ch.Assert(indices.Length >= numElem + numValue); 1154ch.Assert(features.Length >= numElem + numValue);
WrappedLightGbmBooster.cs (7)
150double[] ret = new double[threshold.Length]; 151for (int i = 0; i < threshold.Length; ++i) 214while (i <= lines.Length && !lines[i].StartsWith("end of parameters")) 229for (; i < lines.Length;) 238Contracts.Check(kv.Length == 2); 273categoricalSplitFeatures[node] = new int[cats.Length]; 275for (int j = 0; j < cats.Length; ++j)
WrappedLightGbmDataset.cs (8)
157Contracts.Assert(labels.Length == GetNumRows()); 159LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "label", (IntPtr)ptr, labels.Length, 167Contracts.Assert(weights.Length == GetNumRows()); 170for (int i = 1; i < weights.Length; ++i) 181LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "weight", (IntPtr)ptr, weights.Length, 192LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "group", (IntPtr)ptr, groups.Length, 202Contracts.Assert(initScores.Length % GetNumRows() == 0); 204LightGbmInterfaceUtils.Check(WrappedLightGbmInterface.DatasetSetField(_handle, "init_score", (IntPtr)ptr, initScores.Length,
Microsoft.ML.Maml (2)
ChainCommand.cs (1)
55for (int i = 0; i < _args.Commands.Length; i++)
HelpCommand.cs (1)
361for (int i = 0; i < blocks.Length; i++)
Microsoft.ML.Mkl.Components (53)
ComputeLRTrainingStdThroughHal.cs (1)
85Contracts.Assert(ioffset == invHessian.Length);
OlsLinearRegression.cs (15)
300for (int i = 0; i < beta.Length; ++i) 336ch.Assert(ioff == xtx.Length); 379ch.Assert(ioff == xtx.Length - 1); 406for (int i = 0; i < xty.Length; ++i) 442var weightsValues = new float[beta.Length - 1]; 443for (int i = 1; i < beta.Length; ++i) 445var weights = new VBuffer<float>(weightsValues.Length, weightsValues); 520Contracts.Assert(ioffset == xtx.Length); 567Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length"); 606Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length"); 607Contracts.CheckParam((long)n * ldb <= b.Length, nameof(b), "vector had insufficient length"); 649Contracts.CheckParam((long)n * (n + 1) / 2 <= ap.Length, nameof(ap), "vector had insufficient length"); 873Contracts.Assert(Weight.Length + 1 == _standardErrors.Length); 874Contracts.Assert(Weight.Length + 1 == _tValues.Length); 875Contracts.Assert(Weight.Length + 1 == _pValues.Length);
SymSgdClassificationTrainer.cs (1)
342public int Length => Buffer.Length;
VectorWhitening.cs (36)
170_columns = new VectorWhiteningEstimator.ColumnOptions[ColumnPairs.Length]; 171for (int i = 0; i < _columns.Length; i++) 174_models = new float[ColumnPairs.Length][]; 175_invModels = new float[ColumnPairs.Length][]; 176for (int i = 0; i < ColumnPairs.Length; i++) 239for (int i = 0; i < model.Length; i++) 264var models = new float[columns.Length][]; 265var invModels = new float[columns.Length][]; 280cols = new int[columns.Length]; 281srcTypes = new DataViewType[columns.Length]; 284for (int i = 0; i < columns.Length; i++) 304var columnData = new float[columns.Length][]; 305actualRowCounts = new int[columns.Length]; 308for (int i = 0; i < columns.Length; i++) 333var idxDst = new int[columns.Length]; 337var getters = new ValueGetter<VBuffer<float>>[columns.Length]; 338for (int i = 0; i < columns.Length; i++) 344for (int i = 0; i < columns.Length; i++) 346if (irow >= actualRowCounts[i] || columnData[i].Length == 0) 356for (int i = 0; i < columns.Length; i++) 357ch.Assert(idxDst[i] == columnData[i].Length); 369ch.Assert(columnData.Length == rowCounts.Length); 371for (int iinfo = 0; iinfo < columns.Length; iinfo++) 415for (int i = 0; i < eigValues.Length; i++) 417var eigValuesRcp = new float[eigValues.Length]; 418for (int i = 0; i < eigValuesRcp.Length; i++) 423var uScaled = new float[u.Length]; 424var uInvScaled = new float[u.Length]; 448models[iinfo] = new float[u.Length]; 454invModels[iinfo] = new float[u.Length]; 480Host.Assert(_columns.Length == ColumnPairs.Length); 481for (int i = 0; i < _columns.Length; i++) 483for (int i = 0; i < _models.Length; i++) 649Host.Assert(model.Length == dimension * dimension);
Microsoft.ML.NugetPackageVersionUpdater (1)
Program.cs (1)
42if (detailSplit.Length == 5)
Microsoft.ML.OnnxTransformer (20)
OnnxTransform.cs (20)
176for (int j = 0; j < inputs.Length; j++) 183for (int j = 0; j < outputs.Length; j++) 291OutputTypes = new DataViewType[Outputs.Length]; 292var numModelOutputs = Model.ModelInfo.OutputsInfo.Length; 293for (int i = 0; i < Outputs.Length; i++) 427ctx.Writer.Write(Inputs.Length); 432ctx.Writer.Write(Outputs.Length); 437int customShapeInfosLength = _options.CustomShapeInfos != null ? _options.CustomShapeInfos.Length : 0; 511_inputColIndices = new int[_parent.Inputs.Length]; 512_inputTensorShapes = new OnnxShape[_parent.Inputs.Length]; 513_inputOnnxTypes = new Type[_parent.Inputs.Length]; 516for (int i = 0; i < _parent.Inputs.Length; i++) 569var info = new DataViewSchema.DetachedColumn[_parent.Outputs.Length]; 570for (int i = 0; i < _parent.Outputs.Length; i++) 610return col => Enumerable.Range(0, _parent.Outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col); 691for (int i = 0; i < _inputColIndices.Length; i++) 778var srcNamedOnnxValueGetters = new INamedOnnxValueGetter[inputColIndices.Length]; 779for (int i = 0; i < inputColIndices.Length; i++) 1059for (var i = 0; i < Transformer.Inputs.Length; i++) 1083for (var i = 0; i < Transformer.Outputs.Length; i++)
Microsoft.ML.OnnxTransformerTest (1)
OnnxTransformTests.cs (1)
607for (int i = 0; i < imageData.Length; i += 4)
Microsoft.ML.Parquet (16)
ParquetLoader.cs (6)
479_columnValues = new IList[_actives.Length]; 480_getters = new Delegate[_actives.Length]; 481for (int i = 0; i < _actives.Length; ++i) 576for (int i = 0; i < _actives.Length; i++) 627Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column)); 691public void Conv(in byte[] src, ref VBuffer<Byte> dst) => dst = src != null ? new VBuffer<byte>(src.Length, src) : new VBuffer<byte>(0, new byte[0]);
PartitionedFileLoader.cs (5)
401_subActivecolumnsNeeded = Schema.Where(x => (_subActive?.Length > x.Index) && _subActive[x.Index]); 559for (int i = 0; i < _colValues.Length; i++) 578for (int i = 0; i < getters.Length; i++) 626Ch.Check(col >= 0 && col < _colValues.Length); 646private int SubColumnCount => Schema.Count - _parent._srcDirIndex.Length;
PartitionedPathParser.cs (5)
161ctx.Writer.Write(_columns.Length); 274ctx.Writer.Write(_columns.Length); 311if (values.Count != _columns.Length) 313throw Contracts.Except($"The extracted value count of {values.Count} does not match the expected Column count of {_columns.Length} for path {path}"); 379if (nameValue.Length != 2)
Microsoft.ML.PCA (32)
PcaTrainer.cs (10)
302host.Assert(Utils.Size(y) == omega.Length); // Size of Y and Omega: dimension x oversampled rank 303int numCols = omega.Length; 305for (int i = 0; i < y.Length; ++i) 306Array.Clear(y[i], 0, y[i].Length); 455_dimension = eigenVectors[0].Length; 462_eigenVectors[i] = new VBuffer<float>(eigenVectors[i].Length, eigenVectors[i]); 664rank = _eigenVectors.Length; 665Utils.EnsureSize(ref vectors, _eigenVectors.Length, _eigenVectors.Length); 666for (int i = 0; i < _eigenVectors.Length; i++)
PcaTransformer.cs (22)
139Contracts.CheckDecode(MeanProjected == null || (MeanProjected.Length == Rank && FloatUtils.IsFinite(MeanProjected))); 162Contracts.Assert(MeanProjected == null || (MeanProjected.Length == Rank && FloatUtils.IsFinite(MeanProjected))); 208_numColumns = columns.Length; 233_numColumns = ColumnPairs.Length; 291for (int i = 0; i < _transformInfos.Length; i++) 350for (int iinfo = 0; iinfo < transformInfos.Length; iinfo++) 369for (int iinfo = 0; iinfo < transformInfos.Length; iinfo++) 393Host.Assert(mean.Length == omega.Length && omega.Length == y.Length && y.Length == _numColumns); 394for (int i = 0; i < omega.Length; i++) 395Contracts.Assert(omega[i].Length == y[i].Length); 398for (int iinfo = 0; iinfo < y.Length; iinfo++) 400for (int i = 0; i < y[iinfo].Length; i++) 401Array.Clear(y[iinfo][i], 0, y[iinfo][i].Length); 404bool[] center = Enumerable.Range(0, mean.Length).Select(i => mean[i] != null).ToArray(); 446for (int i = 0; i < omega[iinfo].Length; i++) 462for (var i = 0; i < omega[iinfo].Length; ++i) 468for (int i = 0; i < omega[iinfo].Length; i++)
Microsoft.ML.PerformanceTests (8)
CacheDataViewBench.cs (2)
33for (int i = 0; i < values.Length; ++i) 61for (int i = 0; i < _positions.Length; ++i)
HashBench.cs (2)
129var vbuf = new VBuffer<T>(vals.Length, vals); 130InitMapMurmurHashV2(vbuf, new VectorDataViewType(itemType, vals.Length), numberOfBits, vbuf.CopyTo);
ShuffleRowsBench.cs (1)
21for (var i = 0; i < _rows.Length; i++)
StochasticDualCoordinateAscentClassifierBench.cs (3)
150_batches = new IrisData[_batchSizes.Length][]; 151for (int i = 0; i < _batches.Length; i++) 154for (int bi = 0; bi < batch.Length; bi++)
Microsoft.ML.Predictor.Tests (17)
CmdLine\CmdLine.cs (2)
259if (arr != null && arr.Length > 0) 275if (arr != null && arr.Length > 0)
CompareBaselines.cs (1)
288if (ich > 0 && line[ich - 1] < _forbidNumAfter.Length && _forbidNumAfter[line[ich - 1]])
ResultProcessor\TestResultProcessor.cs (1)
40for (int i = 0; i < resourceNames.Length; i++)
TestGamPublicInterfaces.cs (4)
43Assert.Equal(binUpperBounds.Length, gam.NumberOfShapeFunctions); 94Assert.Equal(array1.Length, array2.Length); 95for (int i = 0; i < array1.Length; i++)
TestTransposer.cs (9)
85Contracts.Assert(vals.Length == expectedVals.Length); 93Assert.True(offset < vals.Length, $"{desc} slot cursor went further than it should have"); 101for (int i = 0; i < vals.Length; ++i) 110for (int r = 0; r < vecs.Length; ++r) 117for (int i = 0; i < vals.Length; ++i) 131for (int i = 0; i < vals.Length; ++i) 142for (int r = 0; r < values.Length; ++r) 181for (int i = 0; i < names.Length; ++i)
Microsoft.ML.Recommender (9)
MatrixFactorizationPredictor.cs (4)
106_host.Assert(_leftFactorMatrix.Length == NumberOfRows * ApproximationRank); 107_host.Assert(_rightFactorMatrix.Length == ApproximationRank * NumberOfColumns); 197for (int i = 0; i < _leftFactorMatrix.Length; ++i) 206for (int i = 0; i < _rightFactorMatrix.Length; ++i)
SafeTrainingAndModelBuffer.cs (5)
332prob.Nnz = nodes.Length; 366prob.Nnz = nodes.Length; 371validProb.Nnz = validNodes.Length; 398Marshal.Copy((IntPtr)_pMFModel->P, p, 0, p.Length); 399Marshal.Copy((IntPtr)_pMFModel->Q, q, 0, q.Length);
Microsoft.ML.ResultProcessor (9)
ResultProcessor.cs (9)
372while (i < lines.Length && !lines[i].Contains("Time elapsed(s):")) 374if (i == lines.Length) 723for (int j = 0; j < rawLines.Length; j++) 764if (cmd == null || cmd.Metrics == null || cmd.Metrics.Length == 0) 965if (foldLineCols.Length < 2) 971if (!int.TryParse(foldLineCols[foldLineCols.Length - 1], out foldIdx)) 978for (int j = foldLineCols.Length - 2; j > 0; j--) 991if (nameValCols.Length != 2) 1056if (cmd.Metrics.Length == 0)
Microsoft.ML.Samples (24)
Dynamic\TensorFlow\TextClassification.cs (1)
126.Length);
Dynamic\Trainers\MulticlassClassification\LogLossPerClass.cs (1)
54for (var i = 0; i < originalLabels.Length; i++)
Dynamic\Transforms\ApplyONNXModelWithInMemoryImages.cs (1)
109for (int i = 0; i < imageData.Length; i += 4)
Dynamic\Transforms\Categorical\OneHotEncoding.cs (1)
82for (var i = 0; i < row.Length; i++)
Dynamic\Transforms\Categorical\OneHotHashEncoding.cs (1)
82for (var i = 0; i < row.Length; i++)
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScaleInMemory.cs (1)
101for (int i = 0; i < imageData.Length; i += 4)
Dynamic\Transforms\NormalizeBinningMulticolumn.cs (1)
51for (int i = 0; i < column.Length; i++)
Dynamic\Transforms\NormalizeMinMaxMulticolumn.cs (2)
72for (int i = 0; i < column.Length; i++) 89for (int i = 0; i < column.Length; i++)
Dynamic\Transforms\Text\ApplyCustomWordEmbedding.cs (1)
70Console.WriteLine($"Number of Features: {prediction.Features.Length}");
Dynamic\Transforms\Text\ApplyWordEmbedding.cs (1)
60Console.WriteLine($"Number of Features: {prediction.Features.Length}");
Dynamic\Transforms\Text\FeaturizeText.cs (1)
68Console.WriteLine($"Number of Features: {prediction.Features.Length}");
Dynamic\Transforms\Text\FeaturizeTextWithOptions.cs (1)
86Console.WriteLine($"Number of Features: {prediction.Features.Length}");
Dynamic\Transforms\Text\LatentDirichletAllocation.cs (1)
74for (int i = 0; i < prediction.Features.Length; i++)
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (1)
69.Length);
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (1)
68.Length);
Dynamic\Transforms\Text\ProduceNgrams.cs (1)
77.Length);
Dynamic\Transforms\Text\ProduceWordBags.cs (1)
74.Length);
Dynamic\Transforms\Text\RemoveDefaultStopWords.cs (1)
56.Length);
Dynamic\Transforms\Text\RemoveStopWords.cs (1)
55.Length);
Dynamic\Transforms\Text\TokenizeIntoCharactersAsKeys.cs (1)
53Console.WriteLine($"Number of tokens: {prediction.CharTokens.Length}");
Dynamic\Transforms\Text\TokenizeIntoWords.cs (1)
51Console.WriteLine($"Number of words: {prediction.Words.Length}");
Dynamic\Transforms\TimeSeries\ForecastingWithConfidenceInterval.cs (1)
115for (int index = 0; index < forecast.Length; index++)
Program.cs (1)
9public static void Main(string[] args) => RunAll(args.Length == 0 ? null : args[0]);
Microsoft.ML.Samples.GPU (1)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
126.Length);
Microsoft.ML.SearchSpace (12)
Option\ChoiceOption.cs (10)
28Contract.Assert(choices.Length > 0 && choices.Length < 1074, "the length of choices must be (0, 1074)"); 30Contract.Assert(distinctChoices.Count() == choices.Length, "choices must not contain repeated values"); 33_option = new UniformSingleOption(0, Choices.Length); 55public override int FeatureSpaceDim => Choices.Length == 1 ? 0 : 1; 58public override int?[] Step => new int?[] { Choices.Length }; 77Contract.Assert(values.Length >= 0, "values length must be greater than 0"); 78if (values.Length == 0) 89if (idx >= Choices.Length) 91idx = Choices.Length - 1;
Option\UniformNumericOption.cs (1)
78Contract.Assert(values.Length == 1, "values length must be 1");
SearchSpace.cs (1)
111Contract.Assert(feature.Length == FeatureSpaceDim, "input feature doesn't match");
Microsoft.ML.StandardTrainers (186)
FactorizationMachine\FactorizationMachineTrainer.cs (3)
228var extraColumnLength = (options.ExtraFeatureColumns != null ? options.ExtraFeatureColumns.Length : 0); 263FeatureColumns = new SchemaShape.Column[featureColumnNames.Length]; 265for (int i = 0; i < featureColumnNames.Length; i++)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (2)
246Array.Copy(_linearWeights, linearWeights, _linearWeights.Length); 314var featureColumnTypes = new DataViewType[featureColumns.Length];
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
33for (int f = 0; f < getters.Length; f++)
LdSvm\LdSvmModelParameters.cs (20)
61Host.Assert(w.Length == numLeaf * 2 - 1); 64Host.Assert(thetaPrime.Length == numLeaf * 2 - 1); 67Host.Assert(theta.Length == numLeaf - 1); 70Host.Assert(biasW.Length == numLeaf * 2 - 1); 71Host.Assert(biasTheta.Length == numLeaf - 1); 72Host.Assert(biasThetaPrime.Length == numLeaf * 2 - 1); 129Host.Assert(_w.Length == _numLeaf * 2 - 1); 132Host.Assert(_thetaPrime.Length == _numLeaf * 2 - 1); 135Host.Assert(_theta.Length == _numLeaf - 1); 138Host.Assert(_biasW.Length == _numLeaf * 2 - 1); 139Host.Assert(_biasTheta.Length == _numLeaf - 1); 140Host.Assert(_biasThetaPrime.Length == _numLeaf * 2 - 1); 186Host.Assert(_w.Length == _numLeaf * 2 - 1); 188Host.Assert(_thetaPrime.Length == _numLeaf * 2 - 1); 190Host.Assert(_theta.Length == _numLeaf - 1); 193Host.Assert(_biasW.Length == _numLeaf * 2 - 1); 195Host.Assert(_biasTheta.Length == _numLeaf - 1); 197Host.Assert(_biasThetaPrime.Length == _numLeaf * 2 - 1); 208if (data.Length == 0) 212for (int i = 0; i < data.Length; i++)
LdSvm\LdSvmTrainer.cs (4)
298for (int i = 0; i < tempW.Length; ++i) 300for (int i = 0; i < tempTheta.Length; ++i) 302for (int i = 0; i < tempThetaPrime.Length; ++i) 506public override long Length => _examples.Length;
Optimizer\Optimizer.cs (2)
289Array.Clear(_sList, 0, _sList.Length); 290Array.Clear(_yList, 0, _yList.Length);
Standard\LogisticRegression\LbfgsPredictorBase.cs (7)
330for (int j = 0; j < initWeights.Length; j++) 332init = new VBuffer<float>(initWeights.Length, initWeights); 560CurrentWeights = new VBuffer<float>(betaArray.Length, betaArray); 678for (int i = 0; i < _localGradients.Length; i++) 908Contracts.Check(i < initWeights.Length, featError); 911Contracts.Check(i == initWeights.Length, featError); 913return new VBuffer<float>(initWeights.Length, initWeights);
Standard\LogisticRegression\LogisticRegression.cs (2)
338Contracts.Assert(i == hessian.Length - 1); 378ch.Assert(ioff == hessian.Length);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (24)
228Contracts.Assert(_labelNames == null || _labelNames.Length == _numClasses); 470for (int i = 0; i < Biases.Length; i++) 473for (int i = 0; i < Weights.Length; i++) 481Contracts.Assert(labelNames == null || labelNames.Length == numClasses); 526Contracts.Assert(labelNames == null || labelNames.Length == numClasses); 569for (int i = 0; i < Weights.Length; i++) 585Host.CheckDecode(numIndices == starts[starts.Length - 1]); 588for (int i = 0; i < indices.Length; i++) 598for (int i = 0; i < Weights.Length; i++) 629Host.Assert(Biases.Length == NumberOfClasses); 630Host.Assert(Biases.Length == Weights.Length); 661ctx.Writer.Write(NumberOfFeatures * Weights.Length); 676for (int i = 0; i < Weights.Length; i++) 790for (int i = 0; i < Biases.Length; i++) 806for (int i = 0; i < Weights.Length; i++) 840for (int classNumber = 0; classNumber < Biases.Length; classNumber++) 848for (int classNumber = 0; classNumber < Weights.Length; classNumber++) 911for (int i = 0; i < Biases.Length; i++) 1047Contracts.Assert(Weights.Length == Biases.Length); 1050for (var i = 0; i < Weights.Length; i++) 1120AnnotationUtils.GetSlotNames(schema, RoleMappedSchema.ColumnRole.Feature, Weights.Length, ref names); 1257for (int c = 0; c < Biases.Length; c++)
Standard\ModelStatistics.cs (3)
484Env.Assert(featureNames.Length >= 1); 514Env.Assert(coeffStat.Index < featureNames.Length); 549Env.Assert(coeffStat.Index < featureNames.Length);
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (31)
296Host.Assert(labelHistogram.Length == featureHistogram.Length); 297Host.Assert(featureHistogram.All(h => h == null || h.Length == featureCount)); 301_labelCount = _labelHistogram.Length; 328_labelCount = _labelHistogram.Length; 388int labelCount = labelHistogram.Length; 390for (int iLabel = 0; iLabel < labelHistogram.Length; iLabel += 1) 427float[] featureHistogram = new float[_featureHistogram[0].Length * _labelHistogram.Length]; 428float[] labelHistogramExpanded = new float[_featureHistogram[0].Length * _labelHistogram.Length]; 430for (int i = 0; i < _featureHistogram.Length; i++) 432Array.Copy(_featureHistogram[i], 0, featureHistogram, i * _featureHistogram[i].Length, _featureHistogram[i].Length); 434for (int i = 0; i < _featureHistogram[0].Length; i++) 436Array.Copy(_labelHistogram, 0, labelHistogramExpanded, i * _featureHistogram.Length, _featureHistogram.Length); 444var labelHistogram = ctx.AddInitializer(labelHistogramExpanded.Take(_labelHistogram.Length), new long[] { _labelHistogram.Length, 1 }, "labelHistogram"); 446var featureHistogramName = ctx.AddInitializer(featureHistogram, new long[] { _featureHistogram.Length, _featureHistogram[0].Length }, "featureHistogram"); 447var labelHistogramName = ctx.AddInitializer(labelHistogramExpanded, new long[] { _featureHistogram[0].Length, _labelHistogram.Length }, "labelHistogramExpanded"); 448var learnedAbsentFeatureLogProb = ctx.AddInitializer(_absentFeaturesLogProb, new long[] { _absentFeaturesLogProb.Length, 1 }, "absentFeaturesLogProb"); 451var typeFea = new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length); 452var typeLabelByFea = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, _featureHistogram[0].Length); 453var typeLabelByOne = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, 1); 455var greaterOutput = ctx.AddIntermediateVariable(new VectorDataViewType(BooleanDataViewType.Instance, _featureHistogram[0].Length), "greaterOutput"); 466var isFeaturePresent = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, 1, _featureHistogram[0].Length), "isFeaturePresent"); 576var logOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length), "LogOutput");
Standard\MulticlassClassification\OneVersusAllTrainer.cs (48)
155for (int i = 0; i < predictors.Length; i++) 223for (int i = 0; i < predictors.Length; i++) 325var dists = new IValueMapperDist[predictors.Length]; 326for (int i = 0; i < predictors.Length; ++i) 363DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length); 395DistType = new VectorDataViewType(NumberDataViewType.Single, _impl.Predictors.Length); 409for (int i = 0; i < predictors.Length; i++) 425ctx.Writer.Write(preds.Length); 428for (int i = 0; i < preds.Length; i++) 462writer.WriteLine("double[] outputs = new double[{0}];", preds.Length); 464for (int i = 0; i < preds.Length; i++) 483for (int i = 0; i < preds.Length; i++) 538string[] outputs = new string[Predictors.Length]; 542for (int i = 0; i < Predictors.Length; i++) 544var predictorOutputNames = new string[localOutputNames.Length]; 573Contracts.Assert(outputNames.Length >= 2); 607Predictors = new IValueMapper[predictors.Length]; 609for (int i = 0; i < predictors.Length; i++) 623var maps = new ValueMapper<VBuffer<float>, float>[Predictors.Length]; 624for (int i = 0; i < Predictors.Length; i++) 627var buffer = new float[maps.Length]; 636Parallel.For(0, maps.Length, i => maps[i](in tmp, ref buffer[i])); 638var editor = VBufferEditor.Create(ref dst, maps.Length); 651for (int i = 0; i < Predictors.Length; ++i) 668var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length); 691_mappers = new IValueMapperDist[predictors.Length]; 693for (int i = 0; i < predictors.Length; i++) 716var maps = new ValueMapper<VBuffer<float>, float, float>[Predictors.Length]; 717for (int i = 0; i < Predictors.Length; i++) 720var buffer = new float[maps.Length]; 729Parallel.For(0, maps.Length, 740NormalizeSumToOne(buffer, maps.Length); 742var editor = VBufferEditor.Create(ref dst, maps.Length); 778for (int i = 0; i < Predictors.Length; ++i) 794Contracts.Assert(outputNames.Length >= 2); 826string[] divOutputs = new string[Predictors.Length]; 827for (int i = 0; i < Predictors.Length; i++) 835var type = new VectorDataViewType(NumberDataViewType.Single, divOutputs.Length); 856Predictors = new IValueMapper[predictors.Length]; 858for (int i = 0; i < predictors.Length; i++) 872var maps = new ValueMapper<VBuffer<float>, float>[Predictors.Length]; 873for (int i = 0; i < Predictors.Length; i++) 876var buffer = new float[maps.Length]; 885Parallel.For(0, maps.Length, i => maps[i](in tmp, ref buffer[i])); 886NormalizeSoftmax(buffer, maps.Length); 888var editor = VBufferEditor.Create(ref dst, maps.Length); 916Contracts.Assert(outputNames.Length >= 2); 924var type = new VectorDataViewType(NumberDataViewType.Single, probabilityOutputs.Length);
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (10)
131for (int i = 0; i < predModels.Length; i++) 200for (int i = 0; i < predictors.Length; i++) 268_numClasses = predictors.Length; 280Host.Assert(index == _predictors.Length); 316mappers = new IValueMapperDist[_predictors.Length]; 318for (int i = 0; i < _predictors.Length; i++) 463var maps = new ValueMapper<VBuffer<float>, float, float>[_mappers.Length]; 464for (int i = 0; i < _mappers.Length; i++) 467var buffer = new double[_mappers.Length]; 475Parallel.For(0, maps.Length, parallelOptions, i =>
Standard\Online\OnlineLinear.cs (1)
148if (weightStr.Length != numFeatures + 1)
Standard\SdcaBinary.cs (14)
546featureNormSquared = InitializeFeatureNormSquared(invariants.Length); 557ch.Assert(metricNames.Length == metrics.Length); 569Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length); 580Contracts.Assert(0 <= longIdx && longIdx < invariants.Length, $"longIdx={longIdx}, invariants.Length={invariants.Length}"); 811Func<DataViewRowId, long> getIndexFromId = GetIndexFromIdGetter(idToIdx, biasReg.Length); 964var reportedValues = new Double?[metrics.Length + 1]; 965reportedValues[metrics.Length] = iter; 974Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length); 1007metrics[(int)MetricKind.L1Sparsity] = SdcaTrainerOptions.L1Regularization == 0 ? 1 : (Double)firstWeights.GetValues().Count(w => w != 0) / weights.Length; 1023for (int i = 0; i < metrics.Length; i++) 1058public override long Length => _duals.Length; 1403for (int i = 0; i < Primes.Length; i++)
Standard\SdcaMulticlass.cs (14)
200Func<DataViewRowId, long> getIndexFromId = GetIndexFromIdGetter(idToIdx, biasReg.Length); 359int numClasses = weights.Length; 366var reportedValues = new Double?[metrics.Length + 1]; 367reportedValues[metrics.Length] = iter; 375Func<DataViewRowId, long, long> getIndexFromIdAndRow = GetIndexFromIdAndRowGetter(idToIdx, biasReg.Length); 459for (int i = 0; i < metrics.Length; i++) 558Host.CheckParam(weights.Length > 0, nameof(weights)); 559Host.CheckParam(weights.Length == bias.Length, nameof(weights)); 561return new MaximumEntropyModelParameters(Host, weights, bias, bias.Length, weights[0].Length, null, stats: null); 655Host.CheckParam(weights.Length > 0, nameof(weights)); 656Host.CheckParam(weights.Length == bias.Length, nameof(weights)); 658return new LinearMulticlassModelParameters(Host, weights, bias, bias.Length, weights[0].Length, null, stats: null);
Microsoft.ML.Sweeper (86)
Algorithms\KdoSweeper.cs (35)
113var numSweeps = Math.Min(numOfCandidates, _args.NumberInitialPopulation - prevRuns.Length); 117if (prevRuns.Length < _args.NumberInitialPopulation) 125} while (rcs.Length < 1 && attempts < 100); 128if (rcs.Length == 0) 141if (viableRuns.Length == 0 && prevRuns.Length > 0) 161int totalHistoryLength = history.Length; 164if (history.Length > _args.HistoryLength) 179_host.Assert(history.Length == weights.Length && parentIndicies.Max() < history.Length); 182for (int i = 0; i < parentIndicies.Length; i++) 185children.Add(SampleChild(parent.ParameterSet, parent.MetricValue, history.Length, previousRuns, rMean, rVar, parent.IsMetricMaximizing)); 219for (int i = 0; i < _sweepParameters.Length; i++) 251double[] stddevs = Enumerable.Repeat(_args.Simple ? 0.2 : bandwidthScale, mu.Length).ToArray(); 254for (int j = 0; j < sampledPoint.Length; j++) 297int d = stddevs.Length; 323double[] weights = new double[history.Length]; 325for (int i = 0; i < history.Length; i++) 329bool isMinimizing = history.Length > 0 && !history[0].IsMetricMaximizing; 336for (int i = 0; i < weights.Length; i++) 373for (int i = 0; i < weights.Length; i++) 381for (int i = 0; i < weights.Length; i++) 406for (int i = 0; i < weights.Length; i++) 454int d = mu.Length; 455_host.Assert(d > 0 && diagonalCovariance.Length == d); 458_host.Assert(diagonalCovariance[i].Length == d); 476for (int i = 0; i < points.Length; i++) 479points[i] = VectorTransformAdd(mu, _spu.NormalRVs(mu.Length, 0, 1), a); 487int d = m.Length; 502if (x.Length != y.Length) 503return x.Length > y.Length ? 1 : -1; 505for (int i = 0; i < x.Length; i++)
Algorithms\NelderMead.cs (5)
322for (int i = 0; i < simplexVertices.Length; i++) 325for (int j = i + 1; j < simplexVertices.Length; j++) 338Contracts.Assert(point.Length == _sweepParameters.Count); 392var newPoint = new float[centroid.Length]; 447Contracts.Assert(array.Length == _sweepParameters.Count);
Algorithms\SmacSweeper.cs (19)
130_host.Assert(view.GetRowCount() == targets.Length, "This data view will have as many rows as there have been evaluations"); 171ParameterSet[] randomChallengers = _randomSweeper.ProposeSweeps(numOfCandidates - eiChallengers.Length, previousRuns); 175ParameterSet[] configs = new ParameterSet[eiChallengers.Length + randomChallengers.Length]; 176Array.Copy(eiChallengers, 0, configs, 0, eiChallengers.Length); 177Array.Copy(randomChallengers, 0, configs, eiChallengers.Length, randomChallengers.Length); 211_host.Assert(randomConfigs.Length == randomEIs.Length); 213for (int i = 0; i < randomConfigs.Length; i++) 273for (int i = 0; i < _sweepParameters.Length; i++) 344VBuffer<float> features = new VBuffer<float>(transformedParams.Length, transformedParams); 360double[][] meansAndStdDevs = new double[leafValues.Length][]; 361for (int i = 0; i < leafValues.Length; i++) 413double[] eis = new double[forestStatistics.Length]; 414for (int i = 0; i < forestStatistics.Length; i++) 424for (int i = 0; i < _sweepParameters.Length; i++) 439_host.Assert(parameterSet.Count == _sweepParameters.Length); 440_host.Assert(index >= 0 && index <= _sweepParameters.Length);
Algorithms\SweeperProbabilityUtils.cs (13)
92double[] rw = new double[weights.Length]; 94for (int i = 0; i < weights.Length; i++) 102for (int i = 0; i < results.Length; i++) 105results[i] = BinarySearch(rw, u, 0, rw.Length - 1); 141weights.SetValue(1, 0, weights.Length); 142total = weights.Length; 145for (int i = 0; i < weights.Length; i++) 154for (int i = 0; i < weights.Length; i++) 162host.Assert(ps.Count == sweepParams.Length); 166for (int i = 0; i < sweepParams.Length; i++) 214Contracts.Assert(array.Length == sweepParams.Length); 218for (int i = 0; i < sweepParams.Length; i++)
ConfigRunner.cs (3)
162RunNums.AddRange(Enumerable.Range(min, sweeps.Length)); 166for (int i = 0; i < sweeps.Length; i++) 202Parallel.For(0, sweeps.Length, _parallelOptions, j =>
ISweeper.cs (2)
304var result = new float[_metricDistribution.Length]; 305Array.Copy(_metricDistribution, result, _metricDistribution.Length);
Parameters.cs (8)
309return _gridValues.Length; 433return _gridValues.Length; 476Contracts.Check(options.Values.Length > 0); 483return new StringParameterValue(_options.Name, _options.Values[(int)(_options.Values.Length * normalizedValue)]); 498return _options.Values.Length; 561if (minMaxRegex.Length != 2) 563if (minMaxRegex.Length > 2) 598if (options.Length != optionsSpecified.Count(b => b))
SynthConfigRunner.cs (1)
45for (int j = 0; j < sweeps.Length; j++)
Microsoft.ML.Sweeper.Tests (14)
SweeperTest.cs (2)
30int length = results.Length; 47int length = results.Length;
TestSweeper.cs (12)
106Assert.Equal(5, initialList.Length); 329for (int i = 0; i < sleeps.Length; i++) 386for (int i = 0; i < metrics.Length; i++) 443Assert.Equal(5, initialList.Length); 477Assert.Equal(4, nextList.Length); 509Assert.Equal(9, lastList.Length); 561Assert.Equal(3, sweeps.Length); 590Assert.True(sweeps.Length <= 5); 609Assert.Equal(3, sweeps.Length); 638Assert.True(sweeps == null || sweeps.Length <= 5); 661Assert.Equal(Math.Min(args.NumberInitialPopulation, maxInitSweeps), sweeps.Length); 690Assert.True(sweeps.Length <= 5);
Microsoft.ML.TensorFlow (52)
TensorflowTransform.cs (37)
235var srcTensorGetters = new ITensorValueGetter[inputColIndices.Length]; 236for (int i = 0; i < inputColIndices.Length; i++) 272for (int j = 0; j < inputs.Length; j++) 282for (int j = 0; j < outputs.Length; j++) 308TFInputNodes = new TF_Output[Inputs.Length]; 309TFOutputNodes = new TF_Output[Outputs.Length]; 311for (int index = 0; index < TFInputOperations.Length; index += 1) 314for (int index = 0; index < TFOutputOperations.Length; index += 1) 336var tfInputTypes = new TF_DataType[inputs.Length]; 337var tfInputShapes = new TensorShape[inputs.Length]; 338var tfInputOperations = new (Operation, int)[inputs.Length]; 376c_api.TF_GraphGetTensorShape(graph, output, dims, dims.Length, cstatus.Handle); 383var tfOutputTypes = new TF_DataType[outputs.Length]; 384var outputTypes = new DataViewType[outputs.Length]; 386var tfOutputOperations = new (Operation, int)[outputs.Length]; 388for (int i = 0; i < outputs.Length; i++) 412for (int j = 0; j < dims.Length; j++) 414if (dims == null || dims.Length == 0) 496ctx.Writer.Write(Inputs.Length); 501ctx.Writer.Write(Outputs.Length); 547_inputColIndices = new int[_parent.Inputs.Length]; 548_isInputVector = new bool[_parent.Inputs.Length]; 549_fullySpecifiedShapes = new TensorShape[_parent.Inputs.Length]; 550for (int i = 0; i < _parent.Inputs.Length; i++) 566if (shape == null || (shape.Length == 0)) 603if (numOfUnkDim == 3 && colTypeDims.Length == 3 && originalShapeNdim == numOfUnkDim + 1 && originalShapeDims[1] == -1) 632for (int ishape = 1; ishape < l.Length; ishape++) 759for (int i = 0; i < _parent.Inputs.Length; i++) 766Contracts.Assert(tensors.Length > 0); 768for (int j = 0; j < activeOutputColNames.Length; j++) 781return col => Enumerable.Range(0, _parent.Outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col); 786var info = new DataViewSchema.DetachedColumn[_parent.Outputs.Length]; 787for (int i = 0; i < _parent.Outputs.Length; i++) 833if (tfShape.dims != null && tfShape.dims.Length != 0) 884if (tfShape.dims.Length != 0) 1035for (var i = 0; i < _options.InputColumns.Length; i++) 1044for (var i = 0; i < _options.OutputColumns.Length; i++)
TensorflowUtils.cs (15)
418for (int i = 0; i < buffer.Length; i++) 472string[] strings = new string[data.Length]; 473for (int i = 0; i < strings.Length; i++) 535_inputValues = new IntPtr[_inputs.Length]; 536_inputTensors = new Tensor[_inputs.Length]; 537_outputValues = new IntPtr[_outputs.Length]; 538_outputTensors = new Tensor[_outputs.Length]; 548_inputValues = new IntPtr[_inputs.Length]; 549_inputTensors = new Tensor[_inputs.Length]; 550_outputValues = new IntPtr[_outputs.Length]; 551_outputTensors = new Tensor[_outputs.Length]; 594_inputs.Length, _outputs, _outputValues, _outputValues.Length, _operations, 595_operations.Length, IntPtr.Zero, _status.Handle); 615for (int i = 0; i < _outputs.Length; i++)
Microsoft.ML.TensorFlow.Tests (19)
TensorflowTests.cs (19)
320Assert.Equal(sample.OneDim.Length, oneDimValues.Length); 324Assert.Equal(sample.TwoDim.Length, twoDimValues.Length); 328Assert.Equal(sample.ThreeDim.Length, threeDimValues.Length); 332Assert.Equal(sample.FourDim.Length, fourDimValues.Length); 336Assert.Equal(sample.FourDimKnown.Length, fourDimKnownValues.Length); 763if (directories != null && directories.Length > 0) 971for (int i = 0; i < onePrediction.PredictedLabels.Length; i++) 1205for (var i = 0; i < predictions.Length; i++) 1207for (var j = 0; j < predictions[i].PredictedScores.Length; j++) 1298Assert.Equal(2, prediction.Prediction.Length); 1361for (int i = 0; i < input.A.Length; i++) 1552string[] labels = new string[directories.Length]; 1553for (int j = 0; j < labels.Length; j++) 1581Assert.Equal((int)labelCountFirst, predictionFirst.Score.Length); 1582Assert.Equal((int)labelCountSecond, predictionSecond.Score.Length); 1711string[] labels = new string[directories.Length]; 1712for (int j = 0; j < labels.Length; j++) 1740Assert.Equal((int)labelCountFirst, predictionFirst.Score.Length); 1741Assert.Equal((int)labelCountSecond, predictionSecond.Score.Length);
Microsoft.ML.TestFramework (25)
BaseTestPredictorsMaml.cs (1)
291for (int i = 0; i < dataFiles.Length; i++)
DataPipe\TestDataPipe.cs (8)
219var getters = new ValueGetter<VBuffer<float>>[cols.Length]; 220for (int i = 0; i < cols.Length; i++) 233for (int i = 0; i < cols.Length; i += 2) 915expected[0] = new VBuffer<ReadOnlyMemory<char>>(values.Length, values); 917expected[1] = new VBuffer<ReadOnlyMemory<char>>(values1.Length, values1); 1157Assert.True(resultRow.Length == r.Length); 1158for (int i = 0; i < r.Length; i++) 1171for (int i = 0; i < values.Length; ++i)
DataPipe\TestDataPipeBase.cs (6)
452string[] res = new string[args1.Length + args2.Length]; 453Array.Copy(args1, res, args1.Length); 454Array.Copy(args2, 0, res, args1.Length, args2.Length); 801Func<bool>[] idComps = new Func<bool>[cursors.Length];
SubComponent.cs (7)
61return _kind.Length == 0 && _settings.Length == 0; 85if (settings == null || settings.Length == 1 && string.IsNullOrEmpty(settings[0])) 114if (_settings.Length != other._settings.Length) 116for (int i = 0; i < _settings.Length; i++) 130if (_settings.Length == 0) 150for (int i = 0; i < Settings.Length; i++)
TestCommandBase.cs (3)
92string[] retval = new string[many.Length + 1]; 182var argString = Path.ArgStr(_names[_names.Length - 1]); 183for (int i = _names.Length - 1; --i >= 0;)
Microsoft.ML.TestFrameworkCommon (1)
Utility\LibraryLoader.cs (1)
66if (names == null || names.Length == 0)
Microsoft.ML.Tests (80)
CalibratedModelParametersTests.cs (3)
145for (int i = 0; i < rawScores.Length; i++) 153for (int i = 0; i < scores.Length; i++) 155averageScore /= scores.Length;
CollectionsDataViewTest.cs (3)
98if (x.Length != y.Length) 100for (int i = 0; i < x.Length; i++)
EvaluateTests.cs (1)
67for (int i = 0; i < expectedTopKArray2.Length; i++)
ExpressionLanguageTests\ExpressionLanguageTests.cs (11)
169var perm = Utils.GetIdentityPermutation(types.Length); 229var res = new DataViewType[toks.Length]; 230for (int i = 0; i < toks.Length; i++) 246var args = new object[types.Length]; 247var getters = new Func<ReadOnlyMemory<char>, bool>[types.Length]; 248for (int i = 0; i < getters.Length; i++) 273Contracts.Assert(vals.Length == getters.Length); 274for (int i = 0; i < getters.Length; i++) 537if (a < 0 || a >= c.Length) 634var meths = new MethodInfo[funcs.Length]; 635for (int i = 0; i < funcs.Length; i++)
FeatureContributionTests.cs (6)
311bldr.AddColumn("GroupId", NumberDataViewType.UInt32, CreateGroupIds(yArray.Length)); 335for (int i = 0; i < rawScores.Length; i++) 344for (int i = 0; i < rawScores.Length; i++) 357for (int i = 0; i < scores.Length; i++) 359averageScore /= scores.Length; 369for (int i = 0; i < groupIds.Length; i++)
ImagesTests.cs (1)
316for (int i = 0; i < imageData.Length; i += 4)
LearningRateSchedulerTest.cs (1)
46for (int i = 0; i < expectedValues.Length; ++i)
OnnxConversionTest.cs (8)
483for (int j = 0; j < dataViews.Length; j++) 1206for (int j = 0; j < dataViews.Length; j++) 1369for (int j = 0; j < dataViews.Length; j++) 1417for (int i = 0; i < pipelines.Length; i++) 1419for (int j = 0; j < dataViews.Length; j++) 1500for (int i = 0; i < pipelines.Length; i++) 1518var columnName = i >= pipelines.Length - 2 ? "Tokens" : "NGrams"; 1866for (int i = 0; i < pipelines.Length; i++)
PermutationFeatureImportanceTests.cs (7)
855bldr.AddColumn("GroupId", NumberDataViewType.UInt32, CreateGroupIds(yArray.Length)); 935bldr.AddColumn("GroupId", NumberDataViewType.UInt32, CreateGroupIds(yArray.Length)); 978for (int i = 0; i < rawScores.Length; i++) 987for (int i = 0; i < rawScores.Length; i++) 1000for (int i = 0; i < scores.Length; i++) 1002averageScore /= scores.Length; 1012for (int i = 0; i < groupIds.Length; i++)
Scenarios\Api\TestApi.cs (3)
211var coltypeStringArray = new VectorDataViewType(coltypeString, valueStringArray.Length); 214var coltypeFloatArray = new VectorDataViewType(coltypeFloat, valueFloatArray.Length); 256VBuffer<float> valueFloatVBuffer = new VBuffer<float>(valueFloatArray.Length, valueFloatArray);
Scenarios\WordBagTest.cs (1)
76Assert.Equal(65536, prediction.Text.Length);
TextLoaderTests.cs (10)
60for (; i < sByteTargets.Length; i++) 78if (i < sByteTargets.Length - 1) 84Assert.Equal(i, sByteTargets.Length); 451for (int i = 0; i < getters.Length; i++) 461for (int i = 0; i < getters.Length; i++) 471for (int i = 0; i < getters.Length; i++) 594Assert.True(Directory.GetFiles(directoryName).Length == 2); 1091Assert.Equal(featuresPeriodArray.Length, featuresCommaArray.Length); 1093for (int i = 0; i < featuresPeriodArray.Length; i++)
TrainerEstimators\CalibratorEstimators.cs (1)
178for (int i = 0; i < dataArray.Length; i++)
TrainerEstimators\LbfgsTests.cs (1)
111Assert.Equal(17, coefficients.Length);
TrainerEstimators\SdcaTests.cs (6)
140Assert.True(scores1.Length == scores2.Length); 143for (int i = 0; i < scores1.Length; i++) 199Assert.True(scores1.Length == scores2.Length); 202for (int i = 0; i < scores1.Length; i++)
Transformers\CountTargetEncodingTests.cs (4)
132var getters = new ValueGetter<VBuffer<float>>[countCols.Length]; 133var getters1 = new ValueGetter<VBuffer<float>>[countCols.Length]; 134for (int i = 0; i < countCols.Length; i++) 145for (int i = 0; i < countCols.Length; i++)
Transformers\GroupUngroup.cs (4)
63Assert.Equal(2, grouped[0].UserName.Length); 66Assert.Equal(2, grouped[0].Gender.Length); 72Assert.Equal(2, grouped[1].Gender.Length); 75Assert.Equal(2, grouped[1].Gender.Length);
Transformers\ValueMappingTests.cs (3)
208Assert.Equal(values[1].Length, dValue.Length); 211Assert.Equal(values[2].Length, eValue.Length); 214Assert.Equal(values[0].Length, fValue.Length);
Transformers\WordTokenizeTests.cs (6)
73Assert.True(tokenizeA.Length == nativeResult.TokenizeA.Length); 74for (int i = 0; i < tokenizeA.Length; ++i) 81Assert.True(tokenizeB.Length == nativeResult.TokenizeB.Length); 82for (int i = 0; i < tokenizeB.Length; ++i)
Microsoft.ML.TimeSeries (110)
Deseasonality.cs (2)
29var length = values.Length; 72var length = values.Length;
EigenUtils.cs (1)
20var count = a.Length;
FftUtils.cs (16)
226Contracts.Check(inputRe.Length >= length && inputIm.Length >= length && outputRe.Length >= length && outputIm.Length >= length, 271Contracts.Check(inputRe.Length >= length && inputIm.Length >= length && outputRe.Length >= length && outputIm.Length >= length, 328Contracts.Check(inputRe.Length >= length && inputIm.Length >= length && outputRe.Length >= length && outputIm.Length >= length, 373Contracts.Check(inputRe.Length >= length && inputIm.Length >= length && outputRe.Length >= length && outputIm.Length >= length,
MovingAverageTransform.cs (2)
76if (_weights != null && _weights.Length != args.WindowSize) 154sumWeights = weights[weights.Length - 1];
PolynomialUtils.cs (3)
46var n = coefficients.Length; 76int n = coefficients.Length; 284int n = roots.Length;
PredictionEngine.cs (7)
170if (innerMappers.Length == 0) 192var deps = new IEnumerable<DataViewSchema.Column>[innerMappers.Length]; 193deps[deps.Length - 1] = activeColumns; 194for (int i = deps.Length - 1; i >= 1; --i) 198for (int i = 0; i < innerMappers.Length; ++i) 251IRowToRowMapper[] mappers = new IRowToRowMapper[transformers.Length]; 253for (int i = 0; i < mappers.Length; ++i)
SeasonalityDetector.cs (14)
219if (values.Length < 2) 224var medianAggregator = new MedianDblAggregator(values.Length / 2 + 1 - values.Length / timeSeriesLength); 229for (int i = values.Length / timeSeriesLength; i < values.Length / 2 + 1; i++) 244int period = values.Length / bestFrequency; 245double lowerBound = values.Length * 1.0 / (period + 1); 246double upperBound = values.Length * 1.0 / (period - 1); 248for (int i = values.Length / timeSeriesLength; i < values.Length / 2 + 1; i++) 265if (i < values.Length - 1) 314int lowerBound = values.Length / (frequency + 1); 315int upperBound = values.Length / (frequency - 1); 317for (int i = lowerBound; i <= upperBound && i < values.Length; i++)
SequentialTransformerBase.cs (5)
666Contracts.CheckParam(index < _getters.Length, nameof(column), "Invalid col value in GetGetter"); 683Contracts.Check(index < _getters.Length); 817Contracts.Assert(activeInput.Length == _bindings.InputSchema.Count); 827col => 0 <= col && col < activeInput.Length && (activeInput[col] || predicateIn(col)); 848Contracts.Assert(active.Length == _bindings.Schema.Count);
SrCnnEntireAnomalyDetector.cs (39)
182return col => 0 <= col && col < active.Length && active[col]; 485results = new double[values.Length][]; 486for (int i = 0; i < results.Length; ++i) 491else if (results.Length > values.Length) 493Array.Resize<double[]>(ref results, values.Length); 502Array.Resize(ref _seriesToDetect, values.Length); 503for (int i = 0; i < values.Length; ++i) 513_mean = sum / values.Length; 514_std = Math.Sqrt((squareSum - (sum * sum) / values.Length) / values.Length); 554int length = _backAddArray.Length; 613AverageFilter(_ifftMagList, Math.Min(_ifftMagList.Length, _judgementWindowSize)); 651for (int i = data.Length - _lookaheadWindowSize - 2; i < data.Length - 1; ++i) 656Array.Resize(ref _backAddArray, data.Length + _backAddWindowSize); 657for (int i = 0; i < data.Length; ++i) 663_backAddArray[data.Length + i] = predictedValue; 669var n = data.Length; 681int length = data.Length; 718for (int i = 0; i < results.Length; ++i) 727for (int i = 0; i < values.Length; ++i) 741for (int i = 0; i < results.Length; ++i) 756for (int i = 0; i < values.Length; ++i) 783for (int i = 0; i < values.Length; ++i) 813for (int i = 0; i < results.Length; ++i) 837for (int i = 0; i < results.Length; ++i) 888for (int i = 0; i < scores.Length; ++i) 899Array.Resize(ref _deAnomalyData, data.Length); 900Array.Copy(data, _deAnomalyData, data.Length); 906int end = Math.Min(data.Length - 1, idx + step); 917while (fitValues.Count < minPointsToFit && (start > 0 || end < data.Length - 1)) 921end = Math.Min(data.Length - 1, idx + step); 955int length = data.Length; 977int window = Math.Min(data.Length / 3, 512); 984for (int i = 0; i < _trends.Length; ++i) 1004Array.Resize(ref _units, _trends.Length); 1005for (int i = 0; i < _units.Length; ++i) 1025int tLen = data.Length;
STL\InnerStl.cs (7)
169for (int i = 0; i < _s.Length; i++) 194for (int i = 0; i < detrendedY.Length; i++) 201for (int i = 0; i < _cycleSubSeries.Length; i++) 220for (int j = 0; j < _smoothedSubseries.Length; j++) 250for (int i = 0; i < s.Length; i++) 266List<double> virtualDeseasonSeries = VirtualXValuesProvider.GetXValues(deseasonSeries.Length); 269for (int i = 0; i < deseasonSeries.Length; i++)
STL\LocalRegression.cs (7)
199var errors = new double[NeighborsX.Length]; 200var absErrors = new double[NeighborsX.Length]; 201for (int i = 0; i < NeighborsX.Length; i++) 210double median = absErrors[absErrors.Length / 2]; 215var deltas = new double[errors.Length]; 216for (int i = 0; i < errors.Length; i++) 222for (int i = 0; i < Weights.Length; i++)
TrajectoryMatrix.cs (7)
120_ectx.Check(data.Length >= seriesLength, "The series length cannot be greater than the data length."); 150FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _cachedSeriesFftRe, _cachedSeriesFftIm, _inputRe.Length); 176FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _cachedSeriesFftRe, _cachedSeriesFftIm, _inputRe.Length); 312FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _outputRe, _outputIm, _inputRe.Length); 327FftUtils.ComputeBackwardFft(_outputRe, _outputIm, _outputRe, _outputIm, _inputRe.Length); 416FftUtils.ComputeForwardFft(_inputRe, _allZerosIm, _outputRe, _outputIm, _inputRe.Length); 431FftUtils.ComputeBackwardFft(_outputRe, _outputIm, _outputRe, _outputIm, _inputRe.Length);
Microsoft.ML.TimeSeries.Tests (6)
TimeSeriesDirectApi.cs (6)
637Assert.Equal(3, prediction.Prediction.Length); 644Assert.Equal(4, prediction.Prediction.Length); 654Assert.Equal(7, prediction.Prediction.Length); 712Assert.Equal(7, prediction.Prediction.Length); 817Assert.Equal(7, prediction.Prediction.Length); 875Assert.Equal(7, prediction.Prediction.Length);
Microsoft.ML.Tokenizers (52)
Model\CodeGenTokenizer.cs (5)
1289if (bytes.Length - bytesIndex < bytesCountToEncode) 1291Helpers.ArrayPoolGrow(ref bytes, (bytes.Length + bytesCountToEncode) * 2); 1571if (bytesIndex >= bytes.Length) 1573Helpers.ArrayPoolGrow<byte>(ref bytes, bytes.Length * 2); 1627string tokenValue = (uint)c < charToString.Length ? charToString[c] : c.ToString();
Model\EnglishRobertaTokenizer.cs (3)
947Debug.Assert(token[0] < charToString.Length); 955Debug.Assert(c < charToString.Length); 1248if (splitLine.Length != 2)
Model\SentencePieceTokenizer.cs (12)
326for (int index = 0; (uint)index < (uint)symbols.Length; index = symbols[index].next) 675for (int index = 0; index != -1 && index < symbols.Length; index = symbols[index].next) 999for (int index = 0; index != -1 && index < symbols.Length; index = symbols[index].next) 1304if (splits.Length == 0) 1309(int Offset, int Length) current = splits[splits.Length - 1]; 1321for (int i = splits.Length - 1; i >= 0 && idsCount < maxTokens; i--) 1374while (symbols[lastSymbolIndex].next != -1 && lastSymbolIndex < symbols.Length) 1621if (bytesCount >= bytesPoolArray!.Length) 1685if (len > charPoolArray.Length) 1904if (bytesCount >= bytesPoolArray!.Length) 2027if (len > charPoolArray.Length) 2175Debug.Assert(symbols.Length >= text.Length);
Model\TiktokenTokenizer.cs (13)
305for (int i = 0; i < value.Length; i++) 338Debug.Assert(encodedTokens.Length > 0); 346for (int i = 0; i < encodedTokens.Length; i++) 468if (tokens.Length <= maxTokens) 479return tokens.Length; 491while (j < tokens.Length && tokens[j].TokenIndex < overlapIndex) 759if (tokens.Length <= maxTokens) 770return tokens.Length; 773int index = tokens.Length - maxTokens; 776while (index < tokens.Length && tokens[index].TokenIndex < tokens[index - 1].TokenIndex + tokens[index - 1].TokenLength) 781for (int i = index; i < tokens.Length; i++) 786textIndex = index >= tokens.Length ? fullTextLength : tokens[index].TokenIndex; 787return tokens.Length - index;
Normalizer\BertNormalizer.cs (3)
152if (index >= buffer.Length) 163if (index + chars.Length >= buffer.Length) 165Helpers.ArrayPoolGrow(ref buffer, index + buffer.Length + 10);
Tokenizer.cs (3)
47for (int i = 0; i < ids.Length; i++) 397long newSize = (long)destination.Length * 2; 400newSize = (long)destination.Length + 1;
Utils\BytePairEncoder.cs (1)
88for (int i = 0; i < result.Length; i++)
Utils\Helpers.cs (1)
16T[] tmp = ArrayPool<T>.Shared.Rent(Math.Max(arrayPoolArray.Length * 2, requiredCapacity));
Utils\Helpers.netstandard.cs (8)
131if (bytesIndex + 1 > destination.Length) 133Helpers.ArrayPoolGrow(ref destination, destination.Length * 2); 143if (bytesIndex + 2 > destination.Length) 145Helpers.ArrayPoolGrow(ref destination, destination.Length * 2); 156if (bytesIndex + 4 > destination.Length) 158Helpers.ArrayPoolGrow(ref destination, Math.Max(destination.Length, 4) * 2); 170if (bytesIndex + 3 > destination.Length) 172Helpers.ArrayPoolGrow(ref destination, Math.Max(destination.Length, 3) * 2);
Utils\Vec.cs (3)
41public int Capacity => _buffer is null ? 0 : _buffer.Length; 54if (_buffer.Length <= _count) 56Array.Resize(ref _buffer, _buffer.Length << 1);
Microsoft.ML.Tokenizers.Tests (201)
BpeTests.cs (29)
261Assert.Equal(expectedTokens.Length, encoding.Count); 262Assert.Equal(offsets.Length, encoding.Count); 263Assert.Equal(ids.Length, encoding.Count); 264Assert.Equal(ids.Length, idsList.Count); 265Assert.Equal(ids.Length, tokenizer.CountTokens(sentence)); 304for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 308Assert.True(idsConsumed < ids.Length); 318Assert.Equal(ids.Length, idsConsumed); 442Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length)); 445Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length)); 449Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text, expectedIds.Length - 2, out normalizedString, out length)); 451int expectedLength = expectedOffsets[expectedOffsets.Length - 3].Index + expectedOffsets[expectedOffsets.Length - 3].Length; 453Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 2, out normalizedString, out length)); 457Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text)); 458Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan())); 460Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedString, out int tokenCount)); 462Assert.Equal(expectedIds.Length - 3, tokenCount); 463Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedString, out tokenCount)); 465Assert.Equal(expectedIds.Length - 3, tokenCount); 467Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedString, out tokenCount)); 470Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedString, out tokenCount));
CodeGenTests.cs (68)
312for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 316Assert.True(idsConsumed < ids.Length); 326Assert.Equal(ids.Length, idsConsumed); 379Assert.Equal(ids, codeGenTokenizer.EncodeToIds(text, ids.Length, out string? normalizedString, out int length)); 382Assert.Equal(ids, codeGenTokenizer.EncodeToIds(text.AsSpan(), ids.Length, out normalizedString, out length)); 386Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text, expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 389Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 393Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text, expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 396Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 400int expectedTokensToExclude = expectedOffsets.Length > 1 && expectedOffsets[expectedOffsets.Length - 1].Index == expectedOffsets[expectedOffsets.Length - 2].Index ? 2 : 1; 401Assert.Equal(ids.Take(ids.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, ids.Length - 1, out normalizedString, out length)); 404int expectedLength = offsets.Length > expectedTokensToExclude ? offsets[offsets.Length - expectedTokensToExclude - 1].Index + offsets[offsets.Length - expectedTokensToExclude - 1].Length : 0; 406Assert.Equal(ids.Take(ids.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), ids.Length - 1, out normalizedString, out length)); 410Assert.Equal(expectedIds.Take(expectedIds.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, expectedIds.Length - 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 413Assert.Equal(expectedIds.Take(expectedIds.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 417Assert.Equal(expectedIdsWithSpace.Take(expectedIdsWithSpace.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, expectedIdsWithSpace.Length - 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 420Assert.Equal(expectedIdsWithSpace.Take(expectedIdsWithSpace.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length - 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out length)); 428Assert.Equal(ids.Length, codeGenTokenizer.CountTokens(text)); 429Assert.Equal(ids.Length, codeGenTokenizer.CountTokens(text.AsSpan())); 431Assert.Equal(expectedIds.Length, codeGenTokenizer.CountTokens(text, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false)); 432Assert.Equal(expectedIds.Length, codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false)); 434Assert.Equal(expectedIdsWithSpace.Length, codeGenTokenizer.CountTokens(text, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false)); 435Assert.Equal(expectedIdsWithSpace.Length, codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false)); 443Assert.Equal(offsets[offsets.Length - 1].Index + offsets[offsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text, ids.Length, out normalizedString, out int tokenCount)); 445Assert.Equal(ids.Length, tokenCount); 446Assert.Equal(offsets[offsets.Length - 1].Index + offsets[offsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), ids.Length, out normalizedString, out tokenCount)); 448Assert.Equal(ids.Length, tokenCount); 450Assert.Equal(expectedOffsets[expectedOffsets.Length - 1].Index + expectedOffsets[expectedOffsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text, expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount)); 452Assert.Equal(expectedIds.Length, tokenCount); 453Assert.Equal(expectedOffsets[expectedOffsets.Length - 1].Index + expectedOffsets[expectedOffsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount)); 455Assert.Equal(expectedIds.Length, tokenCount); 457Assert.Equal(expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index + expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text, expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount)); 459Assert.Equal(expectedIdsWithSpace.Length, tokenCount); 460Assert.Equal(expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index + expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedString, out tokenCount)); 462Assert.Equal(expectedIdsWithSpace.Length, tokenCount); 468int expectedIndex = offsets.Length > 1 && offsets[offsets.Length - 1].Index == offsets[offsets.Length - 2].Index ? text.Length : offsets[offsets.Length - 1].Index; 484expectedIndex = offsets.Length > 1 && expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index == expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 2].Index ? text.Length : expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index; 501for (int i = 0; i < tokens.Length; i++) 1017calculatedLengthUsingOffsets = expectedTokenCountFromEnd > 0 ? offsets[offsets.Length - expectedTokenCountFromEnd].Index : input.Length;
EnglishRobertaTests.cs (26)
194Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length)); 197Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length)); 201Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text, expectedIds.Length - 2, out normalizedString, out length)); 203int expectedLength = expectedOffsets[expectedOffsets.Length - 3].Index + expectedOffsets[expectedOffsets.Length - 3].Length; 205Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 2, out normalizedString, out length)); 209Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text)); 210Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan())); 212Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedString, out int tokenCount)); 214Assert.Equal(expectedIds.Length - 3, tokenCount); 215Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedString, out tokenCount)); 217Assert.Equal(expectedIds.Length - 3, tokenCount); 219Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedString, out tokenCount)); 222Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedString, out tokenCount)); 272Assert.Equal(((int[])p[1]).Length, idsCount); 289for (int i = 0; i < tokens.Length; i++) 317for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 321Assert.True(idsConsumed < ids.Length); 329Assert.Equal(ids.Length, idsConsumed);
LlamaTests.cs (42)
251Assert.Equal(ids.Length, llamaTokenizer.CountTokens(input)); 255for (int i = 0; i < tokens.Length; i++) 274Assert.Equal(isEmptyInput ? 0 : ids.Length - 1, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false)); 284Assert.Equal(isEmptyInput ? 0 : ids.Length, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: true, considerNormalization: false)); 294Assert.Equal(isEmptyInput ? 0 : ids.Length + 1, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: true, addEndOfSentence: true, considerNormalization: false)); 308for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 312Assert.True(idsConsumed < ids.Length); 322Assert.Equal(ids.Length, idsConsumed); 558Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length)); 561Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length)); 579expectedIds1.Length, 588expectedIds1.Length, 596Assert.Equal(expectedIds1.Take(expectedIds1.Length - 6), sentencePieceBpe.EncodeToIds( 600expectedIds1.Length - 6, 606(int Index, int Length)[] expectedOffsets1 = addBeginningOfSentence ? expectedOffsets.Take(expectedIds1.Length - 6).ToArray() : expectedOffsets.Skip(1).Take(expectedIds1.Length - 6).ToArray(); 608int expectedLength = expectedOffsets1[expectedOffsets1.Length - 1].Index + expectedOffsets1[expectedOffsets1.Length - 1].Length; 611Assert.Equal(expectedIds1.Take(expectedIds1.Length - 6), sentencePieceBpe.EncodeToIds( 615expectedIds1.Length - 6, 632Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text)); 633Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan())); 635Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index + expectedOffsets[expectedOffsets.Length - 7].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 6, out string? normalizedString, out int tokenCount)); 637Assert.Equal(expectedIds.Length - 6, tokenCount); 638Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index + expectedOffsets[expectedOffsets.Length - 7].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 6, out normalizedString, out tokenCount)); 640Assert.Equal(expectedIds.Length - 6, tokenCount); 642Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 7, out normalizedString, out tokenCount)); 645Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 7, out normalizedString, out tokenCount)); 697accumulatedStringFromEnd = (encodedTokens.Count == i ? DummyPrefix : (i % 2 == 0 ? $"{DummyPrefix}Hello" : specialTokens[specialTokens.Length - 1 - (i / 2)])) + accumulatedStringFromEnd; 846for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 860for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 885for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 899for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only.
PreTokenizerTests.cs (2)
67Assert.True(encoding.Count >= splitParts.Length, $"Expected to have {encoding.Count} >= {splitParts.Length}");
TiktokenTests.cs (34)
168for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 172Assert.True(idsConsumed < ids.Length); 182Assert.Equal(ids.Length, idsConsumed); 581Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedString, out int length)); 584Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length)); 588Assert.Equal(expectedIds.Take(expectedIds.Length - 4), tokenizer.EncodeToIds(text, expectedIds.Length - 4, out normalizedString, out length)); 590int expectedLength = expectedOffsets[expectedOffsets.Length - 5].Index + expectedOffsets[expectedOffsets.Length - 5].Length; 592Assert.Equal(expectedIds.Take(expectedIds.Length - 4), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 4, out normalizedString, out length)); 596Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text)); 597Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan())); 599Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedString, out int tokenCount)); 601Assert.Equal(expectedIds.Length - 3, tokenCount); 602Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedString, out tokenCount)); 604Assert.Equal(expectedIds.Length - 3, tokenCount); 606Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedString, out tokenCount)); 609Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedString, out tokenCount)); 690Assert.Equal(expectedIds.Length, GPT4.CountTokens(text)); 692for (int tokenCount = 1; tokenCount <= ids.Length; tokenCount++) 695Assert.True(count <= ids.Length); 699Assert.True(count < ids.Length - 1); 713Assert.True(count <= ids.Length); 717Assert.True(ids.Length - tokenCount > 0); 718Assert.True(offsets[offsets.Length - tokenCount].Index < offsets[offsets.Length - tokenCount - 1].Index + offsets[offsets.Length - tokenCount - 1].Length); 723Assert.Equal(offsets[offsets.Length - count].Index, index);
Microsoft.ML.TorchSharp (33)
AutoFormerV2\Anchors.cs (6)
67for (int idx = 0; idx < this.pyramidLevels.Length; ++idx) 100var numAnchors = ratios.Length * scales.Length; 106anchors[RangeUtil.ToTensorIndex(..), RangeUtil.ToTensorIndex(2..)] = baseSize * torch.tile(scales, new long[] { 2, ratios.Length }).transpose(1, 0); 112anchors[RangeUtil.ToTensorIndex(..), 2] = torch.sqrt(areas / torch.repeat_interleave(ratios, new long[] { scales.Length })); 113anchors[RangeUtil.ToTensorIndex(..), 3] = torch.mul(anchors[RangeUtil.ToTensorIndex(..), 2], torch.repeat_interleave(ratios, new long[] { scales.Length }));
AutoFormerV2\ObjectDetectionMetrics.cs (1)
219for (int predSignIndex = 0; predSignIndex < predSign.Length; predSignIndex++)
AutoFormerV2\ObjectDetectionTrainer.cs (8)
430var meanTensor = MEAN.ToTensor(new long[4] { 1L, MEAN.Length, 1L, 1L }).to_type(ScalarType.Float32).to(device); 431var stdTensor = STD.ToTensor(new long[4] { 1L, STD.Length, 1L, 1L }).to_type(ScalarType.Float32).to(device); 816var editor = VBufferEditor.Create(ref dst, outputCacher.ScoresBuffer.Length); 818for (var i = 0; i < outputCacher.ScoresBuffer.Length; i++) 840var editor = VBufferEditor.Create(ref dst, outputCacher.PredictedLabelsBuffer.Length); 842for (var i = 0; i < outputCacher.PredictedLabelsBuffer.Length; i++) 864var editor = VBufferEditor.Create(ref dst, outputCacher.BoxBuffer.Length); 866for (var i = 0; i < outputCacher.BoxBuffer.Length; i++)
AutoFormerV2\PatchMerging.cs (1)
45if (x.shape.Length == 3)
NasBert\Modules\EmbedTransfer.cs (3)
32var hiddenTransfer = SearchSpace.HiddenSizeChoices.Where((source, index) => index != SearchSpace.HiddenSizeChoices.Length - 1) 33.Select(hidden => torch.nn.Linear(hidden, SearchSpace.HiddenSizeChoices[SearchSpace.HiddenSizeChoices.Length - 1])) 42if (hiddenSize == SearchSpace.HiddenSizeChoices[SearchSpace.HiddenSizeChoices.Length - 1]) return x;
NasBert\Modules\Layers\FeedForwardLayer.cs (2)
36SearchSpace.HiddenSizeChoices[SearchSpace.HiddenSizeChoices.Length - 1]); 38SearchSpace.HiddenSizeChoices[SearchSpace.HiddenSizeChoices.Length - 1]);
NasBert\Modules\MultiHeadAttention.cs (2)
162if (query.IsNull() || query.size().Length != 3 || query.size(2) != _embeddingDim) 247if (keyPaddingMaskPad?.shape.Length == 0) keyPaddingMaskPad = null;
NasBert\TextClassificationTrainer.cs (1)
336for (var i = 0; i < values.Length; i++)
Roberta\Models\RobertaModel.cs (1)
111var size = srcTokenArray.Length;
Roberta\Modules\AttentionSelf.cs (2)
69var contextShape = DataUtils.Concat<long>(contextLayer.shape.AsSpan(0, contextLayer.shape.Length - 2), NumAttentionHeads * AttentionHeadSize); 80var newShape = DataUtils.Concat<long>(x.shape.AsSpan(0, x.shape.Length - 1), NumAttentionHeads, AttentionHeadSize);
Roberta\QATrainer.cs (4)
788var editor = VBufferEditor.Create(ref dst, outputCacher.ScoresBuffer.Length); 790for (var i = 0; i < outputCacher.ScoresBuffer.Length; i++) 815var editor = VBufferEditor.Create(ref dst, outputCacher.PredictedAnswersBuffer.Length); 817for (var i = 0; i < outputCacher.PredictedAnswersBuffer.Length; i++)
Utils\MetricUtils.cs (2)
37for (var i = 0; i < starts.Length; ++i) 39for (var j = 0; j < ends.Length; ++j)
Microsoft.ML.Transforms (486)
CountFeatureSelection.cs (10)
197var size = _columns.Length; 206for (int i = 0; i < selectedCount.Length; i++) 210if (dropSlotsColumns.Length <= 0) 212else if (copyColumnsPairs.Length <= 0) 249selectedCount = new int[scores.Length]; 257for (int j = 0; j < score.Length; j++) 263while (j < score.Length && score[j] < columnOptions[i].Count) 267if (j < score.Length) 300var size = columns.Length; 431var size = _count.Length;
CustomMappingFilter.cs (2)
86var cursors = new DataViewRowCursor[inputs.Length]; 87for (int i = 0; i < inputs.Length; i++)
CustomMappingTransformer.cs (2)
135if (!Enumerable.Range(0, result.Length).Any(activeOutput)) 157for (int i = 0; i < result.Length; i++)
Dracula\CountTable.cs (4)
52Contracts.Check(priorCounts.Length == labelCardinality); 58Contracts.Check(garbageCounts.Length == labelCardinality); 67_priorFrequencies = new double[priorCounts.Length]; 70for (int i = 0; i < priorCounts.Length; i++)
Dracula\CountTableTransformer.cs (16)
105if (columns.Length != initial.Featurizer.PriorCoef.Length) 106throw Contracts.ExceptParam(nameof(columns), $"New estimator applied {columns.Length} columns, but old transformer applied to {initial.Featurizer.PriorCoef.Length} columns"); 107var cols = new ColumnOptionsBase[columns.Length]; 108for (int i = 0; i < columns.Length; i++) 140var n = _columns.Length; 142var inputColumns = new DataViewSchema.Column[_columns.Length]; 143for (int i = 0; i < inputColumns.Length; i++) 180var colCount = _columns.Length; 479var columnOptions = new CountTableEstimator.ColumnOptions[options.Columns.Length]; 480for (int i = 0; i < options.Columns.Length; i++) 497var columnOptions = new CountTableEstimator.SharedColumnOptions[options.Columns.Length]; 498for (int i = 0; i < options.Columns.Length; i++) 553Seeds = ctx.Reader.ReadIntArray(ColumnPairs.Length); 577for (int i = 0; i < _labelClassNames.Length; i++)
Dracula\CountTargetEncodingTransformer.cs (13)
182var columns = new CountTableEstimator.SharedColumnOptions[options.Columns.Length]; 183for (int i = 0; i < options.Columns.Length; i++) 199var columns = new CountTableEstimator.ColumnOptions[options.Columns.Length]; 200for (int i = 0; i < options.Columns.Length; i++) 232for (int i = transformerChain.Length - 1; i >= 0; i--) 252var cols = new HashingEstimator.ColumnOptions[columns.Length]; 253for (int i = 0; i < cols.Length; i++) 265var cols = new HashingEstimator.ColumnOptions[columns.Length]; 266for (int i = 0; i < cols.Length; i++) 449var columnOptions = new CountTableEstimator.SharedColumnOptions[columns.Length]; 450for (int i = 0; i < columns.Length; i++) 459var columnOptions = new CountTableEstimator.ColumnOptions[columns.Length]; 460for (int i = 0; i < columns.Length; i++)
Dracula\DictCountTable.cs (1)
51Contracts.Check(counts.Length == labelCardinality, "Counts must be parallel to label cardinality");
Dracula\MultiCountTable.cs (14)
74var n = inputColumns.Length; 76for (int i = 0; i < _countTableBuilders.Length; i++) 98for (int i = 0; i < _countTableBuilders.Length; i++) 112_host.Assert(0 <= iCol && iCol < _countTableBuilders.Length); 113_host.Assert(0 <= iSlot && iSlot < _countTableBuilders[iCol].Length); 119var n = _countTableBuilders.Length; 124int size = _countTableBuilders[i].Length; 137public override int ColCount => _countTables.Length; 139public override int[] SlotCount => _countTables.Select(ct => ct.Length).ToArray(); 181Host.Assert(_countTables.Length > 0); 182ctx.Writer.Write(_countTables.Length); 184for (int i = 0; i < _countTables.Length; i++) 186var size = _countTables[i].Length; 253_colCount = inputColumns.Length;
Expression\BuiltinFunctions.cs (6)
379Contracts.Assert(values.Length == 1); 390Contracts.Assert(values.Length == 1); 412for (int i = 0; i < values.Length; i++) 416Contracts.Assert(values.Length > 1); 762for (int i = 0; i < a.Length; i++) 768for (int i = 0; i < a.Length; i++)
Expression\CharCursor.cs (1)
40Contracts.Assert(0 <= ichLimInit && ichLimInit <= buffer.Length);
Expression\CodeGen.cs (22)
40Contracts.Assert(1 <= node.Vars.Length && node.Vars.Length <= MaxParams); 47switch (node.Vars.Length) 63var types = new Type[node.Vars.Length + 1]; 66Contracts.Assert(0 <= v.Index && v.Index < node.Vars.Length); 70types[node.Vars.Length] = node.ResultType.RawType; 73Array.Copy(types, 0, types, 1, types.Length - 1); 761Contracts.Assert(node.Operands.Items.Length >= 2); 768if (kind == ExprTypeKind.TX && items.Length == 2) 792if (items.Length == 2) 828Contracts.Assert(items.Length > 2); 885if (i == items.Length - 1) 906Contracts.Assert(node.Op == CompareOp.NotEqual && items.Length > 2); 909var locals = new MethodGenerator.Temporary[items.Length]; 910for (int i = 0; i < locals.Length; i++) 920for (int i = 1; i < items.Length; i++) 938for (int i = locals.Length; --i >= 0;) 1251if (Utils.Size(ps) > 0 && (type = ps[ps.Length - 1].ParameterType).IsArray) 1260int head = ps.Length - 1; 1261int tail = node.Args.Items.Length - head; 1284Contracts.Assert(Utils.Size(ps) == node.Args.Items.Length); 1291Contracts.Assert(node.Args.Items.Length == 1);
Expression\LambdaBinder.cs (34)
978for (int i = 0; i < items.Length; i++) 999int lim = items.Length; 1011if (ifn >= _fnEqual.Length || ifn < 0) 1138return arity == Kinds.Length; 1139Contracts.Assert(Kinds.Length > 0); 1140return arity >= Kinds.Length - 1; 1145get { return Kinds.Length; } 1161bool isIdent = ps.Length == 1 && meth.ReturnType == typeof(void); 1174var kinds = new ExprTypeKind[ps.Length]; 1175for (int i = 0; i < ps.Length; i++) 1178if (i == ps.Length - 1 && !isIdent && type.IsArray) 1199Contracts.Assert(kinds.Length == 1); 1236Contracts.Assert(kinds.Length == Kinds.Length || IsVariable && kinds.Length >= Kinds.Length - 1); 1239int head = IsVariable ? Kinds.Length - 1 : Kinds.Length; 1250var kind = Kinds[Kinds.Length - 1]; 1251for (int i = head; i < kinds.Length; i++) 1274if (Kinds.Length != other.Kinds.Length) 1275return Kinds.Length > other.Kinds.Length ? -1 : +1; 1281for (int k = 0; k < Kinds.Length; k++) 1301var arity = kinds.Length; 1352if (arities.Length == 1) 1359else if (arities.Length == 2) 1366if (kindsRet.Length == 1) 1409var args = new object[node.Args.Items.Length]; 1412int ivMax = best.Kinds.Length - 1; 1413for (int i = 0; i < node.Args.Items.Length; i++) 1441int head = best.Kinds.Length - 1; 1442int tail = args.Length - head;
Expression\LambdaParser.cs (9)
156Contracts.Assert(types.Length <= LambdaCompiler.MaxParams); 157Contracts.Assert(Utils.Size(perm) == types.Length); 167Contracts.Assert(Utils.Size(perm) == types.Length); 385if (items.Count != _types.Length) 386PostError(tokFirst, "Wrong number of parameters, expected: {0}", _types.Length); 413if (index < _types.Length) 418Contracts.Assert(i < _perm.Length); 419Contracts.Assert(0 <= _perm[i] && _perm[i] < _perm.Length); 429PostError(tok, "Too many parameters, expected {0}", _types.Length);
Expression\LexCharUtils.cs (9)
164if (ch < _rgchi.Length) 177return ch < _rgchi.Length && _rgchi[ch].Is(LexCharKind.Punc); 181return ch < _rgchi.Length && _rgchi[ch].Is(LexCharKind.Digit); 185return ch < _rgchi.Length && _rgchi[ch].Is(LexCharKind.HexDigit); 189if (ch < _rgchi.Length) 195if (ch < _rgchi.Length) 201return ch >= _rgchi.Length && CharUnicodeInfo.GetUnicodeCategory(ch) == UnicodeCategory.Format; 205if (ch < _rgchi.Length) 211if (ch < _rgchi.Length)
Expression\Node.cs (8)
969Contracts.Assert(delimiters == null || delimiters.Length == items.Length - 1); 1052var argCount = Args.Items.Length; 1054if (Utils.Size(ps) > 0 && ps[ps.Length - 1].ParameterType.IsArray) 1057Contracts.Assert(argCount >= ps.Length - 1); 1080Contracts.Assert(operands.Items.Length >= 2); 1082Contracts.Assert(operands.Delimiters.Length == operands.Items.Length - 1);
Expression\Printer.cs (3)
368if (node.Vars.Length == 1) 483if (++i >= node.Operands.Items.Length) 516int count = node.Items.Length;
Expression\TokenCursor.cs (4)
60Contracts.Assert(0 <= _itokCur && _itokCur < _itokLim && _itokLim <= _buffer.Length); 104if (_itokLim >= _buffer.Length) 125Array.Resize(ref _buffer, 2 * _buffer.Length); 135Contracts.Assert(_itokLim < _buffer.Length);
ExpressionTransformer.cs (45)
90perm = Utils.GetIdentityPermutation(inputTypes.Length); 157var columns = new ExpressionTransformer.ColumnInfo[_columns.Length]; 158for (int i = 0; i < _columns.Length; i++) 161var inputTypes = new DataViewType[_columns[i].InputColumnNames.Length]; 173for (int i = 0; i < _columns.Length; i++) 175for (int j = 0; j < _columns[i].InputColumnNames.Length; j++) 182var inputTypes = new DataViewType[_columns[i].InputColumnNames.Length]; 274InputKinds = new InternalDataKind[inputTypes.Length]; 275for (int i = 0; i < inputTypes.Length; i++) 319var columns = new ExpressionEstimator.ColumnOptions[options.Column.Length]; 320for (int i = 0; i < options.Column.Length; i++) 401ctx.Writer.Write(_columns.Length); 403for (int i = 0; i < _columns.Length; i++) 406ctx.Writer.Write(inputColumnNames.Length); 407for (int j = 0; j < inputColumnNames.Length; j++) 414for (int j = 0; j < _columns[i].InputKinds.Length; j++) 428switch (types.Length - 1) 451var inputColumns = new DataViewSchema.Column[inputColumnNames.Length]; 452for (int i = 0; i < inputColumnNames.Length; i++) 461ectx.Assert(inputColumns.Length == 1); 476ectx.Assert(inputColumns.Length == 2); 494ectx.Assert(inputColumns.Length == 3); 515ectx.Assert(inputColumns.Length == 4); 539ectx.Assert(inputColumns.Length == 5); 570switch (types.Length - 1) 593var inputColumns = new DataViewSchema.Column[inputColumnNames.Length]; 594for (int i = 0; i < inputColumnNames.Length; i++) 603ectx.Assert(inputColumns.Length == 1); 604ectx.Assert(perm.Length == 1); 668ectx.Assert(inputColumns.Length == 2); 669ectx.Assert(perm.Length == 2); 728ectx.Assert(inputColumns.Length == 3); 729ectx.Assert(perm.Length == 3); 791ectx.Assert(inputColumns.Length == 4); 792ectx.Assert(perm.Length == 4); 857ectx.Assert(inputColumns.Length == 5); 858ectx.Assert(perm.Length == 5); 933_inputColumnIndices = new int[_parent._columns.Length][]; 934for (int i = 0; i < _parent._columns.Length; i++) 937_inputColumnIndices[i] = new int[inputColumnNames.Length]; 938for (int j = 0; j < inputColumnNames.Length; j++) 948var outputColumns = new DataViewSchema.DetachedColumn[_parent._columns.Length]; 949for (int i = 0; i < outputColumns.Length; i++) 968_parent.Host.Assert(0 <= iinfo && iinfo < _parent._columns.Length); 980for (int i = 0; i < _inputColumnIndices.Length; i++)
GcnTransform.cs (8)
218var cols = new GlobalContrastNormalizingEstimator.ColumnOptions[options.Columns.Length]; 221for (int i = 0; i < cols.Length; i++) 245var cols = new LpNormNormalizingEstimator.ColumnOptions[options.Columns.Length]; 248for (int i = 0; i < cols.Length; i++) 292var columnsLength = ColumnPairs.Length; 310Host.Assert(_columns.Length == ColumnPairs.Length); 611for (int iinfo = 0; iinfo < _srcCols.Length; ++iinfo)
GroupTransform.cs (13)
318ctx.Writer.Write(_groupColumns.Length); 326ctx.Writer.Write(_keepColumns.Length); 346var ids = new int[names.Length]; 348for (int i = 0; i < names.Length; i++) 374_ectx.Check(0 <= col && col < GroupColumnIndexes.Length + KeepColumnIndexes.Length); 523_groupCount = binding.GroupColumnIndexes.Length; 528var activeCols = _parent.Source.Schema.Where(x => x.Index < srcActiveLeading.Length && srcActiveLeading[x.Index]); 537for (int i = 0; i < binding.KeepColumnIndexes.Length; i++) 543activeCols = _parent.Source.Schema.Where(x => x.Index < srcActiveTrailing.Length && srcActiveTrailing[x.Index]); 550_aggregators = new KeepColumnAggregator[_parent._groupBinding.KeepColumnIndexes.Length]; 551for (int i = 0; i < _aggregators.Length; i++) 568Ch.CheckParam(column.Index < _active.Length, nameof(column));
HashJoiningTransform.cs (12)
140OutputColumnType = new VectorDataViewType(itemType, SlotMap.Length); 265Host.CheckDecode(slotMap[j].Distinct().Count() == slotMap[j].Length); 321for (int i = 0; i < ex.SlotMap.Length; i++) 323Host.Assert(ex.SlotMap[i].Distinct().Count() == ex.SlotMap[i].Length); 349var slotMap = new int[parts.Length][]; 350for (int i = 0; i < slotMap.Length; i++) 353var slots = new int[slotIndices.Length]; 355for (int j = 0; j < slots.Length; j++) 363if (slots.Distinct().Count() < slots.Length) 395for (int i = 0; i < _exes.Length; i++) 403new VectorDataViewType(TextDataViewType.Instance, ex.SlotMap.Length), GetSlotNames); 655Host.Assert(iinfo >= 0 && iinfo < _exes.Length);
KeyToVectorMapping.cs (4)
124var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 127for (int i = 0; i < cols.Length; i++) 281Host.Assert(0 <= iinfo && iinfo < _infos.Length); 339Host.Assert(0 <= iinfo && iinfo < _infos.Length);
MetricStatistics.cs (1)
67for (int i = 0; i < array.Length; i++)
MissingValueHandlingTransformer.cs (3)
146var tmpIsMissingColNames = input.Schema.GetTempColumnNames(options.Columns.Length, "IsMissing"); 147var tmpReplaceColNames = input.Schema.GetTempColumnNames(options.Columns.Length, "Replace"); 148for (int i = 0; i < options.Columns.Length; i++)
MissingValueIndicatorTransformer.cs (3)
206for (int iinfo = 0; iinfo < _infos.Length; iinfo++) 238Host.Assert(0 <= iinfo && iinfo < _infos.Length); 445for (int iinfo = 0; iinfo < _infos.Length; ++iinfo)
MissingValueReplacing.cs (22)
214for (int i = 0; i < ColumnPairs.Length; i++) 226var columnsLength = ColumnPairs.Length; 268Host.Assert(valReturn.Length == src.Length); 279repValues = new object[columns.Length]; 280slotIsDefault = new BitArray[columns.Length]; 281types = new DataViewType[columns.Length]; 282var sources = new int[columns.Length]; 283ReplacementKind[] imputationModes = new ReplacementKind[columns.Length]; 289for (int iinfo = 0; iinfo < columns.Length; iinfo++) 348for (int ii = 0; ii < statAggregators.Length; ii++) 352for (int ii = 0; ii < statAggregators.Length; ii++) 369Host.Assert(values.Length == type.GetVectorSize()); 370BitArray defaultSlots = new BitArray(values.Length); 373for (int slot = 0; slot < values.Length; slot++) 436var cols = new MissingValueReplacingEstimator.ColumnOptions[options.Columns.Length]; 437for (int i = 0; i < cols.Length; i++) 482return new VBuffer<T>(array.Length, array); 504for (int iinfo = 0; iinfo < _replaceTypes.Length; iinfo++) 625Host.Assert(0 <= iinfo && iinfo < _infos.Length); 700Host.Check(src.Length == repArray.Length); 781Host.Assert(rep.Length == src.Length); 852for (int iinfo = 0; iinfo < _infos.Length; ++iinfo)
MissingValueReplacingUtils.cs (21)
351Ch.Assert(0 <= slot && slot < Stat.Length); 584Ch.Assert(0 <= slot && slot < Stat.Length); 590float[] stat = new float[Stat.Length]; 591for (int slot = 0; slot < stat.Length; slot++) 660for (int i = 0; i < Stat.Length; i++) 666Ch.Assert(0 <= slot && slot < Stat.Length); 673Ch.Assert(0 <= slot && slot < Stat.Length); 681for (int slot = 0; slot < Stat.Length; slot++) 736for (int i = 0; i < Stat.Length; i++) 744float[] stat = new float[Stat.Length]; 745for (int slot = 0; slot < stat.Length; slot++) 806Ch.Assert(0 <= slot && slot < Stat.Length); 812double[] stat = new double[Stat.Length]; 813for (int slot = 0; slot < stat.Length; slot++) 878for (int i = 0; i < Stat.Length; i++) 884Ch.Assert(0 <= slot && slot < Stat.Length); 894Ch.Assert(0 <= slot && slot < Stat.Length); 905for (int slot = 0; slot < Stat.Length; slot++) 960for (int i = 0; i < Stat.Length; i++) 968double[] stat = new double[Stat.Length]; 969for (int slot = 0; slot < stat.Length; slot++)
MutualInformationFeatureSelection.cs (11)
184var colSizes = new int[colArr.Length]; 195CreateDropAndCopyColumns(colArr.Length, scores, threshold, tiedScoresToKeep, _columns.Where(col => colSet.Contains(col.inputColumnName)).ToArray(), out int[] selectedCount, out dropSlotsColumns, out copyColumnPairs); 197for (int i = 0; i < selectedCount.Length; i++) 201if (dropSlotsColumns.Length <= 0) 203else if (copyColumnPairs.Length <= 0) 287for (int i = 0; i < scores.Length; i++) 289for (int j = 0; j < scores[i].Length; j++) 332selectedCount = new int[scores.Length]; 338for (int j = 0; j < score.Length; j++) 355while (++j < score.Length) 440var size = columns.Length;
OneHotEncoding.cs (1)
285for (int i = 0; i < columns.Length; i++)
OneHotHashEncoding.cs (1)
333for (int i = 0; i < columns.Length; i++)
OptionalColumnTransform.cs (6)
73var names = new string[args.Columns.Length]; 74var columnTypes = new DataViewType[args.Columns.Length]; 75var srcCols = new int[args.Columns.Length]; 76for (int i = 0; i < args.Columns.Length; i++) 445Ch.CheckParam(active == null || active.Length == bindings.ColumnCount, nameof(active)); 522for (int iinfo = 0; iinfo < _bindings.ColumnTypes.Length; ++iinfo)
PermutationFeatureImportance.cs (3)
104var count = values.Length; 238Array.Clear(featureValuesBuffer, 0, featureValuesBuffer.Length); 240Array.Clear(nextValues, 0, nextValues.Length);
ProduceIdTransform.cs (1)
162for (int c = 0; c < cursors.Length; ++c)
RandomFourierFeaturizing.cs (17)
257_transformInfos = new TransformInfo[columns.Length]; 258for (int i = 0; i < columns.Length; i++) 281var avgDistances = new float[columns.Length]; 284int[] srcCols = new int[columns.Length]; 285for (int i = 0; i < columns.Length; i++) 296var reservoirSamplers = new ReservoirSamplerWithReplacement<VBuffer<float>>[columns.Length]; 299for (int i = 0; i < columns.Length; i++) 324for (int i = 0; i < columns.Length; i++) 327for (int i = 0; i < columns.Length; i++) 330for (int iinfo = 0; iinfo < columns.Length; iinfo++) 347resLength = res.Length; 367Host.Assert(count == distances.Length); 377float median = MathUtils.GetMedianInPlace(distances, distances.Length); 400var columnsLength = ColumnPairs.Length; 418var cols = new ApproximatedKernelMappingEstimator.ColumnOptions[options.Columns.Length]; 422for (int i = 0; i < cols.Length; i++) 463for (int i = 0; i < _transformInfos.Length; i++)
StatefulCustomMappingTransformer.cs (2)
276Ch.Assert(active == null || active.Length == parent.OutputSchema.Count); 303for (int i = 0; i < active.Length; i++)
Text\LdaTransform.cs (23)
219Contracts.Assert(0 <= columnIndex && columnIndex < _ldas.Length); 400ctx.Writer.Write(termTopicVector.Length); 680var columnsLength = ColumnPairs.Length; 683for (int i = 0; i < _ldas.Length; i++) 692var ldas = new LdaState[columns.Length]; 767for (int i = 0; i < _ldas.Length; i++) 827ch.Assert(states.Length == columns.Length); 830int[] numVocabs = new int[columns.Length]; 831int[] srcCols = new int[columns.Length]; 836for (int i = 0; i < columns.Length; i++) 860long[] corpusSize = new long[columns.Length]; 861int[] numDocArray = new int[columns.Length]; 865var getters = new ValueGetter<VBuffer<Double>>[columns.Length]; 866for (int i = 0; i < columns.Length; i++) 877for (int i = 0; i < columns.Length; i++) 918for (int i = 0; i < columns.Length; ++i) 929for (int i = 0; i < columns.Length; i++) 942int[] docSizeCheck = new int[columns.Length]; 945var getters = new ValueGetter<VBuffer<Double>>[columns.Length]; 946for (int i = 0; i < columns.Length; i++) 956for (int i = 0; i < columns.Length; i++) 963for (int i = 0; i < columns.Length; i++)
Text\NgramHashingTransformer.cs (27)
212for (int j = 0; j < _columns[i].InputColumnNamesArray.Length; j++) 339var cols = new NgramHashingEstimator.ColumnOptions[options.Column.Length]; 343for (int i = 0; i < cols.Length; i++) 392_srcIndices[i] = new int[_parent._columns[i].InputColumnNamesArray.Length]; 393_srcTypes[i] = new DataViewType[_parent._columns[i].InputColumnNamesArray.Length]; 394for (int j = 0; j < _parent._columns[i].InputColumnNamesArray.Length; j++) 561int srcCount = _srcIndices[iinfo].Length; 592for (int i = 0; i < _srcIndices.Length; i++) 650Contracts.Assert(friendlyNames.Length == parent._columns.Length); 653Contracts.Assert(invertHashMaxCounts.Length == parent._columns.Length); 663Contracts.Assert(col.Index < _srcTextGetters.Length); 670_srcIndices[i] = new int[_parent._columns[i].InputColumnNamesArray.Length]; 671for (int j = 0; j < _parent._columns[i].InputColumnNamesArray.Length; j++) 694Contracts.Assert(1 <= lim && lim <= ngram.Length); 759if (srcIndices.Length == 1) 787Contracts.Assert(srcIndices.Length > 1); 791srcNames = new string[srcIndices.Length]; 792for (int i = 0; i < srcIndices.Length; ++i) 795Contracts.Assert(Utils.Size(srcNames) == srcIndices.Length); 824Contracts.Assert(0 <= icol && icol < srcIndices.Length); 844var values = new VBuffer<ReadOnlyMemory<char>>[_iinfoToCollector.Length]; 845types = new VectorDataViewType[_iinfoToCollector.Length]; 846for (int iinfo = 0; iinfo < _iinfoToCollector.Length; ++iinfo) 1002for (int i = 0; i < InputColumnNamesArray.Length; i++) 1063Contracts.Assert(InputColumnNamesArray.Length > 0); 1064ctx.Writer.Write(InputColumnNamesArray.Length); 1065for (int i = 0; i < InputColumnNamesArray.Length; i++)
Text\NgramTransform.cs (24)
210var transformInfos = new TransformInfo[columns.Length]; 211for (int i = 0; i < columns.Length; i++) 223var helpers = new NgramBufferBuilder[columns.Length]; 224var getters = new ValueGetter<VBuffer<uint>>[columns.Length]; 225var src = new VBuffer<uint>[columns.Length]; 229var counts = new int[columns.Length][]; 230var ngramMaps = new SequencePool[columns.Length]; 232var srcTypes = new DataViewType[columns.Length]; 233var srcCols = new int[columns.Length]; 234for (int iinfo = 0; iinfo < columns.Length; iinfo++) 243for (int iinfo = 0; iinfo < columns.Length; iinfo++) 261bool[] infoFull = new bool[columns.Length]; 263invDocFreqs = new double[columns.Length][]; 267var buffers = new VBuffer<float>[columns.Length]; 270while (cInfoFull < columns.Length && cursor.MoveNext()) 273for (int iinfo = 0; iinfo < columns.Length; iinfo++) 302for (int iinfo = 0; iinfo < columns.Length; iinfo++) 309for (int iinfo = 0; iinfo < columns.Length; iinfo++) 382var columnsLength = ColumnPairs.Length; 416var cols = new NgramExtractingEstimator.ColumnOptions[options.Columns.Length]; 420for (int i = 0; i < cols.Length; i++) 583for (int i = 0; i < ngramIds.Length; i++) 1058Contracts.CheckUserArg(Utils.Size(maximumNgramsCounts) == 0 || maximumNgramsCounts.All(i => i >= 0) && maximumNgramsCounts[maximumNgramsCounts.Length - 1] > 0, nameof(maximumNgramsCounts)); 1059var extend = Utils.Size(maximumNgramsCounts) == 0 ? Defaults.MaximumNgramsCount : maximumNgramsCounts[maximumNgramsCounts.Length - 1];
Text\NgramUtils.cs (1)
185Contracts.Assert(_ngram.Length == _ngramLength);
Text\SentimentAnalyzingTransform.cs (1)
121var toHide = new List<string>(colNames.Length);
Text\StopWordsRemovingTransformer.cs (9)
227var columnsLength = ColumnPairs.Length; 261var cols = new StopWordsRemovingEstimator.ColumnOptions[options.Columns.Length]; 262for (int i = 0; i < cols.Length; i++) 287var requiredResources = new bool[StopWords.Length]; 288for (int iinfo = 0; iinfo < _columns.Length; iinfo++) 363_resourcesExist = new bool?[StopWords.Length]; 978var columnsLength = ColumnPairs.Length; 1037var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 1038for (int i = 0; i < cols.Length; i++)
Text\TextFeaturizingEstimator.cs (13)
450if (tparams.NeedInitialSourceColumnConcatTransform && textCols.Length > 1) 460var xfCols = new (string outputColumnName, string inputColumnName)[textCols.Length]; 461string[] dstCols = new string[textCols.Length]; 462for (int i = 0; i < textCols.Length; i++) 477var xfCols = new WordTokenizingEstimator.ColumnOptions[textCols.Length]; 478wordTokCols = new string[textCols.Length]; 479for (int i = 0; i < textCols.Length; i++) 493var xfCols = new StopWordsCol[wordTokCols.Length]; 494var dstCols = new string[wordTokCols.Length]; 495for (int i = 0; i < wordTokCols.Length; i++) 533charTokCols = new string[srcCols.Length]; 534var xfCols = new (string outputColumnName, string inputColumnName)[srcCols.Length]; 535for (int i = 0; i < srcCols.Length; i++)
Text\TextNormalizing.cs (6)
156var columnsLength = ColumnPairs.Length; 179var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 180for (int i = 0; i < cols.Length; i++) 208for (int i = 0; i < _types.Length; i++) 221for (int iinfo = 0; iinfo < _types.Length; ++iinfo) 312for (int i = 0; i < _combinedDiacriticsPairs.Length; i++)
Text\TokenizingByCharacters.cs (5)
173var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 174for (int i = 0; i < cols.Length; i++) 206for (int i = 0; i < _isSourceVector.Length; i++) 219for (int iinfo = 0; iinfo < _isSourceVector.Length; ++iinfo) 315Host.Assert(bldr.Length == boundaries[boundaries.Length - 1]);
Text\WordBagTransform.cs (12)
128var tokenizeColumns = new WordTokenizingEstimator.ColumnOptions[options.Columns.Length]; 138Columns = new NgramExtractorTransform.Column[options.Columns.Length] 141for (int iinfo = 0; iinfo < options.Columns.Length; iinfo++) 315if (tf.Length != 2) 467var isTermCol = new bool[options.Columns.Length]; 469for (int i = 0; i < options.Columns.Length; i++) 525var ngramColumns = new NgramExtractingEstimator.ColumnOptions[options.Columns.Length]; 526for (int iinfo = 0; iinfo < options.Columns.Length; iinfo++) 551var extractorCols = new Column[cols.Length]; 552for (int i = 0; i < cols.Length; i++) 705string[][] uniqueNames = new string[columns.Length][]; 707for (int iinfo = 0; iinfo < columns.Length; iinfo++)
Text\WordEmbeddingsExtractor.cs (5)
112ch.Assert(wordVector.Length == Dimension); 231var cols = new WordEmbeddingEstimator.ColumnOptions[options.Columns.Length]; 232for (int i = 0; i < cols.Length; i++) 696dimension = parsedLine.values.Length; 708dimension = wordsInFirstLine.Length - 1;
Text\WordHashBagProducingTransform.cs (9)
103Contracts.Assert(uniqueSourceNames.Length == options.Columns.Length); 106var extractorCols = new NgramHashExtractingTransformer.Column[options.Columns.Length]; 107var colCount = options.Columns.Length; 114Contracts.Assert(uniqueSourceNames[iinfo].Length == options.Columns[iinfo].Source.Length); 336var ngramHashColumns = new NgramHashingEstimator.ColumnOptions[options.Columns.Length]; 338var colCount = options.Columns.Length; 388var extractorCols = new Column[cols.Length]; 389for (int i = 0; i < cols.Length; i++)
Text\WordTokenizing.cs (10)
132var columnsLength = ColumnPairs.Length; 183var cols = new WordTokenizingEstimator.ColumnOptions[options.Columns.Length]; 184for (int i = 0; i < cols.Length; i++) 213_isSourceVector = new bool[_parent._columns.Length]; 214for (int i = 0; i < _isSourceVector.Length; i++) 237Host.Assert(0 <= iinfo && iinfo < _parent._columns.Length); 308if (separators.Length > 1) 340for (int iinfo = 0; iinfo < _parent._columns.Length; ++iinfo) 376if (exInfo.SeparatorsArray.Length > 1) 382for (int i = 1; i < exInfo.SeparatorsArray.Length; ++i)
UngroupTransform.cs (9)
114Host.CheckUserArg(options.Columns.Distinct().Count() == options.Columns.Length, nameof(options.Columns), 283for (int i = 0; i < _infos.Length; i++) 327infos = new PivotColumnOptions[pivotColumns.Length]; 328for (int i = 0; i < pivotColumns.Length; i++) 377ctx.Writer.Write(_infos.Length); 388for (int i = 0; i < _infos.Length; i++) 398get { return _infos.Length; } 403_ectx.Assert(0 <= iinfo && iinfo < _infos.Length); 513Ch.Assert(_fixedSize > 0 || _sizeGetters.Length > 0);
Microsoft.ML.Vision (59)
DnnRetrainTransform.cs (55)
277var inputsForTraining = new string[_inputs.Length + 1]; 278var inputColIndices = new int[inputsForTraining.Length]; 279var isInputVector = new bool[inputsForTraining.Length]; 280var tfInputTypes = new TF_DataType[inputsForTraining.Length]; 281var tfInputShapes = new TensorShape[inputsForTraining.Length]; 283for (int i = 0; i < _inputs.Length; i++) 287for (int i = 0; i < inputsForTraining.Length - 1; i++) 291var index = inputsForTraining.Length - 1; 303tfInputs = new TF_Output[_tfInputNodes.Length + 2]; //Inputs + Label + Learning Rate. 305tfInputs = new TF_Output[_tfInputNodes.Length + 1]; //Inputs + Label. 307Array.Copy(_tfInputNodes, tfInputs, _tfInputNodes.Length); 309tfInputs[_tfInputNodes.Length] = new TF_Output(labelOp, labelOpIdx); 311tfInputs[_tfInputNodes.Length + 1] = new TF_Output(lr.Item1, lr.Item2); 347for (int i = 0; i < inputsForTraining.Length; i++) 381for (int i = 0; i < inputs.Length; i++) 385if (tensor.Length > 0 && tensor[0] != IntPtr.Zero) 391if (tensor.Length > 1 && tensor[1] != IntPtr.Zero) 431if (tmpParamDir != null && tmpParamDir.Length > 0) 454if (tmpParamDir != null && tmpParamDir.Length > 0) 486var srcTensorGetters = new ITensorValueGetter[inputColIndices.Length]; 487for (int i = 0; i < inputColIndices.Length; i++) 512for (int j = 0; j < inputs.Length; j++) 518for (int j = 0; j < outputs.Length; j++) 551_tfInputNodes = new TF_Output[_inputs.Length]; 552_tfOutputNodes = new TF_Output[_outputs.Length]; 554for (int index = 0; index < _tfInputOperations.Length; index += 1) 557for (int index = 0; index < _tfOutputOperations.Length; index += 1) 579var tfInputTypes = new TF_DataType[inputs.Length]; 580var tfInputShapes = new TensorShape[inputs.Length]; 581var tfInputOperations = new (Operation, int)[inputs.Length]; 619c_api.TF_GraphGetTensorShape(graph, output, dims, dims.Length, cstatus.Handle); 626var tfOutputTypes = new TF_DataType[outputs.Length]; 627var outputTypes = new DataViewType[outputs.Length]; 629var tfOutputOperations = new (Operation, int)[outputs.Length]; 631for (int i = 0; i < outputs.Length; i++) 649for (int j = 0; j < dims.Length; j++) 651if (dims == null || dims.Length == 0) 692ctx.Writer.Write(_inputs.Length); 697ctx.Writer.Write(_outputs.Length); 711w.Write(modelFilePaths.Length); 771_inputColIndices = new int[_parent._inputs.Length]; 772_isInputVector = new bool[_parent._inputs.Length]; 773_fullySpecifiedShapes = new TensorShape[_parent._inputs.Length]; 774for (int i = 0; i < _parent._inputs.Length; i++) 794if (shape == null || (shape.Length == 0)) 834for (int ishape = 1; ishape < l.Length; ishape++) 933for (int i = 0; i < _parent._inputs.Length; i++) 940for (int j = 0; j < activeOutputColNames.Length; j++) 949return col => Enumerable.Range(0, _parent._outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col); 954var info = new DataViewSchema.DetachedColumn[_parent._outputs.Length]; 955for (int i = 0; i < _parent._outputs.Length; i++) 986if (tfShape.dims.Length != 0) 1071if (tfShape.dims.Length != 0) 1258for (var i = 0; i < _options.InputColumns.Length; i++) 1269for (var i = 0; i < _options.OutputColumns.Length; i++)
ImageClassificationTrainer.cs (4)
864int featureLength = featurizedImages.Count > 0 ? featurizedImages[0].Item2.Length : 0; 885Contracts.Assert(featurizedImages.All(x => x.Item2.Length == featureLength)); 1115Contracts.Assert(featureTensorShape[0] <= featuresBufferBytes.Length / featureFileRecordSize); 1116Contracts.Assert(labelTensorShape[0] <= labelBufferBytes.Length / sizeof(long));
Microsoft.Net.Http.Headers (3)
ContentDispositionHeaderValue.cs (3)
588if (parts.Length != 5 || parts[0] != "\"=" || parts[4] != "=\"" 601output = encoding.GetString(bytes, 0, bytes.Length); 708if (parts.Length != 3)
Microsoft.Net.Http.Headers.Tests (15)
CacheControlHeaderValueTest.cs (12)
137for (int i = 0; i < values.Length; i++) 153for (int i = 0; i < values.Length; i++) 155for (int j = 0; j < values.Length; j++) 177for (int i = 0; i < values.Length; i++) 188for (int i = 0; i < values.Length; i++) 190for (int j = 0; j < values.Length; j++) 251for (int i = 0; i < values.Length; i++) 267for (int i = 0; i < values.Length; i++) 269for (int j = 0; j < values.Length; j++) 291for (int i = 0; i < values.Length; i++) 302for (int i = 0; i < values.Length; i++) 304for (int j = 0; j < values.Length; j++)
RangeItemHeaderValueTest.cs (3)
148Assert.Equal(expectedRanges.Length, ranges.Length); 150for (int i = 0; i < expectedRanges.Length; i++)
Microsoft.NET.StringTools.net35.UnitTests (3)
SpanBasedStringBuilder_Tests.cs (3)
25bool wrapFirstFragment = datum.Fragments.Length > 0 && datum.Fragments[0] != null; 31for (int i = 1; i < datum.Fragments.Length; i++) 82if (datum.Fragments.Length > 1)
Microsoft.NET.StringTools.UnitTests (3)
SpanBasedStringBuilder_Tests.cs (3)
25bool wrapFirstFragment = datum.Fragments.Length > 0 && datum.Fragments[0] != null; 31for (int i = 1; i < datum.Fragments.Length; i++) 82if (datum.Fragments.Length > 1)
Microsoft.TestUtilities (1)
XUnit\ConditionalTheoryDiscoverer.cs (1)
52if (skipReason == null && dataRow?.Length > 0)
Microsoft.VisualBasic.Core (328)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2638TargetType.GetGenericArguments().Length > 0 AndAlso
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (34)
169If arguments.Length = 1 Then 198If arguments.Length = 1 Then 275If arguments.Length = 1 Then 282If(arguments.Length = 1, NoArguments, New Object() {arguments(1)}) 981Array.Resize(packedIndexes, packedIndexes.Length + 1) 982packedIndexes(packedIndexes.Length - 1) = value 992Dim indexValuesPlusValue(indexValues.Length) As Object 994indexValuesPlusValue(indexValues.Length) = value.Value 1002Dim indexesPlusValue(indexes.Length) As Expression 1004indexesPlusValue(indexes.Length) = valueExpression 1054Array.Resize(packedIndexes, packedIndexes.Length + 1) 1055packedIndexes(packedIndexes.Length - 1) = value 1065Dim indexValuesPlusValue(indexValues.Length) As Object 1067indexValuesPlusValue(indexValues.Length) = value.Value 1075Dim indexesPlusValue(indexes.Length) As Expression 1077indexesPlusValue(indexes.Length) = valueExpression 1217Dim argCount As Integer = packedArgs.Length 1241callInfo = New CallInfo(args.Length - valueArgs, argNames) 1243If argNames.Length > 0 Then 1248packedArgs = New Object(args.Length - 1) {} 1253Dim normalArgCount As Integer = args.Length - valueArgs 1255packedArgs(i) = args((i + argNames.Length) Mod normalArgCount) 1258For i As Integer = normalArgCount To args.Length - 1 1281Dim argCount As Integer = packedArgs.Length 1308For i As Integer = 0 To arguments.Length - 1 1343If Not Invokers.TryGetValue(arguments.Length, Invoker) Then 1344Invoker = CreateInvoker(arguments.Length) 1345Invokers.Add(arguments.Length, Invoker) 1373For i As Integer = 2 To CallSiteSignature.Length - 2 ' Arguments: Object& 1376CallSiteSignature(CallSiteSignature.Length - 1) = ObjectType ' Result: Object 1416Select Case arguments.Length 1450Dim delegateArgTypes(arguments.Length + 2) As Type 1452For i As Integer = 1 To delegateArgTypes.Length - 1 1456Dim args(arguments.Length + 1) As Object
Microsoft\VisualBasic\CompilerServices\IOUtils.vb (1)
83If (files Is Nothing) OrElse (files.Length = 0) Then
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (25)
35If mi Is Nothing OrElse mi.Length = 0 Then 114If (args Is Nothing OrElse args.Length = 0) Then 135If objType.IsCOMObject() OrElse ((Not args Is Nothing) AndAlso (args.Length > 0)) Then 316If (args Is Nothing OrElse args.Length = 0) Then 320ElseIf args.Length = 1 Then 345ElseIf args.Length > 1 Then 418If (Not args Is Nothing) AndAlso (args.Length > 1) Then 512If paramnames IsNot Nothing AndAlso paramnames.Length <> 0 Then 522ArgCount = args.Length 561If (args Is Nothing OrElse args.Length = 0) Then 669If (Not attributeList Is Nothing) AndAlso (attributeList.Length <> 0) Then 680If members Is Nothing OrElse members.Length = 0 Then 703If members Is Nothing OrElse members.Length = 0 Then 748If paramnames IsNot Nothing AndAlso paramnames.Length <> 0 Then 759ArgCount = args.Length - 1 813If (args.Length = 1) Then 982If (mi Is Nothing) OrElse (mi.Length = 0) Then 991If (mi.Length = 1 AndAlso (paramnames Is Nothing OrElse paramnames.Length = 0)) Then 1008ArgsLength = args.Length 1009ParametersLength = Parameters.Length 1022If (ca Is Nothing) OrElse (ca.Length = 0) Then 1055For i = 0 To parameters.Length - 1 1115If (Not GetMembersByName Is Nothing) AndAlso (GetMembersByName.Length = 0) Then 1247If Members IsNot Nothing AndAlso Members.Length > 0 Then
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (2)
285Dim LocaleSpecificLigatureTable As Byte() = New Byte(LigatureExpansions.Length - 1) {} 1230PatternGroups.Length > 0 AndAlso
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (54)
124If members Is Nothing OrElse members.Length = 0 Then 179(Arguments IsNot Nothing AndAlso Arguments.Length > 0) _ 245reportErrors OrElse arguments.Length <> 0 OrElse baseReference.IsArray, 296If argumentNames.Length > 0 Then 332reportErrors = reportErrors OrElse arguments.Length <> 0 OrElse baseReference.IsArray 344Return argumentNames.Length = 0 354For index As Integer = 0 To copyBack.Length - 1 433If typeArguments.Length > 0 Then 438If arguments.Length = 0 Then 447If argumentNames.Length > arguments.Length OrElse 448(copyBack IsNot Nothing AndAlso copyBack.Length <> arguments.Length) Then 468ElseIf arguments.Length > 0 AndAlso members.Length = 1 AndAlso IsZeroArgumentCall(members(0)) Then 534If members Is Nothing OrElse members.Length = 0 Then 560If arguments.Length > 0 AndAlso members.Length = 1 AndAlso IsZeroArgumentCall(members(0)) Then 590DirectCast(member, MethodInfo).GetParameters().Length = 0) OrElse 592DirectCast(member, PropertyInfo).GetIndexParameters().Length = 0)) 649If argumentNames.Length > 0 Then 657If argumentNames.Length > arguments.Length Then 661If arguments.Length < 1 Then 743Return argumentNames.Length = 0 750If members Is Nothing OrElse members.Length = 0 Then 964If members.Length = 0 And OptimisticSet Then 970If TypeArguments.Length > 0 Then 974If Arguments.Length = 1 Then 995If ArgumentNames.Length > Arguments.Length Then 1002If TypeArguments.Length = 0 Then 1071If TypeArguments.Length = 0 Then 1108If members Is Nothing OrElse members.Length = 0 Then 1113If arguments.Length = 1 AndAlso rValueBase AndAlso baseReference.IsValueType Then 1189If argumentNames.Length > arguments.Length OrElse 1190(copyBack IsNot Nothing AndAlso copyBack.Length <> arguments.Length) Then 1200If HasFlag(invocationFlags, BindingFlagsSetProperty) AndAlso arguments.Length < 1 Then 1213If members Is Nothing OrElse members.Length = 0 Then 1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members") 1299argumentNames.Length <= arguments.Length, 1320Dim argumentCount As Integer = arguments.Length 1324If arguments.Length = 0 Then 1337System.Array.Copy(savedArguments, arguments, arguments.Length) 1432Dim lastParameter As ParameterInfo = parameters(parameters.Length - 1) 1497Dim callArguments As Object() = New Object(parameters.Length - 1) {} 1500Dim argumentCount As Integer = arguments.Length 1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value") 1507System.Array.Copy(savedArguments, arguments, arguments.Length) 1517Dim lastParameter As ParameterInfo = parameters(parameters.Length - 1) 1518callArguments(parameters.Length - 1) =
Microsoft\VisualBasic\CompilerServices\ObjectFlowControl.vb (2)
119If parameters.Length <> 2 OrElse 130If parameters.Length <> 2 OrElse
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (5)
116Debug.Assert((IsBinaryOperator(op) AndAlso arguments.Length = 2) OrElse 117(IsUnaryOperator(op) AndAlso arguments.Length = 1), 137Debug.Assert(arguments.Length > 1, "unary op on Nothing unexpected here") 146If arguments.Length > 1 Then 267If arguments.Length > 1 Then
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (74)
48If leftSignature.Length >= rightSignature.Length Then 59For index As Integer = shorterSignature.Length To longerSignature.Length - 1 65For i As Integer = 0 To shorterSignature.Length - 1 493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 732typeArgumentCount = typeArguments.Length 735Dim candidates As List(Of Method) = New List(Of Method)(members.Length) 737If members.Length = 0 Then 793candidateSignature = New ParameterInfo(setParameters.Length - 2) {} 794System.Array.Copy(setParameters, candidateSignature, candidateSignature.Length) 894Loop While index < members.Length AndAlso members(index).DeclaringType Is currentScope 896Loop While keepSearching AndAlso index < members.Length 1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length, 1174For index As Integer = 0 To argumentTypeArguments.Length - 1 1385Do While paramIndex < parameters.Length 1432If typeArguments.Length = 0 Then 1449Debug.Assert(arguments.Length <= parameters.Length OrElse 1453Dim argIndex As Integer = argumentNames.Length 1458Do While argIndex < arguments.Length 1497If argIndex = arguments.Length - 1 AndAlso arguments(argIndex) Is Nothing Then 1503Do While argIndex < arguments.Length 1527Debug.Assert(arguments.Length - argIndex <= 1, 1531If arguments.Length - argIndex <> 1 Then 1570If argumentNames.Length > 0 OrElse paramIndex < parameters.Length Then 1571matchedParameters = CreateMatchTable(parameters.Length, paramIndex - 1) 1576If argumentNames.Length > 0 Then 1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1590Dim namedArgumentMapping As Integer() = New Integer(argumentNames.Length - 1) {} 1593Do While argIndex < argumentNames.Length 1646For index As Integer = 0 To matchedParameters.Length - 1 1672Debug.Assert(typeArguments.Length = targetProcedure.TypeParameters.Length, "expected length match") 1676For typeArgumentIndex As Integer = 0 To typeArguments.Length - 1 1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse 1718matchedArguments.Length = parameters.Length + 1, 1720Debug.Assert(arguments.Length <= parameters.Length OrElse 1727If namedArgumentMapping IsNot Nothing Then argIndex = namedArgumentMapping.Length 1732Do While argIndex < arguments.Length 1754Dim remainingArgumentCount As Integer = arguments.Length - argIndex 1762Do While argIndex < arguments.Length 1775Debug.Assert(arguments.Length - argIndex = 1, 1795If namedArgumentMapping IsNot Nothing OrElse paramIndex < parameters.Length Then 1796matchedParameters = CreateMatchTable(parameters.Length, paramIndex - 1) 1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1816Do While argIndex < namedArgumentMapping.Length 1832For index As Integer = 0 To matchedParameters.Length - 1 1857Debug.Assert(arguments.Length <= parameters.Length OrElse 1861Dim argIndex As Integer = argumentNames.Length 1866Do While argIndex < arguments.Length 1895Do While argIndex < arguments.Length 1915Debug.Assert(arguments.Length - argIndex <= 1, 1918If arguments.Length - argIndex <> 1 Then 1940If argumentNames.Length > 0 Then 1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1945Do While argIndex < argumentNames.Length 1995For index As Integer = 0 To copyBack.Length - 1 2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match") 2007Debug.Assert(parameterResults.Length = targetProcedure.Parameters.Length, "parameter arrays must match") 2013If namedArgumentMapping IsNot Nothing Then argIndex = namedArgumentMapping.Length 2018Do While argIndex < arguments.Length 2039Do While argIndex < namedArgumentMapping.Length 2166Dim argIndex As Integer = argumentNames.Length 2167Do While argIndex < arguments.Length 2231Do While argIndex < argumentNames.Length 2825arguments.Length,
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (2)
134If Not attributeList Is Nothing AndAlso attributeList.Length <> 0 Then 186If attributeList Is Nothing OrElse attributeList.Length = 0 Then
Microsoft\VisualBasic\CompilerServices\Symbols.vb (16)
186Dim paramCount As Integer = method.GetParameters.Length 710maximumParameterCount = parameters.Length 861If members Is Nothing OrElse members.Length = 0 Then 868For memberIndex = 0 To members.Length - 1 893parameters = New ParameterInfo(setParameters.Length - 2) {} 894System.Array.Copy(setParameters, parameters, parameters.Length) 911If validMemberCount = members.Length Then 918For memberIndex = 0 To members.Length - 1 991ElseIf result.Length > 1 Then 1031If attributes IsNot Nothing AndAlso attributes.Length > 0 Then 1046If result.Length > 1 Then 1077If result.Length = 0 Then 1089If result.Length = 0 Then 1156If indices.Length <> rank Then 1205If arguments.Length - 1 <> rank Then 1211Dim value As Object = arguments(arguments.Length - 1)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (5)
472Dim totalTypeArgsCount As Integer = typeArgs.Length 476typeArgsCount = typeArgsCount - typ.DeclaringType.GetGenericArguments().Length 656parameters = New ParameterInfo(setParameters.Length - 2) {} 657System.Array.Copy(setParameters, parameters, parameters.Length) 658propertyType = setParameters(setParameters.Length - 1).ParameterType
Microsoft\VisualBasic\CompilerServices\Utils.vb (13)
85lLength = arySrc.Length 98If lLength > aryDest.Length Then 99lLength = aryDest.Length 110For i = 0 To (arySrc.Length \ lenSrcLastRank) - 1 175If method1.GetGenericArguments().Length <> method2.GetGenericArguments().Length Then 188Return pis1.Length = pis2.Length AndAlso 208Return pis1.Length = pis2.Length AndAlso 298If args1.Length = args2.Length Then 337args.Length > position AndAlso
Microsoft\VisualBasic\CompilerServices\VB6File.vb (7)
123If Not attributeList Is Nothing AndAlso attributeList.Length <> 0 Then 133If attributeList Is Nothing OrElse attributeList.Length = 0 Then 164If attributeList Is Nothing OrElse attributeList.Length = 0 Then 246If Not FixedStringAttributeList Is Nothing AndAlso FixedStringAttributeList.Length > 0 Then 253If attributeList Is Nothing OrElse attributeList.Length = 0 Then 270If attributeList Is Nothing OrElse attributeList.Length = 0 Then 2143If (Output Is Nothing) OrElse (Output.Length = 0) Then
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (39)
166If (match Is Nothing) OrElse (match.Length = 0) Then 180If Not names Is Nothing AndAlso names.Length = 0 Then 200SelectedCount = match.Length 290If (Not ca Is Nothing) AndAlso (ca.Length > 0) Then 358ParamArrayIndexList = New Integer(match.Length - 1) {} 383If (Not ca Is Nothing) AndAlso (ca.Length > 0) Then 392If (ParamArrayIndex = PARAMARRAY_NONE) AndAlso (args.Length > Parameters.Length) Then 409If (args.Length < LengthOfNonParamArrayArguments) Then 415For j = args.Length To LengthOfNonParamArrayArguments - 1 441Dim paramOrder As Object() = New Object(match.Length - 1) {} 452If args.Length > Parameters.Length Then 453ArgIndexes = New Integer(args.Length - 1) {} 455ArgIndexes = New Integer(Parameters.Length - 1) {} 524ArgTypes = New Type(args.Length - 1) {} 555If ArgIndexes.Length > Parameters.Length Then 1111If args.Length > 0 Then 1121If ParmIndex < state.m_ByRefFlags.Length Then 1125If ParmIndex < state.m_OriginalParamOrder.Length Then 1161Dim objs() As Object = New Object(parms.Length - 1) {} 1189Dim ParamArrayLength As Integer = args.Length - parms.Length + 1 1220Dim objs() As Object = New Object(parms.Length - 1) {} 1250Return args.Length - 1 1252Return args.Length 1545If p1.Length > p2.Length Then 1553ElseIf p2.Length > p1.Length Then 1877Dim used() As Boolean = New Boolean(pars.Length - 1) {} 1879Dim LastUnnamedIndex As Integer = (args.Length - names.Length - 1) 1897paramOrder(i) = names.Length + i 2042If (Not attributeList Is Nothing) AndAlso (attributeList.Length <> 0) Then 2222If RemovedCount = mi.Length - 1 Then 2232Dim NewSize As Integer = mi.Length - RemovedCount 2236For Index As Integer = 0 To mi.Length - 1
Microsoft\VisualBasic\FileIO\FileSystem.vb (22)
756FileStream.Write(data, 0, data.Length) 1286ByteCount = FileStream.Read(ByteBuffer, 0, ByteBuffer.Length) 1311Dim AdditionalByteCount As Integer = FileStream.Read(ByteBuffer, ByteCount, ByteBuffer.Length - ByteCount) 1313Debug.Assert(ByteCount <= ByteBuffer.Length) 1323ByteCount = FileStream.Read(ByteBuffer, 0, ByteBuffer.Length) 1400If wildcards Is Nothing OrElse wildcards.Length = 0 Then 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 2189ByteBufferStartIndex = m_Preamble.Length 2190Count -= m_Preamble.Length ' Reduce the valid byte count if ByteBuffer was shrunk. 2203Dim CharBuffer(m_PreviousCharBuffer.Length + ExpectedCharCount - 1) As Char 2206destinationArray:=CharBuffer, destinationIndex:=0, length:=m_PreviousCharBuffer.Length) 2210chars:=CharBuffer, charIndex:=m_PreviousCharBuffer.Length) 2214If CharBuffer.Length > m_SearchText.Length Then 2215If m_PreviousCharBuffer.Length <> m_SearchText.Length Then 2218Array.Copy(sourceArray:=CharBuffer, sourceIndex:=(CharBuffer.Length - m_SearchText.Length), 2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer") 2246If BigBuffer.Length < SmallBuffer.Length Or SmallBuffer.Length = 0 Then 2249For i As Integer = 0 To SmallBuffer.Length - 1
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (15)
424Dim Builder As New System.Text.StringBuilder(m_Buffer.Length) 661Dim BufferLength As Integer = m_Buffer.Length 690Debug.Assert(m_Position >= 0 And m_Position <= m_Buffer.Length, "The cursor is out of range") 699Dim CharsRead As Integer = m_Reader.Read(m_Buffer, ContentLength, m_Buffer.Length - ContentLength) 724If m_CharsRead = m_Buffer.Length Then 726Dim BufferSize As Integer = m_Buffer.Length + DEFAULT_BUFFER_LENGTH 734Array.Copy(m_Buffer, TempArray, m_Buffer.Length) 738Dim CharsRead As Integer = m_Reader.Read(m_Buffer, m_CharsRead, m_Buffer.Length - m_CharsRead) 739Debug.Assert(CharsRead <= m_Buffer.Length - m_CharsRead, "We've read more chars than we have space for") 1022Dim Bound As Integer = m_FieldWidths.Length - 1 1119If m_FieldWidths.Length = 0 Then 1123Dim WidthBound As Integer = m_FieldWidths.Length - 1 1152Dim Bound As Integer = Widths.Length - 1 1170If m_Delimiters.Length = 0 Then 1174Dim Length As Integer = m_Delimiters.Length
Microsoft\VisualBasic\FileSystem.vb (1)
553If (FileNumbers Is Nothing) OrElse (FileNumbers.Length = 0) Then
Microsoft\VisualBasic\Interaction.vb (1)
295Elements = VarExpr.Length
Microsoft\VisualBasic\Strings.vb (9)
334lNumElements = Source.Length 363If lResultIndex = TmpResult.Length Then 650Return CharArray.Length 908If cSubStrings + 1 = asSubstrings.Length Then 1027Expression.CopyTo(LastSrcIndex, Output, Output.Length - TextEnum.ElementIndex, TextEnum.ElementIndex - LastSrcIndex) 1711If nfi.NumberGroupSizes Is Nothing OrElse nfi.NumberGroupSizes.Length = 0 Then 1763If GroupDigits = TriState.False OrElse nfi.NumberGroupSizes.Length = 0 Then 1766If nfi.NumberGroupSizes.Length = 1 Then 2244Return (array.Length = 0)
Microsoft.VisualBasic.Forms (3)
Microsoft\VisualBasic\ApplicationServices\AssemblyInfo.vb (1)
289If attributes.Length > 0 Then
Microsoft\VisualBasic\ApplicationServices\SingleInstanceHelpers.vb (1)
58buffer:=content.AsMemory(start:=0, length:=content.Length), cancellationToken) _
Microsoft\VisualBasic\Logging\FileLogTraceListener.vb (1)
847Dim bound As Integer = data.Length - 1
Microsoft.VisualBasic.Forms.Tests (8)
System\Windows\Forms\FileSystemProxyTests.vb (5)
73bytes.Length.Should.Be(1) 92bytes.Length.Should.Be(1) 241bytes.Length.Should.Be(1) 261bytes.Length.Should.Be(1) 374bytes.Length.Should.Be(1)
System\Windows\Forms\SingleInstanceHelpersTests.vb (3)
55If args.Length = 1 Then 69Dim buffer As Byte() = New Byte(commandLine.Length) {} 71buffer:=buffer.AsMemory(start:=0, length:=commandLine.Length))
Microsoft.VisualBasic.Tests (15)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (2)
160var receivedSorted = receivedArgs.Freeze().Sort((x, y) => x.Length - y.Length);
Microsoft\VisualBasic\MyServices\FileSystemProxyTests.cs (13)
63Assert.Equal(Directory.GetFiles(FullPathToSourceDirectory).Length, Directory.GetFiles(FullPathToTargetDirectory).Length); 88Assert.Equal(Directory.GetFiles(FullPathToSourceDirectory).Length, Directory.GetFiles(FullPathToTargetDirectory).Length); 99Assert.Equal(Directory.GetFiles(FullPathToTargetDirectory).Length, Directory.GetFiles(FullPathToSourceDirectory).Length); 119Assert.Equal(Directory.GetFiles(FullPathToSourceDirectory).Length, Directory.GetFiles(FullPathToTargetDirectory).Length); 361Assert.True(Drives.Length > 0); 500Assert.Equal(6, Directory.GetFiles(FullPathToTargetDirectory).Length); 526Assert.Equal(6, Directory.GetFiles(FullPathToTargetDirectory).Length); 545Assert.Equal(6, DestinationFilesWithPath.Length); 566Assert.Equal(6, Directory.GetFiles(FullPathToTargetDirectory).Length);
Microsoft.VisualStudio.LanguageServices (53)
CodeMarkers\ManagedCodeMarkers.cs (2)
218NativeMethods.TestDllPerfCodeMarker(nTimerID, aBuff, aBuff.Length); 222NativeMethods.ProductDllPerfCodeMarker(nTimerID, aBuff, aBuff.Length);
EditorConfigSettings\Common\EnumPropertyView.xaml.cs (1)
27if (index < descriptions.Length && index >= 0)
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (1)
163if (genericTypeArguments.Length <= 0)
GenerateType\GenerateTypeDialogViewModel.cs (2)
329if (containers.Length > 1) 340else if (containers.Length == 1)
Implementation\AbstractOleCommandTarget.Query.cs (1)
18Contract.ThrowIfFalse(prgCmds.Length == 1);
Implementation\AbstractVsTextViewFilter.cs (2)
45if (pSpan == null || pSpan.Length != 1) 86if (pSpan == null || pSpan.Length != 1)
Implementation\HierarchyItemToProjectIdMap.cs (1)
57if (candidateProjects.Length == 1)
Implementation\VsRefactorNotifyService.cs (2)
50(uint)rqnames.Length, 87(uint)rqnames.Length,
Interactive\VsInteractiveWindowProvider.cs (1)
163for (var i = 0; i < interactiveCommands.Length; i++)
KeybindingReset\KeybindingResetDetector.cs (1)
318var hr = _oleCommandTarget.QueryStatus(s_resharperCommandGroup, (uint)cmds.Length, cmds, IntPtr.Zero);
LanguageService\AbstractLanguageService`2.IVsLanguageBlock.cs (1)
57if (foundBlock != null && ptsBlockSpan != null && ptsBlockSpan.Length >= 1)
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (2)
295if (pCodeSpan != null && pCodeSpan.Length > 0) 359if (pCodeSpan != null && pCodeSpan.Length > 0)
Library\AbstractObjectList.cs (2)
366if (pData == null || pData.Length != 1) 388if (pData == null || pData.Length != 1)
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_Search.cs (1)
18if (pobSrch.Length == 0 ||
MoveStaticMembers\TypeNameItem.cs (2)
54for (var i = 0; i < Math.Min(xnames.Length, ynames.Length); i++)
Packaging\PackageInstallerServiceFactory.cs (4)
640for (int i = 0, n = Math.Min(split1.Length, split2.Length); i < n; i++) 653return split2.Length - split1.Length;
Preview\AbstractChange.cs (1)
82if (Children.Changes.Length == 0)
Preview\ChangeList.cs (2)
55pCount = (uint)Changes.Length; 70for (var i = 0; i < Changes.Length; i++)
Preview\FileChange.cs (2)
139if (split.Length > 1) 176if (pIUnknownTextView != null && Children.Changes != null && Children.Changes.Length > 0)
Preview\PreviewEngine.cs (3)
147ppIUnknownPreviewChangesList = _topLevelChange.Children.Changes.Length == 0 ? new ChangeList(new[] { new NoChange(this) }) : new ChangeList(new[] { _topLevelChange }); 149if (_topLevelChange.Children.Changes.Length == 0) 185if (fileChange.Children.Changes.Length > 0)
Preview\ReferenceChange.cs (1)
104if (pIUnknownTextView != null && Children?.Changes != null && Children.Changes.Length > 0)
Progression\GraphNodeIdCreation.cs (2)
56if (partials.Length == 1) 362if (array.Length > 1)
ProjectSystem\Extensions\IVsRunningDocumentTableExtensions.cs (1)
27while (ErrorHandler.Succeeded(enumRunningDocuments.Next((uint)cookies.Length, cookies, out var cookiesFetched))
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
256while ((read = source.Read(buffer, 0, Math.Min(left, buffer.Length))) != 0)
ProjectSystem\RuleSets\RuleSetEventHandler.cs (5)
89for (var i = 0; i < rgszMkOldNames.Length; i++) 162for (var i = 0; i < rgpProjects.Length; i++) 186for (var i = 0; i < rgpszMkDocuments.Length; i++) 269if (projectIndex >= firstDocumentIndices.Length) 271return firstDocumentIndices.Length;
ProjectSystem\VisualStudioWorkspaceImpl.cs (3)
1451cFiles: fileNames.Length, 1453rgrgf: new uint[fileNames.Length], 1454rgFileInfo: new VSQEQS_FILE_ATTRIBUTE_DATA[fileNames.Length],
Shared\VisualStudioImageIdService.cs (1)
107layerCount: layers.Length, layers: layers);
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
51: this(array.Length)
Utilities\TaskItemsEnum.cs (1)
27for (i = 0; i < celt && _next + i < _items.Length; i++)
Utilities\VsDebugName.cs (1)
28if (pspanLocation != null && pspanLocation.Length > 0)
Utilities\VsEnumDebugName.cs (1)
43if (pceltFetched != null && pceltFetched.Length > 0)
Venus\ContainedLanguageCodeSupport.cs (1)
431for (var i = 0; i < parts.Length && ns != null; i++)
Microsoft.VisualStudio.LanguageServices.CSharp (16)
CodeModel\CSharpCodeModelService.cs (6)
1362for (var i = 1; i < lines.Length; i++) 1378for (var i = 0; i < lines.Length; i++) 3075while (index < attributes.Length) 3104for (var index = 0; index < attributeArguments.Length; index++) 3119for (var index = 0; index < imports.Length; index++) 3134for (var index = 0; index < parameters.Length; index++)
ProjectSystemShim\CSharpProjectShim.ICSharpProjectSite.cs (4)
139if (entryPointNames.Length > classNames.Length) 158Array.Copy(_startupClasses, classNames, _startupClasses.Length); 160count = entryPointNames.Length;
ProjectSystemShim\TempPECompilerService.cs (6)
39Contract.ThrowIfFalse(fileNames.Length == fileContents.Length); 43for (var i = 0; i < fileNames.Length; i++) 73Contract.ThrowIfFalse(optionNames.Length == optionValues.Length); 77for (var i = 0; i < optionNames.Length; i++)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
CodeModel\AbstractFileCodeElementTests.cs (1)
66if (path.Length == 0)
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (2)
CallHierarchy\CallHierarchyTestState.vb (2)
190Assert.Equal(callers.Count, expectedCallers.Length) 204Assert.Equal(callers.Count, expectedCallers.Length)
Microsoft.VisualStudio.LanguageServices.UnitTests (28)
ChangeSignature\ChangeSignatureViewModelTests.vb (1)
397For index = 0 To permutation.Length - 1
CodeModel\AbstractCodeAttributeTests.vb (1)
64Assert.Equal(expectedAttributeArguments.Length, attributes.Count)
CodeModel\AbstractCodeElementTests`1.vb (4)
495Assert.Equal(expectedAttributes.Length, attributes.Count) 507Assert.Equal(expectedBases.Length, bases.Count) 522Assert.Equal(expectedChildren.Length, children.Count) 582Assert.Equal(expectedBases.Length, implementedInterfaces.Count)
CodeModel\AbstractEventCollectorTests.vb (1)
116Assert.Equal(expectedEvents.Length, collectedEvents.Count)
CodeModel\AbstractFileCodeModelTests.vb (1)
63Assert.Equal(expectedChildren.Length, children.Count)
CodeModel\AbstractRootCodeModelTests.vb (3)
33Assert.Equal(expectedChildren.Length, rootCodeModel.CodeElements.Count) 45Assert.Equal(names.Length, rootCodeModel.CodeElements.Count) 47For i = 0 To names.Length - 1
GenerateType\GenerateTypeViewModelTests.vb (1)
764fs.Write(bytearray, 0, bytearray.Length)
InheritanceMargin\InheritanceMarginViewModelTests.vb (4)
128Assert.Equal(expected.MenuItems.Length, actual.MenuItemViewModels.Length) 131For i = 0 To expected.MenuItems.Length - 1 148Assert.Equal(expected.MenuItems.Length, acutalMemberMenuItem.Targets.Length) 149For i = 0 To expected.MenuItems.Length - 1
ObjectBrowser\Helpers.vb (8)
72Assert.Equal(verificationActions.Length, itemIndices.Count) 74For i = 0 To verificationActions.Length - 1 93Dim verificationActions = New Action(Of IVsSimpleObjectList2, UInteger)(names.Length - 1) {} 95For i = 0 To names.Length - 1 114Dim verificationActions = New Action(Of IVsSimpleObjectList2, UInteger)(helpKeywords.Length - 1) {} 116For i = 0 To helpKeywords.Length - 1 134Dim verificationActions = New Action(Of IVsSimpleObjectList2, UInteger)(descriptions.Length - 1) {} 136For i = 0 To descriptions.Length - 1
Options\OptionPageSearchHandlerTests.vb (3)
172If runs.Length = 0 Then 179Assert.Equal(runs.Length, actualRuns.Length) 181For i = 0 To runs.Length - 1
Utilities\VsNavInfoHelpers.vb (1)
55Assert.True(index < verifiers.Length)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
CodeModel\VisualBasicCodeModelService.vb (2)
2487Dim linesCount = lines.Length 2489For i = 1 To lines.Length - 1
MinimalSample (1)
Program.cs (1)
46Console.WriteLine($"Building filter! Num args: {routeContext.MethodInfo.GetParameters().Length}");
MSBuild (126)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
CommandLineSwitches.cs (6)
450Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 452Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 455for (int i = 0; i < s_parameterlessSwitchesMap.Length; i++) 465for (int i = 0; i < s_parameterizedSwitchesMap.Length; i++) 584for (int i = 0; i < _parameterlessSwitches.Length; i++) 592for (int i = 0; i < _parameterizedSwitches.Length; i++)
CommunicationsUtilities.cs (4)
463ErrorUtilities.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes"); 465stream.Write(bytes, 0, bytes.Length); 526var readTask = stream.ReadAsync(bytes, 0, bytes.Length); 543for (int i = 0; i < bytes.Length; i++)
ErrorUtilities.cs (3)
164if (parameterValue.Length == 0) 617VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 619int arrayCapacity = array.Length - arrayIndex;
EventArgsFormatting.cs (2)
351for (int i = 0; i < lines.Length; i++) 360if (i < (lines.Length - 1))
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1144ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1159while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1164if (index == splitBase.Length && index == splitPath.Length) 1177for (int i = index; i < splitBase.Length; i++) 1181for (int i = index; i < splitPath.Length; i++)
JsonOutputFormatter.cs (4)
30if (propertyNames.Length == 0) 48if (itemNames.Length == 0) 84if (itemNames.Length == 0) 125if (targetNames.Length == 0)
LoadedType.cs (3)
72Properties = new ReflectableTaskPropertyInfo[props.Length]; 75PropertyAssemblyQualifiedNames = new string[props.Length]; 78for (int i = 0; i < props.Length; i++)
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++) 526Task<int> readTask = CommunicationsUtilities.ReadAsync(localReadPipe, headerByte, headerByte.Length); 568if (bytesRead != headerByte.Length) 588CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length); 615readTask = CommunicationsUtilities.ReadAsync(localReadPipe, headerByte, headerByte.Length);
OutOfProcTaskAppDomainWrapperBase.cs (1)
364if (value.GetCustomAttributes(typeof(OutputAttribute), true).Length > 0)
OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
ResourceUtilities.cs (1)
372if (args?.Length > 0)
TaskParameter.cs (6)
133ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 135for (int i = 0; i < inputAsITaskItemArray.Length; i++) 351int length = wrappedItems.Length; 609int length = array.Length; 692int length = array.Length; 810return count + FileUtilities.ItemSpecModifiers.All.Length;
TerminalLogger\NodesFrame.cs (1)
32_nodes = new (NodeStatus, int)[nodes.Length];
TypeLoader.cs (2)
195Dictionary<string, string> assembliesDictionary = new(localAssemblies.Length + runtimeAssemblies.Length);
XMake.cs (75)
368if (parameterSections.Length == 2 && 391string[] newArgArray = new string[args.Length + 1]; 394Array.Copy(args, 0, newArgArray, 1, args.Length); 799&& switchesNotFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0 800&& switchesFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0 816bool outputPropertiesItemsOrTargetResults = getProperty.Length > 0 || getItem.Length > 0 || getTargetResult.Length > 0; 828getProperty.Length > 0 ? "getProperty" : 829getItem.Length > 0 ? "getItem" : 832else if ((getProperty.Length > 0 || getItem.Length > 0) && (targets is null || targets.Length == 0)) 911if (outputPropertiesItemsOrTargetResults && targets?.Length > 0 && result is not null) 1089if (getProperty.Length == 1 && getItem.Length == 0) 1122else if (getProperty.Length == 1 && getItem.Length == 0 && getTargetResult.Length == 0) 1328if (loggers.Length == 1 && 1561bool restoreOnly = targets.Length == 1 && string.Equals(targets[0], MSBuildConstants.RestoreTargetName, StringComparison.OrdinalIgnoreCase); 2667bool minimizeStdOutOutput = getProperty.Length + getItem.Length + getTargetResult.Length > 0 && getResultOutputFile.Length == 0; 2877if (parameterAndValue[0].Equals("default", StringComparison.InvariantCultureIgnoreCase) && parameterAndValue.Length > 1) 2910terminalLoggerArg = switches[switches.Length - 1]; 2977return terminalLoggerParameters?.Length > 0 ? MSBuildApp.AggregateParameters(string.Empty, terminalLoggerParameters) : string.Empty; 3027ErrorUtilities.VerifyThrow(projectSwitchParameters.Length <= 1, "Expect exactly one project at a time."); 3029if (projectSwitchParameters.Length == 1) 3094if (parameters.Length == 1 && bool.TryParse(parameters[0], out bool boolValue)) 3128if (parameters.Length == 1 && bool.TryParse(parameters[0], out var boolValue)) 3186if (parameters.Length > 0) 3191enableNodeReuse = bool.Parse(parameters[parameters.Length - 1]); 3195CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message); 3199CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message); 3219if (parameters.Length > 0) 3223writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 3227CommandLineSwitchException.Throw("InvalidPreprocessPath", parameters[parameters.Length - 1], ex.Message); 3238if (parameters.Length > 0) 3242writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 3246CommandLineSwitchException.Throw("TargetsCouldNotBePrinted", parameters[parameters.Length - 1], ex.Message); 3301if (parameters.Length > 0) 3305value = bool.Parse(parameters[parameters.Length - 1]); 3309CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message); 3313CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message); 3330if (parameters == null || parameters.Length == 0) 3337var profilerFile = parameters[parameters.Length - 1]; 3352CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 3357CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 3362CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 3381if (input.Length > 0) 3481if (parameters.Length > 0) 3485cpuCount = int.Parse(parameters[parameters.Length - 1], CultureInfo.InvariantCulture); 3489CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message); 3493CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message); 3496CommandLineSwitchException.VerifyThrow(cpuCount > 0 && cpuCount <= 1024, "InvalidMaxCPUCountValueOutsideRange", parameters[parameters.Length - 1]); 3514ErrorUtilities.VerifyThrow(parameters.Length <= 1, "Expect exactly one project at a time."); 3519if (parameters.Length == 1) 3646if (projectExtensionsToIgnore?.Length > 0) 3741if (parameters.Length > 0) 3745return parameters[parameters.Length - 1]; 3766Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2), 3770CommandLineSwitchException.VerifyThrow((parameterSections[0].Length > 0) && (parameterSections.Length == 2), 3810if (verbositySwitchParameters.Length > 0) 3813originalVerbosity = ProcessVerbositySwitch(verbositySwitchParameters[verbositySwitchParameters.Length - 1]); 3865for (int i = 0; i < parametersToAggregate.Length; i++) 3890for (int i = 0; i < groupedFileLoggerParameters.Length; i++) 3910if (groupedFileLoggerParameters[i].Length > 0) 3945if (binaryLoggerParameters == null || binaryLoggerParameters.Length == 0) 3950string arguments = binaryLoggerParameters[binaryLoggerParameters.Length - 1]; 3980if ((consoleLoggerParameters?.Length > 0)) 4086if ((fileLoggerParameters?.Length > 0)) 4174value = (nameValuePair.Length > 1) ? nameValuePair[1] : null; 4631if (features.Length == 1)
MSBuildTaskHost (69)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
BinaryTranslator.cs (7)
270length = byteArray.Length; 893int count = array.Length; 952int count = array.Length; 1004int count = array.Length; 1245var length = byteArray?.Length ?? 0; 1281int count = array.Length; 1303int count = array.Length;
ChangeWaves.cs (1)
63return AllWaves[AllWaves.Length - 1];
CommunicationsUtilities.cs (3)
463ErrorUtilities.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes"); 465stream.Write(bytes, 0, bytes.Length); 543for (int i = 0; i < bytes.Length; i++)
Concurrent\ConcurrentDictionary.cs (24)
112for (int i = 0; i < locks.Length; i++) 117int[] countPerLock = new int[locks.Length]; 123_budget = buckets.Length / locks.Length; 133int bucketNo = GetBucket(hashcode, tables._buckets.Length); 169GetBucketAndLockNo(hashcode, out bucketNo, out lockNo, tables._buckets.Length, tables._locks.Length); 337for (int i = 0; i < tables._countPerLock.Length; i++) 345if (approxCount < tables._buckets.Length / 4) 365newLength = (tables._buckets.Length * 2) + 1; 400AcquireLocks(1, tables._locks.Length, ref locksAcquired); 405if (_growLockArray && tables._locks.Length < MaxLockNumber) 407newLocks = new object[tables._locks.Length * 2]; 408Array.Copy(tables._locks, 0, newLocks, 0, tables._locks.Length); 409for (int i = tables._locks.Length; i < newLocks.Length; i++) 416int[] newCountPerLock = new int[newLocks.Length]; 419for (int i = 0; i < tables._buckets.Length; i++) 426GetBucketAndLockNo(current._hashcode, out newBucketNo, out newLockNo, newBuckets.Length, newLocks.Length); 440_budget = Math.Max(1, newBuckets.Length / newLocks.Length); 486AcquireLocks(1, _tables._locks.Length, ref locksAcquired); 487Debug.Assert(locksAcquired == _tables._locks.Length);
Concurrent\ConcurrentQueue.cs (4)
316for (int i = 0; i < _slots.Length; i++) 323internal int Capacity => _slots.Length; 326internal int FreezeOffset => _slots.Length * 2; 399Thread.VolatileWrite(ref _slots[slotsIndex].SequenceNumber, currentHead + _slots.Length);
D\a\_work\1\s\bin\repo\msbuild\src\Shared\ErrorUtilities.cs\ErrorUtilities.cs (3)
164if (parameterValue.Length == 0) 617VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 619int arrayCapacity = array.Length - arrayIndex;
FileUtilities.cs (8)
721Debug.Assert(allowedExtensions?.Length > 0); 1144ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1159while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1164if (index == splitBase.Length && index == splitPath.Length) 1177for (int i = index; i < splitBase.Length; i++) 1181for (int i = index; i < splitPath.Length; i++)
Immutable\ImmutableDictionary.cs (1)
120if (arrayIndex + Count > array.Length)
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++) 524IAsyncResult result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null); 568if (bytesRead != headerByte.Length) 588CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length); 613result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
OutOfProcTaskAppDomainWrapperBase.cs (1)
364if (value.GetCustomAttributes(typeof(OutputAttribute), true).Length > 0)
OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
ResourceUtilities.cs (1)
372if (args?.Length > 0)
TaskParameter.cs (6)
133ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 135for (int i = 0; i < inputAsITaskItemArray.Length; i++) 351int length = wrappedItems.Length; 609int length = array.Length; 692int length = array.Length; 810return count + FileUtilities.ItemSpecModifiers.All.Length;
Traits.cs (1)
566if ((args?.Length > 0))
Mvc.RoutingWebSite (2)
StartupForDynamicOrder.cs (1)
110if (split.Length == 2)
StartupForEndpointFilters.cs (1)
43if (context.MethodInfo.GetParameters().Length >= 1 && context.MethodInfo.GetParameters()[0].ParameterType == typeof(string))
PlaintextApp (1)
Startup.cs (1)
30response.ContentLength = payload.Length;
PortableTask (1)
ShowItems.cs (1)
34else if (Items.Length == 0)
PresentationBuildTasks (133)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (3)
196Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 311Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 731for (int i = 0; i < pItemList.Length; i++)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (23)
125if ((PageMarkup == null || PageMarkup.Length == 0) && 126(ApplicationMarkup == null || ApplicationMarkup.Length == 0)) 164for (int i = 0; i < CompilerAnalyzer.RecompileMarkupPages.Length; i++) 407if (SplashScreen != null && SplashScreen.Length > 0) 907if (PageMarkup != null && PageMarkup.Length > 0) 912if (SplashScreen != null && SplashScreen.Length > 1) 930if (ApplicationMarkup != null && ApplicationMarkup.Length > 0) 946if (ApplicationMarkup != null && ApplicationMarkup.Length > 0) 948if (ApplicationMarkup.Length > 1) 1130if (References != null && References.Length > 0) 1135for (int i = 0; i < References.Length; i++) 1175for (int i = 0; i < CompilerAnalyzer.RecompileMarkupPages.Length; i++) 1313if (PageMarkup != null && PageMarkup.Length > 0) 1421for (int i = 0; i < GeneratedBamlFiles.Length; i++) 1426for (int i = 0; i < GeneratedCodeFiles.Length; i++) 1431for (int i = 0; i < GeneratedLocalizationFiles.Length; i++) 1474for (int i = 0; i < inputXamlItemList.Length; i++) 1511if (!SkipMarkupCompilation && inputLocalRefXamlFileList != null && inputLocalRefXamlFileList.Length > 0) 1513for (int i = 0; i < inputLocalRefXamlFileList.Length; i++) 1542for (int i = 0; i < inputXamlItemList.Length; i++) 1608for (int j = 0; j < listCarryOverAttribute.Length; j++) 1633if (ApplicationMarkup != null && ApplicationMarkup.Length > 0 && ApplicationMarkup[0] != null) 1647for (int i = 0; i < PageMarkup.Length; i++)
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (7)
506if (_localApplicationFile != null || (_localMarkupPages != null && _localMarkupPages.Length > 0)) 590if (_localMarkupPages != null && _localMarkupPages.Length > 0) 592int localFileNum = _localMarkupPages.Length; 608if (References != null && References.Length > 0) 613for (int i = 0; i < References.Length; i++) 742if (_localMarkupPages != null && _localMarkupPages.Length > 0) 745for (int i = 0; i < _localMarkupPages.Length; i++)
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
58if (GeneratedLocalizationFiles.Length > 0)
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (1)
167if (OutputResourcesFile != null && OutputResourcesFile.Length > 1)
Microsoft\Build\Tasks\Windows\UidManager.cs (4)
79if (MarkupFiles == null || MarkupFiles.Length == 0) 356if (_markupFiles.Length > countGoodFiles) 358Log.LogErrorWithCodeFromResources(nameof(SR.FilesFailedUidCheck), _markupFiles.Length - countGoodFiles); 363return _markupFiles.Length == countGoodFiles;
MS\Internal\MarkupCompiler\MarkupCompiler.cs (14)
275for (int i = 0; i < cu.FileList.Length; i++) 294if (!cu.Pass2 && ContentList != null && ContentList.Length > 0) 1469sb.Append(_typeArgsList.Length); 1620for (int i = 1; i < dirs.Length; i++) 1842CodeExpression[] expressions = new CodeExpression[args.Length]; 1849for (int i = 0; i < args.Length; i++) 1867for (int i = 0; i < args.Length; i++) 1905Debug.Assert(pis != null && pis.Length == 2 && KnownTypes.Types[(int)KnownElements.DependencyObject].IsAssignableFrom(pis[0].ParameterType)); 2053for (int i = 0; i < pars.Length; i++) 2184for (int i = 1; i < contexts.Length; ++i) 2254for (int i = 0; i < _typeArgsList.Length; i++) 2388for (int i = 0; i < refTypeParams.Length; i++) 2395Debug.Assert(typeArgsList != null && typeArgsList.Length == refTypeParams.Length);
MS\Internal\MarkupCompiler\ParserExtension.cs (6)
188if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 220bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 255localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 273if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 320if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 462bool isLocal = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly;
MS\Internal\MarkupCompiler\VersionHelper.cs (6)
75hasWildcard = allowWildcard && elements[elements.Length - 1] == "*"; 77if ((hasWildcard && elements.Length < 3) || elements.Length > 4) 84int lastExplicitValue = hasWildcard ? elements.Length - 1 : elements.Length; 152for (int i = lastExplicitValue; i < values.Length; i++)
MS\Internal\Tasks\CompilerLocalReference.cs (2)
220if (LocalMarkupPages != null && LocalMarkupPages.Length > 0) 222for (int i = 0; i < LocalMarkupPages.Length; i++)
MS\Internal\Tasks\CompilerState.cs (5)
96Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 156Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 210if (fileItemList != null && fileItemList.Length > 0) 214int iCount = fileItemList.Length; 242for (int i = 0; i < fileItemList.Length; i++)
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (7)
209for (int i = 0; i < _mcPass1.PageMarkup.Length; i++) 391numLocalTypeXamls = CompilerLocalReference.LocalMarkupPages.Length; 461int count = _mcPass1.PageMarkup.Length; 493int count = _mcPass1.ContentFiles.Length; 533if (_mcPass1.ApplicationMarkup != null && _mcPass1.ApplicationMarkup.Length > 0 && _mcPass1.ApplicationMarkup[0] != null) 562for (int i = 0; i < fileList.Length; i++) 601if (list != null && list.Length > 0)
MS\Internal\Tasks\TaskFileService.cs (1)
171fileChecksummer.CalculateCheckSum(hashGuid, tempBytes.Length, tempBytes, out actualSize);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (2)
69for (int i = 0; i < pairs.Length; i++) 369for (int i = 0; i < _enumNames.Length; i++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (1)
180int end = _knownStrings.Length;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (4)
1202if (AssemblyIds != null && AssemblyIds.Length > 0) 1204count = (short) AssemblyIds.Length; 4728Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4771Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (2)
692if (nsMapEntry != null && nsMapEntry.Length > 0) 695for (int i = 0; i < nsMapEntry.Length; i++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypesHelper.cs (1)
74Array.Clear(_typeTable, 0, _typeTable.Length);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (4)
1213if (parInfo.Length >= maxConstructorArguments) 1215maxConstructorArguments = parInfo.Length; 1312for (int i=0; i<infos.Length; i++) 1316if (paramInfos.Length == numberOfConstructorAttributes)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (5)
165if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 233bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 269localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 286if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 304if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (5)
179if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 266bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 305localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 322if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 340if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (4)
581localAssembly = (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly); 3211if (methodInfo.GetParameters().Length == 1) 3217propertyCanWrite = methodInfo != null && methodInfo.GetParameters().Length == 2; 3525return (methodInfo.GetParameters().Length == 2) ||
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (16)
1298if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1367if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1378if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1457if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1525if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1536if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1954for (int i = 0; i < infos.Length; i++) 2065propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType; 2066propertyCanWrite = parameters.Length == 1 ? false : true; 2535for (int count = 0; count < namespaceMaps.Length;) 2570if (knownTypesOnly && (count == namespaceMaps.Length)) 2838localAssembly = (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly); 2961namespaceMaps.Length == 1 && 3161result = (namespaceMaps != null && namespaceMaps.Length > 0) || 3242for (int i = 0; i < _namespaceMaps.Length; i++) 3308for (int k = 0; k < _assemblyNames.Length; k++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsCache.cs (4)
309for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 314for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++) 378for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 388for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (3)
637if (_lastDecl == _nsDeclarations.Length - 1) 639NamespaceDeclaration[] new_nsDeclarations = new NamespaceDeclaration[_nsDeclarations.Length * 2]; 641Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
92if (nameFrags.Length == 1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
82if (methodInfo.GetParameters().Length == 1)
PresentationCore (738)
MS\Internal\Automation\TextRangeProviderWrapper.cs (2)
199ITextRangeProvider[] outArray = new ITextRangeProvider[argument.Length]; 200for (int i = 0; i < argument.Length; i++)
MS\Internal\FontCache\BufferCache.cs (4)
173length <= _buffers[index].Length) 205(_buffers[index].Length < buffer.Length && buffer.Length <= MaxBufferLength))
MS\Internal\FontCache\FamilyCollection.cs (2)
139for (int i = 0; i < _legacyArabicFonts.Length; ++i) 269for (int i = 0; i < _systemCompositeFontsNames.Length; ++i)
MS\Internal\FontCache\FontCacheUtil.cs (1)
543for (int i = 0; i < SupportedExtensions.Length; ++i)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (10)
416for (int i = 0; i < fastTextRanges.Length; i++) 419ushort[] glyphIndices = BufferCache.GetUShorts(codepoints.Length); 427CharacterMap.TryGetValues(pCodepoints, checked((uint)codepoints.Length), pGlyphIndices); 432for (int j = 0; j < codepoints.Length; j++) 480for (int i = 0; i < complexScripts.Length && typography != loclBitsTest; i++) 551for (int i = 0; i < complexScripts.Length; i++) 740ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 741ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count); 958for (int i = 0; i < majorLanguages.Length; i++) 980for (int i = 0; i < majorLanguages.Length; i++)
MS\Internal\FontCache\FontSource.cs (2)
394 bits.Length, 395 bits.Length,
MS\Internal\FontFace\CompositeFontInfo.cs (4)
221for (int i = FirstFamilyMapRange; i < familyMapRanges.Length; i += 2) 261if (count + 2 > ranges.Length) 263ushort[] temp = new ushort[ranges.Length * 2 - FirstFamilyMapRange]; 283if (count < ranges.Length)
MS\Internal\FontFace\FontDriver.cs (1)
216for (int i = 0; i < _tableDirectory.Length; ++i)
MS\Internal\FontFace\TypefaceCollection.cs (2)
83ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 84ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
MS\Internal\Ink\ErasingStroke.cs (4)
64_erasingStrokeNodes = new List<StrokeNode>(points.Length); 73_nodeIterator = _nodeIterator.GetIteratorForNextSegment(points.Length > 1 ? FilterPoints(points) : points); 262System.Diagnostics.Debug.Assert(path.Length > 1); 282while (i < path.Length)
MS\Internal\Ink\ExtendedProperty.cs (5)
75if (array1.Length == array2.Length) 77for (int i = 0; i < array1.Length; i++) 208Array newArray = Array.CreateInstance(elementType, ((Array)_value).Length); 209Array.Copy((Array)_value, newArray, ((Array)_value).Length);
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (5)
388uint cRanges = (uint)( enabledGestures.Length ); 505Debug.Assert(propertyGuids.Length == StylusPointDescription.RequiredCountOfProperties); 508packetDescription.cbPacketSize = (uint)(propertyGuids.Length * sizeof(Int32)); 509packetDescription.cPacketProperties = (uint)propertyGuids.Length; 554int packetCount = rawPackets.Length;
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (12)
37if (input.Length < 3) 53for(; n < input.Length; n++) 101if (((compressedData.Count - 1/*for the algo byte we just made room for*/) >> 2) > input.Length) 163if (input.Length < 2) 168if (outputBuffer.Length == 0) 208if (input.Length < 3) 225Debug.Assert(outputBufferIndex < outputBuffer.Length); 234Debug.Assert(outputBufferIndex < outputBuffer.Length); 264List<byte> compressedData = new List<byte>(input.Length + 1); //reasonable default based on profiling. 289int unitCount = input.Length; 323if (input.Length < 2) 360int unitsToDecode = ((input.Length - inputIndex << 3) / bitCount) - padCount;
MS\Internal\Ink\InkSerializedFormat\Compress.cs (1)
97size > compressedInput.Length ||
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (20)
37for (int i = 0; i < KnownIdCache.OriginalISFIdTable.Length; i++) 45for (int i = 0; i < KnownIdCache.TabletInternalIdTable.Length; i++) 123for( int i = 0; i < data.Length; i++ ) 130for( int i = 0; i < data.Length; i++ ) 137for( int i = 0; i < data.Length; i++ ) 144for( int i = 0; i < data.Length; i++ ) 151for( int i = 0; i < data.Length; i++ ) 158for( int i = 0; i < data.Length; i++ ) 165for( int i = 0; i < data.Length; i++ ) 172for( int i = 0; i < data.Length; i++ ) 179for( int i = 0; i < data.Length; i++ ) 186for (int i = 0; i < data.Length; i++) 206for( int i = 0; i < data.Length; i++ ) 340cbSize = (uint)data.Length; 370cbWrite += SerializationHelper.Encode(strm, (uint)(compresseddata.Length - 1)); 373strm.Write(compresseddata, 0, (int)compresseddata.Length); 374cbWrite += (uint)compresseddata.Length; 388strm.Write(data, 0, (int)data.Length); 389cbWrite += (uint)data.Length; 946for (int i = 0; i < data.Length; i++)
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (1)
194if (data != null && data.Length > 0)
MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (20)
95if (0 == input.Length) 100testDelDel = testDelDel && (input.Length < 3); 142for (uint dataIndex = startIndex; dataIndex < input.Length; dataIndex++) 196if(0 == input.Length) 201int countOfInts = ((0 == (input.Length & 0x03)) ? input.Length >> 2 : 0); 209int countOfShorts = ((0 == (input.Length & 0x01)) ? input.Length >> 1 : 0); 252for (; n < input.Length; ++n) 268int padCount = ((((~(bitCount * input.Length)) & 0x07) + 1) & 0x07) / bitCount; 359if (index < _gorIndexMap.Length && index >= 0) 395for (int i = startInputIndex; i < input.Length; i++) 407for (int i = startInputIndex; i < input.Length; i++) 512ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(inputIndex, input.Length); 514ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(outputBufferIndex, outputBuffer.Length); 544Debug.Assert(outputBufferIndex < outputBuffer.Length); 546if (outputBufferIndex == outputBuffer.Length) 561Debug.Assert(outputBufferIndex < outputBuffer.Length); 563if (outputBufferIndex == outputBuffer.Length) 573return (uint)((outputBuffer.Length * bitCount + 7) >> 3);
MS\Internal\Ink\InkSerializedFormat\GuidTagList.cs (3)
54for (byte iIndex = 0; iIndex < KnownIdCache.OriginalISFIdTable.Length; ++iIndex) 125if (KnownIdCache.OriginalISFIdTable.Length <= nIndex) 192for (uint i = 0; i < KnownIdCache.OriginalISFIdTable.Length; ++i)
MS\Internal\Ink\InkSerializedFormat\HuffCodec.cs (8)
72for (uint i = 0; i < input.Length; i++) 80for (uint i = 0; i < input.Length; i++) 97Debug.Assert(input.Length >= 2); 100Debug.Assert(outputBuffer.Length != 0); 112Debug.Assert(outputBufferIndex < outputBuffer.Length); 114if (outputBufferIndex == outputBuffer.Length) 127Debug.Assert(outputBufferIndex < outputBuffer.Length); 129if (outputBufferIndex == outputBuffer.Length)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (11)
123byte[] isfData = Convert.FromBase64CharArray(chars, 0, chars.Length); 745if ((uint)isfTag >= KnownIdCache.CustomGuidBaseIndex || ((uint)isfTag >= KnownTagCache.KnownTagCount && ((uint)isfTag < (KnownTagCache.KnownTagCount + KnownIdCache.OriginalISFIdTable.Length)))) 1219requestedCount > buffer.Length) 1659for (int i = 0; i < buttonguids.Length; i++) 2024for (int i = 0; i < strkIds.Length; i++) 2057cbWrote += SerializationHelper.Encode(strm, (uint)(data.Length + SerializationHelper.VarSize((uint)strokes.Count))); 2061strm.Write(data, 0, (int)data.Length); 2062cbWrote += (uint)data.Length; 2086for (int i = 0; i < strkIds.Length; i++) 2182for (i = 0; i < descriptionGuids.Length; i++) 2739for (int x = 0; x < strokeIds.Length; x++)
MS\Internal\Ink\InkSerializedFormat\LZCodec.cs (2)
45Debug.Assert(input.Length > 1); 46Debug.Assert(inputIndex < input.Length);
MS\Internal\Ink\InkSerializedFormat\MetricEntry.cs (5)
153if( data.Length > MAX_METRIC_DATA_BUFF ) 156_size = (uint)data.Length; 337for( ul = 0; ul < MetricEntry_Never.Length ; ul++ ) 348for( ul = 0; ul<MetricEntry_Must.Length; ul++ ) 365for( ul = 0; ul<MetricEntry_Optional.Length; ul++ )
MS\Internal\Ink\InkSerializedFormat\MultiByteCodec.cs (4)
80Debug.Assert(inputIndex < input.Length); 83uint cb = (input.Length - inputIndex > 5) ? 5 : (uint)(input.Length - inputIndex); 115ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(inputIndex, input.Length);
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (4)
524if (byteCounter != buttonData.Length) 954if (packetdata.Length == 0) 969stream.Write(data, 0, (int)data.Length); 971return (uint)data.Length;
MS\Internal\Ink\StrokeIntersection.cs (6)
192System.Diagnostics.Debug.Assert(intersections.Length > 0); 194List<StrokeFIndices> inFIndices = new List<StrokeFIndices>(intersections.Length); 195for (int j = 0; j < intersections.Length; j++) 224System.Diagnostics.Debug.Assert(intersections.Length > 0); 226List<StrokeFIndices> hitFIndices = new List<StrokeFIndices>(intersections.Length); 227for (int j = 0; j < intersections.Length; j++)
MS\Internal\Ink\StrokeNode.cs (10)
238int maxCount = vertices.Length * 2; 244Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor); 275for (int j = 0; i < maxCount && j < vertices.Length; i++, j++) 278Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor); 358int maxCount = vertices.Length * 2; 363Point point = _thisNode.Position + (vertices[i % vertices.Length] * pressureFactor); 387for (int j = 0; i < maxCount && j < vertices.Length; i++, j++) 390Point point = _thisNode.Position + (vertices[i % vertices.Length] * pressureFactor); 623for (int i = 0; i < vertices.Length; i++) 625Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor);
MS\Internal\Ink\StrokeNodeOperations.cs (20)
69for (i = 0; (i + 1) < _vertices.Length; i += 2) 73if (i < _vertices.Length) 102for (int i = 0; i < _vertices.Length; i++) 109for (int i = 0; i < _vertices.Length; i++) 130Point vertex = node.Position + (_vertices[_vertices.Length - 1] * node.PressureFactor); 131for (int i = 0; i < _vertices.Length; i++) 142for (int i = 0, count = _vertices.Length; i < count; i++) 211int count = _vertices.Length; 358int i = 0, count = _vertices.Length; 383count = _vertices.Length; 386i = (i + 1) % _vertices.Length; 417count = _vertices.Length; 420i = (i + 1) % _vertices.Length; 697Vector lastVertex = _vertices[_vertices.Length - 1]; 707for (int k = 0, count = _vertices.Length; k < count || (k == count && testNextEdge); k++) 1081int i = 0, count = _vertices.Length; 1096count = _vertices.Length; 1107i = (i + 1) % _vertices.Length; 1147count = _vertices.Length; 1150i = (i + 1) % _vertices.Length;
MS\Internal\Ink\StrokeNodeOperations2.cs (2)
44System.Diagnostics.Debug.Assert((null != vertices) && (2 < vertices.Length)); 47int count = vertices.Length;
MS\Internal\Ink\StylusShape.cs (15)
113vertices = new Vector[m_vertices.Length]; 117for (int i = 0; i < vertices.Length; i++) 124for (int i = 0; i < vertices.Length; i++) 140vertices = new Vector[p.Length]; 141for (int i = 0; i < vertices.Length; i++) 234System.Diagnostics.Debug.Assert(vertices.Length == 4); 236Point prevVertex = (Point)vertices[vertices.Length - 1]; 239for (int i = 0; i < vertices.Length; i++) 245double det = Vector.Determinant(edge, (Point)vertices[(i + 1) % vertices.Length] - (Point)vertex); 259System.Diagnostics.Debug.Assert(clockWiseIndex == vertices.Length || counterClockIndex == vertices.Length); 261if (counterClockIndex == vertices.Length) 264int lastIndex = vertices.Length -1; 265for (int j = 0; j < vertices.Length/2; j++) 316for (int i = 0; i < controlPoints.Length; i++)
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (6)
242int[,] outByteRanges = new int[(inByteRanges.Length / 2),2]; 244for (int i=0, j=0; i < inByteRanges.Length; ++i, ++j) 270int[] outByteRanges = new int[inByteRanges.Length]; 701if (byteRanges.Length < 2 || (byteRanges.Length % 2) != 0) 706for (int i = 0; i < byteRanges.Length; i++)
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (4)
294int guidBytePosition = _guid.Length - ((int) readPosition % _guid.Length) - 1; 300guidBytePosition = _guid.Length - 1; 341for (int i = 0; i < guidBytes.Length; i++)
MS\Internal\IO\Packaging\NetStream.cs (4)
147if (offset + count > buffer.Length) 344while (Read(buf, 0, buf.Length) > 0) 491_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this); 1022_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this);
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (17)
248for (int i = 0; i < visCorners.Length; i++) 301for (int i = 0; i < visualTexCoordBounds.Length; i++) 491Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match"); 497for (int i = 0; i < visualTexCoordBounds.Length; i++) 500Point visEdgeEnd = visualTexCoordBounds[(i + 1) % visualTexCoordBounds.Length]; 508for (int j = 0; j < uv.Length; j++) 511Point uv2 = uv[(j + 1) % uv.Length]; 513Point3D p3D2 = p[(j + 1) % p.Length]; 844for (int i = 0; i < p.Length; i++) 848Point3D p3D2 = p[(i + 1) % p.Length]; 859uv2 = uv[(i + 1) % p.Length]; 865uv1 = uv[(i + 1) % p.Length]; 928for (int i = 0; i < bounds.Length; i++) 931Point visEdgeEnd = bounds[(i + 1) % bounds.Length]; 1012for (int i = 0; i < polygon.Length; i++) 1014double crossProduct = Vector.CrossProduct(polygon[(i + 1) % polygon.Length] - polygon[i],
MS\Internal\Media3D\M3DUtil.cs (1)
352for(int i = 1; i < points.Length; i++)
MS\Internal\PartialArray.cs (4)
37Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length); 48public PartialArray(T[] array) : this(array, 0, array.Length) 150if (arrayIndex >= array.Length) 160if ((array.Length - Count - arrayIndex) < 0)
MS\Internal\Resources\ContentFileHelper.cs (3)
64if (assemblyAttributes != null && assemblyAttributes.Length > 0) 66contentFiles = new HashSet<string>(assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase); 68for (int i=0; i<assemblyAttributes.Length; i++)
MS\Internal\Shaping\OpenTypeCommon.cs (5)
968for(int j = 0; j < featureTagsList.Length; j++) 1277for(int j = 0; !complexFeatureFound && j < featureTagsList.Length; j++) 1307if (complexLanguages.Length == complexLanguageCount) 1310new WritingSystem[complexLanguages.Length * 3 /2]; 1312for(int i = 0; i < complexLanguages.Length; i++)
MS\Internal\Shaping\OpenTypeLayout.cs (6)
129m_length = (uint)data.Length; 1216_lookupUsageFlags.Length < requiredLookupUsageArraySize) 1250if (flagByte >= _lookupUsageFlags.Length) 1266if (flagByte >= _lookupUsageFlags.Length) 1293if (_cachePointers != null && _cachePointers.Length >= glyphRunLength) return; 1319if (_cachePointers.Length < newLength)
MS\Internal\Shaping\OpenTypeLayoutCache.cs (1)
1078if (recordCount == records.Length)
MS\Internal\Shaping\ShaperBuffers.cs (6)
233newSize > _features.Length || 264_features.Length != 0 && 266_features.Length >= keepCount) 270ushort currentLength = (ushort)_features.Length; 326if ( _featuresCount == _features.Length ) 348if ( _featuresCount == _features.Length )
MS\Internal\Shaping\TypefaceMap.cs (2)
887for (int i = 0; i < familyList.Length; i++) 949i = familyList.Length;
MS\Internal\Shaping\UshortList2.cs (6)
190get { return _array.Length; } 208((index + count) <= _array.Length ? count : _array.Length) * sizeof(ushort) 218if (newLength > _array.Length) 223int extra = newLength - _array.Length; 224int newArraySize = _array.Length + ((extra - 1) / _leap + 1) * _leap;
MS\Internal\TextFormatting\FormattedTextSymbols.cs (11)
169int[] nominalAdvances = new int[charArray.Length]; 345_glyphAdvances = new double[glyphAdvances.Length]; 349for (int i = 0; i < glyphAdvances.Length; i++) 361_glyphOffsets = new PartialArray<Point>(new Point[glyphOffsets.Length]); 363for (int i = 0; i < glyphOffsets.Length; i++) 372Debug.Assert(glyphAdvances.Length <= glyphIndices.Length); 374if (glyphAdvances.Length != glyphIndices.Length) 376_glyphIndices = new ushort[glyphAdvances.Length]; 378for (int i = 0; i < glyphAdvances.Length; i++)
MS\Internal\TextFormatting\FullTextLine.cs (3)
724if (collapsingPropertiesList == null || collapsingPropertiesList.Length == 0) 2467subLineInfo.Length, 2524subLineInfo.Length,
MS\Internal\TextFormatting\FullTextState.cs (1)
533rawText.Length,
MS\Internal\TextFormatting\LineServicesCallbacks.cs (1)
1788for (int i = 0; i < lsruns.Length; i++)
MS\Internal\TextFormatting\LineServicesRun.cs (5)
921Debug.Assert(lsruns != null && lsruns.Length > 0 && lsruns[0] != null); 929for (int i = 1; i < lsruns.Length; i++) 944fontFeatures = new DWriteFontFeature[lsruns.Length][]; 945fontFeatureRanges = new uint[lsruns.Length]; 947for (int i = 0; i < lsruns.Length; i++)
MS\Internal\TextFormatting\SimpleTextLine.cs (13)
587if (_runs.Length <= 0) 667for(int i = 0; i < _runs.Length; i++) 898TextSpan<TextRun>[] textRunSpans = new TextSpan<TextRun>[_runs.Length]; 900for (int i = 0; i < _runs.Length; i++) 914List<IndexedGlyphRun> indexedGlyphRuns = new List<IndexedGlyphRun>(_runs.Length); 928displayGlyphAdvances = new ThousandthOfEmRealDoubles(run.EmSize, run.NominalAdvances.Length); 937displayGlyphAdvances = new List<double>(run.NominalAdvances.Length); 938for (int i = 0; i < run.NominalAdvances.Length; i++) 1215while (runIndex < _runs.Length) 1282while (runIndex < _runs.Length && cpRunStart + _runs[runIndex].Length <= cp) 1770displayGlyphAdvances = new ThousandthOfEmRealDoubles(EmSize, NominalAdvances.Length); 1779displayGlyphAdvances = new List<double>(NominalAdvances.Length); 1780for (int i = 0; i < NominalAdvances.Length; i++)
MS\Internal\TextFormatting\TextMarkerSource.cs (3)
154if (textSourceCharacterIndex < _characterArray.Length) 160_characterArray.Length - textSourceCharacterIndex, 184Math.Min(_characterArray.Length, textSourceCharacterIndexLimit)
MS\Internal\TextFormatting\TextRunCacheImp.cs (1)
330for (int i = 0; i < textRunList.Length; i++)
MS\Internal\TextFormatting\TextShapeableCharacters.cs (4)
148caretStops = new bool[clusterMap.Length + 1]; 152caretStops[clusterMap.Length] = true; 156for (int i = 1; i < clusterMap.Length; i++) 236characterString.Length
MS\Internal\TextFormatting\TextStore.cs (6)
333|| cchResolved <= bidiLevels.Length) 525int effectedRangeEnd = Math.Min(cpFetched - offset + runInfo.Length, bounds[bounds.Length - 1].Position); 529for (int i = 0; i < bounds.Length && currentPosition < effectedRangeEnd; i++) 565if (currentEffectsCount == 0 && i < bounds.Length - 1) 990Invariant.Assert(resolvedLength <= bidiLevels.Length); 2306stringBuilder.CopyTo(0, rawText, 0, rawText.Length);
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (8)
77return _shortList.Length; 81return _doubleList.Length; 120_doubleList = new double[_shortList.Length]; 121for (int i = 0; i < _shortList.Length; i++) 159for (int i = 0; i < _shortList.Length; i++) 166for (int i = 0; i < _doubleList.Length; i++) 192if (arrayIndex >= array.Length) 202if ((array.Length - Count - arrayIndex) < 0)
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (2)
135if (arrayIndex >= array.Length) 145if ((array.Length - Count - arrayIndex) < 0)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (4)
203get { return _characterArray.Length; } 251Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 254|| characterOffset + characterLength > _characterArray.Length) 256characterLength = _characterArray.Length - characterOffset;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (4)
36_bufferLengthInBits = (uint)buffer.Length * (uint)Native.BitsPerByte; 49ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, buffer.Length); 53_bufferLengthInBits = (uint)(buffer.Length - startIndex) * (uint)Native.BitsPerByte; 65if (bufferLengthInBits > (buffer.Length * Native.BitsPerByte))
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\LegacyPriorityQueue.cs (1)
145if (_count == _heap.Length)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (4)
143for (int i = assemblies.Length - 1; i >= 0; i--) 266if (reqKeyToken.Length == curKeyToken.Length) 270for (int i = 0; i < reqKeyToken.Length; i++)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SequentialUshortCollection.cs (2)
67ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 68ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Automation\Peers\AutomationPeer.cs (1)
492for(int i = 0; i < roots.Length; i++)
System\Windows\BinaryFormat\BinaryFormatWriter.cs (4)
412new ArrayInfo(1, array.Length), 418new ArrayInfo(1, array.Length), 490new ArrayInfo(2, keys.Length), 493new ArrayInfo(3, values.Length),
System\Windows\ClassHandlersStore.cs (1)
61int length = handlers.Handlers.Length;
System\Windows\clipboard.cs (1)
646for (int i = 0; i < formats.Length; i++)
System\Windows\dataobject.cs (33)
1271for (int i=0; i<formats.Length; i++) 1293for (int i=0; i<ALLOWED_TYMEDS.Length; i++) 1397if (buffer != null && buffer.Length != 0) 1399hEnhancedMetafile = NativeMethods.SetEnhMetaFileBits((uint)buffer.Length, buffer); 1812if (files == null || files.Length < 1) 1833for (int i = 0; i < files.Length; i++) 1858Marshal.Copy(structData, 0, currentPtr, structData.Length); 1867for (int i = 0; i < files.Length; i++) 1934UnsafeNativeMethods.CopyMemoryW(ptr, chars, chars.Length * 2); 1943*(char*)(IntPtr)((ulong)ptr + (ulong)chars.Length * 2) = '\0'; 1972Win32WideCharToMultiByte(str, str.Length, strBytes, strBytes.Length); 2281_formats = new FORMATETC[formats == null ? 0 : formats.Length]; 2285for (int i = 0; i < formats.Length; i++) 2341for (int i = 0; i < celt && _current < _formats.Length; i++) 2362return (_current < _formats.Length) ? NativeMethods.S_OK : NativeMethods.S_FALSE; 2516for (int i=0; i<mappedFormats.Length; i++) 2529for (int formatetcIndex = 0; formatetcIndex < formatetc.Length; formatetcIndex++) 2619for (int i = 0; i < mappedFormats.Length; i++) 2666for (int i = 0; i < mappedFormats.Length; i++) 3012if (size > _serializedObjectID.Length) 3015for(int i = 0; i < _serializedObjectID.Length; i++) 3028index = _serializedObjectID.Length; 3036return new MemoryStream(bytes, index, bytes.Length - index); 3251for (int i=0; i<ALLOWED_TYMEDS.Length; i++) 3407for (int baseFormatIndex = 0; baseFormatIndex < baseVar.Length; baseFormatIndex++) 3415for (int dataStoreIndex = 0; dataStoreIndex < entries.Length; dataStoreIndex++) 3429for (int mappedFormatIndex = 0; mappedFormatIndex < cur.Length; mappedFormatIndex++) 3435dataStoreIndex < entries.Length; 3539for (int i = 0; i < mappedFormats.Length; i++) 3594for (int i = 0; i < entries.Length; i++) 3628for (int i = 0; i < formats.Length; i++) 3655newlist = new DataStoreEntry[datalist.Length + 1]; 3677for (int i = 0; i < dataStoreEntries.Length; i++)
System\Windows\DataObjectPastingEventArgs.cs (1)
136if (availableFormats == null || availableFormats.Length == 0)
System\Windows\DragDrop.cs (1)
1419for (int i = 0; i < formats.Length; i++)
System\Windows\FreezableCollection.cs (2)
395ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 505ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Generated\ContentElement.cs (1)
657for(int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Generated\TextDecorationCollection.cs (2)
296ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 406ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Generated\UIElement.cs (1)
657for(int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Generated\UIElement3D.cs (1)
454for(int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Ink\IncrementalHitTester.cs (1)
684System.Diagnostics.Debug.Assert(stroke != null && hitFragments != null && hitFragments.Length > 0);
System\Windows\Ink\Stroke.cs (15)
731System.Diagnostics.Debug.Assert(cutAt.Length != 0); 741if (cutAt.Length == 0) 746if ((cutAt.Length == 1) && cutAt[0].IsFull) 762System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 763Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) > sourceStylusPoints.Count - 1)); 765for (int i = 0; i < cutAt.Length; i++) 793System.Diagnostics.Debug.Assert(cutAt.Length != 0); 804if ((cutAt.Length == 0) || ((cutAt.Length == 1) && cutAt[0].IsFull)) 818System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 819Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) > sourceStylusPoints.Count - 1)); 829for (; i < cutAt.Length; i++) 1012if (fragments.Length == 0) 1016if (fragments.Length == 1) 1022for (int x = 0; x < fragments.Length; x++)
System\Windows\Ink\Stroke2.cs (3)
625if(cutAt.Length == 0) 649if (cutAt.Length == 0) 659if (inSegments.Length == 0)
System\Windows\Ink\StrokeCollection.cs (5)
411for ( int x = indexes.Length - 1; x >= 0; x-- ) 529for ( int x = indexes.Length - 1; x >= 0; x-- ) 759for ( int x = 0; x < indexes.Length; x++ ) 789for ( int y = 0; y < indexes.Length; y++ ) 796for ( int i = indexes.Length - 1; i > y; i-- )
System\Windows\Input\Cursor.cs (1)
239for (dataSize = cursorData.Length;
System\Windows\Input\CursorConverter.cs (2)
65object[] values = new object[properties.Length]; //Could use Cursor but its wrapped in ICollection anyways 67for (int i = 0; i < properties.Length; i++)
System\Windows\Input\InputManager.cs (4)
715for(int i = (handlers.Length - 1); i >= 0; i--) 738for(int i = (handlers.Length - 1); i >= 0; i--) 838for(int i = (handlers.Length - 1); i >= 0; i--) 904for(int i = (handlers.Length - 1); i >= 0; i--)
System\Windows\Input\InputMethod.cs (2)
1454for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++) 1478for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++)
System\Windows\Input\InputMethodStateTypeInfo.cs (1)
94for (int i = 0; i < _iminfo.Length; i++)
System\Windows\Input\InputProcessorProfiles.cs (1)
127for (i = 0; (i < hklList.Length) && (i < count); i++)
System\Windows\Input\Stylus\Common\RawStylusInputReport.cs (1)
280int lastXIndex = _data.Length - packetLength;
System\Windows\Input\Stylus\Common\StylusPoint.cs (8)
128if (additionalValues.Length != expectedAdditionalValues) 310int buttonData = _additionalValues[_additionalValues.Length - 1]; 403int buttonData = _additionalValues[_additionalValues.Length - 1]; 416_additionalValues[_additionalValues.Length - 1] = buttonData; 529for (int x = 0; x < stylusPoint1._additionalValues.Length; x++) 603for (int x = 0; x < _additionalValues.Length; x++) 638count += _additionalValues.Length; 655for (int x = 0; x < _additionalValues.Length; x++)
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (5)
152int logicalPointCount = rawPacketData.Length / lengthPerPoint; 153Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 541Debug.Assert(additionalData.Length == countToCopy); 618additionalData.Length -1 == countToCopy : 619additionalData.Length == countToCopy);
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (20)
139get { return _stylusPointPropertyInfos.Length; } 188Guid[] ret = new Guid[_stylusPointPropertyInfos.Length]; 189for (int x = 0; x < ret.Length; x++) 203int propertyLength = (_stylusPointPropertyInfos.Length - _buttonCount) + buttonLength; 218int expectedLength = ((_stylusPointPropertyInfos.Length - _buttonCount) + buttonLength) - 3 /*x, y, p*/; 258for (int x = _stylusPointPropertyInfos.Length - _buttonCount; //start of the buttons 259x < _stylusPointPropertyInfos.Length; x++) 308Debug.Assert( stylusPointDescription1._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 313Debug.Assert( stylusPointDescription2._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 318if (stylusPointDescription1._stylusPointPropertyInfos.Length != stylusPointDescription2._stylusPointPropertyInfos.Length) 322for (int x = RequiredCountOfProperties; x < stylusPointDescription1._stylusPointPropertyInfos.Length; x++) 350Debug.Assert(stylusPointDescription._stylusPointPropertyInfos.Length >= 3 && 355Debug.Assert(stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length >= 3 && 368for (int x = RequiredCountOfProperties; x < stylusPointDescription._stylusPointPropertyInfos.Length; x++) 370for (int y = RequiredCountOfProperties; y < stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length; y++) 393if (stylusPointDescriptionSuperset._stylusPointPropertyInfos.Length < _stylusPointPropertyInfos.Length) 401for (int x = 0; x < _stylusPointPropertyInfos.Length; x++) 418for (int x = 0; x < _stylusPointPropertyInfos.Length; x++)
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (4)
169if (!elementHasCapture && inputReport.Data != null && inputReport.Data.Length >= pointLength) 172System.Diagnostics.Debug.Assert(data.Length % pointLength == 0); 173Point ptTablet = new Point(data[data.Length - pointLength], data[data.Length - pointLength + 1]);
System\Windows\Input\Stylus\Wisp\PenContext.cs (1)
453int itemsPerPacket = data.Length / numPackets;
System\Windows\Input\Stylus\Wisp\PenContexts.cs (12)
180for (int i = 0; i < _contexts.Length; i++) 196for (int i = 0; i < _contexts.Length; i++) 227if (_contexts is not null && index <= _contexts.Length && _inputSource.CriticalHandle != 0) 229PenContext[] ctxs = new PenContext[_contexts.Length + 1]; 231uint postCopyCount = (uint)_contexts.Length - index; 252if (_contexts != null && index < _contexts.Length) 256PenContext[] ctxs = new PenContext[_contexts.Length - 1]; 258uint postCopyCount = (uint)_contexts.Length - index - 1; 505if (!elementHasCapture && inputReport.Data != null && inputReport.Data.Length >= pointLength) 508System.Diagnostics.Debug.Assert(data.Length % pointLength == 0); 509Point ptTablet = new Point(data[data.Length - pointLength], data[data.Length - pointLength + 1]);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (10)
770_cachedMoveData = new int [data0.Length + data.Length]; 772data.CopyTo(_cachedMoveData, data0.Length); 1013for (i=0; i<_penContexts.Length; i++) 1072for (i=0; i<_penContexts.Length; i++) 1184for (int j=0; j<workerOps.Length; j++) 1207if (_handles.Length == 1) 1221_handles.Length, _handles, _pimcResetHandle, 1257for (int i = 0; i < _penContexts.Length; i++) 1286for (int i = 0; i < _pimcContexts.Length; i++)
System\Windows\Input\Stylus\Wisp\WispLogic.cs (4)
212int[] mergedData = new int[oldData.Length + newData.Length]; 215newData.CopyTo(mergedData, oldData.Length); 3484return tabletdevices.Length;
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
45int count = tabletInfo.StylusDevicesInfo.Length; 104int cCursors = stylusDevicesInfo.Length;
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (16)
266PenThread penThread = _tablets.Length > 0 ? _tablets[0].As<WispTabletDevice>().PenThread : 280for (uint i = 0; i < tabletdevices.Length; i++) 295for (uint k = 0; k < tabletdevices.Length; k++) 304for (uint iTablet = 0; iTablet < tabletdevices.Length; iTablet++) 314if (tabletsIndex < _tablets.Length && _tablets[tabletsIndex] != null && _tablets[tabletsIndex].Id == id) 324for (uint i = 0; i < _tablets.Length; i++) 363if (unchangedTabletCount == _tablets.Length && 414PenThread penThread = _tablets.Length > 0 ? _tablets[0].As<WispTabletDevice>().PenThread : 441for (uint i = 0; i < _tablets.Length; i++) 467if (tabletIndex <= _tablets.Length) 528if (tabletIndex >= _tablets.Length) 550uint postCopyCount = (uint)_tablets.Length - index; 568TabletDevice[] tablets = new TabletDevice[_tablets.Length - 1]; 571uint postCopyCount = (uint)_tablets.Length - index - 1; 596for (int iTablet = 0, cTablets = _tablets.Length; iTablet < cTablets; iTablet++) 612for (int iTablet = 0, cTablets = _tablets.Length; iTablet < cTablets; iTablet++)
System\Windows\Input\TextCompositionManager.cs (1)
401bytes, bytes.Length,
System\Windows\Input\TextServicesCompartmentContext.cs (1)
58for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++)
System\Windows\InterOp\HwndMouseInputProvider.cs (1)
245for (int i = 0; i < n && cpt < points.Length; i++)
System\Windows\InterOp\HwndPointerInputProvider.cs (4)
142int pointerPropertyCount = tabletDevice.DeviceInfo.SupportedPointerProperties.Length; 161int numButtons = tabletDevice.DeviceInfo.SupportedPointerProperties.Length - tabletDevice.DeviceInfo.SupportedButtonPropertyIndex; 172for (int i = 0, j = rawPointerData.Length - pointerPropertyCount; i < data.Length; i += rawDataPointSize, j -= pointerPropertyCount)
System\Windows\InterOp\HwndSource.cs (2)
244for (int i = handlers.Length -1; i >= 0; --i) 1649for (int i = handlers.Length -1; i >= 0; --i)
System\Windows\LayoutManager.cs (4)
598for(int i=0; i<copy.Length; i++) 701for(int i=0; i<copy.Length; i++) 752AutomationPeer[] peers = new AutomationPeer[copy.Length]; 755for(int i=0; i<copy.Length; i++)
System\Windows\Media\Animation\Clock.cs (1)
4247for (int index = 0; index < idTable.Length; index++)
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\TimelineCollection.cs (2)
306ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 416ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\TimeIntervalCollection.cs (5)
228if (_nodeTime != null && _nodeTime.Length > _minimumCapacity) 1246projection.EnsureAllocatedCapacity(this._nodeTime.Length); 1630Debug.Assert(_nodeTime.Length >= _minimumCapacity); // Assert that we indeed have memory allocated 1786else if (_nodeTime.Length < requiredCapacity) // We may need to grow by up to 2 units 1791int newCapacity = _nodeTime.Length << 1; // Dynamically grow by a factor of 2
System\Windows\Media\Animation\Timeline.cs (1)
1008for (int index = 0; index < idTable.Length; index++)
System\Windows\Media\ByteStreamGeometryContext.cs (1)
762if (chunk.Length == c_defaultChunkSize)
System\Windows\Media\CharacterMetricsDictionary.cs (8)
138if (index >= array.Length) 146for (int i = 0; i < pageTable.Length; ++i) 151for (int j = 0; j < page.Length; ++j) 156if (k >= array.Length) 195if (index >= array.Length) 198if (Count > array.Length - index) 460for (int i = 0; i < pageTable.Length; ++i) 465for (int j = 0; j < page.Length; ++j)
System\Windows\Media\Color.cs (13)
60for (int i = 0; i < c1.nativeColorValue.Length; i++) 83if (values.Length != c1.nativeColorValue.Length) 88for (int numChannels = 0; numChannels < values.Length; numChannels++) 308for (int i = 0; i < nativeColorValue.Length; ++i ) 311if (i < nativeColorValue.Length - 1) 353for (int i = 0; i < color.nativeColorValue.Length; i++) 424for (int i = 0; i < c1.nativeColorValue.Length; i++) 543for (int i = 0; i < c1.nativeColorValue.Length; i++) 753if (color1.nativeColorValue.Length != color2.nativeColorValue.Length) 758for (int i = 0; i < color1.nativeColorValue.Length; i++) 1113if (this.nativeColorValue.Length > 0)
System\Windows\Media\ColorContext.cs (3)
140_colorContextHandle, sRGBProfile, (uint)sRGBProfile.Length)) 148FromRawBytes(sRGBProfile, sRGBProfile.Length, /* dontThrowException = */ true); 641Invariant.Assert(dataLength <= data.Length);
System\Windows\Media\ColorContextHelper.cs (1)
96Invariant.Assert(buffer == null || bufferSize <= buffer.Length);
System\Windows\Media\ColorTransformHelper.cs (2)
100(UInt32)handles.Length, 102(UInt32)dwIntents.Length,
System\Windows\Media\CultureSpecificStringDictionary.cs (4)
127if (index >= array.Length) 130if (_innerDictionary.Count > array.Length - index) 161if (index >= array.Length) 164if (_innerDictionary.Count > array.Length - index)
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (2)
302ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 412ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Effects\PixelShader.cs (3)
160if (_shaderBytecode != null && _shaderBytecode.Length > 3) 202data.PixelShaderBytecodeSize = (uint)(_shaderBytecode?.Length ?? 0); 285destinationBytecode = new byte[sourceBytecode.Length];
System\Windows\Media\EllipseGeometry.cs (1)
276for (int i=0; i<points.Length; i++)
System\Windows\Media\FamilyMap.cs (2)
112for (int i = 0; i < _ranges.Length; ++i) 346for(int i = 0; i < _ranges.Length; i++)
System\Windows\Media\FamilyMapCollection.cs (5)
89if (index >= array.Length) 92if (_count > array.Length - index) 110if (index >= array.Length) 113if (_count > array.Length - index) 283else if (_count == _items.Length)
System\Windows\Media\FamilyTypefaceCollection.cs (3)
262else if (_count == _items.Length) 389if (index >= array.Length) 392if (_count > array.Length - index)
System\Windows\Media\Fonts.cs (2)
336ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 337ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Media\FormattedText.cs (2)
995return _that._maxTextWidths[Math.Min(line, _that._maxTextWidths.Length - 1)]; 1317if (maxTextWidths == null || maxTextWidths.Length <= 0)
System\Windows\Media\Generated\DoubleCollection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\DrawingCollection.cs (2)
318ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 428ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GeneralTransformCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GeometryCollection.cs (2)
318ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 428ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GradientStopCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\Int32Collection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PathFigureCollection.cs (2)
305ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 415ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PathSegmentCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PointCollection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\RenderData.cs (3)
556Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1125Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1465Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length));
System\Windows\Media\Generated\TextEffectCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\TransformCollection.cs (2)
318ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 428ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\VectorCollection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Geometry.cs (3)
953if ((SerializedData == null) || (SerializedData.Length <= 0)) 977if ((SerializedData == null) || (SerializedData.Length <= 0)) 989Invariant.Assert(size <= (uint)SerializedData.Length);
System\Windows\Media\GlyphTypeface.cs (5)
1235Invariant.Assert(glyphsLength <= glyphs.Length); 1830ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 1831ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count); 1915ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 1916ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Media\GuidelineCollection.cs (2)
57Debug.Assert(!isDynamic || guidelinesX.Length % 2 == 0); 66Debug.Assert(!isDynamic || guidelinesY.Length % 2 == 0);
System\Windows\Media\ImageSourceConverter.cs (1)
291return new MemoryStream(rawData, i, rawData.Length - i);
System\Windows\Media\Imaging\BitmapDecoder.cs (1)
961Invariant.Assert(colorContextPtrs == null || numContexts <= colorContextPtrs.Length);
System\Windows\Media\Imaging\BitmapFrameDecode.cs (1)
235Invariant.Assert(colorContextPtrs == null || numContexts <= colorContextPtrs.Length);
System\Windows\Media\Imaging\BitmapSource.cs (1)
679int destBufferSize = checked(elementSize * (pixels.Length - offset));
System\Windows\Media\Imaging\CachedBitmap.cs (1)
153int destBufferSize = elementSize * pixels.Length;
System\Windows\Media\Imaging\PropVariant.cs (7)
150int length = array.Length; 195int length = value.Length; 276for (int i=0; i<charArray.Length; i++) 326short[] array = new short[boolArray.Length]; 328for (int i=0; i<boolArray.Length; i++) 413pclsidVal = Marshal.AllocCoTaskMem(guid.Length); 414Marshal.Copy(guid, 0, pclsidVal, guid.Length);
System\Windows\Media\MatrixStack.cs (3)
46if (_size == _items.Length) 192Debug.Assert(_highWaterMark <= _items.Length); 198if (newSize * (s_shrinkFactor) <= _items.Length)
System\Windows\Media\Parsers.cs (3)
108if (preSplit.Length < 2) 117int numTokens = split.Length; 146if (result.ColorContext.NumChannels != values.Length)
System\Windows\Media\PathGeometry.cs (9)
141Invariant.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHGEOMETRY)); 159Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHFIGURE)); 179Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT)); 189Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 204Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 221Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 237Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 258Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 270Debug.Assert(pathData.SerializedData.Length >=
System\Windows\Media\PixelFormat.cs (5)
98int leftNumChannels = left._mask != null ? left._mask.Length : 0; 99int rightNumChannels = right._mask != null ? right._mask.Length : 0; 143for (int i = 0, count = _mask.Length; i < count; ++i) 548Debug.Assert(cbBytes == channelMask.Length); 702return GetPixelFormat( (PixelFormatEnum)guidBytes[guidBytes.Length-1] );
System\Windows\Media\RectangleGeometry.cs (1)
335for (int i=0; i<points.Length; i++)
System\Windows\Media\RenderData.cs (8)
103if ((_buffer == null) || (newOffset > _buffer.Length)) 110Debug.Assert((_buffer != null) && (_buffer.Length >= newOffset)); 113Debug.Assert(_buffer.Length > 0); 479Debug.Assert(_buffer.Length < cbRequiredSize); 485int newSize = Math.Max((_buffer.Length << 1) - (_buffer.Length >> 1), cbRequiredSize); 498Buffer.MemoryCopy(pBuffer, pNewBuffer, _buffer.Length, _buffer.Length);
System\Windows\Media\StreamGeometry.cs (16)
83if ((_data == null) || (_data.Length <= 0)) 90Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 113Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 137Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 157Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 217Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 241Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 263Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 497if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 499_data = new byte[sourceStream._data.Length]; 512if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 514_data = new byte[sourceStream._data.Length]; 528if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 530_data = new byte[sourceStream._data.Length]; 544if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 546_data = new byte[sourceStream._data.Length];
System\Windows\Media\VisualCollection.cs (6)
198ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _size); 221ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _size); 257return _items != null ? _items.Length : 0; 261int currentCapacity = _items != null ? _items.Length : 0; 472if ((_items == null) || (_size == _items.Length)) 718if ((_items == null) || (_size == _items.Length))
System\Windows\Media\VisualProxy.cs (5)
76int tailLength = _tail.Length; 186else if (count > _tail.Length) 321else if (count == _tail.Length) 574int newLength = _tail.Length + delta; 580Array.Copy(_tail, reallocatedTail, Math.Min(_tail.Length, newLength));
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (2)
300ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 410ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\MaterialCollection.cs (2)
314ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 424ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
314ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 424ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Point3DCollection.cs (2)
251ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 374ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
314ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 424ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
251ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 374ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Matrix3D.cs (3)
527for(int i = 0; i < points.Length; i++) 553for(int i = 0; i < points.Length; i++) 579for(int i = 0; i < vectors.Length; i++)
System\Windows\Media3D\Visual3DCollection.cs (4)
152ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, array.Length); 153ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - Count); 168ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, array.Length); 169ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - Count);
System\Windows\Navigation\BaseUriHelper.cs (2)
284int count = assemblyInfo.Length; 334int count = assemblyInfo.Length;
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
272for (int i = 0; i < keys.Length; i++)
System\Windows\PresentationSource.cs (2)
599if (visuals == null || visuals.Length == 0) 606int count = visuals.Length;
System\Windows\TextDecorationCollectionConverter.cs (2)
132i < TextDecorationNames.Length 137if (i < TextDecorationNames.Length)
PresentationFramework (898)
Microsoft\Win32\CommonItemDialog.cs (3)
478if (_itemNames?.Length > 0) 617string[] names = new string[items.Length]; 618for (int i = 0; i < items.Length; i++)
Microsoft\Win32\FileDialog.cs (10)
141string[] safeFileNames = new string[unsafeFileNames.Length]; 143for (int i = 0; i < unsafeFileNames.Length; i++) 335if (formats.Length % 2 != 0) 510if (filterItems.Length > 0) 512dialog.SetFileTypes((uint)filterItems.Length, filterItems); 596for (int i = 0; i < MutableItemNames.Length; i++) 604for (int j = 0; j < extensions.Length; j++) 682if (0 == tokens.Length % 2) 684for (int i = 1; i < tokens.Length; i += 2) 752if (indexOfExtension >= tokens.Length)
Microsoft\Win32\OpenFileDialog.cs (2)
104Stream[] streams = new Stream[cachedFileNames.Length]; 107for (int i = 0; i < cachedFileNames.Length; i++)
Microsoft\Win32\OpenFolderDialog.cs (2)
131string[] safeFolderNames = new string[unsafeFolderNames.Length]; 133for (int i = 0; i < unsafeFolderNames.Length; i++)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (1)
512if (values.Length != 4)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
611if (realLocator != null && prefixes != null && prefixes.Length > 0)
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (1)
450if (values.Length != 2)
MS\Internal\Annotations\ObservableDictionary.cs (1)
193ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, target.Length);
MS\Internal\AppModel\IconHelper.cs (1)
241Marshal.Copy(colorArray, 0, bits, colorArray.Length);
MS\Internal\AppModel\OleCmdHelper.cs (1)
137Invariant.Assert(args.Length == 3);
MS\Internal\AppModel\ResourceContainer.cs (1)
282for (int i = 0; i < reqKeyToken.Length; i++)
MS\Internal\AppModel\ReturnEventSaver.cs (3)
63list = _returnList = new ReturnEventSaverInfo[delegates.Length]; 65for (int i = 0; i < delegates.Length; i++) 115for (int i = 0; i < list.Length; i++)
MS\Internal\Commands\CommandHelpers.cs (1)
112for (int i = 0; i < inputGestures.Length; i++)
MS\Internal\Controls\EnumUnknown.cs (1)
34this.size = (arr == null) ? 0 : arr.Length;
MS\Internal\Data\AccessorTable.cs (2)
71if (age >= _ages.Length) 156for (int i=0; i<_ages.Length; ++i)
MS\Internal\Data\ClrBindingWorker.cs (1)
108if (path.SVI.Length > 0)
MS\Internal\Data\DefaultValueConverter.cs (4)
492for (int i = 0; i < SupportedTypes.Length; ++i) 497for (; i < SupportedTypes.Length; ++i) 506for (; i < SupportedTypes.Length; ++i) 519for (int i = 0; i < CharSupportedTypes.Length; ++i)
MS\Internal\Data\IndexedEnumerable.cs (3)
323if (index < array.Length) 501for (int i = 0; i <= defaultMembers.Length - 1; i++) 507if (indexerParameters.Length == 1)
MS\Internal\Data\LiveShapingList.cs (3)
263Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos"); 264int n = _compInfos.Length; 480for (int k = 0; k < infos.Length; ++k)
MS\Internal\Data\PropertyPathWorker.cs (32)
55for (int i = _arySVS.Length - 1; i >= 0; --i) 184if (args != null && args.Length == 1 && 249bool indexerIsNext = (level + 1 < SVI.Length && SVI[level + 1].type == SourceValueType.Indexer); 276if (args != null && args.Length == 1 && 343int level = _arySVS.Length - 1; 415for (int k = 1; k < _arySVS.Length; ++k) 440for (int k = 0; k < _arySVS.Length; ++k) 490for (int k = 0; k < _arySVS.Length; ++k) 507UpdateSourceValueState(_arySVS.Length, null, BindingExpression.NullDataItem, isASubPropertyChange); 513for (k = 0; k < _arySVS.Length; ++k) 551result = (pi != null) && pi.GetIndexParameters().Length > 0; 621Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 626for (++k; k < _arySVS.Length; ++k) 661if (initialLevel < _arySVS.Length) 666_arySVS.Length > 0 && 667SVI[_arySVS.Length - 1].type != SourceValueType.Direct && 668!(_arySVS[_arySVS.Length - 1].info is DependencyProperty) && 669typeof(DependencyObject).IsAssignableFrom(_arySVS[_arySVS.Length - 1].type); 672if (!suppressTransfer && _arySVS.Length > 0 && 673_arySVS[_arySVS.Length - 1].info == FrameworkElement.DataContextProperty && 1184if (aryInfo.Length == 1 && 1195args = new object[aryInfo.Length]; 1203for (int ii = 0; info == null && ii < aryMembers.Length; ++ii) 1210for (int jj = 0; jj < defaultMembers.Length; ++jj) 1231info = SystemCoreHelper.GetIndexerAccessor(args.Length); 1281int len1 = (args != null) ? args.Length : 0; 1282int len2 = (svs.args != null) ? svs.args.Length : 0; 1361if (aryPI != null && aryPI.Length != aryInfo.Length) 1365for (int i = 0; i < args.Length; ++i) 1452if (isIList && aryPI.Length == 1 && aryPI[0].ParameterType == typeof(int)) 1520if (k >= _arySVS.Length)
MS\Internal\Data\RBTree.cs (1)
576if (arrayIndex + Count > array.Length)
MS\Internal\Data\SortFieldComparer.cs (3)
61for (int k = 0; k < _fields.Length; ++k) 94int nFields = sfc._fields.Length; 221if (++index < _values.Length)
MS\Internal\Data\StaticPropertyChangedEventManager.cs (1)
464for (int i = keys.Length - 1; i >= 0; --i)
MS\Internal\Data\ValueChangedEventManager.cs (1)
160for (int i = keys.Length - 1; i >= 0; --i)
MS\Internal\Data\ValueTable.cs (1)
289for (int i = localKeys.Length - 1; i >= 0; --i)
MS\Internal\Data\XDeferredAxisSource.cs (2)
80Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer"); 81PropertyInfo pi = (aryMembers.Length > 0) ? aryMembers[0] as PropertyInfo : null;
MS\Internal\Documents\ContentElementCollection.cs (4)
81if (array.Length - index < Size) 113if (array.Length - index < Size) 755return (Items.Length); 759if (value != Items.Length)
MS\Internal\Documents\MultiPageTextView.cs (1)
1114for (i = 0; i < textViewProximities.Length; i++)
MS\Internal\Documents\TableColumnCollectionInternal.cs (2)
43if (Size == Items.Length) 108if (Size == Items.Length)
MS\Internal\Documents\TableTextElementCollectionInternal.cs (1)
357if (Size == Items.Length)
MS\Internal\Documents\TextBoxLine.cs (2)
490int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 491Invariant.Assert(charactersCopied == textBuffer.Length);
MS\Internal\Documents\TextContainerHelper.cs (4)
57Invariant.Assert(other._ranges.Length >= (other._size * 2)); 59for (int i = 0; i < _ranges.Length; i++) 265if (_ranges.Length < (_size + 1) * 2) 267int[] ranges = new int[_ranges.Length * 2];
MS\Internal\Globalization\BamlTreeMap.cs (8)
406for (int i = 0; i < comment.LocalizationAttributes.Length; i++) 424for (int i = 0; i < comment.LocalizationComments.Length; i++) 583for (int i = 0; i < _comments.Length; i++) 618i < node.Children.Count && (comment.LocalizationComments.Length == 0 || comment.LocalizationAttributes.Length == 0); 627&& comment.LocalizationComments.Length == 0) 633&& comment.LocalizationAttributes.Length == 0) 644_commentsIndex = (_commentsIndex + 1) % _comments.Length;
MS\Internal\Globalization\BamlTreeUpdater.cs (2)
638for (int i = 0; i < tokens.Length; i++) 841if (contentPropertyAttributes.Length > 0)
MS\Internal\Globalization\LocalizationComments.cs (2)
69for (int i = 0; i < pairs.Length; i++) 369for (int i = 0; i < _enumNames.Length; i++)
MS\Internal\Helper.cs (4)
663Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 897for (int j = 0; j < dpIndices.Length; j++) 999for (int i = 0; i < dpIndices.Length; i++) 1054for (int j=0; j<dpIndices.Length; j++)
MS\Internal\Ink\LassoHelper.cs (2)
176int marginCount = (points.Length * percentIntersect) / 100; 178if ((0 == marginCount) || (50 <= ((points.Length * percentIntersect) % 100)))
MS\Internal\Ink\LassoSelectionBehavior.cs (2)
194if ( 0 != lassoPoints.Length ) 623if ( 0 != lassoPoints.Length )
MS\Internal\Interop\InternalDispatchObject.cs (1)
64_dispId2MethodMap = new Dictionary<int, MethodInfo>(methods.Length);
MS\Internal\IO\Packaging\ByteStream.cs (2)
282if (!((buffer.Length > 0) && ((buffer.Length - offset) >= count)))
MS\Internal\IO\Packaging\CorePropertiesFilter.cs (3)
270if (attributes != null && attributes.Length > 0) 343while (_currentIndex < _attributes.Length) 406if (_currentIndex < 0 || _currentIndex >= _attributes.Length)
MS\Internal\IO\Packaging\PackageFilter.cs (4)
542for (int keyNameIndex = 0; keyNameIndex < keyPath.Length; ++keyNameIndex) 618for (int i = 0; i < path.Length; ++i) 622Debug.Assert(stopGaps.Length > nextStopGapToUse); 630Debug.Assert(stopGaps.Length == nextStopGapToUse);
MS\Internal\IO\Packaging\XamlFilter.cs (2)
176if (aAttributes != null && aAttributes.Length > 0) 180for (int i = 0; i < aAttributes.Length; i++)
MS\Internal\IO\Packaging\XmlFixedPageInfo.cs (2)
63if (position < 0 || position >= GlyphRunList.Length) 89return GlyphRunList.Length;
MS\Internal\Printing\PrintDlgExMarshaler.cs (9)
377Marshal.Copy(pDevMode, devModeData, 0, devModeData.Length); 724int cbDevNames = checked(((printer.Length + 3) * Marshal.SystemDefaultCharSize) + 739devNames.wDriverOffset = checked((ushort)(devNames.wDeviceOffset + printer.Length + 1)); 752checked((IntPtr)((long)offsetName + (printer.Length * Marshal.SystemDefaultCharSize))); 763Array.Clear(nulls, 0, nulls.Length); 768printer.Length); 773nulls.Length); 817IntPtr hDevMode = Marshal.AllocHGlobal(devModeData.Length); 818Marshal.Copy(devModeData, 0, hDevMode, devModeData.Length);
MS\Internal\PtsHost\CellParaClient.cs (4)
85&& (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length); 365&& (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length); 461_columnWidths = new double[tpc.CalculatedColumns.Length]; 463for(int index = 0; index < tpc.CalculatedColumns.Length; index++)
MS\Internal\PtsHost\ContainerParaClient.cs (3)
293for (int i = 0; i < arrayParaDesc.Length; i++) 345List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 346for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\DtrList.cs (6)
130if (_count == _dtrs.Length) { Resize(); } 140if (_count == _dtrs.Length) { Resize(); } 304if (_count == _dtrs.Length) { Resize(); } 315Debug.Assert(_dtrs.Length > 0); 318DirtyTextRange [] newdtrs = new DirtyTextRange[_dtrs.Length * 2]; 319Array.Copy(_dtrs, newdtrs, _dtrs.Length);
MS\Internal\PtsHost\FigureParaClient.cs (16)
124for (int index = 0; index < arrayColumnDesc.Length; index++) 173emptySubpage = (arrayColumnDesc.Length == 0); 176for (int index = 0; index < arrayColumnDesc.Length; index++) 264for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 323for (int index = 0; index < arrayColumnDesc.Length; index++) 423emptySubpage = (arrayColumnDesc.Length == 0); 453for (int index = 0; index < arrayColumnDesc.Length; index++) 458ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 460for (int index = 0; index < arrayColumnDesc.Length; index++) 523Invariant.Assert(arrayColumnDesc.Length == 1); 526for (int index = 0; index < arrayColumnDesc.Length; index++) 587paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 588for (int i = 0; i < arrayParaDesc.Length; i++) 612Debug.Assert(arrayColumnDesc.Length == 1); 627paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 628for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\FloaterParaClient.cs (15)
108for (int index = 0; index < arrayColumnDesc.Length; index++) 157emptySubpage = (arrayColumnDesc.Length == 0); 160for (int index = 0; index < arrayColumnDesc.Length; index++) 268for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 327for (int index = 0; index < arrayColumnDesc.Length; index++) 429emptySubpage = (arrayColumnDesc.Length == 0); 459for (int index = 0; index < arrayColumnDesc.Length; index++) 464ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 466for (int index = 0; index < arrayColumnDesc.Length; index++) 531for (int index = 0; index < arrayColumnDesc.Length; index++) 595paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 596for (int i = 0; i < arrayParaDesc.Length; i++) 620Debug.Assert(arrayColumnDesc.Length == 1); 635paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 636for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\FlowDocumentPage.cs (4)
495for (int i = 0; i < arrayColumnDesc.Length; i++) 554for (int i = 0; i < arrayParaDesc.Length; i++) 589List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 590for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\LineBase.cs (2)
127int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 187run = new TextCharacters(textBuffer, 0, textBuffer.Length, textProps);
MS\Internal\PtsHost\PtsContext.cs (9)
121for (index = 0; index < _unmanagedHandles.Length; ++index) 138for (int i = 0; i < _unmanagedHandles.Length; ++i) 214Invariant.Assert(handleLong > 0 && handleLong < _unmanagedHandles.Length, "Invalid object handle."); 232if (handleLong < 0 || handleLong >= _unmanagedHandles.Length) 251Invariant.Assert(handleLong > 0 && handleLong < _unmanagedHandles.Length, "Invalid object handle."); 434while (freeIndex < _unmanagedHandles.Length) 448int freeIndex = _unmanagedHandles.Length; 451HandleIndex[] newItems = new HandleIndex[_unmanagedHandles.Length * 2]; 452Array.Copy(_unmanagedHandles, newItems, _unmanagedHandles.Length);
MS\Internal\PtsHost\PtsHelper.cs (9)
161for (int index = 0; index < arrayParaDesc.Length; index++) 258for (int index = 0; index < arrayParaDesc.Length; index++) 302if (arrayParaDesc.Length < visualCollection.Count) 304visualCollection.RemoveRange(arrayParaDesc.Length, visualCollection.Count - arrayParaDesc.Length); 349for (int index = 0; index < arrayParaDesc.Length; index++) 414for (int index = 0; index < arrayParaDesc.Length && ie == null; index++) 493for (int index = 0; index < arrayParaDesc.Length; index++) 749for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\PtsPage.cs (14)
543for (int index = 0; index < arraySectionDesc.Length; index++) 588for (int index = 0; index < arraySectionDesc.Length; index++) 938for (int index = 0; index < arrayColumnDesc.Length; index++) 986for (int index = 0; index < arrayColumnDesc.Length; index++) 1074emptyPage = (arraySectionDesc.Length == 0); 1077ErrorHandler.Assert(arraySectionDesc.Length == 1, ErrorHandler.NotSupportedMultiSection); 1148emptySection = (arrayColumnDesc.Length == 0); 1159for (int index = 0; index < arrayColumnDesc.Length; index++) 1164ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 1165for (int index = 0; index < arrayColumnDesc.Length; index++) 1239for (int index = 0; index < arraySectionDesc.Length && ie == null; index++) 1293for (int index = 0; index < arraySectionDesc.Length; index++) 1352for (int index = 0; index < arrayColumnDesc.Length; index++) 1414for (int index = 0; index < arrayColumnDesc.Length; index++)
MS\Internal\PtsHost\RowParagraph.cs (9)
51for(int index = 0; index < _cellParagraphs.Length; index++) 251Invariant.Assert(cCells == i + _spannedCells.Length); // Protect against buffer overflow 254if (_spannedCells.Length > 0) 258for (int j = 0; j < _spannedCells.Length; ++j) 314_spannedCells = new CellParagraph[Row.SpannedCells.Length]; 321for(int index = 0; index < _spannedCells.Length; index++) 335(isLastRowOfRowGroup && _spannedCells.Length > 0)) 393for(int index = 0; index < _cellParagraphs.Length; index++) 403for(int index = 0; index < previousRow._spannedCells.Length; index++)
MS\Internal\PtsHost\SectionVisual.cs (7)
48if (arrayColumnDesc.Length > 1) 53rulePositions = new Point[(arrayColumnDesc.Length - 1)*2]; 54for (int index = 1; index < arrayColumnDesc.Length; index++) 71int prevSize = _rulePositions == null ? 0 : _rulePositions.Length; 72int newSize = rulePositions == null ? 0 : rulePositions.Length; 75for (int index = 0; index < rulePositions.Length; index++) 115for (int index = 0; index < rulePositions.Length; index += 2)
MS\Internal\PtsHost\SubpageParaClient.cs (14)
137for (int index = 0; index < arrayColumnDesc.Length; index++) 200for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 258for (int index = 0; index < arrayColumnDesc.Length; index++) 356emptySubpage = (arrayColumnDesc.Length == 0); 386for (int index = 0; index < arrayColumnDesc.Length; index++) 391ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 392for (int index = 0; index < arrayColumnDesc.Length; index++) 451emptySubpage = (arrayColumnDesc.Length == 0); 454for (int index = 0; index < arrayColumnDesc.Length; index++) 505for (int index = 0; index < arrayColumnDesc.Length; index++) 585for (int i = 0; i < arrayColumnDesc.Length; i++) 624List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 625for (int i = 0; i < arrayParaDesc.Length; i++) 660for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\TableParaClient.cs (48)
107for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 131for (int iC = 0; iC < arrayFsCell.Length; ++iC) 242for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 290CalculatedColumns.Length, 311if (rowVisualsCollection.Count > arrayTableRowDesc.Length) 314arrayTableRowDesc.Length, 315rowVisualsCollection.Count - arrayTableRowDesc.Length); 333for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 345for (int iC = 0; iC < arrayFsCell.Length; ++iC) 379for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 393for (int iC = 0; iC < arrayFsCell.Length; ++iC) 457for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 467for (int iC = 0; iC < arrayFsCell.Length; ++iC) 529for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 558for (int iC = 0; iC < arrayFsCell.Length; ++iC) 622for (int iR = 0; iR < arrayTableRowDesc.Length && cpcFound == null; ++iR) 634for (int iC = 0; iC < arrayFsCell.Length && cpcFound == null; ++iC) 704for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 755for (int iC = 0; iC < arrayFsCell.Length; ++iC) 839for (int iR = 0; iR < arrayTableRowDesc.Length && !passedEndPosition; ++iR) 851for (int iC = 0; iC < arrayFsCell.Length; ++iC) 906for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 918for (int iC = 0; iC < arrayFsCell.Length; ++iC) 963for (int iR = arrayTableRowDesc.Length - 1; iR >= 0; --iR) 978for (int iC = arrayFsCell.Length - 1; iC >= 0; --iC) 1042for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1057for (int iC = arrayFsCell.Length - 1; iC >= 0; --iC) 1137for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1281for (int i = 0; i < cols.Length; i++) 1353row = ((RowParagraph)(PtsContext.HandleToObject(arrayTableRowDesc[arrayTableRowDesc.Length - 1].fsnmRow))).Row; 1357arrayTableRowDesc[arrayTableRowDesc.Length - 1].pfstablerow, 1551for (int iC = 0; iC < arrayFsCell.Length; ++iC) 1670for (int iC = 0; iC < arrayFsCell.Length; ++iC) 1695for (int columnIndex = 0; columnIndex < arrayCellParaClients.Length; ++columnIndex) 1765for (int iC = CalculatedColumns.Length-1; iC >= 0; iC--) 1784for (int iC = 0; iC < CalculatedColumns.Length; iC++) 1815if(IsLastChunk && rowIndex == arrayTableRowDesc.Length - 1) 1840if(arrayTableRowDesc.Length > 0) 1845for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1895for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1927else if (_calculatedColumns.Length != columns) 1934Math.Min(_calculatedColumns.Length, columns)); 1939if (_calculatedColumns.Length > 0) 1943while (i < _calculatedColumns.Length && i < Table.Columns.Count) 1949while (i < _calculatedColumns.Length) 1958for (int i = 0; i < _calculatedColumns.Length; ++i) 2045for (int i = 0; i < _calculatedColumns.Length; ++i) 2331for (int i = 0; i < _calculatedColumns.Length; ++i)
MS\Internal\PtsHost\TableParagraph.cs (2)
518for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++) 536for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++)
MS\Internal\PtsHost\TextParaClient.cs (87)
179for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 274for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 403floaters = new List<ParagraphResult>(arrayAttachedObjectDesc.Length); 406for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 440figures = new List<ParagraphResult>(arrayAttachedObjectDesc.Length); 443for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 547for (index = 0; index < arrayLineDesc.Length; index++) 571for (index = 0; index < arrayLineDesc.Length; index++) 581for (elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 596if (elIndex < arrayLineElement.Length) 1006for (index = 0; index < arrayLineDesc.Length; index++) 1031for (index = 0; index < arrayLineDesc.Length; index++) 1041for (elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1058if (elIndex < arrayLineElement.Length) 1263for (int index = 0; index < arrayLineDesc.Length; index++) 1289for (int index = 0; index < arrayLineDesc.Length; index++) 1297for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1327for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 1532List<LineResult> lines = new List<LineResult>(arrayLineDesc.Length); 1535for (int index = 0; index < arrayLineDesc.Length; index++) 1584List<LineResult> lines = new List<LineResult>(arrayLineDesc.Length); 1587for (int index = 0; index < arrayLineDesc.Length; index++) 1596for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1654for (int index = 0; index < arrayLineDesc.Length; index++) 1663|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 1742for (int index = 0; index < arrayLineDesc.Length; index++) 1751for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1760|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 1837int lineCount = arrayLineDesc.Length; 1875|| ( (lineIndex == arrayLineDesc.Length - 1) 1886if ( (handleEndOfPara && lineIndex == (arrayLineDesc.Length - 1)) 1943for (int lineIndex = 0; lineIndex < arrayLineDesc.Length; ++lineIndex) 1955for (int elemIndex = 0; elemIndex < arrayLineElement.Length; ++elemIndex) 1986&& (elemIndex == arrayLineElement.Length - 1) 1987&& (lineIndex == arrayLineDesc.Length - 1) ) ) 1996if ( (handleEndOfPara && lineIndex == (arrayLineDesc.Length - 1)) 2340for (int index = 0; index < arrayAttachedObjectDesc.Length; ++index) 2386for (int index = 0; index < arrayLineDesc.Length; index++) 2393|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2396if (dcp >= lineDesc.dcpLim - 1 && index == arrayLineDesc.Length - 1) 2478for (int index = 0; index < arrayLineDesc.Length; index++) 2490for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 2497|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 2500if (dcp >= element.dcpLim - 1 && elIndex == arrayLineElement.Length - 1 && index == arrayLineDesc.Length - 1) 2540element = arrayLineElement[arrayLineElement.Length - 1]; 2605for (int index = 0; index < arrayLineDesc.Length; index++) 2612|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2632if (index == arrayLineDesc.Length - 1) 2671if (index == arrayLineDesc.Length - 1) 2730for (int index = 0; index < arrayLineDesc.Length; index++) 2739for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 2746|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 2783element = arrayLineElement[arrayLineElement.Length - 1]; 2793Debug.Assert(elIndex == arrayLineElement.Length - 1); 2794Debug.Assert(index == arrayLineDesc.Length - 1); 2797else if (dcp == element.dcpLim - 1 && elIndex == arrayLineElement.Length - 1 && index == arrayLineDesc.Length - 1) 2834if (index == arrayLineDesc.Length - 1) 2895for (int index = 0; index < arrayLineDesc.Length; index++) 2902|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2987for (int index = 0; index < arrayLineDesc.Length; index++) 2996for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3003|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 3040element = arrayLineElement[arrayLineElement.Length - 1]; 3111for (int index = 0; index < arrayLineDesc.Length; index++) 3164for (int index = 0; index < arrayLineDesc.Length; index++) 3173for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3234for (int index = 0; index < arrayLineDesc.Length; index++) 3306for (int index = textDetails.cLinesBeforeChange + textDetails.cLinesChanged; index < arrayLineDesc.Length; index++) 3409for (lineIndex = 0; lineIndex < arrayLineDesc.Length; lineIndex++) 3424for (lineIndex = lineIndexFirstVisible; lineIndex < arrayLineDesc.Length; lineIndex++) 3605for (int index = 0; index < arrayLineDesc.Length; index++) 3628for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3697for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3725for (int index = textDetails.cLinesBeforeChange + textDetails.cLinesChanged; index < arrayLineDesc.Length; index++) 3758for (index = 0; index < arrayAttachedObjectDesc.Length; index++) 3799for (int index = 0; index < arrayLineDesc.Length; index++) 3887for (int index = 0; index < arrayLineDesc.Length; index++) 3979for (int index = 0; index < arrayLineDesc.Length; index++) 3992for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 4064for (int index = 0; index < arrayLineDesc.Length; index++) 4111for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++)
MS\Internal\PtsHost\TextParagraph.cs (1)
1433for(int index = 0; arrayAttachedObjectDesc != null && index < arrayAttachedObjectDesc.Length; index++)
MS\Internal\PtsTable\RowSpanVector.cs (5)
99if (_size == _entries.Length) 249Debug.Assert( _entries.Length > 0 250&& _size <= _entries.Length ); 252Entry[] newEntries = new Entry[_entries.Length * 2]; 253Array.Copy(_entries, newEntries, _entries.Length);
MS\Internal\Text\ComplexLine.cs (2)
373int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 406run = new TextCharacters(textBuffer, 0, textBuffer.Length, textProps);
MS\Internal\TraceData.cs (1)
98for( int i = start; i < parameters.Length; i++ )
MS\Internal\UncommonValueTable.cs (2)
48int n = _table.Length; 71int n = _table.Length - 1;
MS\Internal\WeakDictionary.cs (1)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - count);
MS\Internal\WeakHashSet.cs (1)
51ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - count);
MS\Internal\WindowsRuntime\Generated\WinRT\IInspectable.cs (1)
59iidCount = (uint)iids.Length;
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (18)
150var length = array.Length; 171return (m._marshalers?.Length ?? 0, m._array); 217var length = array.Length; 239DisposeAbiArrayElements((array.Length, data)); 244var length = array.Length; 295return (((Array)m._gchandle.Target).Length, m._gchandle.AddrOfPinnedObject()); 315var length = array.Length; 328var length = array.Length; 468int length = array.Length; 492return (m._marshalers?.Length ?? 0, m._array); 548int length = array.Length; 573DisposeAbiArrayElements((array.Length, data)); 578int length = array.Length; 650int length = array.Length; 672return (m._marshalers?.Length ?? 0, m._array); 708int length = array.Length; 731DisposeAbiArrayElements((array.Length, data)); 736int length = array.Length;
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (2)
160var newArguments = new Type[genericArguments.Length]; 161for (int i = 0; i < genericArguments.Length; i++)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IEnumerable.cs (2)
396while (index < items.Length && HasCurrent) 408for (int i = index; i < items.Length; ++i)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (2)
190uint itemCount = Math.Min((uint)items.Length, (uint)_list.Count - startIndex); 202for (uint i = itemCount; i < items.Length; ++i)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (3)
266if (reqKeyToken.Length == curKeyToken.Length) 270for (int i = 0; i < reqKeyToken.Length; i++)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\ItemMap.cs (2)
42if ((Count + 1) > Entries.Length) 44destEntries = new Entry[Entries.Length * 2];
System\Windows\Annotations\Annotation.cs (2)
638if (typeName.Length == 1) 648else if (typeName.Length == 2)
System\Windows\Annotations\AnnotationService.cs (2)
1043for (int i = 0; i < adorners.Length; i++) 1336List<AttachedAnnotationChangedEventArgs> eventsToFire = new List<AttachedAnnotationChangedEventArgs>(list.Length);
System\Windows\Application.cs (2)
2457int l = bamlConvertUriSegments.Length; 2458int m = curUriSegments.Length;
System\Windows\BroadcastEventHelper.cs (4)
51Debug.Assert(loadedPending.Length == 3); 99Debug.Assert(unloadedPending.Length == 3); 172Debug.Assert(loadedPending != null && loadedPending.Length == 3, 209Debug.Assert(unloadedPending != null && unloadedPending.Length == 3,
System\Windows\Controls\BorderGapMaskConverter.cs (1)
41values.Length != 3 ||
System\Windows\Controls\ColumnDefinition.cs (5)
97if (array.Length - index < _size) 119if (array.Length - index < _size) 644else if (_size == _items.Length) 646PrivateSetCapacity(Math.Max(_items.Length * 2, c_defaultCapacity)); 714else if (_items == null || value != _items.Length)
System\Windows\Controls\DataGridCell.cs (1)
435for (int i = 0; i < bindingExpressionsCopy.Length; i++)
System\Windows\Controls\DataGridClipboardHelper.cs (1)
86int bytecountEndOfFragment = bytecountPrefixContext + destinationBytes.Length;
System\Windows\Controls\DataGridHelper.cs (2)
540for (int i = 0; i < bindingExpressionsCopy.Length; i++) 656for (int i = 0; i < bindingExpressionsCopy.Length; i++)
System\Windows\Controls\DataGridLengthConverter.cs (1)
218int numUnitStrings = _unitStrings.Length;
System\Windows\Controls\DateTimeHelper.cs (2)
257if (monthNames != null && monthNames.Length > 0) 259result = monthNames[(date.Value.Month - 1) % monthNames.Length];
System\Windows\Controls\Grid.cs (66)
396Array.Clear(_definitionIndices, 0, _definitionIndices.Length); 404Array.Clear(_roundingErrors, 0, _roundingErrors.Length); 424Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 593bool canResolveStarsU = extData.CellGroup2 > PrivateCells.Length; 683Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 694for (int currentCell = 0; currentCell < PrivateCells.Length; ++currentCell) 782value = definitions[(columnIndex + 1) % definitions.Length].FinalOffset; 804value = definitions[(rowIndex + 1) % definitions.Length].FinalOffset; 900for (int i = PrivateCells.Length - 1; i >= 0; --i) 917cell.ColumnIndex = Math.Min(GetColumn(child), DefinitionsU.Length - 1); 920cell.RowIndex = Math.Min(GetRow(child), DefinitionsV.Length - 1); 925cell.ColumnSpan = Math.Min(GetColumnSpan(child), DefinitionsU.Length - cell.ColumnIndex); 929cell.RowSpan = Math.Min(GetRowSpan(child), DefinitionsV.Length - cell.RowIndex); 931Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length); 932Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length); 1030Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0); 1077Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0); 1092for (int i = 0; i < definitions.Length; ++i) 1136double[] minSizes = isRows ? new double[DefinitionsV.Length] : new double[DefinitionsU.Length]; 1138for (int j=0; j<minSizes.Length; j++) 1156} while (i < PrivateCells.Length); 1163for (int i=0; i<minSizes.Length; i++) 1208if (cellsHead >= PrivateCells.Length) 1261} while (i < PrivateCells.Length); 1390Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1417Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1445Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length); 1647for (int i = 0; i < definitions.Length; ++i) 1743int defCount = definitions.Length; 2041for (int i = 0; i < definitions.Length; ++i) 2077int nonStarIndex = definitions.Length; // traverses from the last entry down 2093for (int i = 0; i < definitions.Length; ++i) 2221Array.Sort(definitionIndices, 0, definitions.Length, new DistributionOrderIndexComparer(definitions)); 2224for (int i = 0; i < definitions.Length; ++i) 2227double final = definitions[definitionIndex].SizeCache + (sizeToDistribute / (definitions.Length - i)); 2252for (int i = 0; i < definitions.Length; ++i) 2259Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2265int i = definitions.Length - 1; 2282while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length) 2299for (int i = 0; i < definitions.Length; ++i) 2301definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache; 2322int defCount = definitions.Length; 2668for (int i = 0; i < definitions.Length; ++i) 2722for (int i = 0; i < definitions.Length; ++i) 2728Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2734int i = definitions.Length - 1; 2751while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length) 2769for (int i = 0; i < definitions.Length; ++i) 2771definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache; 2878Array.Clear(extData.TempDefinitions, 0, Math.Max(DefinitionsU.Length, DefinitionsV.Length)); 3083int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length) * 2; 3086|| extData.TempDefinitions.Length < requiredLength ) 3098|| extData.TempDefinitions.Length < requiredLength ) 3116int requiredLength = Math.Max(Math.Max(DefinitionsU.Length, DefinitionsV.Length), 1) * 2; 3118if (_definitionIndices == null || _definitionIndices.Length < requiredLength) 3134int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length); 3140else if (_roundingErrors == null || _roundingErrors.Length < requiredLength) 4008for (int i = 1; i < grid.DefinitionsU.Length; ++i) 4016for (int i = 1; i < grid.DefinitionsV.Length; ++i)
System\Windows\Controls\GridViewHeaderRowPresenter.cs (3)
1381for (int i = 0, n = s_DPList[0].Length; i < n; i++) 1704for (int i = 0; i < s_DPList.Length; i++) 1706for (int j = 0; j < s_DPList[i].Length; j++)
System\Windows\Controls\MenuScrollingVisibilityConverter.cs (1)
50values.Length != 4 ||
System\Windows\Controls\Panel.cs (1)
1042if (_zLut == null || _zLut.Length != count)
System\Windows\Controls\PopupControlService.cs (3)
1548for (int i=0, N=_points.Length; i<N; ++i) 1658for (int i = 0, N = _points.Length; i < N; ++i) 1678for (int i = 0, N = _points.Length; i < N; ++i)
System\Windows\Controls\Primitives\CalendarItem.cs (3)
1027if (daytitle != null && shortestDayNames != null && shortestDayNames.Length > 0) 1031daytitle.DataContext = shortestDayNames[(childIndex + (int)this.Owner.FirstDayOfWeek) % shortestDayNames.Length]; 1035daytitle.DataContext = shortestDayNames[(childIndex + (int)DateTimeHelper.GetDateFormat( DateTimeHelper.GetCulture(this)).FirstDayOfWeek) % shortestDayNames.Length];
System\Windows\Controls\Primitives\Popup.cs (3)
2036positions = customPlacements == null ? 0 : customPlacements.Length; 2455for (int i = 1; i < interestPoints.Length; i++) 2780if (UnsafeNativeMethods.GetBitmapBits(iconInfo.hbmMask.MakeHandleRef(null), curMask.Length, curMask) != 0)
System\Windows\Controls\Primitives\TabPanel.cs (4)
270bool lastHeaderInRow = isMultiRow && (separatorIndex < solution.Length && solution[separatorIndex] == childIndex || childIndex == _numHeaders - 1); 326if (solution.Length > 0) 340if (activeRow < solution.Length && solution[activeRow] == childIndex) 393int numHeaders = headerWidth.Length;
System\Windows\Controls\RichTextBox.cs (4)
639for (int i = 0; i < inheritableFormattingProperties.Length; i++) 647for (int i = 0; i < inheritableBehavioralProperties.Length; i++) 666for (int i = 0; i < inheritableFormattingProperties.Length; i++) 680for (int i = 0; i < inheritableBehavioralProperties.Length; i++)
System\Windows\Controls\RowDefinition.cs (5)
97if (array.Length - index < _size) 119if (array.Length - index < _size) 644else if (_size == _items.Length) 646PrivateSetCapacity(Math.Max(_items.Length * 2, c_defaultCapacity)); 714else if (_items == null || value != _items.Length)
System\Windows\Controls\SinglePageViewer.cs (3)
845for (index = 0; index < pageRects.Length; index++) 853if (index >= pageRects.Length) 857for (index = 1; index < pageRects.Length; index++)
System\Windows\Controls\TextBlock.cs (1)
326for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Controls\TextBox.cs (1)
68for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Controls\TextRangeAdaptor.cs (2)
1819double[] asDoubles = new double[rects.Length * 4]; 1820for (int i = 0; i < rects.Length; i++)
System\Windows\Controls\VirtualizingStackPanel.cs (3)
12031if (a.Length > 1) 12040if (a.Length > 2) 12280int length = (args != null) ? args.Length : 0;
System\Windows\Controls\WebBrowser.cs (2)
309dp.cArgs = (uint)((args == null) ? 0 : args.Length); 340UnsafeNativeMethods.ArrayToVARIANTHelper.FreeVARIANTVector(dp.rgvarg, args.Length);
System\Windows\Data\BindingExpressionBase.cs (6)
460int n = (_sources != null) ? _sources.Length : 0; 2468for (int i=0; i < commonSources.Length; ++i) 2480int m = (sources == null) ? 0 : sources.Length; 2896sources = new DependencySource[newSources.Length]; 2898for (int i = 0; i < newSources.Length; ++i) 2909if (n < newSources.Length)
System\Windows\Data\BindingGroup.cs (3)
1178for (int i=_proposedValueBindingExpressions.Length-1; i>=0; --i) 1211for (int i=_proposedValueBindingExpressions.Length-1; i>=0; --i) 1468for (int i=0, n=_proposedValueBindingExpressions.Length; i<n; ++i)
System\Windows\Data\CollectionView.cs (4)
1403object[] newArray = new object[array.Length + 1]; 1405newArray[array.Length] = value; 1522for (int i=0; i<interfaces.Length; ++i) 1530if (typeParameters.Length == 1)
System\Windows\Data\MultiBindingExpression.cs (18)
550for (int i=0; i<values.Length; ++i) 563if (values.Length != count && TraceData.IsEnabled) 566traceParameters: new object[] { Converter.GetType().Name, count, values.Length, TraceData.DescribeTarget(target, TargetProperty) }); 570if (values.Length < count) 571count = values.Length; 612Array.Clear(_tempTypes, 0, _tempTypes.Length); 667for (int i=0; i<values.Length; ++i) 699if (values.Length < count) 700count = values.Length; 764if (values.Length < count) 765count = values.Length; 808if (values.Length < count) 809count = values.Length; 900if (convertedValues.Length < count) 901count = convertedValues.Length; 1057for (int j = 0; j < sources.Length; ++j) 1206for (int i=0; i<_tempValues.Length; ++i) 1271Array.Clear(_tempValues, 0, _tempValues.Length);
System\Windows\Data\ObjectDataProvider.cs (1)
399if (ciAry.Length != 0)
System\Windows\Data\PriorityBindingExpression.cs (1)
594for (int j=0; j<sources.Length; ++j)
System\Windows\Data\XmlNamespaceMappingCollection.cs (1)
139int maxLength = array.Length;
System\Windows\DataTrigger.cs (1)
190Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\Documents\AdornerLayer.cs (3)
421for (int i = 0; i < zOrderMapEntries.Length; i++) 455for (int i = 0; i < zOrderMapEntries.Length; i++) 796for (int i = 0; i < keys.Length; i++)
System\windows\Documents\CaretElement.cs (1)
562for (int i = 0; i < adorners.Length; i++)
System\Windows\Documents\DocumentSequenceTextPointer.cs (4)
670if (startIndex > textBuffer.Length) 672throw new ArgumentException(SR.Format(SR.StartIndexExceedsBufferSize, startIndex, textBuffer.Length)); 678if (count > textBuffer.Length - startIndex) 680throw new ArgumentException(SR.Format(SR.MaxLengthExceedsBufferSize, count, textBuffer.Length, startIndex));
System\Windows\Documents\FixedLineResult.cs (1)
110return _nodes[_nodes.Length - 1];
System\Windows\Documents\FixedNode.cs (8)
98int[] completePath = new int[childPath.Length + 1]; 135Debug.Assert(path != null && path.Length >= 2); // At least a page index and an element index 200for (int i = 0; i < childPath.Length && i < _path.Length - 1; i++) 290for (int i = 1; i < _path.Length; i++) 342Debug.Assert(level < _path.Length); 353Debug.Assert(_path.Length >= 2); 354return _path.Length - 1;
System\Windows\Documents\FixedPage.cs (1)
167if (adorners != null && adorners.Length > 0)
System\Windows\Documents\FixedPageStructure.cs (9)
121while (line < _lineResults.Length - 1 && count > 0) 138line = Math.Max(0, Math.Min(line, _lineResults.Length - 1)); 230for (int line = 0; line < _lineResults.Length; line++) 255int lineCount = _lineResults.Length; 559ft = new FormattedText($"{fn}-{(int)(fn.Cookie)}-{somElements.Length}", 649for (int i=0; i<_lineResults.Length; i++) 697if (_lineResults.Length > 0) 699return _lineResults[_lineResults.Length - 1].Nodes; 709if (_lineResults.Length > 0)
System\Windows\Documents\FixedSchema.cs (1)
94predefinedNamespaces = new string[_predefinedNamespaces.Length + 1];
System\Windows\Documents\FixedTextBuilder.cs (9)
409int loIndex = 0, hiIndex = fixes.Length - 1; 477if (flowNodes.Length <= 0) 484FlowNode flowEnd = flowNodes[flowNodes.Length - 1]; 503Debug.Assert(fixes.Length == 1); 546if (somElements.Length == 0) 798int[] newPath = new int[pathPrefix.Length + 1]; 800newPath[newPath.Length - 1] = childIndex; 1005newPathPrefix = new int[pathPrefix.Length + 1]; 1010newPathPrefix[newPathPrefix.Length - 1] = childIndex;
System\Windows\Documents\FixedTextContainer.cs (2)
425for(int i=0; i<elements.Length; i++) 468if (i == elements.Length - 1)
System\Windows\Documents\FixedTextView.cs (4)
609FixedNode lastNode = fixedNodes[fixedNodes.Length - 1]; 827if (fixedNodes != null && fixedNodes.Length > 0) 898if (fixedNodes != null && fixedNodes.Length > 0) 916for (int i = fixedNodes.Length - 1; i >= 0; i--)
System\Windows\Documents\FlowDocument.cs (1)
85for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Documents\FlowNode.cs (1)
171if (this.FixedSOMElements != null && this.FixedSOMElements.Length > 0)
System\Windows\Documents\FlowPosition.cs (1)
258if (elements != null && elements.Length > 0)
System\Windows\Documents\Glyphs.cs (9)
237if (glyphRunProperties.clusterMap != null && glyphRunProperties.clusterMap.Length != 0) 238caretStopCount = glyphRunProperties.clusterMap.Length + 1; 242caretStopCount = glyphRunProperties.glyphIndices.Length + 1; 269if (i >= caretStops.Length) 276if (i >= caretStops.Length) 283if (i >= caretStops.Length) 290if (i >= caretStops.Length) 299while (i < caretStops.Length) 474if (index < 0 || index >= clusterMap.Length)
System\Windows\Documents\ImmComposition.cs (9)
935int compositionLength = compositionChars == null ? 0 : compositionChars.Length; 936resultLength = resultChars == null ? 0 : resultChars.Length; 956int originalLength = (compositionText == null) ? 0 : compositionText.Length; 969(caretOffset < attributes.Length) && 973((caretOffset - 1) < attributes.Length) && 1179for (int i = 0; i < attributes.Length; i++) 1181if ((i + 1) < attributes.Length) 1423int copied = navigator.GetTextInRun(LogicalDirection.Backward, buffer, 0, buffer.Length); 1475int copied = navigator.GetTextInRun(LogicalDirection.Forward, buffer, 0, buffer.Length);
System\Windows\Documents\NaturalLanguageHyphenator.cs (3)
113&& characterSource.Length > 0 115&& length <= characterSource.Length 137isHyphenPositions.Length
System\Windows\Documents\RangeContentEnumerator.cs (2)
306else if (_buffer.Length < size) 308newBuffer = new char[Math.Max(2*_buffer.Length, size)];
System\Windows\Documents\RtfToXamlLexer.cs (12)
66if (_rtfIndex >= _rtfBytes.Length) 99if (_rtfIndex >= _rtfBytes.Length) 226if (_rtfIndex + skip < _rtfBytes.Length) 232_rtfIndex = _rtfBytes.Length - 1; 353while (e < _rtfBytes.Length) 358&& e + 3 < _rtfBytes.Length 435while (_rtfIndex < _rtfBytes.Length && IsControlCharValid(CurByte)) 453if (_rtfIndex < _rtfBytes.Length) 473while (_rtfIndex < _rtfBytes.Length && IsParameterFollow(CurByte)) 482if (_rtfIndex < _rtfBytes.Length && CurByte == ' ') 561_rtfControlTable = new Hashtable(controlWordInfoTable.Length); 563for (int i = 0; i < controlWordInfoTable.Length; i++)
System\Windows\Documents\RtfToXamlReader.cs (1)
3389for (int i = 0; i < CodePageList.Length; i++)
System\Windows\Documents\RubberbandSelector.cs (1)
278while (nodesInLine != null && nodesInLine.Length > 0)
System\windows\Documents\SelectionWordBreaker.cs (7)
55if (position == text.Length) 70if (position == text.Length || IsWhiteSpace(text[position], classes[position])) 146Invariant.Assert(text.Length == classes.Length); 148(index > 0 && index + 1 < classes.Length) && 204CharClass[] classes = new CharClass[text.Length]; 206for (int i = 0; i < text.Length; i++)
System\Windows\Documents\Speller.cs (1)
1693runCount = Math.Min(runCount, _text.Length - _textLength);
System\Windows\Documents\TableRow.cs (1)
258_formatCellCount += _spannedCells.Length;
System\Windows\Documents\TextContainer.cs (4)
1079UpdateContainerSymbolCount(elementNode.GetContainingNode(), /* symbolCount */ elementText == null ? 2 : elementText.Length, deltaCharCount + formerFirstIMEVisibleNodeCharDelta + newFirstIMEVisibleNodeCharDelta); 1122AddChange(startEdgePosition, elementText == null ? 2 : elementText.Length, deltaCharCount, PrecursorTextChangeType.ContentAdded); 1546length = ((char[])text).Length; 2480Invariant.Assert(elementText.Length == elementNode.SymbolCount);
System\Windows\Documents\TextElement.cs (1)
49for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Documents\TextElementCollection.cs (3)
610if (arrayIndex > array.Length) 615if (array.Length < arrayIndex + count) 617throw new ArgumentException(SR.Format(SR.TextElementCollection_CannotCopyToArrayNotSufficientMemory, count, arrayIndex, array.Length));
System\Windows\Documents\TextElementCollectionHelper.cs (3)
43for (int i = 0; i < _cleanParentList.Length; i++) 71index = firstFreeIndex >= 0 ? firstFreeIndex : _cleanParentList.Length - 1; 130for (int i = 0; i < _cleanParentList.Length; i++)
System\Windows\Documents\TextFindEngine.cs (12)
240int textStartIndex = matchLast ? findText.Length - findTextLength : 0; 250GetContextualInformation(startFindTextPosition, matchLast ? -findTextPositionMap[findTextPositionMap.Length - findTextLength - 1] : findTextPositionMap[findTextLength], 293navigator.MoveByOffset(matchLast ? - findTextPositionMap[findText.Length - findTextLength + findPattern.Length] : findTextPositionMap[findTextLength - findPattern.Length]); 662findTextPositionMap[findTextPositionMap.Length - 1] = 0; 671runCount = Math.Min(runCount, findText.Length - findTextLength); 689findText.Length - findTextLength - runCount, 694int mapIndex = findText.Length - findTextLength - 1; 730findText[findText.Length - findTextLength] = '\n'; 731findTextPositionMap[findText.Length - findTextLength] = findTextLength + inlineCount; 751findText[findText.Length - findTextLength] = '\xf8ff'; 752findTextPositionMap[findText.Length - findTextLength] = findTextLength + inlineCount; 759if (findTextLength >= findText.Length)
System\Windows\Documents\TextPointer.cs (4)
1760if (startIndex > textBuffer.Length) 1762throw new ArgumentException(SR.Format(SR.StartIndexExceedsBufferSize, startIndex, textBuffer.Length)); 1768if (count > textBuffer.Length - startIndex) 1770throw new ArgumentException(SR.Format(SR.MaxLengthExceedsBufferSize, count, textBuffer.Length, startIndex));
System\Windows\Documents\TextRangeBase.cs (4)
877else if (charArray.Length < textLength) 879int newLength = charArray.Length * 2; 941textBuffer.Append(charArray, 0, charArray.Length); 1384int length = textParagraphs.Length;
System\Windows\Documents\TextRangeEdit.cs (11)
96for (int i = 0; i < inheritableProperties.Length; i++) 137for (int i = 0; i < noninheritableProperties.Length; i++) 349for (int i = 0; i < inheritableProperties.Length; i++) 374for (int i = 0; i < nonInheritableProperties.Length; i++) 495for (int i = 0; i < nonFormattingCharacterProperties.Length; i++) 1784for (int i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1816for (i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1823return (i < TextSchema.StructuralCharacterProperties.Length); 1831for (i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1838return (i < TextSchema.StructuralCharacterProperties.Length); 2326for (int i = 0; i < _ranges.Length; i++)
System\Windows\Documents\TextRangeEditTables.cs (7)
1136for (int i = 0; i < spannedCells.Length; i++) 1313for (int i = 0; i < spannedCells.Length; i++) 1673while (table.Columns.Count < columnWidths.Length) 2301for (int i = 0; i < nonInheritableProperties.Length; i++) 2310for (int i = 0; i < inheritableProperties.Length; i++) 2385for (int i = 0; i < spannedCells.Length; i++) 2469for (int i = 0; i < spannedCells.Length; i++)
System\Windows\Documents\TextRangeSerialization.cs (8)
733for (int i = 0; i < inheritableProperties.Length; i++) 782for (int i = 0; i < inheritableProperties.Length; i++) 842for (int i = 0; i < elementProperties.Length; i++) 1042for (int i = 0; i < inheritableProperties.Length; i++) 1050for (int i = 0; i < nonInheritableProperties.Length; i++) 1126for (int i = 0; i < elementProperties.Length; i++) 1178for (int i = 0; i < imageProperties.Length; i++) 1777Invariant.Assert(text.Length >= length, "Asserting that text.Length >= length");
System\Windows\Documents\TextSchema.cs (22)
56_inheritableTextElementProperties = new DependencyProperty[textElementPropertyList.Length + Typography.TypographyPropertiesList.Length]; 57Array.Copy(textElementPropertyList, 0, _inheritableTextElementProperties, 0, textElementPropertyList.Length); 58Array.Copy(Typography.TypographyPropertiesList, 0, _inheritableTextElementProperties, textElementPropertyList.Length, Typography.TypographyPropertiesList.Length); 68_inheritableBlockProperties = new DependencyProperty[blockPropertyList.Length + _inheritableTextElementProperties.Length]; 69Array.Copy(blockPropertyList, 0, _inheritableBlockProperties, 0, blockPropertyList.Length); 70Array.Copy(_inheritableTextElementProperties, 0, _inheritableBlockProperties, blockPropertyList.Length, _inheritableTextElementProperties.Length); 79_inheritableTableCellProperties = new DependencyProperty[tableCellPropertyList.Length + _inheritableTextElementProperties.Length]; 80Array.Copy(tableCellPropertyList, _inheritableTableCellProperties, tableCellPropertyList.Length); 81Array.Copy(_inheritableTextElementProperties, 0, _inheritableTableCellProperties, tableCellPropertyList.Length, _inheritableTextElementProperties.Length); 662for (int i = 0; i < _inheritableBlockProperties.Length; i++) 671for (int i = 0; i < _paragraphProperties.Length; i++) 687for (int i = 0; i < _inheritableTextElementProperties.Length; i++) 696for (int i = 0; i < _inlineProperties.Length; i++) 711for (int i = 0; i < _nonFormattingCharacterProperties.Length; i++) 742for (i = 0; i < _structuralCharacterProperties.Length; i++) 748return (i < _structuralCharacterProperties.Length);
System\windows\Documents\TextSelection.cs (3)
1492for (int i = 0; i < inheritableProperties.Length; i++) 1503for (int i = 0; i < noninheritableProperties.Length; i++) 1699(keyboardListIndex < keyboardList.Length) && (keyboardListIndex < keyboardListCount);
System\Windows\Documents\TextStore.cs (9)
533change.newEnd = endIndex + text.Length - (endIndex - startIndex); 1508navigator.GetTextInRun(LogicalDirection.Forward, nextChars, 0, nextChars.Length); 2470runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit); 2473hitLimit = (text.Length == charsCopied) || (limit != null && navigator.CompareTo(limit) == 0); 2586hitLimit = (text.Length == charsCopied) || (limit != null && navigator.CompareTo(limit) == 0); 2786for (i = 0; i < _supportingattributes.Length; i++) 4378for (int i = units.Length - 1; i >= 0; i--) 4693if (a.Length > 1) 4864int length = (args != null) ? args.Length : 0;
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (1)
119for (int columnIndex = 0; columnIndex < savedColumns.Length; columnIndex++)
System\Windows\Documents\TextTreeTextBlock.cs (9)
89if (_text.Length < MaxBlockSize && count > _gapSize) 97rightOfGapLength = _text.Length - (_gapOffset + _gapSize); 98Array.Copy(_text, _gapOffset + _gapSize, newText, newText.Length - rightOfGapLength, rightOfGapLength); 99_gapSize += newText.Length - _text.Length; 144Invariant.Assert(_text.Length == MaxBlockSize, "Splitting non-max sized block!"); 233Invariant.Assert(_gapOffset + _gapSize <= _text.Length); 264copyCount = Math.Min(count, _text.Length - logicalOffset); 431return (_text.Length - _gapSize);
System\Windows\Documents\TextTreeUndoUnit.cs (1)
179for (i = 0; i < records.Length; i++)
System\Windows\Documents\WinRTSpellerInterop.cs (1)
578if (matches.Length != 3)
System\Windows\Documents\XamlToRtfWriter.cs (1)
3467for (int i = 0; i < entries.Length; i++)
System\Windows\FrameworkElement.cs (1)
3059for (int i=0; i<handlers.Length; i++)
System\Windows\Interop\DynamicScriptObject.cs (6)
132if (indexes.Length != 1) 160if (indexes.Length != 1) 335for (int i = 0; i < args.Length; i++) 369dp.cArgs = (uint)args.Length; 436UnsafeNativeMethods.ArrayToVARIANTHelper.FreeVARIANTVector(dp.rgvarg, args.Length); 539HRESULT hr = _scriptObject.GetIDsOfNames(ref guid, names, dispids.Length, Thread.CurrentThread.CurrentCulture.LCID, dispids);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
2596if (bytes.Length == 2)
System\Windows\Markup\Baml2006\SharedStream.cs (2)
170ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(offset, buffer.Length); 171ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length - count);
System\Windows\Markup\Baml2006\WpfKnownTypeInvoker.cs (2)
24if ((arguments == null || arguments.Length == 0) && _type.DefaultConstructor != null) 31if(!_type.Constructors.TryGetValue(arguments.Length, out ctorInfo))
System\Windows\Markup\BamlMapTable.cs (2)
180int end = _knownStrings.Length; 620Debug.Assert(-id <= _knownStrings.Length);
System\Windows\Markup\BamlReader.cs (1)
1021for (int i = 0; i < infos.Length; i++)
System\Windows\Markup\BamlRecordReader.cs (4)
1506for (int i=0; i<infos.Length; i++) 1510if (paramInfos.Length == paramCount) 1512object[] paramArray = new object[paramInfos.Length]; 1534for (int j=0; j<paramInfos.Length; j++)
System\Windows\Markup\BamlRecords.cs (4)
1202if (AssemblyIds != null && AssemblyIds.Length > 0) 1204count = (short) AssemblyIds.Length; 4728Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4771Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlWriter.cs (3)
1148if(pi.GetIndexParameters().Length == 0) 1220if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1232if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1)
System\Windows\Markup\DependencyPropertyConverter.cs (1)
125if (bytes.Length == 2)
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (2)
287if (arrayIndex >= array.Length) 299if (Count > (array.Length - arrayIndex))
System\Windows\Markup\MarkupExtensionParser.cs (2)
1213if (parInfo.Length >= maxConstructorArguments) 1215maxConstructorArguments = parInfo.Length;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
272if (parameters.Length == 1) 394if (ctorParameters != null && ctorParameters.Length == instanceDescriptor.Arguments.Count)
System\Windows\Markup\SetterTriggerConditionValueConverter.cs (1)
164if (bytes != null && bytes.Length == 1)
System\Windows\Markup\XamlFigureLengthSerializer.cs (2)
209for (i = 1; i < UnitStrings.Length; ++i) 224if (i >= UnitStrings.Length)
System\Windows\Markup\XamlGridLengthSerializer.cs (2)
210for (i = 1; i < UnitStrings.Length; ++i) 225if (i >= UnitStrings.Length)
System\Windows\Markup\XamlTypeMapper.cs (23)
893if (attachedPropertyInfo != null && attachedPropertyInfo.GetParameters().Length == paramCount) 1298if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1367if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1378if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1457if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1525if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1536if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1701count < namespaceMaps.Length && !foundNamespaceMatch; 1954for (int i = 0; i < infos.Length; i++) 2065propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType; 2066propertyCanWrite = parameters.Length == 1 ? false : true; 2224for (int i = 0; i < namespaces.Length; i++) 2535for (int count = 0; count < namespaceMaps.Length;) 2570if (knownTypesOnly && (count == namespaceMaps.Length)) 3161result = (namespaceMaps != null && namespaceMaps.Length > 0) || 3193if (assemblyIds != null && assemblyIds.Length > 0) 3195asmNameList = new string[assemblyIds.Length]; 3197for (int i = 0; i < assemblyIds.Length; i++) 3242for (int i = 0; i < _namespaceMaps.Length; i++) 3308for (int k = 0; k < _assemblyNames.Length; k++) 3682_parameters = new ParameterInfo[_constructors.Length][]; 3757if (trimAttribute.Length > 0) 3759Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute");
System\Windows\Markup\XmlnsCache.cs (6)
177Assembly[] asmList = new Assembly[asmNameList.Length]; 178for (int i = 0; i < asmNameList.Length; i++) 348for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 353for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++) 378for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 388for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++)
System\Windows\Markup\XmlnsDictionary.cs (3)
637if (_lastDecl == _nsDeclarations.Length - 1) 639NamespaceDeclaration[] new_nsDeclarations = new NamespaceDeclaration[_nsDeclarations.Length * 2]; 641Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (2)
347Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 915int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\MultiDataTrigger.cs (3)
111for (int i = 0; i < TriggerConditions.Length; ++i) 151bool retVal = (TriggerConditions.Length > 0); 153for( int i = 0; retVal && i < TriggerConditions.Length; i++ )
System\Windows\MultiTrigger.cs (3)
106for (int i = 0; i < TriggerConditions.Length; i++) 130bool retVal = (TriggerConditions.Length > 0); 132for( int i = 0; retVal && i < TriggerConditions.Length; i++ )
System\Windows\Navigation\JournalEntryListConverter.cs (1)
116if (values != null && values.Length == 2)
System\Windows\PropertyPath.cs (7)
87if (pathParameters != null && pathParameters.Length > 0) 155internal int Length { get { return _arySVI.Length; } } 374if (_arySVI.Length == 0) 393for (int i=0; i<_arySVI.Length; ++i) 435Debug.Assert(aryIPI.Length > 0); 454if (j < aryIPI.Length) 709for (int i = 0; i < args.Length; ++i)
System\Windows\StartupEventArgs.cs (3)
63Invariant.Assert(args.Length >= 1); 65int newLength = args.Length - 1; 70for (int i = 1; i < args.Length; i++)
System\Windows\Style.cs (1)
771for (int k=0; k<conditions.Length; k++)
System\Windows\StyleHelper.cs (10)
563for (int i = 0; i < propertyValue.Conditions.Length; i++) 607for (int i = 0; i < propertyValue.Conditions.Length; i++) 937for (int k=0; k<conditions.Length; k++) 3081for (int j = 0; j < conditions.Length; j++) 4863Debug.Assert( conditions != null && conditions.Length == 1, 4893Debug.Assert( conditions != null && conditions.Length == 1, 4922for( int i = 0; i < conditions.Length; i++ ) 5795if( Conditions.Length == other.Conditions.Length ) 5798for( int i = 0; i < Conditions.Length; i++ )
System\Windows\SystemParameters.cs (2)
83for (int i=0; i<propertyNames.Length; ++i) 5067for (int i = 0; i < param.Length; i++)
System\Windows\Trigger.cs (1)
239Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\TriggerBase.cs (1)
241for (int j = 0; j < propertyValue.Conditions.Length; j++)
System\Windows\VisualStateGroup.cs (1)
117for (int index = 0; index < newStoryboards.Length; ++index)
System\Windows\Window.cs (2)
6732HRESULT hr = _taskbarList.ThumbBarAddButtons(CriticalHandle, (uint)nativeButtons.Length, nativeButtons); 6843return _taskbarList.ThumbBarUpdateButtons(CriticalHandle, (uint)nativeButtons.Length, nativeButtons);
PresentationFramework.Aero (1)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (1)
36values.Length != 3 ||
PresentationFramework.Aero2 (1)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (1)
36values.Length != 3 ||
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework-SystemCore (5)
DynamicAccessorImpl.cs (5)
110int rank = args.Length; 121int rank = args.Length; 134if (_accessors.Length < rank || _accessors[rank-1] == null) 138if (_accessors.Length < rank) 141Array.Copy(_accessors, 0, newAccessors, 0, _accessors.Length);
PresentationUI (7)
MS\Internal\Documents\PeoplePickerWrapper.cs (4)
225List<String> addresses = new List<String>(paths.Length); 227for (int i = 0; i < paths.Length; i++) 322_ptrToDsObjectNames = Marshal.AllocHGlobal(data.Length); 326Marshal.Copy(data, 0, _ptrToDsObjectNames, data.Length);
MS\Internal\Documents\RightsManagementResourceHelper.cs (1)
122_brushResources = new DrawingBrush[statusList.Length];
MS\Internal\Documents\RMPublishingDialog.cs (1)
698if (userNames != null && userNames.Length > 0)
MS\Internal\Documents\SignatureResourceHelper.cs (1)
149_brushResources = new DrawingBrush[statusList.Length];
RazorWebSite (2)
artifacts\obj\RazorWebSite\Release\net10.0\RazorWebSite.Resources.Models.ModelEnum.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\RazorWebSite\Release\net10.0\RazorWebSite.Resources.SingleType.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ReachFramework (65)
AlphaFlattener\Optimizer.cs (1)
175for (int primIndex = 0; primIndex < addedPrimitives.Length; primIndex++)
AlphaFlattener\SegmentTree.cs (4)
155int len = values.Length; 230_xCount = _xCoord.Length; 233_yCount = _yCoord.Length; 289SegmentTree st = new SegmentTree(uniqueY, 0, uniqueY.Length);
MS\Internal\Printing\Configuration\DevMode.cs (7)
389this.Size = (ushort)this._byteData.Length; 477Array.Copy(ticketDevMode.ByteData, this.dmFieldsByteOffset, this.ByteData, this.dmFieldsByteOffset, this.ByteData.Length - this.dmFieldsByteOffset); 526if (byteOffset >= data.Length) 537if (byteOffset >= data.Length) 548if (byteOffset >= data.Length) 560if (byteOffset >= data.Length) 708int byteDataLength = this.ByteData.Length;
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (2)
30SafeMemoryHandle buffer = SafeMemoryHandle.Create(devMode.ByteData.Length); 31buffer.CopyFromArray(devMode.ByteData, 0, devMode.ByteData.Length);
PrintConfig\FallbackPTProvider.cs (4)
448for (int i = 0; i < originalDevMode.ByteData.Length; i++) 509using (SafeMemoryHandle buffer = SafeMemoryHandle.Create(devModeBytes.Length)) 511buffer.CopyFromArray(devModeBytes, 0, devModeBytes.Length); 527outPtr.CopyToArray(devModeBytes, 0, devModeBytes.Length);
PrintConfig\PageMediaSize.cs (1)
474for (int i = 0; i < PrintSchema.StdMediaSizeTable.Length; i++)
PrintConfig\PrintSchema.cs (3)
2295for (int i=0; i < map.Length; i++) 2325for (int i=1; i < enumNames.Length; i++) 2410for (int i=1; i < enumNames.Length; i++)
PrintConfig\PrtCap_Builder.cs (2)
441for (int i=0; i<handlersTable.Length; i++) 478for (int i=0; i<handlersTable.Length; i++)
PrintConfig\PrtCap_Public.cs (2)
62_countRootFeatures = Enum.GetNames(typeof(CapabilityName)).Length; 63_countLocalParamDefs = Enum.GetNames(typeof(PrintSchemaLocalParameterDefs)).Length;
PrintConfig\PrtTicket_Base.cs (2)
97for (int i=0; i<_propertyMaps.Length; i++) 366for (int i=0; i<_propertyMaps.Length; i++)
PrintConfig\PTProvider.cs (9)
400IntPtr umDevMode = Marshal.AllocCoTaskMem(devMode.Length); 404Marshal.Copy(devMode, 0, umDevMode, devMode.Length); 410(uint)devMode.Length, 644CopyIStreamToArray(stream, result, (uint)result.Length); 660Invariant.Assert(src.Length >= byteCount); 684int bytesToWrite = Math.Min(data.Length, (int)(byteCount - totalBytesWritten)); 718Invariant.Assert(dst.Length >= byteCount); 738int bytesToRead = Math.Min(data.Length, (int)(byteCount - totalBytesRead)); 740Array.Clear(data, 0, data.Length);
Serialization\ColorTypeConverter.cs (3)
188for (int i = 0; i < color.GetNativeColorValues().Length; ++i) 191if (i < color.GetNativeColorValues().Length - 1) 337while ( (count = profileStream.Read( buffer, 0, buffer.Length) ) > 0 )
Serialization\Crc32.cs (1)
102int bytes = data.Length;
Serialization\Manager\MetroSerializationManager.cs (7)
559int[] serializableIndeces = new int[clrProperties.Length]; 568indexInClrProperties < clrProperties.Length; 603indexInClrProperties < clrProperties.Length; 632int[] serializableIndeces = new int[dependencyProperties.Length]; 641indexInDependencyProperties < dependencyProperties.Length; 679indexInDependencyProperties < dependencyProperties.Length; 843i<properties.Length && propertyInfo == null;
Serialization\Manager\ReachSerializableProperties.cs (2)
239indexInClrSerializableProperties < clrProperties.Length; 289indexInSerializableDependencyProperties < dependencyProperties.Length;
Serialization\Manager\ReachSerializationCacheItems.cs (6)
105int[] propertiesIndex = new int[properties.Length]; 106TypePropertyCache[] cachedProperties = new TypePropertyCache[properties.Length]; 110indexInProperties < properties.Length; 221propertyInfo.GetIndexParameters().Length == 0) 228numberOfAttributes < attributes.Length; 502numberOfAttributes < attributes.Length;
Serialization\Manager\ReachSerializationUtils.cs (2)
176if ((Count + delta) > List.Length) 178System.Windows.DependencyProperty[] newList = new System.Windows.DependencyProperty[Math.Max(List.Length * 2, Count + delta)];
Serialization\Manager\XpsSerializationManager.cs (6)
1302IndexInTypes < ReachSerializationServices._xpsTypesRequiringXMLNS.Length; 1328numberOfDependencyPropertiesInFixedPage < _fixedPageDependencyProperties.Length; 1345numberOfDependencyPropertiesInFixedDocument < _fixedDocumentDependencyProperties.Length; 1362numberOfDependencyPropertiesInFixedDS < _fixedDocumentSequenceDependencyProperties.Length; 1392numberOfClrPropertiesInFixedDocument < _fixedDocumentExcludedClrProperties.Length; 1409numberOfClrPropertiesInFixedDS < _fixedDocumentSequenceExcludedClrProperties.Length;
Serialization\XpsFontSubsetter.cs (1)
605stream.Write(fontData, 0, fontData.Length);
RemoteExecutorConsoleApp (4)
RemoteExecutorConsoleApp.cs (4)
20if (args.Length < 4) 31string[] additionalArgs = args.Length > 4 ? 32Subarray(args, 4, args.Length - 4) : 88if (additionalArgs.Length > 0)
Replay (3)
Replay.cs (1)
226for (var i = 0; i < args.Length; i++)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
329responseBuffer.Length,
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
160_loggingStream.Write(bytes, 0, bytes.Length);
ResultsOfTGenerator (4)
Program.cs (4)
20if (args.Length > 0) 22if (args.Length != 2) 31GenerateClassFile(classTargetFilePath, TYPE_ARG_COUNT, args.Length == 0); 33GenerateTestFiles(testsTargetFilePath, TYPE_ARG_COUNT, args.Length == 0);
Roslyn.Compilers.Extension (2)
CompilerPackage.cs (2)
45if (registryParts.Length >= 4) 153if (parts.Length != 2)
Roslyn.Test.PdbUtilities (33)
Reader\MethodDebugInfoBytes.cs (2)
48var groupSizes = importStringGroups.Select(g => (short)g.Length).ToArray(); 62var numGroupSizes = groupSizes.Length;
Reader\MockSymUnmanagedReader.cs (5)
300pRetVal = _constants.Length; 306pcConstants = _constants.Length; 309Array.Copy(_constants, constants, constants.Length); 406Assert.Equal(2, shortBytes.Length); 413Assert.Equal(4, intBytes.Length);
Reader\PdbValidation.cs (2)
437return array.Length > 0; 554Marshal.Copy((IntPtr)data, result, 0, result.Length);
Reader\Token2SourceLineExporter.cs (23)
81if (_buffer.Length < newCapacity) 84Array.Copy(_buffer, newBuffer, _buffer.Length); 100if (_buffer.Length < capacity) 211for (int i = 0; i < values.Length; i++) 219for (int i = 0; i < values.Length; i++) 227for (int i = 0; i < bytes.Length; i++) 264while (_offset + len < _buffer.Length && _buffer[_offset + len] != 0) 275while (_offset + len < _buffer.Length && _buffer[_offset + len] != 0) 304while (_offset + len < _buffer.Length && _buffer[_offset + len] != 0) 362for (int i = 0; i < s_primes.Length; i++) 453uint hashcode = InitHash(key, lbuckets.Length, out var seed, out var incr); 459int bucketNumber = (int)(seed % (uint)lbuckets.Length); 470} while (b.hash_coll < 0 && ++ntry < lbuckets.Length); 480rehash(GetPrime(1 + _buckets.Length * 2)); 485rehash(_buckets.Length); 503for (nb = 0; nb < _buckets.Length; nb++) 545uint hashcode = InitHash(key, _buckets.Length, out var seed, out var incr); 552int bucketNumber = (int)(seed % (uint)_buckets.Length); 608} while (++ntry < _buckets.Length); 632uint incr = (uint)(1 + (((seed >> 5) + 1) % ((uint)newBuckets.Length - 1))); 636int bucketNumber = (int)(seed % (uint)newBuckets.Length); 955int directoryRootPages = head.directoryRoot.Length; 1220for (int m = 0; m < modules.Length; m++)
Shared\DummyMetadataImport.cs (1)
68pcbSig = signature.Length;
Roslyn.VisualStudio.DiagnosticsWindow (2)
OptionPages\ForceLowMemoryMode.cs (1)
126for (var i = 0; i < block.Length; i++)
PerfMargin\DataModel.cs (1)
35var featureName = featureNames.Length > 1 ? featureNames[0] : "Uncategorized";
Roslyn.VisualStudio.Next.UnitTests (9)
Services\PerformanceTrackerServiceTests.cs (4)
194for (var i = 1; i < lines.Length; i++) 202Assert.Equal(data.Length, expectedDataCount); 207for (var j = 0; j < data.Length; j++) 233return data.Length - 1;
Services\ServiceHubServicesTests.cs (5)
375DoPermute(0, values.Length - 1); 510return SourceText.From(bytes, bytes.Length, encoding, SourceHashAlgorithm.Sha1, throwIfBinaryDetected: true); 1734for (var i = 0; i < documents.Length; i++) 1740for (var i = 0; i < additionalDocuments.Length; i++) 1746for (var i = 0; i < p2pReferences.Length; i++)
RoutingSandbox (3)
HelloExtension\HelloMiddleware.cs (1)
33var payloadLength = _helloPayload.Length;
Program.cs (1)
21if (args.Length == 0)
UseEndpointRoutingStartup.cs (1)
58var payloadLength = _plainTextPayload.Length;
RoutingWebSite (4)
HelloExtension\HelloMiddleware.cs (1)
33var payloadLength = _helloPayload.Length;
Program.cs (1)
23if (args.Length == 0)
UseEndpointRoutingStartup.cs (2)
60var payloadLength = _plainTextPayload.Length; 133var hostsDisplay = (hosts == null || hosts.Length == 0)
RunTests (2)
Program.cs (2)
327else if (Directory.GetFiles(targetFrameworkDirectory, searchPattern: "*.UnitTests.dll") is { Length: > 0 } matches) 332if (matches.Length > 1)
ScenarioTests.Common.Tests (8)
ScenarioTestHelpers.cs (1)
246return new string(chars, 0, chars.Length);
ScenarioTestTypes.cs (7)
535if (_byteArrayValue.Length != other._byteArrayValue.Length) { return false; } 536for (int i = 0; i < _byteArrayValue.Length; i++) 541for (int i = 0; i < _charArrayValue.Length; i++) 572sb.AppendLine("ByteArrayValue: " + (_byteArrayValue != null ? "Length: " + _byteArrayValue.Length : "null")); 573sb.AppendLine("CharArrayValue: " + (_charArrayValue != null ? "Length: " + _charArrayValue.Length : "null")); 1158readResult = stream.Read(buffer, 0, buffer.Length);
Security.TransportSecurity.IntegrationTests (1)
Tcp\StreamingTests.4.1.0.cs (1)
173while ((bytesRead = returnStream.ReadAsync(buffer, 0, buffer.Length).Result) != 0)
SemanticSearch.BuildTask (6)
GenerateFilteredReferenceAssembliesTask.cs (4)
468Debug.Assert(stream.Read(buffer, 0, buffer.Length) == buffer.Length); 471var reader = new BlobReader(ptr, buffer.Length); 481writer.Write(buffer, 0, buffer.Length);
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
97var maxSize = Math.Min(maxItemsToHash, values.Length); 206for (int i = 0; i < data.Length; i++)
Shared (16)
BufferWriterPool\BufferWriter.cs (5)
70get => _buffer.Length; 121_ = Throw.IfOutOfRange(count, 0, _buffer.Length - WrittenCount); 171var avail = _buffer.Length - WrittenCount; 174var targetCapacity = _buffer.Length == 0 ? DefaultCapacity : _buffer.Length * 2;
EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (4)
155if (parameters?.Length > 0) 157Dictionary<ParameterLookupKey, ParameterInfo> dict = new(parameters.Length); 348if (constructors.Length == 1) 365else if (constructor.GetParameters().Length == 0)
JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (6)
123for (int i = 0; i < parameters.Length; i++) 382genericArgumentsState = new NullabilityInfo[genericArguments.Length]; 384for (int i = 0; i < genericArguments.Length; i++) 459if (nullability.GenericTypeArguments.Length > 0) 463for (int i = 0; i < genericArguments.Length; i++) 599if (nullability.GenericTypeArguments.Length > 0)
SignalR.Client.FunctionalTestApp (1)
Program.cs (1)
13for (var i = 0; i < args.Length; i++)
SocialWeather (5)
Pipe\PipeWeatherStreamFormatter.cs (4)
24var zipCode = tokens.Length > 3 ? tokens[3] : string.Empty; 26if (tokens.Length == 0 || !int.TryParse(tokens[0], out temperature)) 31if (tokens.Length < 2 || !Enum.TryParse<Weather>(tokens[1], out weather)) 36if (tokens.Length < 3 || !long.TryParse(tokens[2], out reportTime))
SocialWeatherConnectionHandler.cs (1)
45await stream.WriteAsync(data, 0, data.Length);
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
Sockets.FunctionalTests (63)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Servers\Kestrel\shared\test\TestApp.cs (10)
20if (buffer.Length > 0) 23await response.Body.WriteAsync(buffer, 0, buffer.Length); 35response.Headers.ContentLength = bytes.Length; 36await response.Body.WriteAsync(bytes, 0, bytes.Length); 50if (buffer.Length > 0) 54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 69response.Headers.ContentLength = bytes.Length; 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length);
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (15)
71for (var i = 1; i < _requestLines.Length - 1; i++) 141await WritePostRequestHeaders(stream, data.Length); 147while (bytesWritten < data.Length) 149var size = Math.Min(data.Length - bytesWritten, maxSendSize); 155Assert.Equal(data.Length, bytesWritten); 172var maximumExpectedBytesWritten = data.Length - 1; 205await AssertStreamContains(stream, $"bytesRead: {data.Length}"); 235await WritePostRequestHeaders(stream, data.Length); 241while (bytesWritten < data.Length) 243var size = Math.Min(data.Length - bytesWritten, maxSendSize); 263var maximumExpectedBytesWritten = data.Length - 1; 349var buffer = new byte[expectedBody.Length]; 351while (bytesRead < buffer.Length) 353bytesRead += await context.Request.Body.ReadAsync(buffer, bytesRead, buffer.Length - bytesRead); 406var exptectedLength = expectedBytes.Length;
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (8)
92while ((received = await context.Request.Body.ReadAsync(receivedBytes, 0, receivedBytes.Length)) > 0) 126for (var i = 0; i < contentBytes.Length; i++) 132for (var i = 0; i < contentLength / contentBytes.Length; i++) 1023$"Content-Length: {scratchBuffer.Length}", 1027var ignore = connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 1076$"Content-Length: {scratchBuffer.Length * 2}", 1082await connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 1142var expectedLength = expectedBytes.Length;
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (19)
56for (int i = 0; i < bytes.Length; i++) 61context.Response.ContentLength = bytes.Length * 1024; 65await context.Response.BodyWriter.WriteAsync(new Memory<byte>(bytes, 0, bytes.Length)); 85var count = await responseBody.ReadAsync(bytes, 0, bytes.Length); 93count = await responseBody.ReadAsync(bytes, 0, bytes.Length); 309await context.Response.BodyWriter.WriteAsync(new Memory<byte>(scratchBuffer, 0, scratchBuffer.Length), context.RequestAborted); 331$"Content-Length: {scratchBuffer.Length}", 335var ignore = connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 372await context.Response.Body.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 390await connection.Stream.ReadAsync(scratchBuffer, 0, scratchBuffer.Length); 535await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 673await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 701await sslStream.WriteAsync(request, 0, request.Length); 824await connection.Stream.WriteAsync(buffer, 0, buffer.Length); 888await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 1052await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 1101var bytes = await stream.ReadAsync(receiveBuffer, 0, receiveBuffer.Length).DefaultTimeout(); 1127var received = await stream.ReadAsync(receiveBuffer, 0, Math.Min(receiveBuffer.Length, expectedBytes - totalReceived)); 1151received = await stream.ReadAsync(receiveBuffer, 0, receiveBuffer.Length);
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (3)
104var buffer = new byte[data.Length]; 106while (read < data.Length) 108var bytesReceived = await socket.ReceiveAsync(buffer.AsMemory(read, buffer.Length - read), SocketFlags.None).DefaultTimeout();
StackDepthTest (1)
Program.cs (1)
36if (args.Length != 1)
Stress.ApiService (1)
TraceCreator.cs (1)
111for (var i = 0; i < links.Length; i++)
Stress.AppHost (1)
TestResource.cs (1)
57var randomState = states[Random.Shared.Next(0, states.Length)];
StringTools.Benchmark (1)
SpanBasedStringBuilder_Benchmark.cs (1)
31for (int i = 0; i < _subStrings.Length; i++)
Swaggatherer (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
System.CodeDom (44)
Microsoft\CSharp\CSharpCodeGenerator.cs (10)
2409Debug.Assert(names.Length > 0); 2411for (int i = 1; i < names.Length; i++) 3066string[] filenames = new string[ea.Length]; 3068for (int i = 0; i < ea.Length; i++) 3113string[] filenames = new string[sources.Length]; 3115for (int i = 0; i < sources.Length; i++) 3132if (sa == null || sa.Length == 0) 3137if (sa.Length == 1) 3143for (int i = 0; i < sa.Length - 1; i++) 3151sb.Append(sa[sa.Length - 1]);
Microsoft\CSharp\CSharpModifierAttributeConverter.cs (2)
25for (int i = 0; i < names.Length; i++) 47for (int i = 0; i < modifiers.Length; i++)
Microsoft\VisualBasic\VBCodeGenerator.cs (2)
2329Debug.Assert(names.Length > 0); 2331for (int i = 1; i < names.Length; i++)
Microsoft\VisualBasic\VBModifierAttributeConverter.cs (2)
25for (int i = 0; i < names.Length; i++) 47for (int i = 0; i < modifiers.Length; i++)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (2)
107for (int i = 0; i < genericArgs.Length; i++) 286if (typeArguments != null && typeArguments.Length > 0)
src\libraries\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs (1)
53for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeAttributeArgumentCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeAttributeDeclarationCollection.cs (1)
39for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeCatchClauseCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeCommentStatementCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeDirectiveCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeExpressionCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\codemethodreferenceexpression.cs (1)
23if (typeParameters != null && typeParameters.Length > 0)
System\CodeDom\CodeNamespaceCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeParameterDeclarationExpressionCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeStatementCollection.cs (1)
39for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeTypeDeclarationCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeTypeMemberCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeTypeParameterCollection.cs (1)
39for (int i = 0; i < value.Length; i++)
System\CodeDom\Compiler\CodeCompiler.cs (8)
175var filenames = new string[ea.Length]; 177for (int i = 0; i < ea.Length; i++) 254var filenames = new string[sources.Length]; 256for (int i = 0; i < sources.Length; i++) 272if (sa == null || sa.Length == 0) 277if (sa.Length == 1) 283for (int i = 0; i < sa.Length - 1; i++) 291sb.Append(sa[sa.Length - 1]);
System\CodeDom\Compiler\CompilerErrorCollection.cs (1)
37for (int i = 0; i < value.Length; i++)
System\CodeDom\Compiler\ExposedTabStringIndentedTextWriter.cs (1)
57for (int i = 0; i < args.Length; i++)
System\Collections\Specialized\FixedStringLookup.cs (2)
20if (length <= 0 || length - 1 >= lookupTable.Length) 39int max = array.Length;
System.Collections (108)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
65if (count == arr.Length)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (2)
24var items = new DebugViewDictionaryItem<TKey, TValue>[keyValuePairs.Length]; 25for (int i = 0; i < items.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (2)
33ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length); 41if (array.Length - index < sourceCount)
System\Collections\BitArray.cs (28)
80if (bytes.Length > int.MaxValue / BitsPerByte) 85m_array = new int[GetInt32ArrayLengthFromByteLength(bytes.Length)]; 86m_length = bytes.Length * BitsPerByte; 88uint totalCount = (uint)bytes.Length / 4; 122m_array = new int[GetInt32ArrayLengthFromBitLength(values.Length)]; 123m_length = values.Length; 127if (values.Length < Vector256<byte>.Count) 139for (; i <= (uint)values.Length - Vector512<byte>.Count; i += (uint)Vector512<byte>.Count) 151for (; i <= (uint)values.Length - Vector256<byte>.Count; i += (uint)Vector256<byte>.Count) 162for (; i <= (uint)values.Length - Vector128<byte>.Count * 2u; i += (uint)Vector128<byte>.Count * 2u) 177for (; i < (uint)values.Length; i++) 202if (values.Length > int.MaxValue / BitsPerInt32) 207m_array = new int[values.Length]; 208Array.Copy(values, m_array, values.Length); 209m_length = values.Length * BitsPerInt32; 227Debug.Assert(bits.m_array.Length <= arrayLength); 329if (Length != value.Length || (uint)count > (uint)thisArray.Length || (uint)count > (uint)valueArray.Length) 402if (Length != value.Length || (uint)count > (uint)thisArray.Length || (uint)count > (uint)valueArray.Length) 475if (Length != value.Length || (uint)count > (uint)thisArray.Length || (uint)count > (uint)valueArray.Length) 723if (newints > m_array.Length || newints + _ShrinkThreshold < m_array.Length) 759if (array.Length - index < GetInt32ArrayLengthFromBitLength(m_length)) 777if ((array.Length - index) < arrayLength) 802Debug.Assert(m_array.Length > quotient); 824if (array.Length - index < m_length)
System\Collections\Generic\LinkedList.cs (4)
200if (index > array.Length) 205if (array.Length - index < Count) 363for (int i = 0; i < array.Length; i++) 463if (array.Length - index < Count)
System\Collections\Generic\OrderedDictionary.cs (20)
218public int Capacity => _entries?.Length ?? 0; 448if (entries.Length == _count) 450Resize(HashHelpers.ExpandPrime(entries.Length)); 540Array.Clear(_buckets, 0, _buckets.Length); 650if ((uint)i >= (uint)entries.Length) 665while (collisionCount <= (uint)entries.Length); 679if ((uint)i >= (uint)entries.Length) 694while (collisionCount <= (uint)entries.Length); 899int currentCapacity = _entries?.Length ?? 0; 990if (++collisionCount > entries.Length) 1042if (++collisionCount > entries.Length) 1068Resize(entries.Length, forceNewHashCodes: true); 1143return ref buckets[HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)]; 1147return ref buckets[(uint)hashCode % buckets.Length]; 1205if (array.Length - arrayIndex < _count) 1292if (array.Length - index < _count) 1505if (array.Length - arrayIndex < count) 1535if (array.Length - index < _dictionary.Count) 1694if (array.Length - arrayIndex < count) 1844if (array.Length - index < _dictionary.Count)
System\Collections\Generic\PriorityQueue.cs (13)
202if (_nodes.Length == currentSize) 403if (collection is not null && (count = collection.Count) > _nodes.Length - _size) 423if (nodes.Length == i) 466(count = collection.Count) > _nodes.Length - _size) 479if (nodes.Length == i) 594if (_nodes.Length < capacity) 600return _nodes.Length; 613int threshold = (int)(_nodes.Length * 0.9); 626Debug.Assert(_nodes.Length < minCapacity); 631int newcapacity = GrowFactor * _nodes.Length; 638newcapacity = Math.Max(newcapacity, _nodes.Length + MinimumGrow); 963if (index < 0 || index > array.Length) 968if (array.Length - index < _queue._size)
System\Collections\Generic\SortedDictionary.cs (4)
542if (array.Length - index < Count) 566if (array.Length - index < _dictionary.Count) 703if (array.Length - index < Count) 727if (array.Length - index < _dictionary.Count)
System\Collections\Generic\SortedList.cs (12)
158Debug.Assert(count == this.keys.Length); 163for (int i = 1; i < keys.Length; ++i) 225return keys.Length; 229if (value != keys.Length) 435if (arrayIndex < 0 || arrayIndex > array.Length) 440if (array.Length - arrayIndex < Count) 466if (index < 0 || index > array.Length) 471if (array.Length - index < Count) 510int newCapacity = keys.Length == 0 ? DefaultCapacity : keys.Length * 2; 659if (_size == keys.Length) EnsureCapacity(_size + 1); 736int threshold = (int)(keys.Length * 0.9);
System\Collections\Generic\SortedSet.cs (4)
521if (count > array.Length - index) 556if (array.Length - index < Count) 1152Debug.Assert(count >= 0 && count <= other.Length); 1575for (int i = 0; i < items.Length; i++)
System\Collections\Generic\Stack.cs (18)
63public int Capacity => _array.Length; 101if (arrayIndex < 0 || arrayIndex > array.Length) 106if (array.Length - arrayIndex < _size) 134if (arrayIndex < 0 || arrayIndex > array.Length) 139if (array.Length - arrayIndex < _size) 167int threshold = (int)(_array.Length * 0.9); 184if (capacity == _array.Length) 197if ((uint)size >= (uint)array.Length) 210if ((uint)size >= (uint)array.Length) 229if ((uint)size >= (uint)array.Length) 249if ((uint)size >= (uint)array.Length) 271if ((uint)size < (uint)array.Length) 287Debug.Assert(_size == _array.Length); 305if (_array.Length < capacity) 310return _array.Length; 315Debug.Assert(_array.Length < capacity); 317int newcapacity = _array.Length == 0 ? DefaultCapacity : 2 * _array.Length;
System.Collections.Concurrent (56)
System\Collections\Concurrent\BlockingCollection.cs (16)
767Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 809Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 1024for (int i = 0; i < collections.Length; i++) 1051List<WaitHandle> handlesList = new List<WaitHandle>(collections.Length + 1); // + 1 for the external token handle to be added 1052List<CancellationToken> tokensList = new List<CancellationToken>(collections.Length + 1); // + 1 for the external token 1058for (int i = 0; i < collections.Length; i++) 1070for (int i = 0; i < collections.Length; i++) 1168Debug.Assert(returnValue >= 0 && returnValue < collections.Length, 1316for (int i = 0; i < collections.Length; i++) 1401if (collections.Length != handles.Count - 1) // -1 because of the combined token handle 1403for (int i = 0; i < collections.Length; i++) 1566Array.Copy(collectionSnapShot, 0, array, index, collectionSnapShot.Length); 1657if (collections.Length < 1) 1662if ((collections.Length > 63) || 1663((collections.Length == 63) && (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA))) 1670for (int i = 0; i < collections.Length; ++i)
System\Collections\Concurrent\ConcurrentBag.cs (10)
295if (index > array.Length - count) 791var newArray = new T[_array.Length << 1]; 795Array.Copy(_array, newArray, _array.Length); 799Array.Copy(_array, headIdx, newArray, 0, _array.Length - headIdx); 800Array.Copy(_array, 0, newArray, _array.Length - headIdx, headIdx); 1030Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1039Debug.Assert(arrayIndex <= array.Length - count); 1101if (_index < _array.Length) 1107_index = _array.Length + 1; 1117if (_index == 0 || _index == _array.Length + 1)
System\Collections\Concurrent\ConcurrentDictionary.cs (20)
187for (int i = 1; i < locks.Length; i++) 192var countPerLock = new int[locks.Length]; 229_budget = buckets.Length / locks.Length; 763if (array.Length - count < index) 917if ((uint)i < (uint)buckets.Length) 1901if (array.Length - count < index) 2031for (int i = tables._locks.Length; i < newLocks.Length; i++) 2038var newCountPerLock = new int[newLocks.Length]; 2067_budget = Math.Max(1, newBuckets.Length / newLocks.Length); 2129for (int i = 1; i < locks.Length; i++) 2135Debug.Assert(locksAcquired == locks.Length); 2259return buckets[HashHelpers.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier)]._node; 2263return buckets[(uint)hashcode % (uint)buckets.Length]._node; 2276bucketNo = HashHelpers.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier); 2280bucketNo = (uint)hashcode % (uint)buckets.Length; 2311_fastModBucketsMultiplier = HashHelpers.GetFastModMultiplier((uint)buckets.Length); 2745var items = new DebugViewDictionaryItem<TKey, TValue>[keyValuePairs.Length]; 2746for (int i = 0; i < items.Length; i++)
System\Collections\Concurrent\ConcurrentStack.cs (3)
308PushRange(items, 0, items.Length); 396int length = items.Length; 502return TryPopRange(items, 0, items.Length);
System\Collections\Concurrent\PartitionerStatic.cs (7)
697Debug.Assert(destArray.Length == 1, $"Expected destArray to be of length 1, instead its length is {destArray.Length}"); 812_fillBufferCurrentPosition >= localFillBufferRef.Length) 814for (int i = 0; i < localFillBufferRef.Length; i++) 1292get { return _sharedReader.Length; } 1551get { return _array.Length; } 1571Debug.Assert(startIndex >= 0 && endIndex <= array.Length - 1);
System.Collections.Immutable (141)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (2)
24var items = new DebugViewDictionaryItem<TKey, TValue>[keyValuePairs.Length]; 25for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\FrozenDictionary.cs (10)
339Debug.Assert(keys.Length == values.Length); 341for (int i = 0; i < keys.Length; i++) 362if ((uint)index > (uint)array.Length) 367if (array.Length - index < Count) 602Debug.Assert(keys.Length == values.Length); 612if ((uint)_index < (uint)_keys.Length) 617_index = _keys.Length; 626if ((uint)_index >= (uint)_keys.Length)
System\Collections\Frozen\FrozenHashTable.cs (7)
30Debug.Assert(hashCodes.Length != 0); 31Debug.Assert(buckets.Length != 0); 87for (int bucketNum = 0; bucketNum < hashtableBuckets.Length; bucketNum++) 112Debug.Assert(count == hashtableHashcodes.Length); 129ref Bucket b = ref buckets[HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 134public int Count => HashCodes.Length; 226Array.Clear(seenBuckets, 0, Math.Min(numBuckets, seenBuckets.Length));
System\Collections\Frozen\FrozenSet.cs (4)
292Array.Copy(items, 0, array!, index, items.Length); 462if ((uint)_index < (uint)_entries.Length) 467_index = _entries.Length; 476if ((uint)_index >= (uint)_entries.Length)
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (4)
29_values = new TValue[entries.Length]; 31int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length); 32Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length); 33for (int i = 0; i < entries.Length; i++)
System\Collections\Frozen\ItemsFrozenSet.cs (4)
24_items = new T[entries.Length]; 26int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length); 27Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length); 28for (int i = 0; i < entries.Length; i++)
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (5)
25_keys = new TKey[entries.Length]; 26_values = new TValue[entries.Length]; 28int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length); 29Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length); 30for (int i = 0; i < entries.Length; i++)
System\Collections\Frozen\SmallFrozenDictionary.AlternateLookup.cs (1)
17for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\SmallFrozenDictionary.cs (2)
34private protected override int CountCore => _keys.Length; 41for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\SmallFrozenSet.AlternateLookup.cs (1)
16for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\SmallFrozenSet.cs (2)
25private protected override int CountCore => _items.Length; 30for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (3)
38_max = _keys[_keys.Length - 1]; 44private protected override int CountCore => _keys.Length; 52for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (3)
35_max = _items[_items.Length - 1]; 40private protected override int CountCore => _items.Length; 47for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (2)
33private protected override int CountCore => _keys.Length; 39for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenSet.cs (2)
29private protected override int CountCore => _items.Length; 34for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\String\LengthBuckets.cs (2)
25if (keys.Length / spread > MaxPerLength) 51for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.AlternateLookup.cs (2)
24if (bucketIndex >= 0 && bucketEndIndex <= lengthBuckets.Length) 32if ((uint)index < (uint)keys.Length)
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.cs (7)
35Debug.Assert(keys.Length != 0 && keys.Length == values.Length); 56private protected override int CountCore => _keys.Length; 65if (bucketIndex >= 0 && bucketEndIndex <= lengthBuckets.Length) 75if ((uint)index < (uint)keys.Length) 94if ((uint)index < (uint)keys.Length)
System\Collections\Frozen\String\LengthBucketsFrozenSet.AlternateLookup.cs (2)
23if (bucketIndex >= 0 && bucketEndIndex <= lengthBuckets.Length) 30if ((uint)index < (uint)items.Length)
System\Collections\Frozen\String\LengthBucketsFrozenSet.cs (5)
32Debug.Assert(items.Length != 0); 50private protected override int CountCore => _items.Length; 61if (bucketIndex >= 0 && bucketEndIndex <= lengthBuckets.Length) 70if ((uint)index < (uint)items.Length) 89if ((uint)index < (uint)items.Length)
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (8)
30Debug.Assert(keys.Length != 0 && keys.Length == values.Length); 34_keys = new string[keys.Length]; 35_values = new TValue[values.Length]; 43int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(keys.Length); 44Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, keys.Length); 45for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\String\OrdinalStringFrozenSet.cs (4)
27_items = new string[entries.Length]; 34int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length); 35Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length); 36for (int i = 0; i < entries.Length; i++)
System\Collections\Immutable\ImmutableArray.cs (9)
188if (items == null || items.Length == 0) 197var tmp = new T[items.Length]; 198Array.Copy(items, tmp, items.Length); 215Requires.Range(start >= 0 && start <= items.Length, nameof(start)); 216Requires.Range(length >= 0 && start + length <= items.Length, nameof(length)); 225for (int i = 0; i < array.Length; i++) 286for (int i = 0; i < array.Length; i++) 320for (int i = 0; i < array.Length; i++) 392for (int i = 0; i < array.Length; i++)
System\Collections\Immutable\ImmutableArray_1.Builder.cs (13)
55get { return _elements.Length; } 63if (value != _elements.Length) 229if (result.Length != _count) 369this.Count += items.Length; 371Array.Copy(items, 0, _elements, offset, items.Length); 384this.Count += items.Length; 386Array.Copy(items, 0, _elements, offset, items.Length); 397Requires.Range(length >= 0 && length <= items.Length, nameof(length)); 703Requires.Range(index >= 0 && index + this.Count <= array.Length, nameof(index)); 729Requires.Range(destinationIndex >= 0 && destinationIndex + length <= destination.Length, nameof(destinationIndex)); 739if (_elements.Length < capacity) 741int newCapacity = Math.Max(_elements.Length * 2, capacity); 1094Array.Copy(_elements, copied + removed, _elements, copied, _elements.Length - (copied + removed));
System\Collections\Immutable\ImmutableArray_1.cs (8)
455Requires.Range(length >= 0 && length <= items.Length, nameof(length)); 457if (items.Length == 0 || length == 0) 485if (items.Length == 0) 490T[] tmp = new T[self.Length + items.Length]; 492Array.Copy(items, 0, tmp, self.Length, items.Length); 760for (int i = 0; i < self.array!.Length; i++) 870if (self.array == null || self.array.Length == 0) 934if (items.Length == 0)
System\Collections\Immutable\ImmutableArray_1.Enumerator.cs (4)
64return ++_index < _array.Length; 111if (unchecked((uint)_index) < (uint)_array.Length) 136int length = _array.Length; 173if (array.Length != 0)
System\Collections\Immutable\ImmutableArray_1.Minimal.cs (4)
157get { return this.array!.Length == 0; } 174return this.array!.Length; 196return self.array == null || self.array.Length == 0; 419_ = this.array!.Length;
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (1)
347Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableDictionary_2.cs (2)
613Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 753Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (2)
103Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 120Array.Copy(sourceArray, 0, array, arrayIndex, sourceArray.Length);
System\Collections\Immutable\ImmutableHashSet_1.Builder.cs (1)
397Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableHashSet_1.cs (2)
496Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 541Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableList_1.Node.cs (4)
837Requires.Range(array.Length >= this.Count, nameof(array)); 862Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 893Requires.Range(arrayIndex + count <= array.Length, nameof(arrayIndex)); 913Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
525Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (2)
203Requires.Range(array.Length >= arrayIndex + dictionarySize, nameof(arrayIndex)); 218Requires.Range(array.Length >= arrayIndex + dictionarySize, nameof(arrayIndex));
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (2)
310Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 324Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\KeysOrValuesCollectionAccessor.cs (2)
94Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 135Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Linq\ImmutableArrayExtensions.cs (2)
368return immutableArray.array!.Length > 0 ? immutableArray.array[0] : default; 621if (immutableArray.array!.Length == 0)
System.Collections.NonGeneric (30)
System\Collections\Queue.cs (20)
87int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy; 91Array.Copy(_array, 0, q._array, _array.Length - _head, numToCopy); 113Array.Clear(_array, _head, _array.Length - _head); 136int arrayLen = array.Length; 143int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy; 147Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy); 154if (_size == _array.Length) 156int newcapacity = (int)((long)_array.Length * (long)_growFactor / 100); 157if (newcapacity < _array.Length + MinimumGrow) 159newcapacity = _array.Length + MinimumGrow; 165_tail = (_tail + 1) % _array.Length; 187_head = (_head + 1) % _array.Length; 234index = (index + 1) % _array.Length; 242return _array[(_head + i) % _array.Length]; 261Array.Copy(_array, _head, arr, 0, _array.Length - _head); 262Array.Copy(_array, 0, arr, _array.Length - _head, _tail); 282Array.Copy(_array, _head, newarray, 0, _array.Length - _head); 283Array.Copy(_array, 0, newarray, _array.Length - _head, _tail);
System\Collections\SortedList.cs (7)
163for (int i = 0; i < keys.Length; i++) 193return keys.Length; 202if (value != keys.Length) 341if (array.Length - arrayIndex < Count) 371int newCapacity = keys.Length == 0 ? 16 : keys.Length * 2; 497if (_size == keys.Length) EnsureCapacity(_size + 1);
System\Collections\Stack.cs (3)
121if (array.Length - index < _size) 177if (_size == _array.Length) 179object[] newArray = new object[2 * _array.Length];
System.Collections.Specialized (5)
System\Collections\Specialized\ListDictionary.cs (1)
210if (array.Length - index < count)
System\Collections\Specialized\NameObjectCollectionBase.cs (2)
382if (array.Length - index < _entriesArray.Count) 606if (array.Length - index < _coll.Count)
System\Collections\Specialized\NameValueCollection.cs (2)
173for (int j = 0; j < values.Length; j++) 207if (dest.Length - index < Count)
System.ComponentModel.Annotations (10)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (1)
58if (newMetadata.Length > 0)
System\ComponentModel\DataAnnotations\CompareAttribute.cs (1)
41if (otherPropertyInfo.GetIndexParameters().Length > 0)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (3)
260if (parameterInfos.Length == 0 || parameterInfos[0].ParameterType.IsByRef) 268_isSingleArgumentMethod = (parameterInfos.Length == 1); 272if ((parameterInfos.Length != 2) || (parameterInfos[1].ParameterType != typeof(ValidationContext)))
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (5)
83_inputControlParameters = new object[controlParameters.Length]; 84Array.Copy(controlParameters, _inputControlParameters, controlParameters.Length); 168if (inputControlParameters == null || inputControlParameters.Length == 0) 172if (inputControlParameters.Length % 2 != 0) 177for (int i = 0; i < inputControlParameters.Length; i += 2)
System.ComponentModel.Composition (71)
Microsoft\Internal\Collections\CollectionServices.cs (3)
229if (thisArray.Length != thatArray.Length) 234for (int i = 0; i < thisArray.Length; i++)
System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs (3)
134bool isPrerequisite = member.GetAttributes<ExportAttribute>().Length > 0; 154if (imports.Length == 0) 159if (imports.Length > 1)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (4)
199if (constructors.Length == 0) 205if (constructors.Length == 1 && constructors[0].GetParameters().Length == 0) 231if (constructor.GetParameters().Length == 0)
System\ComponentModel\Composition\ContractNameServices.cs (5)
94for (int i = 0; i < parameters.Length; i++) 304WriteTypeArgumentsString(typeName, types.Length, false, typeArguments, formatGenericName); 340return type.GetGenericArguments().Length; 346int delclaringTypeGenericArguments = type.DeclaringType.GetGenericArguments().Length; 347int typeGenericArguments = type.GetGenericArguments().Length;
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (2)
44copiedProviders = new ExportProvider[providers.Length]; 45for (int i = 0; i < providers.Length; i++)
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (1)
303if (_values == null || _valueCount == _values.Length)
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (4)
168if ((providers != null) && (providers.Length > 0)) 171if (providers.Length > 1) 194int exportProviderCount = 1 + ((catalog != null) ? 1 : 0) + ((providers != null) ? providers.Length : 0); 207for (int i = 0; i < providers.Length; i++)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (8)
74if (typeGenericArguments.Length == metadataTypeGenericArguments.Length) 214dictionary.Add(CompositionConstants.GenericPartArityMetadataName, genericArguments.Length); 218object?[] genericParameterConstraints = new object?[genericArguments.Length]; 219GenericParameterAttributes[] genericParameterAttributes = new GenericParameterAttributes[genericArguments.Length]; 220for (int i = 0; i < genericArguments.Length; i++) 225if (constraints.Length == 0) 439for (int i = 0; i < array.Length; i++)
System\ComponentModel\Composition\MetadataViewGenerator.cs (3)
154if (attrs.Length > 0) 244if (attrs.Length > 0) 267if (attrs.Length > 0)
System\ComponentModel\Composition\Primitives\ExportedDelegate.cs (3)
50Type[] parameterTypes = new Type[parameters.Length + 1]; 51parameterTypes[parameters.Length] = _method.ReturnType; 52for (int i = 0; i < parameters.Length; i++)
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (5)
74for (int i = 0; i < genericParametersOrder.Length; i++) 83T[] genericSpecialization = new T[genericParametersOrder.Length]; 84for (int i = 0; i < genericParametersOrder.Length; i++) 120Type[] subSpecialization = new Type[typeGenericArguments.Length]; 122for (int i = 0; i < typeGenericArguments.Length; i++)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (8)
41_specializationIdentities = new string[_specialization.Length]; 42for (int i = 0; i < _specialization.Length; i++) 221MemberInfo[] accessors = new MemberInfo[genericAccessors.Length]; 223for (int i = 0; i < genericAccessors.Length; i++) 446metadata[CompositionConstants.GenericContractMetadataName] = GenericServices.GetGenericName(originalImport.ContractName, importParametersOrder, _specialization.Length); 551if (partArity != specialization.Length) 565if ((genericParameterConstraints != null) && (genericParameterConstraints.Length != partArity)) 570if ((genericParameterAttributes != null) && (genericParameterAttributes.Length != partArity))
System\ComponentModel\Composition\ReflectionModel\ImportingItem.cs (4)
53Array array = Array.CreateInstance(elementType, exports.Length); 55for (int i = 0; i < array.Length; i++) 69if (exports.Length >= 2) 74if (exports.Length == 0)
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (3)
152if (arguments.Length == 2) 187if (arguments.Length == 1) 195else if (arguments.Length == 2)
System\ComponentModel\Composition\ReflectionModel\LazyMemberInfo.cs (4)
170if (accessors.Length != 2) 185if (accessors.Length != 3) 201(accessors.Length != 1) || 202((accessors.Length == 1) && (accessors[0].MemberType != memberType)))
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (1)
316object?[] arguments = new object?[parameterImports.Length];
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (4)
270if ((genericParametersOrder != null) && (genericParametersOrder.Length == genericParameters.Length)) 284genericTypeParameters = new Type[genericParametersAsArray.Length]; 285for (int i = 0; i < genericParametersAsArray.Length; i++)
System\ComponentModel\Composition\ReflectionModel\ReflectionExtensions.cs (2)
18if (accessors.Length != 1) 25if (accessors.Length != 2)
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (2)
367if (constructors.Length == 1) 371else if (constructors.Length == 0)
System\ComponentModel\Composition\ReflectionModel\ReflectionProperty.cs (2)
103if (parameters.Length == 0) 107return parameters[parameters.Length - 1].ParameterType;
System.ComponentModel.Composition.Registration (3)
System\ComponentModel\Composition\Registration\PartBuilder.cs (3)
371if (attributes.Length != 0) 546int length = candidateConstructor.GetParameters().Length; 565int length = candidateConstructor.GetParameters().Length;
System.ComponentModel.TypeConverter (127)
System\ComponentModel\AttributeCollection.cs (10)
48for (int idx = 0; idx < _attributes.Length; idx++) 67Attribute[] newArray = new Attribute[existing.Count + newAttributes.Length]; 71for (int idx = 0; idx < newAttributes.Length; idx++) 96if (actualCount < newArray.Length) 117public int Count => Attributes.Length; 172int count = Attributes.Length; 228for (int i = 0; i < attributes.Length; i++) 299for (int i = 0; i < Attributes.Length; i++) 320for (int i = 0; i < attributes.Length; i++) 342public void CopyTo(Array array, int index) => Array.Copy(Attributes, 0, array, index, Attributes.Length);
System\ComponentModel\Container.cs (2)
60if (_sites.Length == _siteCount) 226for (int i = 0; i < Math.Min(_siteCount, _sites!.Length); i++)
System\ComponentModel\CultureInfoConverter.cs (4)
184Debug.Assert(invariantIndex >= 0 && invariantIndex < installedCultures.Length); 186array = new CultureInfo[installedCultures.Length]; 190array = new CultureInfo[installedCultures.Length + 1]; 193Array.Copy(installedCultures, array, installedCultures.Length);
System\ComponentModel\Design\DesignerVerbCollection.cs (1)
28for (int i = 0; i < value.Length; i++)
System\ComponentModel\Design\PropertyTabAttribute.cs (14)
103_tabClasses = new Type[_tabClassNames.Length]; 104for (int i = 0; i < _tabClassNames.Length; i++) 158if (other.TabClasses.Length != TabClasses.Length || other.TabScopes.Length != TabScopes.Length) 161for (int i = 0; i < TabClasses.Length; i++) 196if (tabScopes != null && tabClasses.Length != tabScopes.Length) 204if (tabScopes != null && tabClassNames.Length != tabScopes.Length) 218for (int i = 0; i < tabScopes.Length; i++) 229TabScopes = new PropertyTabScope[tabClasses!.Length]; 231for (int i = 0; i < TabScopes.Length; i++)
System\ComponentModel\Design\Serialization\InstanceDescriptor.cs (3)
59if (Arguments.Count != ci.GetParameters().Length) 70if (Arguments.Count != mi.GetParameters().Length) 120for (int i = 0; i < translatedArguments.Length; i++)
System\ComponentModel\Design\ServiceContainer.cs (1)
175for (int idx = 0; idx < defaults.Length; idx++)
System\ComponentModel\EnumConverter.cs (4)
183long[] ulValues = new long[objValues.Length]; 184for (int idx = 0; idx < objValues.Length; idx++) 261if (fields != null && fields.Length > 0) 263objValues = new ArrayList(fields.Length);
System\ComponentModel\EventDescriptorCollection.cs (10)
40Count = events.Length; 145if (sizeNeeded <= _events.Length) 150if (_events.Length == 0) 159int newSize = Math.Max(sizeNeeded, _events.Length * 2); 253if (_events.Length == Count) 305if (_events.Length == 0) 312if (names != null && names.Length > 0) 316int eventCount = _events.Length; 318for (int i = 0; i < names.Length; i++) 422Debug.Assert(array == null || count <= array.Length, "Trying to enumerate more than the array contains");
System\ComponentModel\ListSortDescriptionCollection.cs (1)
21for (int i = 0; i < sorts.Length; i++)
System\ComponentModel\MemberDescriptor.cs (3)
289if (_attributes.Length != mdObj._attributes!.Length) 293for (int i = 0; i < _attributes.Length; i++)
System\ComponentModel\PropertyDescriptor.cs (5)
338if (_editorCount >= _editorTypes.Length) 340Type[] newTypes = new Type[_editorTypes.Length * 2]; 341object[] newEditors = new object[_editors!.Length * 2]; 342Array.Copy(_editorTypes, newTypes, _editorTypes.Length); 343Array.Copy(_editors, newEditors, _editors.Length);
System\ComponentModel\PropertyDescriptorCollection.cs (10)
46Count = properties.Length; 152if (sizeNeeded <= _properties.Length) 157if (_properties.Length == 0) 166int newSize = Math.Max(sizeNeeded, _properties.Length * 2); 323if (_properties.Length == 0) 330if (names != null && names.Length > 0) 334int propCount = _properties.Length; 336for (int i = 0; i < names.Length; i++) 393if (_properties.Length != Count) 524if (_properties.Length != Count)
System\ComponentModel\ReferenceConverter.cs (1)
138for (int i = 0; i < objs.Length; i++)
System\ComponentModel\ReflectPropertyDescriptor.cs (1)
849if (milist.Length > 0 && milist[0] != null)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (22)
258argTypes = new Type[args.Length]; 259for (int idx = 0; idx < args.Length; idx++) 575if (extenders.Length == 0) 601for (int idx = 0; idx < extenders.Length; idx++) 605propertyList ??= new List<PropertyDescriptor>(propertyArray.Length * extenders.Length); 607for (int propIdx = 0; propIdx < propertyArray.Length; propIdx++) 717for (curIdx = 0; curIdx < currentExtenders.Length; curIdx++) 725if (!newExtenders && (idx >= existingExtenders!.Length || currentExtenders[curIdx] != existingExtenders[idx++])) 742if (!newExtenders && (idx >= existingExtenders!.Length || prov != existingExtenders[idx++])) 750if (existingExtenders != null && extenderCount != existingExtenders.Length) 756if (currentExtenders == null || extenderCount != currentExtenders.Length) 765while (curIdx < currentExtenders.Length) 1177events = new EventDescriptor[eventInfos.Length]; 1180for (int idx = 0; idx < eventInfos.Length; idx++) 1199if (eventCount != events.Length) 1308properties = new PropertyDescriptor[extendedProperties.Length]; 1309for (int idx = 0; idx < extendedProperties.Length; idx++) 1363properties = new PropertyDescriptor[propertyInfos.Length]; 1367for (int idx = 0; idx < propertyInfos.Length; idx++) 1373if (propertyInfo.GetIndexParameters().Length > 0) 1399if (propertyCount != properties.Length)
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (4)
102for (int idx = 0; idx < interfaces.Length; idx++) 127for (int ifaceSkipIdx = 0; ifaceSkipIdx < s_skipInterfaceAttributeList.Length; ifaceSkipIdx++) 385if (_editorTypes == null || _editorTypes.Length == _editorCount) 387int newLength = (_editorTypes == null ? 4 : _editorTypes.Length * 2);
System\ComponentModel\TypeConverter.cs (1)
450return _valueArray.Length;
System\ComponentModel\TypeDescriptor.cs (16)
371for (int idx = attrs.Length - 1; idx >= 0; idx--) 489if (argTypes.Length != args.Length) 570for (int attrIdx = 0; attrIdx < attributes.Length; attrIdx++) 1129if (attributes != null && attributes.Length > 0) 1366if (attributes != null && attributes.Length > 0) 1880if (filter == null || filter.Length == 0) 2372for (int idx = 0; idx < s_pipelineFilterKeys.Length; idx++) 2921Attribute[] newArray = new Attribute[existing.Count + newAttrs.Length]; 2925for (int idx = 0; idx < newAttrs.Length; idx++) 2949if (actualCount < newArray.Length) 2982if (_filter.Length != filter.Length) return false; 2984for (int idx = 0; idx < filter.Length; idx++) 3256if (argTypes.Length != args.Length)
System\ComponentModel\TypeListConverter.cs (2)
98objTypes = new object[_types.Length]; 99Array.Copy(_types, objTypes, _types.Length);
System\Drawing\PointConverter.cs (3)
40int[] values = new int[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 48if (values.Length == 2)
System\Drawing\RectangleConverter.cs (3)
40int[] values = new int[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 48if (values.Length != 4)
System\Drawing\SizeConverter.cs (3)
40int[] values = new int[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 48if (values.Length != 2)
System\Drawing\SizeFConverter.cs (3)
40float[] values = new float[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 47if (values.Length != 2)
System.Composition.Convention (4)
System\Composition\Convention\PartConventionBuilder.cs (4)
607if (attributes.Length != 0) 686&& mi.GetParameters().Length == 0) 834int length = candidateConstructor.GetParameters().Length; 853int length = candidateConstructor.GetParameters().Length;
System.Composition.Hosting (9)
System\Composition\Hosting\Core\DependencyAccessor.cs (4)
31var result = new CompositionDependency[all.Length]; 32for (var i = 0; i < all.Length; ++i) 64if (all.Length == 0) 70if (all.Length != 1)
System\Composition\Hosting\Core\ExportDescriptorRegistry.cs (2)
40if (allForExport.Length == 0) 48if (allForExport.Length != 1)
System\Composition\Hosting\Core\LifetimeContext.cs (1)
217if (_sharingBoundaries.Length == 0)
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (2)
31return ci.IsPublic && ps.Length == 1 && ps[0].ParameterType == typeof(IDictionary<string, object>); 43var parameterlessConstructor = ti.DeclaredConstructors.SingleOrDefault(ci => ci.IsPublic && ci.GetParameters().Length == 0);
System.Composition.TypedParts (10)
System\Composition\TypedParts\ActivationFeatures\OnImportsSatisfiedFeature.cs (1)
47m.IsGenericMethodDefinition || m.GetParameters().Length != 0)
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
37if (imports.Length == 0)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (5)
106_constructor ??= _partType.DeclaredConstructors.FirstOrDefault(ci => ci.IsPublic && !(ci.IsStatic || ci.GetParameters().Length != 0)); 117for (var i = 0; i < cps.Length; ++i) 172Expression[] paramActivatorCalls = new Expression[cps.Length]; 178for (var i = 0; i < cps.Length; ++i) 224for (int index = 0; index < _partType.GenericTypeParameters.Length; index++)
System\Composition\TypedParts\Discovery\TypeInspector.cs (3)
134var newArray = Array.CreateInstance(valueType, existingArray.Length + 1); 135Array.Copy(existingArray, newArray, existingArray.Length); 136newArray.SetValue(value, existingArray.Length);
System.Configuration.ConfigurationManager (34)
src\libraries\Common\src\System\Security\IdentityHelper.cs (3)
37if (publicKey == null || publicKey.Length == 0) 79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 84l = buff.Length;
System\Configuration\ApplicationSettingsBase.cs (5)
453for (int i = 0; i < attributes.Length; i++) 560for (int i = 0; i < properties.Length; i++) 599for (int i = 0; i < _classAttributes.Length; i++) 722for (int i = 0; i < allProps.Length; i++) 725for (int j = 0; j < attributes.Length; j++)
System\Configuration\BaseConfigurationRecord.cs (2)
1442if (iKey < keys.Length - 1) 1549string name = keys[keys.Length - 1];
System\Configuration\CallbackValidatorAttribute.cs (1)
30if ((parameters.Length == 1) && (parameters[0].ParameterType == typeof(object)))
System\Configuration\ClientConfigPaths.cs (2)
299if ((attrs != null) && (attrs.Length > 0)) 305if ((attrs != null) && (attrs.Length > 0))
System\Configuration\ConfigurationErrorsException.cs (3)
215if ((_errors != null) && (_errors.Length > 1)) 217subErrors = _errors.Length; 219for (int i = 0; i < _errors.Length; i++)
System\Configuration\ConfigurationSectionCollection.cs (1)
72if (array.Length < c + index) throw new ArgumentOutOfRangeException(nameof(index));
System\Configuration\ConfigurationSectionGroupCollection.cs (1)
76if (array.Length < c + index) throw new ArgumentOutOfRangeException(nameof(index));
System\Configuration\Internal\InternalConfigRoot.cs (7)
112if ((index == parts.Length) || !currentRecord.HlNeedsChildFor(parts[index])) return currentRecord; 130if (index == parts.Length) return currentRecord; 136while ((index < parts.Length) && currentRecord.HlNeedsChildFor(parts[index])) 221for (; nextIndex < parts.Length; nextIndex++) 249if ((index != parts.Length) || ((configRecord != null) && !ReferenceEquals(configRecord, currentRecord))) 253currentRecord.Parent.HlRemoveChild(parts[parts.Length - 1]); 286if ((index == parts.Length) && ReferenceEquals(configRecord, currentRecord))
System\Configuration\MgmtConfigurationRecord.cs (5)
2154byte[] streamStart = new byte[preamble.Length]; 2155if (preambleStream.Read(streamStart, 0, streamStart.Length) == streamStart.Length) 2158for (int i = 0; i < streamStart.Length; i++) 3025if (hasFile) streamWrite.Write(readBuffer, 0, readBuffer.Length);
System\Configuration\PropertyInformationCollection.cs (1)
49if (array.Length < Count + index) throw new ArgumentOutOfRangeException(nameof(index));
System\Configuration\StringUtil.cs (1)
32string[] stringKeys = new string[objectArray.Length];
System\Diagnostics\TraceUtils.cs (2)
98for (int i = 0; i < ctorInfos.Length; i++) 101if (ctorparams.Length == 1)
System.Console (14)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
80if (TryGetHomeDirectoryFromPasswd(buf, heapBuf.Length, out userHomeDirectory))
System\IO\StdInReader.cs (2)
76int spaceRemaining = _unprocessedBufferToBeRead.Length - _endIndex; 79Array.Resize(ref _unprocessedBufferToBeRead, _unprocessedBufferToBeRead.Length * 2);
System\IO\SyncTextReader.cs (2)
124if (buffer.Length - index < count) 136if (buffer.Length - index < count)
System\TermInfo.cs (4)
272if (args.Length > 0) 275if (args.Length > 1) 382Interop.Sys.SNPrintF(ptr, bytes.Length, format, stringArg) : 383Interop.Sys.SNPrintF(ptr, bytes.Length, format, (int)arg);
System\TermInfo.Database.cs (4)
169if (extendedBeginning + ExtendedHeaderSize >= data.Length) 214if (extendedStringTableEnd > data.Length) 229if (offset < 0 || offset >= data.Length) 307return i >= 0 ? pos + i : buffer.Length;
System.Data.Common (684)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
480internal static bool IsEmptyArray([NotNullWhen(false)] string?[]? array) => (null == array) || (0 == array.Length);
src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (1)
51int limit = ary.Length;
System\Data\ColumnTypeConverter.cs (4)
85for (int i = 0; i < s_types.Length; i++) 115for (int i = 0; i < s_types.Length; i++) 140objTypes = new object[s_types.Length]; 141Array.Copy(s_types, objTypes, s_types.Length);
System\Data\Common\AdapterUtil.Common.cs (6)
58if (0 == value.Length) 766if (index == dataRows.Length) 782Dictionary<string, int> hash = new Dictionary<string, int>(columnNameArray.Length); 784int startIndex = columnNameArray.Length; // lowest non-unique index 785for (int i = columnNameArray.Length - 1; 0 <= i; --i) 805for (int i = startIndex; i < columnNameArray.Length; ++i)
System\Data\Common\BooleanStorage.cs (3)
31for (int i = 0; i < records.Length; i++) 47for (int i = 0; i < records.Length; i++) 62if (records.Length > 0)
System\Data\Common\ByteStorage.cs (3)
103for (int i = 0; i < records.Length; i++) 119for (int i = 0; i < records.Length; i++) 134if (records.Length > 0)
System\Data\Common\CharStorage.cs (3)
30for (int i = 0; i < records.Length; i++) 46for (int i = 0; i < records.Length; i++) 61if (records.Length > 0)
System\Data\Common\DataAdapter.cs (7)
424if ((null == dataTables) || (0 == dataTables.Length) || (null == dataTables[0])) 432if ((1 < dataTables.Length) && ((0 != startRecord) || (0 != maxRecords))) 447for (int i = 0; i < dataTables.Length; ++i) 769for (int i = 0; i < tables.Length; ++i) 776DataTable[] newTables = new DataTable[tables.Length + 1]; // add unique data table 777for (int i = 0; i < tables.Length; ++i) 781newTables[tables.Length] = newTable;
System\Data\Common\DataRecordInternal.cs (14)
33return _schemaInfo.Length; 44int copyLen = (values.Length < _schemaInfo.Length) ? values.Length : _schemaInfo.Length; 112cbytes = data.Length; 144cbytes = data.Length; 152if (bufferIndex < 0 || bufferIndex >= buffer.Length) 164if (cbytes + bufferIndex > buffer.Length) 182int cchars = data.Length; 220cchars = data.Length; 228if (bufferIndex < 0 || bufferIndex >= buffer.Length) 230throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex)); 240if (cchars + bufferIndex > buffer.Length)
System\Data\Common\DataStorage.cs (3)
184for (int i = 0; i < recordNos.Length; i++) 360for (int i = 0; i < s_storageClassType.Length; ++i) 398for (int i = (int)StorageType.SqlBinary; i < s_storageClassType.Length; ++i)
System\Data\Common\DataTableMapping.cs (1)
35if ((null != columnMappings) && (0 < columnMappings.Length))
System\Data\Common\DateTimeOffsetStorage.cs (4)
30for (int i = 0; i < records.Length; i++) 47for (int i = 0; i < records.Length; i++) 63if (records.Length > 0) 71for (int i = 0; i < records.Length; i++)
System\Data\Common\DateTimeStorage.cs (6)
30for (int i = 0; i < records.Length; i++) 47for (int i = 0; i < records.Length; i++) 63if (records.Length > 0) 71for (int i = 0; i < records.Length; i++) 270for (int i = 0; i < _values.Length; i++) 280for (int i = 0; i < _values.Length; i++)
System\Data\Common\DBCommandBuilder.cs (18)
42_baseParameterNames = new string[schemaRows.Length]; 43_originalParameterNames = new string[schemaRows.Length]; 44_nullParameterNames = new string[schemaRows.Length]; 45_isMutatedName = new bool[schemaRows.Length]; 46_count = schemaRows.Length; 57for (int i = 0; i < schemaRows.Length; i++) 110for (int i = 0; i < schemaRows.Length; i++) 170for (int i = 0; i < _baseParameterNames.Length; i++) 223for (int i = 0; i < _baseParameterNames.Length; i++) 257for (int i = 0; i < _baseParameterNames.Length; i++) 632string[] srcColumnNames = new string[schemaRows.Length]; 633for (int i = 0; i < schemaRows.Length; ++i) 659if ((null == rows) || (0 == rows.Length)) 669for (int i = 0; i < rows.Length; ++i) 828string[] parameterName = new string[schemaRows.Length]; 829for (int i = 0; i < schemaRows.Length; ++i) 918for (int i = 0; i < schemaRows.Length; ++i) 1007for (int i = 0; i < schemaRows.Length; ++i)
System\Data\Common\DbConnectionStringBuilder.cs (2)
247for (int i = 0; i < values.Length; ++i) 543if ((null == attributes) || (0 == attributes.Length))
System\Data\Common\DbDataAdapter.cs (16)
581if ((null == dataTables) || (0 == dataTables.Length) || (null == dataTables[0])) 593if ((1 < dataTables.Length) && ((0 != startRecord) || (0 != maxRecords))) 601if (1 == dataTables.Length) 858else if (0 != dataRows.Length) 861for (int i = 0; i < dataRows.Length; ++i) 966Debug.Assert((null != dataRows) && (0 < dataRows.Length), "Update: bad dataRows"); 987int maxBatchCommands = Math.Min(UpdateBatchSize, dataRows.Length); 991maxBatchCommands = dataRows.Length; 1177for (int i = 0; i < batchCommands.Length; ++i) 1256for (int i = 0; i < batchCommands.Length; ++i) 1280for (int i = 0; i < batchCommands.Length; ++i) 1302if (commandCount < rowBatch.Length) 1332for (int i = 0; i < batchCommands.Length; ++i) 1351for (int i = 0; i < connections.Length; ++i) 1453rowUpdatedEvent.Errors = ADP.UpdateConcurrencyViolation(StatementType.Batch, commandCount - rowsInError.Length, commandCount, rowsInError); 1487if ((null != dataRows) && (0 < dataRows.Length))
System\Data\Common\DbDataReader.cs (1)
221bytesRead = GetBytes(ordinal, bytesReadTotal, buffer, 0, buffer.Length);
System\Data\Common\DbEnumerator.cs (2)
66object[] values = new object[_schemaInfo.Length]; 96for (int i = 0; i < si.Length; i++)
System\Data\Common\DBSchemaRow.cs (2)
35DbSchemaRow[] schemaRows = new DbSchemaRow[dataRows.Length]; 37for (int i = 0; i < dataRows.Length; ++i)
System\Data\Common\DBSchemaTable.cs (1)
59private readonly DataColumn?[] _columnCache = new DataColumn[s_DBCOLUMN_NAME.Length];
System\Data\Common\DecimalStorage.cs (3)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0)
System\Data\Common\DoubleStorage.cs (3)
103for (int i = 0; i < records.Length; i++) 119for (int i = 0; i < records.Length; i++) 134if (records.Length > 0)
System\Data\Common\FieldNameLookup.cs (2)
92int length = _fieldNames.Length; 107int length = _fieldNames.Length;
System\Data\Common\Int16Storage.cs (4)
107for (int i = 0; i < records.Length; i++) 124for (int i = 0; i < records.Length; i++) 140if (records.Length > 0) 148for (int i = 0; i < records.Length; i++)
System\Data\Common\Int32Storage.cs (4)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\Int64Storage.cs (3)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0)
System\Data\Common\ObjectStorage.cs (8)
154if (arr1.Length > arr2.Length) 156else if (arr1.Length < arr2.Length) 160for (int i = 0; i < arr1.Length; i++) 310Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); 375if (_typename.Length == 2) 538for (int i = 0; i < _values.Length; i++)
System\Data\Common\RowUpdatedEventArgs.cs (2)
91return ((null != dataRows) ? dataRows.Length : ((null != _dataRow) ? 1 : 0)); 138if ((null != dataRows) && (1 == dataRows.Length))
System\Data\Common\SByteStorage.cs (3)
103for (int i = 0; i < records.Length; i++) 119for (int i = 0; i < records.Length; i++) 134if (records.Length > 0)
System\Data\Common\SingleStorage.cs (3)
104for (int i = 0; i < records.Length; i++) 120for (int i = 0; i < records.Length; i++) 135if (records.Length > 0)
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (2)
29if (records.Length > 0) 37for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (4)
32for (int i = 0; i < records.Length; i++) 48for (int i = 0; i < records.Length; i++) 63if (records.Length > 0) 71for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLBytesStorage.cs (2)
30if (records.Length > 0) 38for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLByteStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLCharsStorage.cs (2)
30if (records.Length > 0) 38for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (4)
32for (int i = 0; i < records.Length; i++) 49for (int i = 0; i < records.Length; i++) 65if (records.Length > 0) 73for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 145for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLGuidStorage.cs (2)
30if (records.Length > 0) 38for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLInt16Storage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLInt32Storage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLInt64Storage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLSingleStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 121for (int i = 0; i < records.Length; i++) 136if (records.Length > 0) 144for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLStringStorage.cs (5)
32for (i = 0; i < recordNos.Length; i++) 41for (i++; i < recordNos.Length; i++) 57for (i = 0; i < recordNos.Length; i++) 66for (i++; i < recordNos.Length; i++) 79for (i = 0; i < recordNos.Length; i++)
System\Data\Common\StringStorage.cs (6)
27for (i = 0; i < recordNos.Length; i++) 36for (i++; i < recordNos.Length; i++) 51for (i = 0; i < recordNos.Length; i++) 60for (i++; i < recordNos.Length; i++) 73for (i = 0; i < recordNos.Length; i++) 185Array.Copy(_values, newValues, Math.Min(capacity, _values.Length));
System\Data\Common\TimeSpanStorage.cs (3)
30for (int i = 0; i < records.Length; i++) 46for (int i = 0; i < records.Length; i++) 61if (records.Length > 0)
System\Data\Common\UInt16Storage.cs (4)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\UInt32Storage.cs (4)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\UInt64Storage.cs (3)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0)
System\Data\ConstraintCollection.cs (11)
97if (1 < _table.NestedParentRelations.Length) 224for (int i = 0; i < columns.Length; i++) 491if (array.Length - index < _list.Count) 539if ((null != constraint) && (constraint.Key.ColumnsReference.Length == 1) && (constraint.Key.ColumnsReference[0] == column)) 565if (a1.Length != a2.Length) 569for (i = 0; i < a1.Length; i++) 572for (j = 0; j < a2.Length; j++) 753for (int i = 0; i < _delayLoadingConstraints.Length; i++) 766colCount = constr._columnNames.Length; 803colCount = constr._parentColumnNames.Length;
System\Data\DataColumn.cs (5)
1236if ((null != o) && (o.ColumnsReference.Length == 1) && (o.ColumnsReference[0] == this)) 1566for (int i = 0; i < parentRelations.Length; i++) 1570if (key.ColumnsReference.Length == 1 && key.ColumnsReference[0] == this) 1717for (int i = 0; i < rows.Length; i++) 1723return (rows.Length > 0);
System\Data\DataColumnCollection.cs (5)
662if (array.Length - index < _list.Count) 929DataColumn[] tempColumns = new DataColumn[columns.Length + 1]; 931tempColumns[columns.Length] = dataColumn; 938DataColumn[] tempColumns = new DataColumn[columns.Length - 1]; 939for (int i = 0, j = 0; i < columns.Length; i++)
System\Data\DataColumnPropertyDescriptor.cs (1)
28attrs[attrs.Length - 1] = new ListBindableAttribute(false);
System\Data\DataError.cs (1)
139if (_count >= _errorList!.Length)
System\Data\DataException.cs (5)
432for (int i = 0; i < keys.Length; i++) 434values += Convert.ToString(keys[i], null) + (i < keys.Length - 1 ? ", " : string.Empty); 441if (columns.Length > 1) 444for (int i = 0; i < columns.Length; i++) 446columnNames += columns[i].ColumnName + (i < columns.Length - 1 ? ", " : "");
System\Data\DataKey.cs (21)
21if (columns.Length == 0) 26if (columns.Length > maxColumns) 31for (int i = 0; i < columns.Length; i++) 39for (int i = 0; i < columns.Length; i++) 53_columns = new DataColumn[columns.Length]; 54for (int i = 0; i < columns.Length; i++) 79for (int i = 1; i < _columns.Length; i++) 106else if (column1.Length != column2.Length) 113for (i = 0; i < column1.Length; i++) 116for (j = 0; j < column2.Length; j++) 135for (int i = 0; i < _columns.Length; i++) 179string[] values = new string[_columns.Length]; 180for (int i = 0; i < _columns.Length; ++i) 189IndexField[] indexDesc = new IndexField[_columns.Length]; 190for (int i = 0; i < _columns.Length; i++) 199object[] values = new object[_columns.Length]; 200for (int i = 0; i < _columns.Length; i++) 217for (int i = 0; i < _columns.Length; i++) 229DataColumn[] values = new DataColumn[_columns.Length]; 230for (int i = 0; i < _columns.Length; ++i)
System\Data\DataRelation.cs (8)
205for (int i = 0; i < values.Length; i++) 651for (int i = 0; i < _parentKey.ColumnsReference.Length; i++) 689if (parentColumns.Length != childColumns.Length) 694for (int i = 0; i < parentColumns.Length; i++) 720int keyLength = _parentKey.ColumnsReference.Length; 778if (0 < ChildTable.NestedParentRelations.Length) 781if (childCols.Length != 1 || !IsAutoGenerated(childCols[0]))
System\Data\DataRelationCollection.cs (3)
295if (array.Length - index < alist.Count) 875for (int i = 0; i < _delayLoadingRelations.Length; i++) 884colCount = rel._parentColumnNames.Length;
System\Data\DataRow.cs (5)
426for (int i = 0; i < values.Length; i++) 440if (_columns.Count < value.Length) 451for (int i = 0; i < value.Length; ++i) 1126for (int i = 0; i < columns.Length; i++) 1241for (int i = 0; i < keyValues.Length; i++)
System\Data\DataRowCollection.cs (1)
73if (_table.NestedParentRelations.Length > 0)
System\Data\DataRowComparer.cs (7)
57(a.Length != b.Length)) 83int length = index1 + a.Length; 99Debug.Assert(a.Length == b.Length); 101for (int i = 0; i < a.Length; ++i) 201else if (array.Length > 0)
System\Data\DataSet.cs (18)
547int[] parentInfo = new int[rel.ParentColumns.Length + 1]; 550for (int j = 1; j < parentInfo.Length; j++) 555int[] childInfo = new int[rel.ChildColumns.Length + 1]; 557for (int j = 1; j < childInfo.Length; j++) 590DataColumn[] parentkeyColumns = new DataColumn[parentInfo.Length - 1]; 591for (int i = 0; i < parentkeyColumns.Length; i++) 597DataColumn[] childkeyColumns = new DataColumn[childInfo.Length - 1]; 598for (int i = 0; i < childkeyColumns.Length; i++) 794if ((dt.NestedParentRelations.Length == 0) || 795(dt.NestedParentRelations.Length == 1 && dt.NestedParentRelations[0].ChildTable == dt)) 1335for (int i = 0; i < bitMatrix.Length; ++i) 1344for (int i = 0; i < bitMatrix.Length; ++i) 1387for (int tableIndex = 0; tableIndex < bitMatrix.Length; ++tableIndex) 3350if (props.Length < propStart + 1) 3598var dataTables = new DataTable[tables.Length]; 3599for (int i = 0; i < tables.Length; i++) 3632if (dataTables.Length == 0) 3637for (int i = 0; i < dataTables.Length; i++)
System\Data\DataTable.cs (61)
531int[] colInfo = new int[uc.Columns.Length]; 532for (int j = 0; j < colInfo.Length; j++) 554int[] parentInfo = new int[fk.RelatedColumns.Length + 1]; 556for (int j = 1; j < parentInfo.Length; j++) 561int[] childInfo = new int[fk.Columns.Length + 1]; 563for (int j = 1; j < childInfo.Length; j++) 604DataColumn[] keyColumns = new DataColumn[keyColumnIndexes.Length]; 605for (int i = 0; i < keyColumnIndexes.Length; i++) 630DataColumn[] parentkeyColumns = new DataColumn[parentInfo.Length - 1]; 631for (int i = 0; i < parentkeyColumns.Length; i++) 638DataColumn[] childkeyColumns = new DataColumn[childInfo.Length - 1]; 639for (int i = 0; i < childkeyColumns.Length; i++) 904if (dcArr.Length > 0) 906int[] columnsInError = new int[dcArr.Length]; 907string[] columnErrors = new string[dcArr.Length]; 908for (int i = 0; i < dcArr.Length; i++) 940Debug.Assert(columnsInError.Length == columnErrors.Length); 941for (int i = 0; i < columnsInError.Length; i++) 1564Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken"); 1565for (int i = 0; i < nRel.Length; i++) 1648if ((value != null) && (value.Length != 0)) 1651for (int i = 0; i < value.Length; i++) 1666if (count != value.Length) 1733for (int i = 0; i < key.ColumnsReference.Length; i++) 1790if (nestedRelations.Length == 0) 1855if (nestedRelations.Length > 0) 1857for (int i = 0; i < nestedRelations.Length; i++) 1868while (j < nestedRelations.Length && ((nestedRelations[j].ParentTable == this) || (visitedTables.Contains(nestedRelations[j].ParentTable)))) 1872if (j < nestedRelations.Length) 2119for (int i = 0; i < keyValues.Length; i++) 2266for (int i = 0; i < cols.Length; i++) 2299for (int i = 0; i < oldRows.Length; ++i) 2437if (pkey.Length > 0) 2439DataColumn[] key = new DataColumn[pkey.Length]; 2440for (int i = 0; i < pkey.Length; i++) 3006for (int i = 0; i < cols.Length; i++) 3266for (int i = 0; i < cols.Length; i++) 3370IndexField[] newIndexDesc = new IndexField[indexDesc.Length]; 3371Array.Copy(indexDesc, newIndexDesc, indexDesc.Length); 3385if (colCount < value.Length) 3392for (int i = 0; i < value.Length; i++) 3403for (int i = value.Length; i < colCount; i++) 3706indexDesc = new IndexField[split.Length]; 3708for (int i = 0; i < split.Length; i++) 3785Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same"); 3786Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 3973for (int i = 0; i < oldRows.Length; i++) 4834if (pkey.Length == 1) 4863if (pkey.Length == 0) 4974if (PrimaryKey.Length == 0) 5013primaryKeyIndex = new int[_primaryKey.ColumnsReference.Length]; 5014for (int i = 0; i < _primaryKey.ColumnsReference.Length; i++) 5020object[] keys = new object[primaryKeyIndex.Length]; 5021for (int i = 0; i < primaryKeyIndex.Length; i++) 5040for (int count = 0; count < values.Length; count++) 5047for (int count = values.Length; count < _columnCollection.Count; count++) 5521for (int j = 0; j < dependency.Length; j++) 6596for (int j = 0; j < dependency.Length; j++)
System\Data\DataTableCollection.cs (1)
559if (array.Length - index < _list.Count)
System\Data\DataTableReader.cs (23)
47if (dataTables.Length == 0) 52_tables = new DataTable[dataTables.Length]; 53for (int i = 0; i < dataTables.Length; i++) 143if ((_tableCounter == _tables.Length - 1)) 364return tempBuffer.Length; 368int byteCount = Math.Min(tempBuffer.Length - srcIndex, length); 371throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, nameof(dataIndex)); 373else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length)) 375throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex)); 427return tempBuffer.Length; 431int charCount = Math.Min(tempBuffer.Length - srcIndex, length); 434throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, nameof(dataIndex)); 436else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length)) 438throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex)); 680Array.Copy(_currentDataRow!.ItemArray, values, _currentDataRow.ItemArray.Length > values.Length ? values.Length : _currentDataRow.ItemArray.Length); 681return (_currentDataRow.ItemArray.Length > values.Length ? values.Length : _currentDataRow.ItemArray.Length); 826for (int j = 0; j < dependency.Length; j++)
System\Data\DataView.cs (16)
416if (_sort.Length == 0 && _applyDefaultSort && _table != null && _table._primaryIndex.Length > 0) 775for (int i = 0; i < rows.Length; i++) 955if (_table != null && _index != null && _index._indexFields.Length == 1) 962ListSortDirection IBindingList.SortDirection => (_index!._indexFields.Length == 1 && _index._indexFields[0].IsDescending) ? 1126if (_table != null && _index != null && _index._indexFields.Length > 0) 1128sortDescArray = new ListSortDescription[_index._indexFields.Length]; 1129for (int i = 0; i < _index._indexFields.Length; i++) 1158if (listAccessors == null || listAccessors.Length == 0) 1182if (listAccessors == null || listAccessors.Length == 0) 1693if (columnNames.Length == 0) 1696for (int i = 0; i < columnNames.Length; i++) 1702int[] columnIndexes = new int[columnNames.Length]; 1706for (int i = 0; i < columnNames.Length; i++) 1719object[] o = new object[columnNames.Length]; 1721for (int j = 0; j < columnIndexes.Length; j++) 1741for (int j = 0; j < objectArray.Length; j++)
System\Data\DataViewManager.cs (2)
267if (listAccessors == null || listAccessors.Length == 0) 290if (listAccessors == null || listAccessors.Length == 0)
System\Data\DBConcurrencyException.cs (2)
53return (((null != rows) && (0 < rows.Length)) ? rows[0] : null); 66return ((null != dataRows) ? dataRows.Length : 0);
System\Data\FillErrorEventArgs.cs (2)
37object?[] copy = new object?[_values.Length]; 38for (int i = 0; i < _values.Length; ++i)
System\Data\Filter\AggregateNode.cs (1)
199for (int i = 0; i < rows.Length; i++)
System\Data\Filter\ExpressionParser.cs (11)
1059if (_pos + 1 < text.Length && charsToEscape.Contains(text[_pos + 1])) 1065} while (_pos < text.Length && text[_pos] != chEnd); 1067if (_pos >= text.Length) 1086do _pos++; while (_pos < text.Length && text[_pos] != '#'); 1088if (_pos >= text.Length || text[_pos] != '#') 1091if (_pos >= text.Length) 1121int hi = s_reservedwords.Length - 1; 1153while (_pos < text.Length) 1157if (ch == escape && _pos < text.Length && text[_pos] == escape) 1165if (_pos >= text.Length) 1184while (_pos < text.Length && IsWhiteSpace(text[_pos]))
System\Data\Filter\FunctionNode.cs (3)
52for (int i = 0; i < s_funcs.Length; i++) 76else if (_argumentCount == _arguments.Length) 123Debug.Assert(_info < s_funcs.Length && _info >= 0, "Invalid function info.");
System\Data\Filter\Operators.cs (1)
222if ((uint)op < (uint)s_looks.Length)
System\Data\ForeignKeyConstraint.cs (30)
161for (int i = 0; i < values.Length; i++) 179for (int i = 0; i < uniqueChildKeys.Length; i++) 189for (int j = 0; j < rows.Length; j++) 211for (int i = 0; i < uniqueChildKeys.Length; i++) 301for (int j = 0; j < rows.Length; j++) 314object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 315for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 321for (int j = 0; j < rows.Length; j++) 333object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 334for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 340for (int j = 0; j < rows.Length; j++) 376for (int j = 0; j < rows.Length; j++) 442for (int j = 0; j < rows.Length; j++) 454object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 455for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 461for (int j = 0; j < rows.Length; j++) 472object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 473for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 479for (int j = 0; j < rows.Length; j++) 512if (DataRelation.GetChildRows(ParentKey, ChildKey, row, DataRowVersion.Default).Length > 0) 603for (lo = 0; lo < childValues.Length; lo++) 612if (lo == childValues.Length) 636for (int i = 0; i < _parentKey.ColumnsReference.Length; i++) 720int keys = Columns.Length; 760int keys = Columns.Length; 798if (parentColumns.Length == 0 || childColumns.Length == 0) 802if (parentColumns.Length != childColumns.Length) 807for (int i = 0; i < parentColumns.Length; i++)
System\Data\LinqDataView.cs (2)
153else if (base.SortComparison != null && key.Length != sortExpressionBuilder!.Count) 193else if (base.SortComparison != null && key.Length != sortExpressionBuilder!.Count)
System\Data\Merger.cs (16)
244for (int i = 0; i < rows.Length; i++) 405if (targetPKey.Length != tablePKey.Length) 409if (targetPKey.Length == 0) 411DataColumn[] key = new DataColumn[tablePKey.Length]; 412for (int i = 0; i < tablePKey.Length; i++) 418else if (tablePKey.Length != 0) 425for (int i = 0; i < targetPKey.Length; i++) 536if (relation.ParentKey.ColumnsReference.Length != destRelation.ParentKey.ColumnsReference.Length) 542for (int i = 0; i < relation.ParentKey.ColumnsReference.Length; i++) 578DataColumn[] parentColumns = new DataColumn[relation.ParentKey.ColumnsReference.Length]; 579DataColumn[] childColumns = new DataColumn[relation.ParentKey.ColumnsReference.Length]; 580for (int i = 0; i < relation.ParentKey.ColumnsReference.Length; i++) 637DataColumn[] srcColumns = new DataColumn[dstColumns.Length]; 638for (int j = 0; j < dstColumns.Length; j++)
System\Data\ProviderBase\SchemaMapping.cs (28)
201bool[] readOnly = new bool[mapped.Length]; 202for (int i = 0; i < readOnly.Length; ++i) 212for (int i = 0; i < readOnly.Length; ++i) 220for (int i = 0; i < mapped.Length; ++i) 232for (int i = 0; i < readOnly.Length; ++i) 284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length"); 299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length"); 314for (int i = 0; i < _xmlMap.Length; ++i) 390for (int i = 0; i < _readerDataValues!.Length; ++i) 439for (int i = 0; i < _chapterMap!.Length; ++i) 458int rowLength = _chapterMap!.Length; 513for (int i = 0; i < fieldNames.Length; ++i) 524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray"); 657for (int x = 0; x < _xmlMap.Length; ++x) 770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount"); 772if (0 == schemaRows.Length) 780bool addPrimaryKeys = (((0 == _dataTable.PrimaryKey.Length) && ((4 <= (int)_loadOption) || (0 == _dataTable.Rows.Count))) 803for (int sortedIndex = 0; sortedIndex < schemaRows.Length; ++sortedIndex) 825chapterIndexMap = new bool[schemaRows.Length]; 834_xmlMap = new int[schemaRows.Length]; 843_xmlMap = new int[schemaRows.Length]; 859columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex); 891for (int x = 0; x < _xmlMap.Length; ++x) 1022keys ??= new DataColumn[schemaRows.Length]; 1039columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex); 1076if (keyCount < keys.Length) 1112dataValues = SetupMapping(schemaRows.Length, columnCollection, chapterColumn, chapterValue);
System\Data\RbTree.cs (14)
125_pageTableMap = new int[(_pageTable.Length + TreePage.slotLineSize - 1) / TreePage.slotLineSize]; // Ceiling(size) 165TreePage[] newPageTable = new TreePage[_pageTable.Length * 2]; 166Array.Copy(_pageTable, newPageTable, _pageTable.Length); 167int[] newPageTableMap = new int[(newPageTable.Length + TreePage.slotLineSize - 1) / TreePage.slotLineSize]; 168Array.Copy(_pageTableMap, newPageTableMap, _pageTableMap.Length); 170_nextFreePageLine = _pageTableMap.Length; 171freePageIndex = _pageTable.Length; 262else if (page.InUseCount == page._slots.Length - 1) 277while (pageTableMapPos < _pageTableMap.Length) 1636if (array.Length - index < Count) 1660if (array.Length - index < Count) 1979if (_inUseCount < _slots.Length) 1982while (segmentPos < _slotMap.Length) 1993if (_inUseCount == _slots.Length) // mark page as full
System\Data\RecordManager.cs (5)
39Array.Copy(_rows, newRows, Math.Min(_lastFreeRecord, _rows.Length)); 185Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 190Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 197for (int i = 0; i < keyValues.Length; i++) 263_lastFreeRecord = _rows.Length;
System\Data\RelatedView.cs (3)
127if (value1.Length != value2.Length) 131for (int i = 0; i < value1.Length; i++)
System\Data\Select.cs (20)
185if (fields.Length < _indexFields.Length) 188for (int i = 0; i < fields.Length && j < _indexFields.Length; i++) 201return j == _indexFields.Length; 239int count = (fields.Length < _nCandidates ? fields.Length : _nCandidates); 303for (int i = 0; i < depColumns.Length; i++) 328int lenCanColumns = _candidateColumns.Length; 329int lenIndexDesc = _indexFields.Length; 380for (i = 0; i < _candidateColumns.Length; i++) 442for (i = 0; i < _candidateColumns.Length; i++) 479int lenId = fields.Length; 490int lenCanColumns = _candidateColumns.Length; 526for (int i = 0; i < _candidateColumns.Length; i++) 545if (_index == null && (_indexFields.Length > 0 || _linearExpression == _expression)) 583_recordCount = _records.Length; 595for (int i = 0; i < newRows.Length; i++) 797Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 864int lenIndexDesc = _indexFields.Length;
System\Data\Selection.cs (22)
102for (int i = 0; i < fields.Length; ++i) 146_indexFields.Length != indexDesc.Length || 153for (int loop = 0; loop < _indexFields.Length; loop++) 310if (0 < _indexFields.Length) 312for (int i = 0; i < _indexFields.Length; i++) 354for (int i = 0; i < _indexFields.Length; i++) 388for (int i = 0; i < _indexFields.Length; i++) 495if (_indexFields == null || _indexFields.Length == 0) 539if (_indexFields.Length != 1) 541throw ExceptionBuilder.IndexKeyLength(_indexFields.Length, 1); 579c = ((null != originalKey) ? originalKey.Length : 0); 580if (originalKey is null || 0 == c || _indexFields.Length != c) 582throw ExceptionBuilder.IndexKeyLength(_indexFields.Length, c); 590object?[] key = new object?[originalKey.Length]; 591for (int i = 0; i < originalKey.Length; ++i) 704if (0 < newRows.Length) 707for (int i = 0; i < newRows.Length && iterator.MoveNext(); i++) 721bool append = (0 == _indexFields.Length); 793if ((0 == _indexFields.Length) && (null != _table)) 1016object[] element = new object[_indexFields.Length]; // number of columns in PK 1017for (int j = 0; j < element.Length; ++j)
System\Data\SQLTypes\SQLBinary.cs (19)
32_value = new byte[value.Length]; 66var value = new byte[_value.Length]; 95return _value.Length; 118public override string ToString() => _value is null ? SQLResource.NullString : $"SqlBinary({_value.Length})"; 134byte[] rgbResult = new byte[x.Value.Length + y.Value.Length]; 136y.Value.CopyTo(rgbResult, x.Value.Length); 147int len = (x.Length < y.Length) ? x.Length : y.Length; 161if (x.Length == y.Length) 169if (x.Length < y.Length) 172for (i = len; i < y.Length; ++i) 181for (i = len; i < x.Length; ++i) 379Debug.Assert(rgbValue.Length >= length); 405int cbLen = _value.Length;
System\Data\SQLTypes\SQLBytes.cs (13)
78_lCurLen = _rgbBuf.Length; 153_ => (_rgbBuf == null) ? -1L : _rgbBuf.Length, 269ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _rgbBuf.Length); 311ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 349if (offset > _rgbBuf.Length) 352if (buffer.Length > _rgbBuf.Length - offset) 377if (offset > _rgbBuf.Length) 381ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length); 384ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 386if (count > _rgbBuf.Length - offset) 468Debug.Assert(FStream() || (_rgbBuf != null && _lCurLen <= _rgbBuf.Length)); 484if (_rgbBuf == null || _rgbBuf.Length < lStreamLen) 508_lCurLen = (_rgbBuf == null) ? x_lNull : _rgbBuf.Length;
System\Data\SQLTypes\SQLChars.cs (17)
72_lCurLen = _rgchBuf.Length; 152_ => (_rgchBuf == null) ? -1L : _rgchBuf.Length, 274ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _rgchBuf.Length); 300ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length); 304ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 348if (offset > _rgchBuf.Length) 352ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length); 355ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 357if (count > _rgchBuf.Length - offset) 433Debug.Assert(FStream() || (_rgchBuf != null && _lCurLen <= _rgchBuf.Length)); 436Debug.Assert(_rgchWorkBuf == null || _rgchWorkBuf.Length == 1); 456if (_rgchBuf == null || _rgchBuf.Length < lStreamLen) 473_lCurLen = (_rgchBuf == null) ? x_lNull : _rgchBuf.Length; 650ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 652ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset); 666ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 668ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Data\SQLTypes\SQLDecimal.cs (2)
588if (bits.Length != 4) 1002int cwchStr = rgwchStr.Length;
System\Data\SQLTypes\SQLGuid.cs (1)
33if (value == null || value.Length != SizeOfGuid)
System\Data\SQLTypes\SQLString.cs (5)
140: this(lcid, compareOptions, data, 0, data.Length, fUnicode) 156: this(lcid, compareOptions, data, 0, data.Length, true) 723int cbX = rgDataX.Length; 724int cbY = rgDataY.Length; 917return SqlBinary.HashByteArray(rgbSortKey, rgbSortKey.Length);
System\Data\SQLTypes\SqlXml.cs (4)
399ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 401ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset); 435ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 437ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Data\TypeLimiter.cs (1)
248for (int i = 0; i < appDomainAllowedTypes.Length; i++)
System\Data\UniqueConstraint.cs (8)
143DataColumn[] sortIndexColumns = new DataColumn[_constraintIndex._indexFields.Length]; 144for (int i = 0; i < sortIndexColumns.Length; i++) 226for (int i = 0; i < uniqueKeys.Length; i++) 233for (int j = 0; j < rows.Length; j++) 292int keys = ColumnsReference.Length; 317int keys = ColumnsReference.Length; 377for (int i = 0; i < columns.Length; i++) 410if (_key.ColumnsReference.Length == 1)
System\Data\XDRSchema.cs (2)
273for (int i = 1; i < s_mapNameTypeXdr.Length; ++i) 592int keyLength = list.Length;
System\Data\XmlDataLoader.cs (3)
819for (int i = foundColumns.Length - 1; i >= 0; --i) 1059for (int i = foundColumns.Length - 1; i >= 0; --i) 1086for (int i = foundColumns.Length - 1; i >= 0; --i)
System\Data\xmlsaver.cs (24)
662if (top.Length == 0 || _schFormat == SchemaFormat.WebServiceSkipSchema || _schFormat == SchemaFormat.RemotingSkipSchema) 695for (int i = 0; i < top.Length; i++) 782for (int i = 0; i < rels.Length; ++i) 1167if (1 < key.Length) 1171for (int i = 1; i < key.Length; i++) 1181if (1 < key.Length) 1192for (int i = 1; i < key.Length; i++) 1391if (nestedParentRelations.Length != 0) 1393for (int i = 0; i < nestedParentRelations.Length; i++) 1636if (rel.ChildColumnsReference.Length != 1) 1642if (rel.ParentColumnsReference.Length != 1) 1668if (unique.Key.ColumnsReference.Length != 1) 1704if (fk.RelatedColumnsReference.Length != 1) 1740if (nestedParentRelations.Length == 0) 1746for (int i = 0; i < nestedParentRelations.Length; i++) 1799if (childRelations[j].Nested && childRelations[j].ParentKey.ColumnsReference.Length == 1 && childRelations[j].ParentKey.ColumnsReference[0] == col) 2024if (0 < fields.Length) 2027for (int k = 0; k < fields.Length; k++) 2092if (0 < fields.Length) 2095for (int k = 0; k < fields.Length; k++) 2176if (0 < fields.Length) 2179for (int k = 0; k < fields.Length; k++) 2496if ((state == DataRowState.Deleted) && (row.Table.NestedParentRelations.Length != 0)) 2836int countTopTable = _topLevelTables.Length;
System\Data\XMLSchema.cs (21)
265for (int i = 0; i < attrs.Length; i++) 325for (int i = 0; i < attrs.Length; i++) 366for (int i = 0; i < attrs.Length; i++) 386for (int i = 0; i < nodeAttributes.Length; i++) 470keyLength = parentNames.Length; 471if (keyLength != childNames.Length) 810if (dt.NestedParentRelations.Length == 0 && dt.Namespace == ds.Namespace) 865for (int i = 0; i < relations.Length; i++) 1178colName = split[split.Length - 1]; 1410if (0 < key.Length) 1428for (int i = 0; i < key.Length; i++) 1779for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 1845for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 1893for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 2024for (int i = 0; i < attrs.Length; i++) 2137for (int i = 0; i < attrs.Length; i++) 2734for (int i = 0; i < qualifiedNames.Length; i++) 2750for (int i = 0; i < qualifiedNames.Length; i++) 2766string QualifiedTableName = split[split.Length - 1]; //get the last string after '/' and ':' 2785string tableName = split[split.Length - 1]; //get the last string after '/' and ':' 2802for (int i = 0; i < attribs.Length; i++)
System\Xml\XmlDataDocument.cs (4)
829if (relations.Length == 0) 1259for (int i = 0; i < orderedTables.Length; i++) 1734for (int i = 0; i < columns.Length; i++) 2959if (relations.Length != 0 && relations[0].ParentTable == parentRow.Table) // just backward compatible
System.Data.Odbc (92)
Common\System\Data\Common\AdapterUtil.Odbc.cs (1)
580for (int i = 0; i < d.Length; i++)
Common\System\Data\Common\DBConnectionString.cs (19)
163if ((null != restrictionValues) && (0 < restrictionValues.Length)) 166for (int i = 0; i < restrictionValues.Length; ++i) 269if (_restrictionValues.Length <= entry._restrictionValues.Length) 396for (int i = 0; i < allowonly.Length; ++i) 419for (int i = 0; i < a.Length; ++i) 442Debug.Assert(null != a && 0 < a.Length, "empty a"); 443Debug.Assert(null != b && 0 < b.Length, "empty b"); 447List<string> newlist = new List<string>(a.Length + b.Length); 448for (int i = 0; i < a.Length; ++i) 452for (int i = 0; i < b.Length; ++i) 493int count = restrictions.Length; 498for (int i = 1; i < restrictions.Length; ++i) 507if (0 == restrictions[restrictions.Length - 1]!.Length) 509restrictions[restrictions.Length - 1] = null; 512if (count != restrictions.Length) 516for (int i = 0; i < restrictions.Length; ++i) 535for (int i = 1; i < restrictionValues.Length; ++i)
Common\System\Data\ProviderBase\DbBuffer.cs (8)
149Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 182Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 241Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 293Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 438Debug.Assert(startIndex + length <= source.Length, "source too small"); 464Debug.Assert(startIndex + length <= source.Length, "source too small"); 519Debug.Assert(startIndex + length <= source.Length, "source too small"); 569Debug.Assert(startIndex + length <= source.Length, "source too small");
Common\System\Data\ProviderBase\DbConnectionFactory.cs (3)
53for (idx = 0; idx < s_pendingOpenNonPooled.Length; idx++) 68if (idx == s_pendingOpenNonPooled.Length) 70idx = (int)(s_pendingOpenNonPooledNext % s_pendingOpenNonPooled.Length);
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
480internal static bool IsEmptyArray([NotNullWhen(false)] string?[]? array) => (null == array) || (0 == array.Length);
src\libraries\Common\src\System\Data\Common\BasicFieldNameLookup.cs (2)
114int length = _fieldNames.Length; 129int length = _fieldNames.Length;
src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (1)
51int limit = ary.Length;
src\libraries\Common\src\System\Data\ProviderBase\DbMetaDataFactory.cs (4)
120if ((restrictions != null) && (restrictions.Length > numberOfRestrictions)) 134if ((restrictions != null) && (restrictions.Length > i) && (restrictions[i] != null)) 406for (int i = 0; i < restrictions.Length; i++) 484for (int i = 0; i < hiddenColumnNames.Length; i++)
src\libraries\Common\src\System\Data\ProviderBase\DbReferenceCollection.cs (3)
106if ((!itemAdded) && (_lastItemIndex + 1 < _items.Length)) 131Array.Resize<CollectionEntry>(ref _items, _items.Length * 2); 210if (_items.Length > 100)
System\Data\Odbc\DbDataRecord.cs (1)
135int count = _values.Length;
System\Data\Odbc\OdbcCommandBuilder.cs (2)
145int count = list.Length; 148for (int i = 0; i < list.Length; ++i)
System\Data\Odbc\OdbcConnection.cs (4)
390if (buffer.Length + 2 <= cbActual) 399value = (BitConverter.IsLittleEndian ? Encoding.Unicode : Encoding.BigEndianUnicode).GetString(buffer, 0, Math.Min(cbActual, buffer.Length)); 492if (buffer.Length < cbActual - 2) 501value = (BitConverter.IsLittleEndian ? Encoding.Unicode : Encoding.BigEndianUnicode).GetString(buffer, 0, Math.Min(cbActual, buffer.Length));
System\Data\Odbc\OdbcConnectionHandle.cs (3)
227ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetConnectAttrW(this, attribute, buffer, buffer.Length, out cbActual); 240ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), out cbActual); 246ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), ADP.PtrZero);
System\Data\Odbc\OdbcConnectionStringbuilder.cs (3)
148string[] tmp = new string[knownKeywords.Length + count]; 151int index = knownKeywords.Length; 179for (int i = 0; i < s_validKeywords.Length; ++i)
System\Data\Odbc\OdbcDataReader.cs (9)
571int nValues = Math.Min(values.Length, FieldCount); 1161int cachedObjectLength = isCharsBuffer ? ((string)cachedObj).Length : ((byte[])cachedObj).Length; 1188lengthOfCopy = Math.Min(lengthOfCopy, buffer.Length - bufferIndex); 1308length = Math.Min(length, buffer.Length - bufferIndex); 1343Debug.Assert(buffer == null || bytesOrCharsLength <= (buffer.Length - bufferIndex), "Not enough space in user's buffer"); 1511cbOffset += junk.Length; 2884for (parts = 0; (parts < qualifiers.Length) && (currentPos < name.Length); ++parts) 2928if ((currentPos < 0) || (parts == qualifiers.Length - 1)) 2940for (int j = qualifiers.Length - 1; 0 <= j; --j)
System\Data\Odbc\OdbcHandle.cs (2)
186checked((short)(2 * buffer.Length)), // expects number of bytes, see \\kbinternal\kb\articles\294\1\69.HTM 206ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetDiagRecW(HandleType, this, record, buffer, out nativeError, message, checked((short)message.Length), out cchActual);
System\Data\Odbc\OdbcMetaDataFactory.cs (6)
90for (int i = 0; i < _schemaMapping.Length; i++) 503Debug.Assert(allRestrictions.Length >= restrictionsCount); 510if (restrictions.Length > restrictionsCount) 515for (i = 0; i < restrictions.Length; i++) 850if (restrictions.Length >= indexOfIndexName + 1) 990for (int i = 0; i < values.Length; ++i)
System\Data\Odbc\OdbcParameter.cs (11)
375cch = ((char[])value).Length - offset; 389cch = ((byte[])value).Length - offset; 435cch = ((char[])value).Length - offset; 440cch = ((byte[])value).Length - offset; 497ccb = (((char[])value).Length - offset) * 2 + 2; 501ccb = ((byte[])value).Length - offset; 522else if ((value is byte[]) && (ccb < ((byte[])value).Length) && (_bindtype == _originalbindtype)) 525ccb = ((byte[])value).Length; 647if (offset > ((char[])value).Length) 654if (offset > ((byte[])value).Length) 746size = ((byte[])value).Length;
System\Data\Odbc\OdbcParameterHelper.cs (2)
243byte[] bvalue => bvalue.Length, 244char[] cvalue => cvalue.Length,
System\Data\Odbc\OdbcUtils.cs (7)
180Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 182WriteCharArray(offset, rgChars, 0, rgChars.Length); 183WriteInt16(offset + (rgChars.Length * 2), 0); // Add the null terminator 187length = Math.Max(0, ((char[])value).Length - valueOffset); 193Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 196WriteInt16(offset + (rgChars.Length * 2), 0); // Add the null terminator 205int length = rgBytes.Length;
System.Diagnostics.DiagnosticSource (37)
System\Diagnostics\ActivitySource.cs (9)
428T[] newArray = new T[_volatileArray.Length + 1]; 430Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items 431newArray[_volatileArray.Length] = item;// copy new item 448T[] newArray = new T[_volatileArray.Length + 1]; 450Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items 451newArray[_volatileArray.Length] = item;// copy new item 470T[] newArray = new T[_volatileArray.Length - 1]; 476newArray, index, _volatileArray.Length - index - 1// remaining items accounting for removed item 484public int Count => _volatileArray.Length;
System\Diagnostics\DsesFilterAndTransform.cs (1)
1002if (property.GetMethod == null || property.GetMethod!.GetParameters().Length > 0)
System\Diagnostics\Helpers.cs (3)
40if (labels is null || labels.Length == 0) 46for (int i = 0; i < labels.Length; i++) 49if (i != labels.Length - 1)
System\Diagnostics\Metrics\AggregatorStore.cs (5)
337switch (instructions.Length) 381string[] labelNames = new string[instructions.Length]; 382for (int i = 0; i < instructions.Length; i++) 453for (int i = 0; i < _instructions.Length; i++) 503for (int i = 0; i < labels.Length; i++)
System\Diagnostics\Metrics\CounterAggregator.cs (1)
41% deltas.Length];
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (3)
98QuantileValue[] quantiles = new QuantileValue[_config.Quantiles.Length]; 100if (nextQuantileIndex == _config.Quantiles.Length) 120if (nextQuantileIndex == _config.Quantiles.Length)
System\Diagnostics\Metrics\Measurement.cs (3)
48_tags = new KeyValuePair<string, object?>[tags.Length]; 129int length = array.Length; 160length = array.Length;
System\Diagnostics\Metrics\MetricsEventSource.cs (2)
734for (int i = 0; i < quantiles.Length; i++) 741if (i != quantiles.Length - 1)
System\Diagnostics\Metrics\ObjectSequence.cs (3)
94if (_values.Length != other._values.Length) 98for (int i = 0; i < _values.Length; i++)
System\Diagnostics\Metrics\ObjectSequence.netcore.cs (1)
53for (int i = 0; i < _values.Length; i++)
System\Diagnostics\Metrics\RuntimeMetrics.cs (2)
21private static readonly int s_maxGenerations = Math.Min(GC.GetGCMemoryInfo().GenerationInfo.Length, s_genNames.Length); 124() => (long)AppDomain.CurrentDomain.GetAssemblies().Length,
System\Diagnostics\Metrics\StringSequence.netcore.cs (1)
48for (int i = 0; i < _values.Length; i++)
System\Diagnostics\Metrics\TagList.netcore.cs (3)
126else if (_tagsCount == _overflowTags.Length) 161ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)arrayIndex, (uint)array.Length, nameof(arrayIndex)); 190if (_tagsCount == _overflowTags.Length)
System.Diagnostics.Process (18)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (2)
166if (bytesConsumed < bytes.Length) 346if (postSeparatorlineParts.Length < 3)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (4)
152int read = fileStream.Read(bytes, count, bytes.Length - count); 160if (count >= bytes.Length) 162byte[] temp = ArrayPool<byte>.Shared.Rent(bytes.Length * 2); 163Array.Copy(bytes, temp, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (5)
31setUser ? 1 : 0, userId, groupId, pGroups, groups?.Length ?? 0, 38FreeArray(envpPtr, envp.Length); 39FreeArray(argvPtr, argv.Length); 52nuint arrLength = (nuint)arr.Length + 1; // +1 is for null termination 63for (int i = 0; i < arr.Length; i++)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
System\Diagnostics\Process.cs (2)
1100Process[] processes = new Process[processInfos.Length]; 1101for (int i = 0; i < processInfos.Length; i++)
System\Diagnostics\Process.Linux.cs (1)
172_processInfo.HandleCount = Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly).Length;
System\Diagnostics\Process.Unix.cs (1)
1014if (TryGetPasswd(userName, buf, heapBuf.Length, out passwd))
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\DelimitedListTraceListener.cs (1)
149for (int i = 0; i < data.Length; i++)
System\Diagnostics\XmlWriterTraceListener.cs (2)
94WriteEscaped(args != null && args.Length != 0 ? string.Format(CultureInfo.InvariantCulture, format!, args) : format); 136for (int i = 0; i < data.Length; i++)
System.Diagnostics.TraceSource (2)
System\Diagnostics\TraceListeners.cs (1)
90for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
System\Diagnostics\TraceUtils.cs (1)
25for (int i = 0; i < supportedAttributes.Length; i++)
System.Drawing.Common.Tests (96)
DrawingTest.cs (1)
17byte[] hash = new byte[expectedHash.Length];
Helpers.cs (2)
32for (int y = 0; y < colors.Length; y++) 34for (int x = 0; x < colors[y].Length; x++)
mono\System.Drawing.Imaging\JpegCodecTests.cs (1)
69Assert.Equal(256, cp.Entries.Length);
mono\System.Drawing.Imaging\PngCodecTests.cs (2)
50Assert.Equal(2, bmp.Palette.Entries.Length); 360Assert.Equal(16, bmp.Palette.Entries.Length);
mono\System.Drawing\BitmapTests.cs (8)
362StringBuilder sOutput = new(arrInput.Length); 363for (int i = 0; i < arrInput.Length; i++) 827Assert.Equal(2, pal.Entries.Length); 828for (int i = 0; i < pal.Entries.Length; i++) 861Assert.Equal(16, pal.Entries.Length); 862for (int i = 0; i < pal.Entries.Length; i++) 1135Assert.Equal(256, pal.Entries.Length); 1136for (int i = 0; i < pal.Entries.Length; i++)
mono\System.Drawing\GraphicsTests.cs (8)
184Assert.Equal(3, _rects.Length); 1907Assert.Equal(2, regions.Length); 1912Assert.Equal(2, regions.Length); 2027Assert.Equal(3, zero.Length); 2030Assert.Equal(3, small.Length); 2042Assert.Equal(3, max.Length); 2061Assert.Equal(3, min.Length); 2072Assert.Equal(3, neg.Length);
mono\System.Imaging\MetafileTest.cs (2)
319Assert.Equal(2, region.Length); 322Assert.Equal(2, region.Length);
System\Drawing\Drawing2D\GraphicsPathIteratorTests.cs (3)
302AssertExtensions.Throws<ArgumentException>(null, () => gpi.CopyData(ref points, ref types, 0, points.Length)); 338PointF[] resultPoints = new PointF[points.Length]; 339byte[] resultTypes = new byte[points.Length];
System\Drawing\Drawing2D\GraphicsPathTests.cs (18)
544for (int i = 0; i < points.Length - 1; i++) 764Assert.Equal(8, gpi.PathPoints.Length); 765Assert.Equal(8, gpi.PathTypes.Length); 766Assert.Equal(8, gpi.PathData.Points.Length); 769Assert.Equal(8, gpf.PathPoints.Length); 770Assert.Equal(8, gpf.PathTypes.Length); 771Assert.Equal(8, gpf.PathData.Points.Length); 792Assert.Equal(8, gpi.PathPoints.Length); 793Assert.Equal(8, gpi.PathTypes.Length); 794Assert.Equal(8, gpi.PathData.Points.Length); 797Assert.Equal(8, gpf.PathPoints.Length); 798Assert.Equal(8, gpf.PathTypes.Length); 799Assert.Equal(8, gpf.PathData.Points.Length); 844Assert.Equal(13, gpi.PathData.Points.Length); 847Assert.Equal(13, gpf.PathData.Points.Length); 1022int gpiLengthOld = gpi.PathPoints.Length; 1029int pgfLengthOld = gpf.PathPoints.Length; 2341Assert.Equal(expectedPoints.Length, gp.PointCount);
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (5)
240Assert.Equal(brush.Blend.Positions.Length, clone.Blend.Positions.Length); 289Assert.Equal(factors.Length, brush.Blend.Positions.Length); 462Colors = new Color[positions.Length],
System\Drawing\Drawing2D\MatrixTests.cs (3)
822Assert.Equal(expected.Length, actual.Length); 823for (int i = 0; i < expected.Length; i++)
System\Drawing\Drawing2D\PathGradientBrushTests.cs (9)
254int expectedSize = factors.Length; 259Assert.Equal(expectedSize, brush.Blend.Positions.Length); 260if (expectedSize == positions.Length && expectedSize != 1) 383Assert.Equal(256, brush.Blend.Positions.Length); 384Assert.Equal(256, brush.Blend.Factors.Length); 392Assert.Equal(256, brush.Blend.Positions.Length); 393Assert.Equal(256, brush.Blend.Factors.Length); 401Assert.Equal(511, brush.Blend.Positions.Length); 402Assert.Equal(511, brush.Blend.Factors.Length);
System\Drawing\FontFamilyTests.cs (3)
104Assert.Equal(families.Length, familiesWithGraphics.Length); 106for (int i = 0; i < families.Length; i++)
System\Drawing\Graphics_GetContextTests.cs (1)
19Assert.Equal(2, infoArray.Length);
System\Drawing\IconTests.cs (1)
212stream.Write(bytes, 0, bytes.Length);
System\Drawing\ImageTests.cs (15)
41Assert.Equal(3, items.Length); 233item.Len = item.Value.Length; 248item.Len = item.Value.Length; 254Assert.Equal(2, items.Length); 269Assert.Equal(2, items.Length); 291item.Len = item.Value.Length; 297Assert.Equal(3, items.Length); 334item.Len = item.Value.Length; 340Assert.Equal(4, items.Length); 383Assert.Equal(4, items.Length); 434item.Len = item.Value.Length; 449item.Len = item.Value.Length; 455Assert.Equal(2, items.Length); 470Assert.Equal(2, items.Length); 548stream.Write(bytes, 0, bytes.Length);
System\Drawing\Imaging\EncoderParameterTests.cs (7)
118CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeByte, value.Length); 127CheckEncoderParameter(ep, s_anyEncoder, expected, value.Length); 136CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeShort, value.Length); 145CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeLong, value.Length); 153CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeRational, numerator.Length); 161CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeLongRange, rangeBegin.Length); 169CheckEncoderParameter(ep, s_anyEncoder, EncoderParameterValueType.ValueTypeRationalRange, numerator1.Length);
System\Drawing\Imaging\ImageCodecInfoTests.cs (2)
103Assert.Equal(signatureLength, codecInfo.SignatureMasks.Length); 110Assert.Equal(signatureLength, codecInfo.SignaturePatterns.Length);
System\Drawing\Text\PrivateFontCollectionTests.cs (5)
140IntPtr fontBuffer = Marshal.AllocCoTaskMem(data.Length); 143Marshal.Copy(data, 0, fontBuffer, data.Length); 144fontCollection.AddMemoryFont(fontBuffer, data.Length); 176IntPtr fontBuffer = Marshal.AllocCoTaskMem(data.Length); 179Marshal.Copy(data, 0, fontBuffer, data.Length);
System.Formats.Asn1 (10)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
System\Formats\Asn1\AsnCharacterStringEncodings.cs (5)
115new Span<byte>(bytes, byteIndex, bytes.Length - byteIndex), 150new Span<char>(chars, charIndex, chars.Length - charIndex), 232if (c >= isAllowed.Length) 265if ((uint)c >= (uint)_isAllowed.Length || !_isAllowed[c]) 293if ((uint)b >= (uint)_isAllowed.Length || !_isAllowed[b])
System\Formats\Asn1\AsnDecoder.BitString.cs (1)
297ret[ret.Length - 1] = normalizedLastByte;
System\Formats\Asn1\AsnDecoder.Oid.cs (2)
180Array.Clear(tmpBytes, 0, tmpBytes.Length); 212int bytesWritten = tmpBytes.Length - writeSpan.Length;
System\Formats\Asn1\AsnWriter.Boolean.cs (1)
35Debug.Assert(_offset < _buffer.Length);
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.cs (1)
238int currentCapacity = _buffer.Length;
System.Formats.Nrbf (12)
System\Formats\Nrbf\ArrayOfClassesRecord.cs (1)
68Debug.Assert(resultIndex == result.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
65Debug.Assert(valueIndex == values.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (2)
180for (int i = 0; i < booleans.Length; i++) 206for (int i = 0; i < values.Length; i++)
System\Formats\Nrbf\ArraySingleStringRecord.cs (1)
87Debug.Assert(valueIndex == values.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\BinaryArrayRecord.cs (2)
138Debug.Assert(resultIndex == array.Length, "We should have traversed the entirety of the newly created array."); 164for (int i = 0; i < lengths.Length; i++)
System\Formats\Nrbf\NrbfDecoder.cs (2)
74while (offset < buffer.Length) 76int read = stream.Read(buffer, offset, buffer.Length - offset);
System\Formats\Nrbf\SerializationRecord.cs (2)
131if (genericNames.Length != genericTypes.Length) 136for (int i = 0; i < genericTypes.Length; i++)
System\Formats\Nrbf\Utils\BinaryReaderExtensions.cs (1)
142if (result.Length != count)
System.Formats.Tar (3)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
17if (buffer.Length < min) 19int newCapacity = buffer.Length * 2;
System.IO.Compression (58)
System\IO\Compression\Crc32Helper.ZLib.cs (1)
14Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0) && (offset <= buffer.Length - length));
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (3)
125int bytes = _stream!.Read(_buffer, 0, _buffer.Length); 130else if (bytes > _buffer.Length) 217else if (bytesRead > _buffer.Length)
System\IO\Compression\DeflateManaged\HuffmanTree.cs (9)
49codeLengths.Length == MaxLiteralTreeElements || 50codeLengths.Length == MaxDistTreeElements || 51codeLengths.Length == NumberOfCodeLengthTreeElements, 55if (_codeLengthArray.Length == MaxLiteralTreeElements) 71_left = new short[2 * _codeLengthArray.Length]; 72_right = new short[2 * _codeLengthArray.Length]; 135for (int i = 0; i < _codeLengthArray.Length; i++) 155short avail = (short)_codeLengthArray.Length; 157for (int ch = 0; ch < _codeLengthArray.Length; ch++)
System\IO\Compression\DeflateManaged\InputBuffer.cs (2)
166Debug.Assert(offset <= output.Length - length); 205Debug.Assert(offset <= buffer.Length - length);
System\IO\Compression\DeflateZLib\Deflater.cs (5)
139Debug.Assert(outputBuffer?.Length > 0); 146_zlibStream.AvailOut = (uint)outputBuffer.Length; 149bytesRead = outputBuffer.Length - (int)_zlibStream.AvailOut; 159Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 171Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!");
System\IO\Compression\DeflateZLib\DeflateStream.cs (10)
314int n = _stream.Read(_buffer, 0, _buffer.Length); 328else if (n > _buffer.Length) 459int n = await _stream.ReadAsync(new Memory<byte>(_buffer, 0, _buffer.Length), cancellationToken).ConfigureAwait(false); 473else if (n > _buffer.Length) 940int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length); 953await _deflateStream._stream.CopyToAsync(this, _arrayPoolBuffer.Length, _cancellationToken).ConfigureAwait(false); 976int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length); 989_deflateStream._stream.CopyTo(this, _arrayPoolBuffer.Length); 1010else if (count > buffer.Length - offset) 1059else if (count > buffer.Length - offset)
System\IO\Compression\DeflateZLib\Inflater.cs (1)
187Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length);
System\IO\Compression\ZipArchiveEntry.cs (14)
143if (_storedEntryNameBytes.Length > ushort.MaxValue) 476Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 549writer.Write((ushort)_storedEntryNameBytes.Length); // File Name Length (2 bytes) 552Debug.Assert(_fileComment.Length <= ushort.MaxValue); 554writer.Write((ushort)_fileComment.Length); 568if (_fileComment.Length > 0) 594for (int i = 0; i < _compressedBytes.Length - 1; i++) 598_compressedBytes[_compressedBytes.Length - 1] = new byte[_compressedSize % MaxSingleBufferSize]; 602for (int i = 0; i < _compressedBytes.Length - 1; i++) 606ZipHelper.ReadBytes(_archive.ArchiveStream, _compressedBytes[_compressedBytes.Length - 1], (int)(_compressedSize % MaxSingleBufferSize)); 865Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 950writer.Write((ushort)_storedEntryNameBytes.Length); 1000_archive.ArchiveStream.Write(compressedBytes, 0, compressedBytes.Length); 1075+ _storedEntryNameBytes.Length + Zip64ExtraField.OffsetToFirstField,
System\IO\Compression\ZipBlocks.cs (3)
601Debug.Assert(archiveComment.Length <= ZipFileCommentMaxLength); 603writer.Write((ushort)archiveComment.Length); // zip file comment length 604if (archiveComment.Length > 0)
System\IO\Compression\ZipHelper.cs (10)
123Debug.Assert(bufferPointer < buffer.Length); 138bytesRead += buffer.Length; 162int numBytesToSkip = (int)Math.Min(numBytesLeft, buffer.Length); 174if (stream.Position >= buffer.Length) 176stream.Seek(-buffer.Length, SeekOrigin.Current); 177ReadBytes(stream, buffer, buffer.Length); 178stream.Seek(-buffer.Length, SeekOrigin.Current); 179bufferPointer = buffer.Length - 1; 229Debug.Assert(totalCodePoints <= bytes.Length); 235return maxBytes < bytes.Length ? bytes[0..maxBytes] : bytes;
System.IO.Compression.Brotli (3)
System\IO\Compression\dec\BrotliStream.Decompress.cs (3)
66int bytesRead = _stream.Read(_buffer, _bufferCount, _buffer.Length - _bufferCount); 77if (_bufferCount > _buffer.Length) 165if (_bufferCount > _buffer.Length)
System.IO.Compression.ZipFile (2)
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
17if (buffer.Length < min) 19int newCapacity = buffer.Length * 2;
System.IO.FileSystem.DriveInfo (2)
System\IO\DriveInfo.UnixOrDefault.cs (2)
16DriveInfo[] info = new DriveInfo[mountPoints.Length]; 17for (int i = 0; i < info.Length; i++)
System.IO.FileSystem.Watcher (11)
System\IO\FileSystemWatcher.cs (5)
395if (filters.Length == 0) 727ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)index, (uint)items.Length, nameof(index)); 738public int Count => Items.Length; 761string[] newItems = new string[items.Length + 1]; 777string[] newItems = new string[items.Length - 1];
System\IO\FileSystemWatcher.Linux.cs (6)
286Debug.Assert(_buffer != null && _buffer.Length > (c_INotifyEventSize + NAME_MAX + 1)); 789Debug.Assert(_buffer.Length > 0); 790Debug.Assert(_bufferAvailable >= 0 && _bufferAvailable <= _buffer.Length); 804_bufferAvailable = Interop.CheckIo(Interop.Sys.Read(_inotifyHandle, buf, this._buffer.Length)); 805Debug.Assert(_bufferAvailable <= this._buffer.Length); 856Debug.Assert(nameLength >= 0 && (position + nameLength) <= _buffer.Length);
System.IO.IsolatedStorage (9)
src\libraries\Common\src\System\Security\IdentityHelper.cs (3)
37if (publicKey == null || publicKey.Length == 0) 79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 84l = buff.Length;
System\IO\IsolatedStorage\IsolatedStorageFile.cs (6)
693if (dirs.Length > 1 || (dirs.Length > 0 && !IsMatchingScopeDirectory(dirs[0]))) 699if (files.Length == 0) 707return ((files.Length > 1) || !IsIdFile(files[0])); 709return (files.Length > 2 || 712(files.Length == 2 && !IsIdFile(files[1]) && !IsInfoFile(files[1]))
System.IO.Packaging (14)
System\IO\Packaging\InterleavedZipPackagePartStream.cs (2)
555int bytesToRead = remainingBytes < readBuffer.Length ? (int)remainingBytes : readBuffer.Length;
System\IO\Packaging\Package.cs (4)
417Dictionary<string, KeyValuePair<PackUriHelper.ValidatedPartUri, PackagePart>> partDictionary = new(parts.Length); 418List<string> partIndex = new(parts.Length); 420for (int i = 0; i < parts.Length; i++) 1075for (int i = 0; i < partKeys.Length; i++)
System\IO\Packaging\PackUriHelper.cs (8)
813Debug.Assert(segments.Length > 0 && segments[0].Length == 0); 816Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension); 820if ((segments.Length >= 3) && 821(segments[segments.Length - 1].Length > RelationshipPartExtensionName.Length)) 824result = segments[segments.Length - 2] == RelationshipPartUpperCaseSegmentName; 829if (segments.Length > 3 && result) 831if ((segments[segments.Length - 1]).EndsWith(RelsrelsUpperCaseExtension, StringComparison.Ordinal)) 834if (segments[segments.Length - 3] == RelationshipPartUpperCaseSegmentName)
System.IO.Pipelines (3)
System\IO\Pipelines\BufferSegmentStack.cs (3)
30if ((uint)size >= (uint)array.Length) 48if ((uint)size < (uint)array.Length) 63Array.Resize(ref _array, 2 * _array.Length);
System.IO.Pipes (1)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
System.IO.Ports (26)
System\IO\Ports\SerialPort.cs (25)
631if (buffer.Length - offset < count) 772if (buffer.Length - offset < count) 784Debug.Assert(buffer.Length - offset >= count, "invalid offset/count!"); 914Debug.Assert((buffer.Length - offset - totalCharsFound) >= currentCharsFound, "internal buffer to read one full unicode char sequence is not sufficient!"); 967_internalSerialStream.ReadExactly(bytesReceived, CachedBytesToRead, bytesReceived.Length - CachedBytesToRead); // get everything 989int numCharsReceived = localDecoder.GetCharCount(bytesReceived, 0, bytesReceived.Length); 990int lastFullCharIndex = bytesReceived.Length; 994Buffer.BlockCopy(bytesReceived, 0, _inBuffer, 0, bytesReceived.Length); // put it all back! 997_readLen = bytesReceived.Length; 1008_readLen = bytesReceived.Length - (lastFullCharIndex + 1); 1010Buffer.BlockCopy(bytesReceived, lastFullCharIndex + 1, _inBuffer, 0, bytesReceived.Length - (lastFullCharIndex + 1)); 1109if (readBuffer.Length > 0) 1120MaybeResizeBuffer(readBuffer.Length + bytesToSave); 1122Buffer.BlockCopy(readBuffer, 0, _inBuffer, _readLen, readBuffer.Length); 1123_readLen += readBuffer.Length; 1148_internalSerialStream.Write(bytesToWrite, 0, bytesToWrite.Length, _writeTimeout); 1163if (buffer.Length - offset < count) 1166if (buffer.Length == 0) return; 1169Write(byteArray, 0, byteArray.Length); 1183if (buffer.Length - offset < count) 1185if (buffer.Length == 0) return; 1284if (additionalByteLength + _readLen <= _inBuffer.Length) 1288if (CachedBytesToRead + additionalByteLength <= _inBuffer.Length / 2) 1293int newLength = Math.Max(CachedBytesToRead + additionalByteLength, _inBuffer.Length * 2); 1295Debug.Assert(_inBuffer.Length >= _readLen, "ResizeBuffer - readLen > inBuffer.Length");
System\IO\Ports\SerialStream.cs (1)
99if (array.Length - offset < count)
System.Linq (82)
System\Linq\AppendPrepend.SpeedOpt.cs (1)
247index = array.Length;
System\Linq\Chunk.cs (10)
53return array.Length != 0 ? 64while (index < source.Length) 66TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 67index += chunk.Length; 92if (size != array.Length) 97if (i >= array.Length) 99arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 111Debug.Assert(local.Length == size); 112for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 118if (i != array.Length)
System\Linq\Concat.SpeedOpt.cs (2)
79secondCollection.CopyTo(result, result.Length - secondCount); 236int arrayIndex = array.Length; // We start copying in collection-sized chunks from the end of the array.
System\Linq\DebugView.cs (1)
40if (array.Length == 0)
System\Linq\DefaultIfEmpty.cs (1)
21if (source is TSource[] { Length: > 0 })
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
16return array.Length == 0 ? [_default] : array;
System\Linq\Enumerable.cs (1)
25source is TSource[] { Length: 0 };
System\Linq\Grouping.cs (2)
372if (_elements.Length == _count) 383if (_elements.Length != _count)
System\Linq\Lookup.cs (6)
207for (Grouping<TKey, TElement>? g = _groupings[(uint)hashCode % _groupings.Length]; g is not null; g = g._hashNext) 217if (_count == _groupings.Length) 222int index = hashCode % _groupings.Length; 270ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length); 271ArgumentOutOfRangeException.ThrowIfLessThan(array.Length - arrayIndex, Count, nameof(arrayIndex)); 318ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length);
System\Linq\OrderedEnumerable.cs (11)
18private protected int[] SortedMap(TElement[] buffer) => GetEnumerableSorter().Sort(buffer, buffer.Length); 21GetEnumerableSorter().Sort(buffer, buffer.Length, minIdx, maxIdx); 132Debug.Assert(_map.Length == _buffer.Length); 136if ((uint)i < (uint)map.Length) 146if (buffer.Length != 0) 207if ((uint)i < (uint)buffer.Length) 217if (buffer.Length != 0) 405for (int i = 0; i < keys.Length; i++) 516while (i < map.Length && CompareKeys(x, map[i]) > 0) 586while (i < map.Length && CompareKeys(x, map[i]) > 0)
System\Linq\OrderedEnumerable.SpeedOpt.cs (21)
18if (buffer.Length <= 1) 23TElement[] array = new TElement[buffer.Length]; 32List<TElement> list = new(buffer.Length); 33if (buffer.Length >= 2) 35Fill(buffer, SetCountAndGetSpan(list, buffer.Length)); 37else if (buffer.Length == 1) 67if (buffer.Length <= minIdx) 72if (buffer.Length <= maxIdx) 74maxIdx = buffer.Length - 1; 79return [GetEnumerableSorter().ElementAt(buffer, buffer.Length, minIdx)]; 92if (buffer.Length <= minIdx) 97if (buffer.Length <= maxIdx) 99maxIdx = buffer.Length - 1; 104return new List<TElement>(1) { GetEnumerableSorter().ElementAt(buffer, buffer.Length, minIdx) }; 154if (index < buffer.Length) 157return GetEnumerableSorter().ElementAt(buffer, buffer.Length, index); 222if (minIdx < buffer.Length) 225return (maxIdx < buffer.Length - 1) ? 226GetEnumerableSorter().ElementAt(buffer, buffer.Length, maxIdx) : 241for (int i = 1; i < items.Length; ++i) 483int count = buffer.Length;
System\Linq\Reverse.cs (2)
33if (source.Length == 0) 79_state = buffer.Length + 2;
System\Linq\Reverse.SpeedOpt.cs (2)
45if (index < array.Length) 48return array[array.Length - index - 1];
System\Linq\Select.cs (4)
35if (array.Length == 0) 163Debug.Assert(source.Length > 0); // Caller should check this beforehand and return a cached result 168private int CountForDebugger => _source.Length; 176if ((uint)index < (uint)source.Length)
System\Linq\Select.SpeedOpt.cs (11)
144Debug.Assert(source.Length > 0); 146var results = new TResult[source.Length]; 155Debug.Assert(source.Length > 0); 157var results = new List<TResult>(source.Length); 158Fill(source, SetCountAndGetSpan(results, source.Length), _selector); 184return _source.Length; 190if (count >= _source.Length) 201return count >= _source.Length ? 209if ((uint)index < (uint)source.Length) 221Debug.Assert(_source.Length > 0); // See assert in constructor 229Debug.Assert(_source.Length > 0); // See assert in constructor
System\Linq\Where.cs (5)
31if (array.Length == 0) 160Debug.Assert(source is not null && source.Length > 0); 174while ((uint)index < (uint)source.Length) 263Debug.Assert(source is not null && source.Length > 0); 279while ((uint)index < (uint)source.Length)
System\Linq\Where.SpeedOpt.cs (1)
245for (int i = source.Length - 1; i >= 0; i--)
System.Linq.Expressions (301)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
System\Dynamic\BinaryOperationBinder.cs (1)
66ContractUtils.Requires(args.Length == 1, nameof(args));
System\Dynamic\ConvertBinder.cs (1)
66ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\DeleteMemberBinder.cs (1)
71ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\DynamicMetaObject.cs (2)
258Expression[] res = new Expression[objects.Length]; 259for (int i = 0; i < objects.Length; i++)
System\Dynamic\DynamicMetaObjectBinder.cs (5)
55ArgumentOutOfRangeException.ThrowIfZero(args.Length); 57ArgumentOutOfRangeException.ThrowIfNotEqual(args.Length, parameters.Count); 140if (args.Length != 1) 142mos = new DynamicMetaObject[args.Length - 1]; 143for (int i = 1; i < args.Length; i++)
System\Dynamic\DynamicObject.cs (3)
443var paramArgs = new Expression[args.Length]; 445for (int i = 0; i < args.Length; i++) 461for (int i = 0; i < args.Length; i++)
System\Dynamic\ExpandoClass.cs (6)
68if (string.Equals(klass._keys[klass._keys.Length - 1], newKey, StringComparison.Ordinal)) 76string[] keys = new string[_keys.Length + 1]; 77Array.Copy(_keys, keys, _keys.Length); 78keys[_keys.Length] = newKey; 123for (int i = 0; i < _keys.Length; i++) 153for (int i = _keys.Length - 1; i >= 0; i--)
System\Dynamic\ExpandoObject.cs (15)
405for (int i = 0; i < data.Class.Keys.Length; i++) 437for (int i = 0, n = _expandoData.Class.Keys.Length; i < n; i++) 534for (int i = 0; i < data.Class.Keys.Length; i++) 555for (int i = 0; i < data.Class.Keys.Length; i++) 588for (int i = 0; i < data.Class.Keys.Length; i++) 693for (int i = 0, n = data.Class.Keys.Length; i < n; i++) 753for (int i = 0; i < data.Class.Keys.Length; i++) 907for (int i = 0; i < klass.Keys.Length; i++) 1064internal int Length => _dataArray.Length; 1095if (_dataArray.Length >= newClass.Keys.Length) 1098this[newClass.Keys.Length - 1] = ExpandoObject.Uninitialized; 1104int oldLength = _dataArray.Length; 1105object[] arr = new object[GetAlignedSize(newClass.Keys.Length)]; 1106Array.Copy(_dataArray, arr, _dataArray.Length);
System\Dynamic\GetMemberBinder.cs (1)
71ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\SetIndexBinder.cs (2)
46ContractUtils.Requires(args.Length >= 2, nameof(args)); 48DynamicMetaObject value = args[args.Length - 1];
System\Dynamic\SetMemberBinder.cs (1)
54ContractUtils.Requires(args.Length == 1, nameof(args));
System\Dynamic\UnaryOperationBinder.cs (1)
76ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\UpdateDelegates.Generated.cs (40)
35for (int i = 0; i < applicable.Length; i++) 73for (int i = 0; i < applicable.Length; i++) 181for (int i = 0; i < applicable.Length; i++) 219for (int i = 0; i < applicable.Length; i++) 327for (int i = 0; i < applicable.Length; i++) 365for (int i = 0; i < applicable.Length; i++) 473for (int i = 0; i < applicable.Length; i++) 511for (int i = 0; i < applicable.Length; i++) 619for (int i = 0; i < applicable.Length; i++) 657for (int i = 0; i < applicable.Length; i++) 765for (int i = 0; i < applicable.Length; i++) 803for (int i = 0; i < applicable.Length; i++) 911for (int i = 0; i < applicable.Length; i++) 949for (int i = 0; i < applicable.Length; i++) 1057for (int i = 0; i < applicable.Length; i++) 1095for (int i = 0; i < applicable.Length; i++) 1203for (int i = 0; i < applicable.Length; i++) 1241for (int i = 0; i < applicable.Length; i++) 1349for (int i = 0; i < applicable.Length; i++) 1387for (int i = 0; i < applicable.Length; i++) 1494for (int i = 0; i < applicable.Length; i++) 1532for (int i = 0; i < applicable.Length; i++) 1639for (int i = 0; i < applicable.Length; i++) 1677for (int i = 0; i < applicable.Length; i++) 1784for (int i = 0; i < applicable.Length; i++) 1822for (int i = 0; i < applicable.Length; i++) 1929for (int i = 0; i < applicable.Length; i++) 1967for (int i = 0; i < applicable.Length; i++) 2074for (int i = 0; i < applicable.Length; i++) 2112for (int i = 0; i < applicable.Length; i++) 2219for (int i = 0; i < applicable.Length; i++) 2257for (int i = 0; i < applicable.Length; i++) 2364for (int i = 0; i < applicable.Length; i++) 2402for (int i = 0; i < applicable.Length; i++) 2509for (int i = 0; i < applicable.Length; i++) 2547for (int i = 0; i < applicable.Length; i++) 2654for (int i = 0; i < applicable.Length; i++) 2692for (int i = 0; i < applicable.Length; i++) 2799for (int i = 0; i < applicable.Length; i++) 2837for (int i = 0; i < applicable.Length; i++)
System\Dynamic\Utils\CollectionExtensions.cs (8)
23T[] res = new T[array.Length + 1]; 31T[] res = new T[array.Length + 1]; 33res[array.Length] = item; 39T[] result = new T[array.Length - 1]; 40Array.Copy(array, 1, result, 0, result.Length); 46T[] result = new T[array.Length - 1]; 47Array.Copy(array, result, result.Length); 73if (array.Length != 0)
System\Dynamic\Utils\DelegateHelpers.cs (13)
132if (parameters.Length > 2) 151int thunkTypeArgCount = parameters.Length; 156for (int i = 0; i < parameters.Length; i++) 165thunkTypeArgs[thunkTypeArgs.Length - 1] = returnType; 166uninstantiatedMethod = s_FuncThunks[parameters.Length]; 170uninstantiatedMethod = s_ActionThunks[parameters.Length]; 173return (thunkTypeArgs.Length > 0) ? 234Type[] paramTypes = new Type[parameters.Length + 1]; 246for (int i = 0; i < parameters.Length; i++) 261if (parameters.Length == 0) 267ilgen.Emit(OpCodes.Ldc_I4, parameters.Length); 274for (int i = 0; i < parameters.Length; i++) 315for (int i = 0; i < parameters.Length; i++)
System\Dynamic\Utils\ExpressionUtils.cs (2)
109for (int i = 0, n = pis.Length; i < n; i++) 136if (pis.Length != count)
System\Dynamic\Utils\ListArgumentProvider.cs (1)
98if (index + n > array.Length)
System\Dynamic\Utils\TypeExtensions.cs (3)
49if (ps.Length != argTypes.Length) 54for (int i = 0; i < ps.Length; i++)
System\Dynamic\Utils\TypeUtils.cs (8)
448if (destParams.Length != 1) 475if (sourceParams.Length != 1) 550Debug.Assert(genericParameters.Length == sourceArguments.Length); 551Debug.Assert(genericParameters.Length == destArguments.Length); 553for (int iParam = 0; iParam < genericParameters.Length; ++iParam) 728if (pis.Length == 1 && AreEquivalent(pis[0].ParameterType, typeFrom))
System\Linq\Expressions\BinaryExpression.cs (7)
636if (pms.Length != 2) 803if (pms.Length != 2) 846if (pmsOpTrue.Length != 1) 1400Debug.Assert(pms.Length == conversion.ParameterCount); 1401if (pms.Length != 1) 1552Debug.Assert(pms.Length == conversion.ParameterCount); 1553if (pms.Length != 1)
System\Linq\Expressions\BlockExpression.cs (8)
242Debug.Assert(args.Length == 2); 308Debug.Assert(args.Length == 3); 380Debug.Assert(args.Length == 4); 458Debug.Assert(args.Length == 5); 594Debug.Assert(args.Length == 1); 633Debug.Assert(args.Length == ExpressionCount); 658Debug.Assert(args.Length == ExpressionCount); 771if (index + n > array.Length)
System\Linq\Expressions\Compiler\DelegateHelpers.cs (6)
68for (int i = 0; i < args.Length; i++) 87Type[] paramTypes = new Type[args.Length + 2]; 89paramTypes[paramTypes.Length - 1] = returnType; 90for (int i = 0; i < args.Length; i++) 117Type returnType = types[types.Length - 1]; 125TypeBuilder builder = AssemblyGen.DefineDelegateType("Delegate" + types.Length);
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (11)
26for (int i = 0; i < types.Length; i++) 100if (types.Length < 3 || types[0].IsByRef || types[1] != typeof(object) || types[types.Length - 1] != typeof(object)) 106for (int i = 2; i < types.Length - 2; ++i) 115switch (types.Length - 1) 136Debug.Assert(types != null && types.Length > 0); 142if (types.Length > MaximumArity) 150for (int i = 0; i < types.Length; i++) 174if (types[types.Length - 1] == typeof(void)) 190switch (types.Length) 235switch (types.Length)
System\Linq\Expressions\Compiler\ILGen.cs (1)
962for (int i = 0; i < types.Length; i++)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (4)
516Debug.Assert(args.ArgumentCount + skipParameters == pis.Length); 519for (int i = skipParameters, n = pis.Length; i < n; i++) 1129for (int i = 0, n = paramList.Length; i < n; i++) 1215for (int i = 0, n = paramList.Length; i < n; i++)
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (1)
624Debug.Assert(slot == jmpLabels.Length);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (1)
309Debug.Assert(pis != null && pis.Length == 1);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (5)
335for (int i = 0, n = parameters.Length; i < n; i++) 353_byRefs ??= new bool[_expressions.Length]; 408index += _expressions.Length; 442last += _expressions.Length; 448if (count == _expressions.Length)
System\Linq\Expressions\Compiler\TypeInfoExtensions.cs (1)
25paramTypes[paramTypes.Length - 1] = retType;
System\Linq\Expressions\DynamicExpression.cs (6)
516Debug.Assert(args.Length == ((IArgumentProvider)this).ArgumentCount); 574Debug.Assert(args.Length == 1); 643Debug.Assert(args.Length == 2); 718Debug.Assert(args.Length == 3); 799Debug.Assert(args.Length == 4); 1016if (pi.Length == 0 || pi[0].ParameterType != typeof(CallSite)) throw Error.FirstArgumentMustBeCallSite();
System\Linq\Expressions\ElementInit.cs (1)
106if (pis.Length == 0)
System\Linq\Expressions\IndexExpression.cs (16)
123Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 242if (arguments == null || arguments.Length == 0) 258for (int i = 0; i < arguments.Length; i++) 314if (parms.Length == 0) 323return parms.Length == 0; 326if (parms.Length != args.Length) 328for (int i = 0; i < args.Length; i++) 408if (setParameters.Length == 0) 414Type valueType = setParameters[setParameters.Length - 1].ParameterType; 434if (getParameters!.Length != setParameters.Length - 1) 439for (int i = 0; i < getParameters.Length; i++) 491if (indexes.Length > 0) 493if (indexes.Length != arguments.Count) 498for (int i = 0, n = indexes.Length; i < n; i++)
System\Linq\Expressions\Interpreter\ArrayOperations.cs (1)
149frame.Push(((Array)obj).Length);
System\Linq\Expressions\Interpreter\CallInstruction.cs (6)
38int argumentCount = parameters.Length; 184if (index < pi.Length) 190if (target.ReturnType == typeof(void) || index > pi.Length) 202return pi.Length != index || (pi.Length == index && !target.IsStatic); 361for (int i = 0; i < args.Length; i++)
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
137Debug.Assert(pi.Length == 2); 169switch (arrTypes.Length) 192switch (arrTypes.Length)
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (1)
29if (cache != null && offset >= 0 && offset < cache.Length)
System\Linq\Expressions\Interpreter\InstructionList.cs (16)
378if (_objects.Count < s_loadObjectCached!.Length) 432if (index < s_loadLocal.Length) 451if (index < s_loadLocalBoxed.Length) 465if (index < s_loadLocalFromClosure.Length) 479if (index < s_loadLocalFromClosureBoxed.Length) 493if (index < s_assignLocal.Length) 507if (index < s_storeLocal.Length) 526if (index < s_assignLocalBoxed.Length) 545if (index < s_storeLocalBoxed.Length) 559if (index < s_assignLocalToClosure.Length) 794Emit(new NewInstruction(constructorInfo, parameters.Length)); 799Emit(new ByRefNewInstruction(constructorInfo, parameters.Length, updaters)); 902Emit(new ByRefMethodInfoCallInstruction(method, method.IsStatic ? parameters.Length : parameters.Length + 1, byrefArgs)); 907Emit(NullableMethodCallInstruction.Create(method.Name, parameters.Length, method)); 932result[result.Length - 1] = new RuntimeLabel(Interpreter.RethrowOnReturn, 0, 0);
System\Linq\Expressions\Interpreter\Interpreter.cs (1)
60while (index < instructions.Length)
System\Linq\Expressions\Interpreter\LightCompiler.cs (7)
1043Debug.Assert(parameters.Length == 1); 2154Debug.Assert(parameters.Length == arguments.ArgumentCount); 2395for (int i = 0; i < parameters.Length; i++) 3262var args = new object?[_args.Length + 1]; 3263for (int i = 0; i < args.Length - 1; i++) 3267args[args.Length - 1] = value; 3289for (int i = 0; i < _args.Length; i++)
System\Linq\Expressions\Interpreter\LightLambda.cs (6)
145for (int i = 0; i < instructions.Length; i++) 173EmitExits(sb, instructions.Length); 409for (int i = 0; i < arguments.Length; i++) 420for (int i = 0; i < arguments.Length; i++) 433for (int i = 0; i < arguments.Length; i++) 444for (int i = 0; i < arguments.Length; i++)
System\Linq\Expressions\Interpreter\LocalAccess.cs (1)
468for (int i = ret.Length - 1; i >= 0; i--)
System\Linq\Expressions\Interpreter\NewInstruction.cs (1)
54for (int i = 0; i < args.Length; i++)
System\Linq\Expressions\Interpreter\RuntimeVariables.cs (1)
17int IRuntimeVariables.Count => _boxes.Length;
System\Linq\Expressions\Interpreter\TypeOperations.cs (2)
32for (int i = closure.Length - 1; i >= 0; i--) 581for (int i = 0; i < indexes.Length; i++)
System\Linq\Expressions\Interpreter\Utilities.cs (6)
186for (int i = 0; i < _keysAndValues.Length; i++) 209for (int i = 0; i < _keysAndValues.Length; i++) 232for (int i = 0; i < keysAndValues.Length; i++) 258for (int i = 0; i < _keysAndValues.Length; i++) 296for (int i = 0; i < _keysAndValues.Length; i++) 322for (int i = 0; i < _keysAndValues.Length; i++)
System\Linq\Expressions\InvocationExpression.cs (7)
147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 175Debug.Assert(arguments == null || arguments.Length == 0); 208Debug.Assert(arguments == null || arguments.Length == 1); 248Debug.Assert(arguments == null || arguments.Length == 2); 291Debug.Assert(arguments == null || arguments.Length == 3); 337Debug.Assert(arguments == null || arguments.Length == 4); 386Debug.Assert(arguments == null || arguments.Length == 5);
System\Linq\Expressions\LambdaExpression.cs (9)
378Debug.Assert(parameters == null || parameters.Length == 0); 422Debug.Assert(parameters == null || parameters.Length == 1); 484Debug.Assert(parameters == null || parameters.Length == 2); 552Debug.Assert(parameters == null || parameters.Length == 3); 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count); 938if (pis.Length > 0) 940if (pis.Length != parameters.Count) 945for (int i = 0, n = pis.Length; i < n; i++) 998for (int i = 0; i < typeArgs.Length; i++)
System\Linq\Expressions\MemberExpression.cs (2)
264else if (mi.GetParametersCached().Length != 1) 269else if (mi.GetParametersCached().Length != 0)
System\Linq\Expressions\MethodCallExpression.cs (7)
1331if (typeArgs != null && typeArgs.Length > 0) 1350if (parms.Length != arguments.Length) 1352for (int i = 0; i < arguments.Length; i++) 1375if (typeArgs == null || typeArgs.Length == 0) 1382if (m.IsGenericMethodDefinition && m.GetGenericArguments().Length == typeArgs.Length)
System\Linq\Expressions\NewExpression.cs (3)
207ConstructorInfo? ci = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).SingleOrDefault(c => c.GetParametersCached().Length == 0); 223if ((pis = constructor.GetParametersCached()).Length > 0) 225if (arguments.Count != pis.Length)
System\Linq\Expressions\SwitchExpression.cs (1)
201if (pms.Length != 2)
System\Linq\Expressions\UnaryExpression.cs (5)
262Debug.Assert(i == temps.Length); 268Debug.Assert(i == temps.Length); 271Debug.Assert(i == block.Length); 385if (pms.Length != 1) 431if (pms.Length != 1)
System\Runtime\CompilerServices\CallSite.cs (13)
250if (rules.Length < (MaxRules - 1)) 252temp = new T[rules.Length + 1]; 253Array.Copy(rules, 0, temp, 1, rules.Length); 272if (i < rules.Length) 311method = typeof(UpdateDelegates).GetMethod("UpdateAndExecuteVoid" + args.Length, BindingFlags.NonPublic | BindingFlags.Static); 312noMatchMethod = typeof(UpdateDelegates).GetMethod("NoMatchVoid" + args.Length, BindingFlags.NonPublic | BindingFlags.Static); 319method = typeof(UpdateDelegates).GetMethod("UpdateAndExecute" + (args.Length - 1), BindingFlags.NonPublic | BindingFlags.Static); 320noMatchMethod = typeof(UpdateDelegates).GetMethod("NoMatch" + (args.Length - 1), BindingFlags.NonPublic | BindingFlags.Static); 337ContractUtils.Requires(pis.Length > 0 && pis[0].ParameterType == typeof(CallSite), nameof(T)); 339Type[] args = new Type[invoke.ReturnType != typeof(void) ? pis.Length : pis.Length - 1]; 342for (int i = 1; i < pis.Length; i++) 353args[args.Length - 1] = invoke.ReturnType;
System\Runtime\CompilerServices\CallSiteBinder.cs (2)
65var @params = new ParameterExpression[pis.Length - 1]; 66for (int i = 0; i < @params.Length; i++)
System\Runtime\CompilerServices\ReadOnlyCollectionBuilder.cs (8)
79get { return _items.Length; } 84if (value != _items.Length) 129if (_size == _items.Length) 192if (_size == _items.Length) 415if (_size == _items.Length) 432if (_items.Length < min) 435if (_items.Length > 0) 437newCapacity = _items.Length * 2;
System\Runtime\CompilerServices\RuleCache.cs (4)
40int count = _rules.Length - i; 47int max = Math.Min(_rules.Length, i + count); 81if (rules.Length < InsertPosition) 88int newLength = rules.Length + 1;
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
136for (int i = 0; i < indexes.Length; i++)
System\Runtime\CompilerServices\RuntimeOps.MergedRuntimeVariables.cs (1)
28public int Count => _indexes.Length;
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariableList.cs (1)
83public int Count => _indexes.Length;
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariables.cs (1)
17int IRuntimeVariables.Count => _boxes.Length;
System.Linq.Parallel (97)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (7)
161(consumerIndex == 0 && producerIndex == _buffer.Length - 1); 305Interlocked.Exchange(ref _producerBufferIndex, (bufferIndex + 1) % _buffer.Length); 419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 425if (_consumerChunkIndex == _consumerChunk.Length) 497Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 502if (_consumerChunkIndex == _consumerChunk.Length) 621Interlocked.Exchange(ref _consumerBufferIndex, (consumerBufferIndex + 1) % _buffer.Length);
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (15)
55_done = new bool[_channels.Length]; // Initialized to { false }, i.e. no channels done. 71if (_channelIndex == -1 || _channelIndex == _channels.Length) 98if (index == _channels.Length) 106_channelIndex = (index + 1) % _channels.Length; 127while ((currChannelIndex = _channelIndex) < _channels.Length) 137_channelIndex = (currChannelIndex + 1) % _channels.Length; 170if (++doneChannels == _channels.Length) 173_channelIndex = currChannelIndex = _channels.Length; 179_channelIndex = currChannelIndex = (currChannelIndex + 1) % _channels.Length; 194for (int i = 0; i < _channels.Length; i++) 210if (++doneChannels == _channels.Length) 214_channelIndex = currChannelIndex = _channels.Length; 221if (currChannelIndex == _channels.Length) 252for (int i = 0; i < _channels.Length; i++) 271Debug.Assert(currChannelIndex == _channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (4)
86Debug.Assert(_asyncChannels == null || _asyncChannels.Length == partitions.PartitionCount); 87Debug.Assert(_syncChannels == null || _syncChannels.Length == partitions.PartitionCount); 146for (int i = 0; i < _syncChannels.Length; i++) 154for (int i = 0; i < _syncChannels.Length; i++)
System\Linq\Parallel\Merging\MergeExecutor.cs (2)
166for (int i = 0; i < channels.Length; i++) 193for (int i = 0; i < channels.Length; i++)
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (2)
362for (int i = 0; i < locks.Length; i++) 482int partitionCount = _mergeHelper._buffers.Length;
System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs (3)
59if (_channelIndex == -1 || _channelIndex == _channels.Length) 87while (_channelIndex < _channels.Length) 109Debug.Assert(_channelIndex == _channels.Length);
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (1)
75Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)");
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (1)
77Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)");
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (9)
138Debug.Assert(partitions.Length == partitionCount); 245_elementCount = data.Length; 348int smallerChunkSize = data.Length / partitionCount; 349int biggerChunkCount = data.Length % partitionCount; 627Debug.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length); 641Debug.Assert(0 <= mutables._nextChunkMaxSize && mutables._nextChunkMaxSize <= chunkBuffer.Length); 684if (mutables._nextChunkMaxSize < chunkBuffer.Length) 689if (mutables._nextChunkMaxSize > chunkBuffer.Length) 691mutables._nextChunkMaxSize = chunkBuffer.Length;
System\Linq\Parallel\Partitioning\PartitionedStream.cs (3)
58Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 65Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 79return _partitions.Length;
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (9)
70Debug.Assert(producerWaiting != null && producerWaiting.Length == consumerWaiting.Length); 71Debug.Assert(producerDone != null && producerDone.Length == consumerWaiting.Length); 72Debug.Assert(buffers != null && buffers.Length == consumerWaiting.Length); 73Debug.Assert(partitionIndex >= 0 && partitionIndex < consumerWaiting.Length); 155Debug.Assert(producerDone != null && producerDone.Length == partitions.PartitionCount); 156Debug.Assert(buffers != null && buffers.Length == partitions.PartitionCount);
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
115for (int i = 0; i < sortHelpers.Length; i++)
System\Linq\Parallel\Scheduling\SpoolingTask.cs (2)
36Debug.Assert(partitions.PartitionCount == channels.Length); 92Debug.Assert(partitions.PartitionCount == channels.Length);
System\Linq\Parallel\Utils\ExchangeUtilities.cs (1)
46else if (enumerators.Length != partitionCount)
System\Linq\Parallel\Utils\FixedMaxHeap.cs (2)
57get { return _elements.Length; } 102if (_count < _elements.Length)
System\Linq\Parallel\Utils\GrowingArray.cs (4)
47if (_count >= _array.Length) 49GrowArray(2 * _array.Length); 56Debug.Assert(newSize > _array.Length); 66if (_count + otherCount > _array.Length)
System\Linq\Parallel\Utils\HashLookup.cs (3)
81for (int i = buckets[(uint)hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) 108if (count == slots.Length) Resize(); 113int bucket = hashCode % buckets.Length;
System\Linq\Parallel\Utils\ListChunk.cs (2)
44if (tail._chunkCount == tail._chunk.Length) 81Debug.Assert(curr._chunkCount == curr._chunk.Length || curr._nextChunk == null);
System\Linq\Parallel\Utils\Sorting.cs (26)
68Debug.Assert(sharedIndices.Length <= sharedkeys.Length); 69Debug.Assert(sharedIndices.Length == sharedValues.Length); 86Debug.Assert(_sharedKeys.Length >= _sharedValues.Length); 128for (int i = 0; i < sharedBarriers.Length; i++) 131for (int j = 0; j < sharedBarriers[i].Length; j++) 166for (int i = 0; i < _sharedBarriers.Length; i++) 168for (int j = 0; j < _sharedBarriers[i].Length; j++) 273for (int i = 0; i < indices.Length; i++) 279if (indices.Length > 1 282QuickSort(0, indices.Length - 1, keys.InternalArray, indices, _groupState.CancellationState.MergedCancellationToken); 290for (int i = 0; i < indices.Length; i++) 361int phaseCount = _sharedBarriers.Length; 405int leftCount = myValues.Length; 406int rightCount = rightValues.Length; 502int leftCount = leftValues.Length; 503int rightCount = myValues.Length; 551if (!isLastPhase && myValues.Length > 0) 553mergedKeys.CopyFrom(myKeysArr, myValues.Length); 554Array.Copy(myValues, 0, mergedValues, leftCount, myValues.Length); 585Debug.Assert(keys.Length >= indices.Length); 587Debug.Assert(0 <= left && left < keys.Length); 588Debug.Assert(0 <= right && right < keys.Length);
System.Linq.Queryable (16)
System\Linq\EnumerableRewriter.cs (16)
66if (pis.Length > 0) 69for (int i = 0, n = pis.Length; i < n; i++) 176.Where(i => i.IsGenericType && i.GenericTypeArguments.Length == 1) 227Debug.Assert(matchingMethods.Length > 0, "All static methods with arguments on Queryable have equivalents on Enumerable."); 229if (matchingMethods.Length > 1) 247Debug.Assert(matchingMethods.Length > 1); 254for (int i = 0; i < matchingMethods.Length; i++) 257for (int j = 0; j < matchingMethods.Length; j++) 278Debug.Assert(left.Length == right.Length); 282for (int i = 0; i < left.Length; i++) 316if (mParams.Length != args.Count) 318if (!m.IsGenericMethod && typeArgs != null && typeArgs.Length > 0) 328if (typeArgs == null || typeArgs.Length == 0) 330if (m.GetGenericArguments().Length != typeArgs.Length)
System.Memory (12)
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (8)
73public int Capacity => _buffer.Length; 78public int FreeCapacity => _buffer.Length - _index; 95Debug.Assert(_buffer.Length >= _index); 131if (_index > _buffer.Length - count) 132ThrowInvalidOperationException_AdvancedTooFar(_buffer.Length); 164Debug.Assert(_buffer.Length > _index); 195Debug.Assert(_buffer.Length > _index); 211int currentLength = _buffer.Length;
System\Buffers\ReadOnlySequence.cs (3)
121_endInteger = ReadOnlySequence.ArrayToSequenceEnd(array.Length); 130(uint)start > (uint)array.Length || 131(uint)length > (uint)(array.Length - start))
System\ThrowHelper.cs (1)
86else if ((uint)start > (uint)array.Length)
System.Net.Http (116)
src\libraries\Common\src\System\CharArrayHelpers.cs (2)
16Debug.Assert(startIndex <= array.Length - length, $"Expected {startIndex} to be <= {array.Length} - {length}, got {startIndex}");
src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
46Debug.Assert(buffer.Length > 0); 87public int AvailableLength => _bytes.Length - _availableStart; 92public int Capacity => _bytes.Length; 129if (_bytes.Length == 0) 149int newSize = _bytes.Length; 183if (_usePool && buffer.Length > 0)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (1)
674else if (buffer.Length < requiredLength)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (3)
237int valueLength = separator.Length * (values.Length - 1); 269buffer = buffer.Slice(separator.Length); 284buffer = buffer.Slice(separator.Length);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (9)
48for (int i = 0; i < _blocks.Length; i++) 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 187uint blockArraySize = (uint)_blocks.Length; 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 272for (uint i = firstUnallocatedBlock; i < _blocks.Length; i++) 310Debug.Assert(start + length <= blocks.Length * BlockSize); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (1)
39Debug.Assert(properties.Length == 13);
System\Net\Http\ByteArrayContent.cs (3)
22_count = content.Length; 30ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, content.Length); 33ArgumentOutOfRangeException.ThrowIfGreaterThan(count, content.Length - offset);
System\Net\Http\DiagnosticsHelper.cs (3)
84Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError."); 115return (uint)value < (uint)boxes.Length 127return (uint)index < (uint)strings.Length
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (1)
476output = encoding.GetString(bytes, 0, bytes.Length);
System\Net\Http\Headers\HeaderDescriptor.cs (3)
108Debug.Assert(qpackStaticTable.Length == 99); 112if (uindex < (uint)qpackStaticTable.Length) 144for (int i = 0; i < knownValues.Length; i++)
System\Net\Http\Headers\HeaderStringValues.cs (2)
39string[] values => values.Length, 102if ((uint)index < (uint)values.Length)
System\Net\Http\Headers\HeaderUtilities.cs (1)
338for (int i = 0; i < headers.Length; i++)
System\Net\Http\Headers\HttpHeaders.cs (16)
294Debug.Assert(multiValue is not null && multiValue.Length > 0); 296for (int i = 1; i < multiValue.Length; i++) 567if (_headerStore is not HeaderEntry[] entries || entries.Length < _count) 569entries = new HeaderEntry[sourceEntries.Length]; 573for (int i = 0; i < _count && i < sourceEntries.Length; i++) 1188if (values.Length == 0) 1202if (values.Length < length) 1420for (int i = 0; i < _count && i < entries.Length; i++) 1442for (int i = 0; i < _count && i < entries.Length; i++) 1452if ((uint)count < (uint)entries.Length) 1477if (entries.Length == ArrayThreshold) 1483Array.Resize(ref entries, entries.Length << 1); 1485ref HeaderEntry firstNewEntry = ref entries[entries.Length >> 1]; 1523if ((uint)count < (uint)entries.Length) 1559for (int i = 0; i < _count && i < entries.Length; i++) 1563while (i + 1 < _count && (uint)(i + 1) < (uint)entries.Length)
System\Net\Http\Headers\HttpHeadersNonValidated.cs (1)
140if (_entries is HeaderEntry[] entries && index < _numberOfEntries && (uint)index < (uint)entries.Length)
System\Net\Http\Headers\HttpHeaderValueCollection.cs (3)
87ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length); 103if (arrayIndex == array.Length) 117if (arrayIndex == array.Length)
System\Net\Http\Headers\KnownHeader.cs (2)
33asciiBytesWithColonSpace[asciiBytesWithColonSpace.Length - 2] = (byte)':'; 34asciiBytesWithColonSpace[asciiBytesWithColonSpace.Length - 1] = (byte)' ';
System\Net\Http\Headers\ObjectCollection.cs (4)
64if ((uint)size < (uint)array.Length) 73Debug.Assert(_size == array.Length); 75var newItems = new T[array.Length * 2]; 104if (array is null || _size > array.Length - arrayIndex)
System\Net\Http\HttpContent.cs (14)
89Debug.Assert(preambleLength == actualPreamble.Length, 91$"Expected (constant): {preambleLength}, Actual (Encoding.GetPreamble().Length): {actualPreamble.Length}"); 93Debug.Assert(actualPreamble.Length >= 2); 100Debug.Assert(preamble.Length == actualPreamble.Length, 104for (int i = 0; i < preamble.Length; i++) 784return BufferHasPrefix(buffer, preamble) ? preamble.Length : 0; 840if (prefix == null || byteArray == null || prefix.Length > buffer.Count || prefix.Length == 0) 843for (int i = 0, j = buffer.Offset; i < prefix.Length; i++, j++) 879return TryGetBuffer(out buffer) && buffer.Offset == 0 && buffer.Count == buffer.Array!.Length ? 996else if (value > _buffer.Length) 1004Debug.Assert(value > _buffer.Length); 1015uint twiceLength = 2 * (uint)currentBuffer.Length;
System\Net\Http\MultipartContent.cs (6)
475if (_next >= _streams.Length) 511if (_next >= _streams.Length) 556if (_next >= _streams.Length) 573for (int i = 0; i < _streams.Length; i++) 585for (; i < _streams.Length; i++) 598_next = _streams.Length;
System\Net\Http\SocketsHttpHandler\ConnectionPool\RequestQueue.cs (7)
37if (_size == _array.Length) 84if (tmp == _array.Length) 93var newArray = new QueueItem[Math.Max(4, _array.Length * 2)]; 103Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 104Array.Copy(_array, 0, newArray, _array.Length - _head, _tail); 172if (index >= _array.Length) 174index -= _array.Length;
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (2)
18Debug.Assert(valuesArray.Length > 0, "No values for header??"); 22for (int i = 0; i < valuesArray.Length; i++)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
1984Debug.Assert(origReadBuffer.Length > 0);
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (3)
58int idx = uris.Length; 159if (_currentIndex == _uris.Length) 167isFinalProxy = _currentIndex == _uris.Length;
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
260if (addresses.Length == 0)
System.Net.HttpListener (45)
src\libraries\Common\src\System\Net\CookieParser.cs (2)
485for (int i = 0; i < s_recognizedServerAttributes.Length; ++i) 495for (int i = 0; i < s_recognizedAttributes.Length; ++i)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\libraries\Common\src\System\Net\WebHeaderEncoding.cs (2)
23Debug.Assert(bytes != null && (uint)byteIndex <= (uint)bytes.Length && (uint)(byteIndex + byteCount) <= (uint)bytes.Length);
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (4)
103if (arraySegment.Offset < 0 || arraySegment.Offset > arraySegment.Array.Length) 107if (arraySegment.Count < 0 || arraySegment.Count > (arraySegment.Array.Length - arraySegment.Offset)) 118ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 121ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Net\HttpListenerPrefixCollection.cs (4)
42if (Count > array.Length) 46ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, array.Length - Count); 58if (Count > array.Length) 62ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, array.Length - Count);
System\Net\HttpRequestStream.cs (2)
20if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset); 34if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
System\Net\HttpResponseStream.cs (2)
47if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset); 61if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
System\Net\Managed\ChunkStream.cs (5)
66int nread = (size > Bytes.Length - Offset) ? Bytes.Length - Offset : size; 116if (chunk.Offset == chunk.Bytes.Length) 202if (ch.Bytes.Length > 0 && ch.Offset < ch.Bytes.Length)
System\Net\Managed\HttpListener.Managed.cs (3)
224for (int i = all.Length - 1; i >= 0; i--) 234for (int i = conns.Length - 1; i >= 0; i--) 241for (int i = ctxs.Length - 1; i >= 0; i--)
System\Net\Managed\HttpListenerRequest.Managed.cs (2)
204output.InternalWrite(s_100continue, 0, s_100continue.Length); 296if (errors != null && errors.Length > 0)
System\Net\Managed\HttpListenerResponse.Managed.cs (5)
120ContentLength64 = responseEntity.Length; 127OutputStream.Write(responseEntity, 0, responseEntity.Length); 136OutputStream.BeginWrite(responseEntity, 0, responseEntity.Length, iar => 274ms.Write(statusDescriptionBytes, 0, statusDescriptionBytes.Length); 303for (int j = 0; j < values.Length; j++)
System\Net\Managed\HttpRequestStream.Managed.cs (2)
80if (_offset > _buffer.Length - size) 82size = Math.Min(size, _buffer.Length - _offset);
System\Net\Managed\HttpResponseStream.Managed.cs (7)
72ms.Write(bytes, 0, bytes.Length); 80InternalWrite(bytes, 0, bytes.Length); 106ms.Write(bytes, 0, bytes.Length); 181ms.Write(bytes, 0, bytes.Length); 195InternalWrite(bytes, 0, bytes.Length); 225ms.Write(bytes, 0, bytes.Length); 235InternalWrite(bytes, 0, bytes.Length);
System\Net\WebSockets\HttpWebSocket.cs (2)
64for (int i = 0; i < requestProtocols.Length; i++) 142isSecWebSocketKeyInvalid = Convert.FromBase64String(secWebSocketKey!).Length != 16;
System.Net.Mail (42)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
System\Net\BufferBuilder.cs (5)
23if (count > _buffer.Length - _offset) 25byte[] newBuffer = new byte[((_buffer.Length * 2) > (_buffer.Length + count)) ? (_buffer.Length * 2) : (_buffer.Length + count)];
System\Net\BufferedReadStream.cs (2)
118if (_storedBuffer == null || _storedBuffer.Length < count) 133else if (count <= _storedBuffer!.Length - _storedLength + _storedOffset)
System\Net\Mail\MailHeaderInfo.cs (1)
75for (int i = 0; i < s_headerInfo.Length; i++)
System\Net\Mail\MailPriority.cs (1)
509for (int j = 0; j < values.Length; j++)
System\Net\Mail\SmtpCommands.cs (5)
207if (lines == null || lines.Length == 0) 211System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command"); 357if (lines == null || lines.Length == 0) 370string[] extensions = new string[lines.Length - 1]; 371for (int i = 1; i < lines.Length; i++)
System\Net\Mail\SmtpConnection.cs (2)
258for (int i = 0; i < _authenticationModules.Length; i++) 745while (++_currentModule < _connection._authenticationModules.Length)
System\Net\Mail\SmtpFailedRecipientsException.cs (2)
41base(message, innerExceptions.Length > 0 ? innerExceptions[0].FailedRecipient : null, innerExceptions.Length > 0 ? innerExceptions[0] : null)
System\Net\Mail\SmtpReplyReaderFactory.cs (5)
78while (0 != Read(caller, _byteBuffer, 0, _byteBuffer.Length)) ; 93if (info != null && info.Length > 0) 288if (info != null && info.Length > 0) 319read = _bufferedStream.Read(_byteBuffer, 0, _byteBuffer.Length); 413IAsyncResult result = _parent._bufferedStream.BeginRead(_parent._byteBuffer!, 0, _parent._byteBuffer!.Length, s_readCallback, this);
System\Net\Mime\ByteEncoder.cs (1)
63return EncodeBytes(buffer, 0, buffer.Length, true, true);
System\Net\Mime\EightBitStream.cs (1)
108for (int i = offset; (i < offset + count) && (i < buffer.Length); i++)
System\Net\Mime\MimeBasePart.cs (2)
67if ((subStrings.Length != 5 || subStrings[0] != "=" || subStrings[4] != "=")) 79newLength = s.DecodeBytes(buffer, 0, buffer.Length);
System\Net\Mime\MimePart.cs (2)
227IAsyncResult readResult = Stream!.BeginRead(context._buffer, 0, context._buffer.Length, _readCallback, context); 262IAsyncResult readResult = Stream!.BeginRead(context._buffer, 0, context._buffer.Length, _readCallback, context);
System\Net\Mime\QuotedPrintableStream.cs (6)
215if (WriteState.Buffer.Length - WriteState.Length < SizeOfSoftCRLF) 230if (WriteState.Buffer.Length - WriteState.Length < (_encodeCRLF ? SizeOfEncodedCRLF : SizeOfNonEncodedCRLF)) 251if (WriteState.Buffer.Length - WriteState.Length < SizeOfSoftCRLF) 265if (WriteState.Buffer.Length - WriteState.Length < 1) 274if (WriteState.Buffer.Length - WriteState.Length < SizeOfEncodedChar) 298return EncodeBytes(buffer, 0, buffer.Length);
System\Net\Mime\WriteStateInfoBase.cs (5)
46internal int FooterLength => _footer!.Length; 57int newsize = Buffer.Length; 63if (newsize > Buffer.Length) 107if (Header != null && Header.Length != 0) 115if (Footer != null && Footer.Length != 0)
System.Net.NameResolution (9)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
System\Net\Dns.cs (4)
53if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries"); 89if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostNameOrAddress, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries"); 129NetEventSource.Info(hostNameOrAddress, $"{t.Result} with {t.Result.AddressList.Length} entries"); 167if (NetEventSource.Log.IsEnabled()) NetEventSource.Info((IPAddress)s, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
System\Net\NameResolutionPal.Unix.cs (1)
114for (int i = 0; i < localAliases.Length; i++)
System\Net\NameResolutionTelemetry.cs (2)
233string[] result = new string[addresses.Length]; 234for (int i = 0; i < addresses.Length; i++)
System.Net.NetworkInformation (28)
System\Net\NetworkInformation\LinuxIPv4InterfaceProperties.cs (1)
46for (int i = 0; i < paths.Length; i++)
System\Net\NetworkInformation\NetworkInterfacePal.Linux.cs (1)
39for (int i = 0; i < interfaces.Length; i++)
System\Net\NetworkInformation\PhysicalAddress.cs (5)
28int size = _address.Length & ~3; 35if ((_address.Length & 3) != 0) 40for (; i < _address.Length; ++i) 62_address.Length == other._address.Length &&
System\Net\NetworkInformation\StringParsingHelpers.Addresses.cs (1)
61if (token.Length > 9 && token[4] != "00000000000000000000000000000000")
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (20)
52if (v4connections.Length > 0) 54count += v4connections.Length - 1; 57if (v6connections.Length > 0) 59count += v6connections.Length - 1; 68for (int i = 1; i < v4connections.Length; i++) // Skip first line header. 83for (int i = 1; i < v6connections.Length; i++) // Skip first line header. 99Array.Resize(ref connections, connections.Length - skip); 132if (v4connections.Length > 0) 134count += v4connections.Length - 1; 137if (v6connections.Length > 0) 139count += v6connections.Length - 1; 148for (int i = 1; i < v4connections.Length; i++) // Skip first line header. 163for (int i = 1; i < v6connections.Length; i++) // Skip first line header. 179Array.Resize(ref endPoints, endPoints.Length - skip); 212if (v4connections.Length > 0) 214count += v4connections.Length - 1; 217if (v6connections.Length > 0) 219count += v6connections.Length - 1; 226for (int i = 1; i < v4connections.Length; i++) // Skip first line header. 234for (int i = 1; i < v6connections.Length; i++) // Skip first line header.
System.Net.Ping (7)
System\Net\NetworkInformation\Ping.cs (1)
50if (buffer.Length > MaxBufferSize)
System\Net\NetworkInformation\Ping.PingUtility.cs (1)
41string processArgs = UnixCommandLinePing.ConstructCommandLine(buffer.Length, timeout, address.ToString(), isIpv4, options?.Ttl ?? 0, fragmentOption);
System\Net\NetworkInformation\Ping.RawSocket.cs (5)
38totalLength = sizeof(IpHeader) + checked(sizeof(IcmpHeader) + buffer.Length); 239Buffer.BlockCopy(receiveBuffer, dataOffset, dataBuffer, 0, dataBuffer.Length); 260byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length]; 339byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length]; 459int packetSize = totalLength != 0 ? totalLength : checked(icmpHeaderSize + payload.Length);
System.Net.Primitives (14)
src\libraries\Common\src\System\Net\CookieParser.cs (2)
485for (int i = 0; i < s_recognizedServerAttributes.Length; ++i) 495for (int i = 0; i < s_recognizedAttributes.Length; ++i)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\SocketAddress.cs (1)
42ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _buffer.Length);
System\Net\Cookie.cs (2)
596int[] parsedPorts = new int[ports.Length]; 598for (int i = 0; i < ports.Length; ++i)
System\Net\CookieContainer.cs (2)
443for (int i = 0; i < cookies.Length; ++i) 690for (int i = 0; i < s_headerInfo.Length; ++i)
System\Net\IPAddress.cs (5)
168Debug.Assert(numbers.Length == NumberOfLabels); 216for (int i = 0; i < numbers.Length; i++) 350Debug.Assert(numbers != null && numbers.Length == NumberOfLabels); 362for (int i = 0; i < numbers.Length; i++) 390Debug.Assert(_numbers != null && _numbers.Length == NumberOfLabels);
System.Net.Quic (24)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
79bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
158int ret = method(handle, bytes, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
39ErrErrorStringN(error, buf, buffer.Length);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
46Debug.Assert(buffer.Length > 0); 87public int AvailableLength => _bytes.Length - _availableStart; 92public int Capacity => _bytes.Length; 129if (_bytes.Length == 0) 149int newSize = _bytes.Length; 183if (_usePool && buffer.Length > 0)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (9)
48for (int i = 0; i < _blocks.Length; i++) 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 187uint blockArraySize = (uint)_blocks.Length; 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 272for (uint i = firstUnallocatedBlock; i < _blocks.Length; i++) 310Debug.Assert(start + length <= blocks.Length * BlockSize); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
43hostNameMatch = Interop.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length);
System\Net\Quic\Internal\MsQuicConfiguration.cs (1)
272Asn1BlobLength = (uint)certificateData.Length,
System\Net\Quic\NetEventSource.Quic.Counters.cs (1)
225uint size = (uint)s_counters.Length * sizeof(long);
System\Net\Quic\QuicConnection.cs (1)
398if (addresses.Length == 0)
System.Net.Requests (19)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
System\Net\Authorization.cs (1)
37set { _protectionRealm = value != null && value.Length != 0 ? value : null; }
System\Net\CommandStream.cs (9)
190while (_index < _commands!.Length) 215BeginWrite(sendBuffer, 0, sendBuffer.Length, s_writeCallbackDelegate, this); 219Write(sendBuffer, 0, sendBuffer.Length); 281if (index < 0 || index >= commands!.Length || 291if (_index >= _commands!.Length) 520BeginRead(state.Buffer, 0, state.Buffer.Length, s_readCallbackDelegate, state); 525bytesRead = Read(state.Buffer, 0, state.Buffer.Length); 630BeginRead(state.Buffer, 0, state.Buffer.Length, s_readCallbackDelegate, state); 635bytesRead = Read(state.Buffer, 0, state.Buffer.Length);
System\Net\FtpControlStream.cs (7)
817for (int i = address.IsIPv4MappedToIPv6 ? 12 : 0; i < localAddressInBytes.Length; i++) 909if (parsedList.Length < 2) 1001baseUri.Segments.Length != newUri.Segments.Length - 1) 1060if (parsedList.Length <= 7) 1065int index = parsedList.Length - 1; 1090if (parsedList.Length < 4)
System.Net.Security (72)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (3)
22Debug.Assert((offset >= 0 && offset < destination.Length) || destination.Length == 0, $"invalid offset {offset}"); 31int destinationAvailable = destination.Length - offset; // amount of space in the given buffer
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
79bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
158int ret = method(handle, bytes, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
39ErrErrorStringN(error, buf, buffer.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
226Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0));
src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
46Debug.Assert(buffer.Length > 0); 87public int AvailableLength => _bytes.Length - _availableStart; 92public int Capacity => _bytes.Length; 129if (_bytes.Length == 0) 149int newSize = _bytes.Length; 183if (_usePool && buffer.Length > 0)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
77ReportDownloadStop(ret?.Length ?? 0);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
43hostNameMatch = Interop.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
22Debug.Fail($"Convert.TryToBase64 failed with {input.Length} bytes to a {base64.Length} buffer");
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (5)
543if (targetInfoOffset == targetInfoBuffer.Length) 613targetInfoBuffer.Length + 616s_workstation.Length + 650Debug.Assert(payloadOffset == sizeof(AuthenticateMessage) + ChallengeResponseLength + sizeof(NtChallengeResponse) + targetInfoBuffer.Length); 697Debug.Assert(payloadOffset == responseBytes.Length);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (2)
321if (blob?.Length > 0) 332if (response?.Length > 0)
System\Net\NegotiateAuthenticationPal.Unix.cs (3)
313_tokenBuffer.Length == resultBlobLength ? _tokenBuffer : 638resultBlobLength = resultBlob?.Length ?? 0; 714resultBlobLength = resultBlob.Length;
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (6)
93policy.Pal._tls13CipherSuites.Length != 0 && 94policy.Pal._tls13CipherSuites[policy.Pal._tls13CipherSuites.Length - 1] == 0, 98return policy.Pal._tls13CipherSuites.Length == 1; 110policy.Pal._cipherSuites.Length != 0 && 111policy.Pal._cipherSuites[policy.Pal._cipherSuites.Length - 1] == 0, 115return policy.Pal._cipherSuites.Length == 1;
System\Net\Security\NegotiateAuthentication.cs (1)
264if (decodedOutgoingBlob != null && decodedOutgoingBlob.Length > 0)
System\Net\Security\NegotiateStream.cs (3)
386if (_readBuffer.Length < readBytes) 874if (message.Length >= sizeof(long)) 886if (HandshakeComplete && message.Length > 0)
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (2)
24Debug.Assert(certHashBytes.Length <= CertHashMaxSize); 26int length = certHashBytes.Length;
System\Net\Security\SslApplicationProtocol.cs (6)
32if (protocol.Length == 0 || protocol.Length > 255) 68for (int i = 0; i < arr.Length; i++) 91char[] byteChars = new char[arr.Length * 5]; 94for (int i = 0; i < byteChars.Length; i += 5) 104return new string(byteChars, 0, byteChars.Length - 1);
System\Net\Security\SslSessionsCache.cs (4)
59if (_thumbPrint.Length > 3) 82thumbPrint.Length == otherThumbPrint.Length && 211for (int i = 0; i < toRemoveAttempt.Length; ++i)
System\Net\Security\SslStream.cs (1)
832public void Write(byte[] buffer) => Write(buffer, 0, buffer.Length);
System\Net\Security\SslStream.IO.cs (1)
301Debug.Assert(consumed == (reAuthenticationData?.Length ?? 0));
System\Net\Security\SslStream.Protocol.cs (4)
397if (issuers == null || issuers.Length == 0) 403NetEventSource.Log.LookForMatchingCerts(issuers.Length, this); 413if (issuers != null && issuers.Length != 0) 1395internal int Available => Payload == null ? 0 : Payload.Length - Size;
System\Net\Security\SslStreamCertificateContext.Linux.cs (6)
262X509Certificate2? caCert = _privateIntermediateCertificates.Length > 0 ? _privateIntermediateCertificates[0] : _rootCertificate; 282IntPtr[] issuerHandles = ArrayPool<IntPtr>.Shared.Rent(_privateIntermediateCertificates.Length + 1); 283for (int i = 0; i < _privateIntermediateCertificates.Length; i++) 287issuerHandles[_privateIntermediateCertificates.Length] = _rootCertificate.Handle; 314if (!Interop.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration)) 336NetEventSource.Info(this, $"Received {ret.Length} B OCSP response, Expiration: {_ocspExpiration}, Next refresh: {_nextDownload}");
System\Net\StreamFramer.cs (7)
35stream, buffer, buffer.Length, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false); 36if (bytesRead < buffer.Length) 57if (buffer.Length > 0) 60stream, buffer, buffer.Length, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false); 61if (bytesRead < buffer.Length) 72_writeHeader.PayloadSize = message.Length; 76if (message.Length != 0)
System.Net.ServerSentEvents (7)
System\Net\ServerSentEvents\SseParser_1.cs (7)
259Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}"); 284if (_lineOffset + _lineLength == _lineBuffer.Length) 295else if (_lineLength == _lineBuffer.Length) 297GrowBuffer(ref _lineBuffer, _lineBuffer.Length * 2); 375if (_dataBuffer is null || _dataLength + _lineLength + 1 > _dataBuffer.Length) 528Array.Copy(toReturn, buffer, toReturn.Length);
System.Net.Sockets (45)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\libraries\Common\src\System\Net\RangeValidationHelpers.cs (1)
22if (segment.Offset < 0 || segment.Count < 0 || segment.Count > (segment.Array.Length - segment.Offset))
System\Net\Sockets\SendPacketsElement.cs (3)
65this(buffer, 0, (buffer != null ? buffer.Length : 0), false) 76ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 77ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)count, (uint)(buffer.Length - offset), nameof(count));
System\Net\Sockets\Socket.cs (10)
939if (addresses.Length == 0) 1109return Send(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags); 1116return Send(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None); 1392return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, remoteEP); 1399return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, remoteEP); 1511return Receive(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags); 1518return Receive(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None); 1898return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, ref remoteEP); 1905return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, ref remoteEP); 2225int optionLength = optionValue != null ? optionValue.Length : 0;
System\Net\Sockets\Socket.Tasks.cs (6)
167if (addresses.Length == 0) 785SendPacketsElement[] sendPacketsElements = saea.SendPacketsElements?.Length == packetsCount 816ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 817ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)size, (uint)(buffer.Length - offset), nameof(size)); 824if ((uint)buffer.Offset > (uint)buffer.Array.Length) 828if ((uint)buffer.Count > (uint)(buffer.Array.Length - buffer.Offset))
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
113int engineIndex = Math.Abs(Interlocked.Increment(ref s_allocateFromEngine) % s_engines.Length);
System\Net\Sockets\SocketAsyncEventArgs.cs (3)
393ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 394ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)count, (long)(buffer.Length - offset), nameof(count)); 595if (_acceptBuffer == null || _acceptBuffer.Length < _acceptAddressBufferCount)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (2)
248SafeFileHandle[] fileHandles = new SafeFileHandle[elements.Length]; 254for (int i = 0; i < elements.Length; i++)
System\Net\Sockets\SocketPal.Unix.cs (7)
1399if (optionOutValue == null || optionOutValue.Length < sizeof(int)) 1506Interop.Error err = Interop.Sys.SetSockOpt(handle, optionLevel, optionName, pinnedValue, optionValue != null ? optionValue.Length : 0); 1648if (optionValue == null || optionValue.Length == 0) 1653else if (optionName == SocketOptionName.Error && optionValue.Length >= sizeof(int)) 2088Debug.Assert(elements.Length == fileHandles.Length); 2089for (int i = 0; i < elements.Length; i++)
System\Net\Sockets\UDPClient.cs (4)
320ArgumentOutOfRangeException.ThrowIfGreaterThan(bytes, datagram.Length); 343for (; i < addresses.Length && !IsAddressFamilyCompatible(addresses[i].AddressFamily); i++) 347if (addresses.Length == 0 || i == addresses.Length)
System\Net\Sockets\UnixDomainSocketEndPoint.cs (4)
74for (int i = 0; i < _encodedPath.Length; i++) 80int length = _encodedPath.Length; 104for (int index = 0; index < _encodedPath.Length; index++) 168private static bool IsAbstract(byte[] encodedPath) => encodedPath.Length > 0 && encodedPath[0] == 0;
System\Net\Sockets\UnixDomainSocketEndPoint.Unix.cs (1)
34new SocketAddress(AddressFamily.Unix, s_nativePathOffset + _encodedPath.Length);
System.Net.WebClient (24)
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (3)
29Debug.Assert(chunk._next == null || chunk._freeOffset == chunk._buffer.Length); 47int remaining = _currentChunk._buffer.Length - _currentChunk._freeOffset; 87int nextChunkLength = _currentChunk != null ? _currentChunk._buffer.Length * 2 : InitialChunkDefaultSize;
System\Net\WebClient.cs (21)
459_contentLength = data.Length; 526_contentLength = fs.Length + formHeaderBytes.Length + boundaryBytes.Length; 614_contentLength = buffer.Length; 841writeStream.SetLength(copyBuffer.Length); 849while ((bytesRead = readStream.Read(copyBuffer, 0, copyBuffer.Length)) != 0) 888writeStream.SetLength(copyBuffer.Length); 958writeStream.Write(header, 0, header.Length); 967int bytesRead = readStream.Read(buffer, 0, buffer.Length); 976for (int pos = 0; pos < buffer.Length;) 978int toWrite = buffer.Length - pos; 990writeStream.Write(footer, 0, footer.Length); 1026_progress.BytesSent += header.Length; 1047for (int pos = 0; pos < buffer.Length;) 1049int toWrite = buffer.Length - pos; 1064_progress.BytesSent += footer.Length; 1162return enc.GetString(data, bomLengthInData, data.Length - bomLengthInData); 1380_contentLength = requestData.Length; 1428_contentLength = data.Length; 1435chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, data.Length); 1511chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, buffer.Length);
System.Net.WebHeaderCollection (2)
System\Net\WebHeaderCollection.cs (2)
224for (int i = 0; i < values.Length; i++) 241valueList.RemoveRange(i, values.Length - i);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
138for (int i = 0; i < regexBypassList.Length; i++)
System.Net.WebSockets (13)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (4)
103if (arraySegment.Offset < 0 || arraySegment.Offset > arraySegment.Array.Length) 107if (arraySegment.Count < 0 || arraySegment.Count > (arraySegment.Array.Length - arraySegment.Offset)) 118ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 121ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Net\WebSockets\Compression\WebSocketDeflater.cs (1)
67byte[] newBuffer = ArrayPool<byte>.Shared.Rent((int)(_buffer.Length * 1.3));
System\Net\WebSockets\Compression\WebSocketInflater.cs (1)
106if (_buffer.Length < _available + FlushMarkerLength)
System\Net\WebSockets\ManagedWebSocket.cs (4)
720Debug.Assert(sendBuffer.Length >= MaxMessageHeaderLength, $"Expected {nameof(sendBuffer)} to be at least {MaxMessageHeaderLength}, got {sendBuffer.Length}"); 1654Debug.Assert(mask.Length >= MaskLength + maskOffset, $"Unexpected inputs: {mask.Length}, {maskOffset}");
System\Net\WebSockets\WebSocket.cs (1)
94if (validStates != null && validStates.Length > 0)
System.Net.WebSockets.Client (5)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (4)
103if (arraySegment.Offset < 0 || arraySegment.Offset > arraySegment.Array.Length) 107if (arraySegment.Count < 0 || arraySegment.Count > (arraySegment.Array.Length - arraySegment.Offset)) 118ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 121ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
154if (subprotocolArray.Length > 0 && !string.IsNullOrEmpty(subprotocolArray[0]))
System.Numerics.Tensors (71)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (19)
37public ReadOnlyTensorSpan(T[]? array) : this(array, 0, [array?.Length ?? 0], []) 54: this(array, startIndex.GetOffset(array?.Length ?? 0), lengths, strides) 75lengths = [array.Length]; 96if ((ulong)(uint)start + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0) 101if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0) 105_shape = new TensorShape(array.Length - start, lengths, strides); 177if ((ulong)(uint)startOffset + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0) 182if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0) 186_shape = new TensorShape(array.Length - startOffset, lengths, strides); 221if ((ulong)(uint)startOffset + (ulong)(uint)maxElements > (ulong)(uint)array.Length) 226if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) 230_shape = new TensorShape(array.Length - startOffset, lengths, strides);
System\Numerics\Tensors\netcore\Tensor.cs (8)
67_lengths = lengths.IsEmpty ? [values.Length] : lengths.ToArray(); 77if ((ulong)(uint)maxElements >= (ulong)(uint)values.Length && values.Length != 0) 82if (((uint)maxElements >= (uint)(values.Length)) && values.Length != 0) 150public bool IsEmpty => _lengths.Length == 0; 162public int Rank => _lengths.Length; 374public static implicit operator Tensor<T>(T[] array) => new Tensor<T>(array, [array.Length]);
System\Numerics\Tensors\netcore\Tensor.Factory.cs (3)
80return new Tensor<T>(data, lengths.IsEmpty ? [data.Length] : lengths, pinned); 93return new Tensor<T>(data, lengths.IsEmpty ? [data.Length] : lengths, strides, pinned); 154for (int i = 0; i < values.Length; i++)
System\Numerics\Tensors\netcore\TensorExtensions.cs (18)
165for (int i = strides.Length - 1; i >= 0; i--) 208for (int i = strides.Length - 1; i >= 0; i--) 251for (int i = strides.Length - 1; i >= 0; i--) 2674for (int i = 0; i < lengths.Length; i++) 2770for (int i = 0; i < arrLengths.Length; i++) 2838for (int i = 0; i < arrLengths.Length; i++) 2909for (int i = 0; i < arrLengths.Length; i++) 2945ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor.AsTensorSpan()._reference, (int)tensor._values.Length); 2947if (newSize > tensor._values.Length) 2948TensorSpanHelpers.Memmove(ospan, span, tensor._values.Length); 2963ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref tensor._values[0], tensor._values.Length); 2965if (destination._shape._memoryLength > tensor._values.Length) 2966TensorSpanHelpers.Memmove(ospan, span, tensor._values.Length); 3232for (int i = 0; i < outputs.Length; i++) 7053if (newSize.Length > TensorShape.MaxInlineRank) 7055curIndexArray = ArrayPool<nint>.Shared.Rent(newSize.Length); 7056curIndex = curIndexArray.AsSpan(0, newSize.Length); 7061curIndex = stackalloc nint[newSize.Length];
System\Numerics\Tensors\netcore\TensorHelpers.cs (2)
95=> tensor1._values.Length == tensor2._values.Length;
System\Numerics\Tensors\netcore\TensorSpan.cs (19)
38public TensorSpan(T[]? array) : this(array, 0, [array?.Length ?? 0], []) 56: this(array, startIndex.GetOffset(array?.Length ?? 0), lengths, strides) 77lengths = [array.Length]; 98if ((ulong)(uint)start + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0) 103if (((uint)start > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - start)) && array.Length != 0) 107_shape = new TensorShape(array.Length - start, lengths, strides); 181if ((ulong)(uint)startOffset + (ulong)(uint)maxElements >= (ulong)(uint)array.Length && array.Length != 0) 186if (((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) && array.Length != 0) 190_shape = new TensorShape(array.Length - startOffset, lengths, strides); 224if ((ulong)(uint)startOffset + (ulong)(uint)maxElements > (ulong)(uint)array.Length) 229if ((uint)startOffset > (uint)array.Length || (uint)maxElements >= (uint)(array.Length - startOffset)) 233_shape = new TensorShape(array.Length, lengths, strides);
System\Numerics\Tensors\netcore\TensorSpanHelpers.cs (2)
53for (int i = strides.Length - 1; i >= 0; i--) 75for (int i = strides.Length - 1; i >= 0; i--)
System.ObjectModel (3)
System\Collections\CollectionHelpers.cs (2)
25ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length); 27if (array.Length - index < sourceCount)
System\Collections\ObjectModel\KeyedCollection.cs (1)
300for (int i = 0; i < items.Length; i++)
System.Private.CoreLib (1650)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (4)
152int read = fileStream.Read(bytes, count, bytes.Length - count); 160if (count >= bytes.Length) 162byte[] temp = ArrayPool<byte>.Shared.Rent(bytes.Length * 2); 163Array.Copy(bytes, temp, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs (1)
35result = GetCwdHelper(ptr, buf.Length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
27if (capacity > version.Length)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (8)
85int tail2 = (last + 1) & (array.Length - 1); 111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize); 143segment._state._first = (first + 1) & (array.Length - 1); 209segment._state._first = (first + 1) & (segment._array.Length - 1); 233segment._state._first = (first + 1) & (array.Length - 1); 281segment._state._first = (first + 1) & (segment._array.Length - 1); 327pt = (pt + 1) & (segment._array.Length - 1)) 346int arraySize = segment._array.Length;
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
65if (count == arr.Length)
src\libraries\Common\src\System\Number.Formatting.Common.cs (4)
485int groupSizeLen = groupDigits.Length; // The length of groupDigits array. 764if (groupDigits.Length != 0) // You can pass in 0 length arrays 777if (groupSizeIndex < groupDigits.Length - 1) 810if (groupSizeIndex < groupDigits.Length - 1)
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (3)
65if (pkt.Length > PUBLIC_KEY_TOKEN_LEN) 75if (keyOrToken.Length == 0) 81HexConverter.EncodeToUtf16(keyOrToken, vsb.AppendSpan(keyOrToken.Length * 2), HexConverter.Casing.Lower);
src\libraries\System.Private.CoreLib\src\Internal\Console.Unix.cs (2)
16Interop.Sys.Log(pBytes, bytes.Length); 27Interop.Sys.LogError(pBytes, bytes.Length);
src\libraries\System.Private.CoreLib\src\System\Activator.RuntimeType.cs (1)
33if (activationAttributes?.Length > 0)
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (9)
123base(message ?? SR.AggregateException_ctor_DefaultMessage, innerExceptions.Length > 0 ? innerExceptions[0] : null) 125_innerExceptions = cloneExceptions ? new Exception[innerExceptions.Length] : innerExceptions; 127for (int i = 0; i < _innerExceptions.Length; i++) 172for (int i = 0; i < _innerExceptions.Length; i++) 264for (int i = 0; i < _innerExceptions.Length; i++) 340if (_innerExceptions.Length == 0) 348for (int i = 0; i < _innerExceptions.Length; i++) 368for (int i = 0; i < _innerExceptions.Length; i++) 392internal int InnerExceptionCount => _innerExceptions.Length;
src\libraries\System.Private.CoreLib\src\System\ApplicationId.cs (1)
57HexConverter.EncodeToUtf16(_publicKeyToken, sb.AppendSpan(2 * _publicKeyToken.Length), HexConverter.Casing.Upper);
src\libraries\System.Private.CoreLib\src\System\Array.cs (103)
36return array.Length == 0 ? 53if (larray.Length != newSize) 65(uint)Math.Min(newSize, larray.Length)); 124if (lengths.Length == 0) 135for (int i = 0; i < lengths.Length; i++) 140return InternalCreate(t, lengths.Length, pLengths, null); 150if (lengths.Length != lowerBounds.Length) 152if (lengths.Length == 0) 163for (int i = 0; i < lengths.Length; i++) 169return InternalCreate(t, lengths.Length, pLengths, pLowerBounds); 177int[] intLengths = new int[lengths.Length]; 179for (int i = 0; i < lengths.Length; ++i) 254if (t.GetArrayRank() != lengths.Length) 261for (int i = 0; i < lengths.Length; i++) 266return InternalCreateFromArrayType(t, lengths.Length, pLengths, null); 300if (lengths.Length != lowerBounds.Length) 310if (t.GetArrayRank() != lengths.Length) 320for (int i = 0; i < lengths.Length; i++) 326return InternalCreateFromArrayType(t, lengths.Length, pLengths, pLowerBounds); 426if (Rank != indices.Length) 484if (Rank != indices.Length) 532if (Rank != indices.Length) 535int[] intIndices = new int[indices.Length]; 537for (int i = 0; i < indices.Length; ++i) 592if (Rank != indices.Length) 595int[] intIndices = new int[indices.Length]; 597for (int i = 0; i < indices.Length; ++i) 624int ICollection.Count => Length; 700if (o == null || this.Length != o.Length) 708while (i < o.Length && c == 0) 732if (other is not Array o || o.Length != this.Length) 738while (i < o.Length) 760for (int i = (this.Length >= 8 ? this.Length - 8 : 0); i < this.Length; i++) 785return BinarySearch(array, array.GetLowerBound(0), array.Length, value, null); 824return BinarySearch(array, array.GetLowerBound(0), array.Length, value, comparer); 851if (array.Length - (index - lb) < length) 988return BinarySearch(array, 0, array.Length, value, null); 995return BinarySearch(array, 0, array.Length, value, comparer); 1012if (array.Length - index < length) 1030TOutput[] newArray = new TOutput[array.Length]; 1031for (int i = 0; i < array.Length; i++) 1050Copy(this, GetLowerBound(0), array!, index, Length); 1088for (int i = 0; i < array.Length; i++) 1106if ((uint)startIndex > (uint)array.Length) 1111if ((uint)count > (uint)(array.Length - startIndex)) 1142for (int i = 0; i < array.Length; i++) 1165for (int i = 0; i < array.Length; i++) 1182return FindIndex(array, 0, array.Length, match); 1192return FindIndex(array, startIndex, array.Length - startIndex, match); 1202if (startIndex < 0 || startIndex > array.Length) 1207if (count < 0 || startIndex > array.Length - count) 1238for (int i = array.Length - 1; i >= 0; i--) 1255return FindLastIndex(array, array.Length - 1, array.Length, match); 1280if (array.Length == 0) 1291if (startIndex < 0 || startIndex >= array.Length) 1326for (int i = 0; i < array.Length; i++) 1340return IndexOf(array, value, array.GetLowerBound(0), array.Length); 1354return IndexOf(array, value, startIndex, array.Length - startIndex + lb); 1371if (startIndex < lb || startIndex > array.Length + lb) 1373if (count < 0 || count > array.Length - startIndex + lb) 1480return IndexOf(array, value, 0, array.Length); 1490return IndexOf(array, value, startIndex, array.Length - startIndex); 1500if ((uint)startIndex > (uint)array.Length) 1505if ((uint)count > (uint)(array.Length - startIndex)) 1562return LastIndexOf(array, value, array.Length - 1 + lb, array.Length); 1589if (array.Length == 0) 1594if (startIndex < lb || startIndex >= array.Length + lb) 1703return LastIndexOf(array, value, array.Length - 1, array.Length); 1713return LastIndexOf(array, value, startIndex, (array.Length == 0) ? 0 : (startIndex + 1)); 1723if (array.Length == 0) 1743if ((uint)startIndex >= (uint)array.Length) 1814Reverse(array, array.GetLowerBound(0), array.Length); 1833if (array.Length - (index - lowerBound) < length) 1892if (array.Length > 1) 1893SpanHelpers.Reverse(ref MemoryMarshal.GetArrayDataReference(array), (nuint)array.Length); 1904if (array.Length - index < length) 1921Sort(array, null, array.GetLowerBound(0), array.Length, null); 1934Sort(keys, items, keys.GetLowerBound(0), keys.Length, null); 1967Sort(array, null, array.GetLowerBound(0), array.Length, comparer); 1982Sort(keys, items, keys.GetLowerBound(0), keys.Length, comparer); 2018if (keys.Length - (index - keysLowerBound) < length || (items != null && (index - keysLowerBound) > items.Length - length)) 2109if (array.Length > 1) 2111var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2120Sort(keys, items, 0, keys.Length, null); 2137Sort(array, 0, array.Length, comparer); 2144Sort(keys, items, 0, keys.Length, comparer); 2155if (array.Length - index < length) 2173if (keys.Length - index < length || (items != null && index > items.Length - length)) 2202var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2218for (int i = 0; i < array.Length; i++) 2235/// <see cref="Length"/> property may return larger value than this property for multi-dimensional arrays.</para> 2673new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (1)
116Debug.Assert(array == null || endIndex == array.Length);
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (4)
51_count = array.Length; 59if (array == null || (uint)offset > (uint)array.Length || (uint)count > (uint)(array.Length - offset)) 293Debug.Assert(arraySegment.Offset + arraySegment.Count <= arraySegment.Array.Length);
src\libraries\System.Private.CoreLib\src\System\Attribute.cs (5)
37for (int i = 0; i < thisFields.Length; i++) 64for (int i = 0; i < fields.Length; i++) 109if (thisValueArray.Length != thatValueArray.Length) 117for (int j = 0; j < thisValueArray.Length; j++)
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (15)
419if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 421if (startIndex > value.Length - sizeof(short)) 457if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 459if (startIndex > value.Length - sizeof(int)) 495if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 497if (startIndex > value.Length - sizeof(long)) 533if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 535if (startIndex > value.Length - Int128.Size) 659if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 661if (startIndex > value.Length - UInt128.Size) 787if (startIndex < 0 || startIndex >= value.Length && startIndex > 0) 790if (startIndex > value.Length - length) 834return ToString(value, 0, value.Length); 852return ToString(value, startIndex, value.Length - startIndex); 869if (startIndex >= value.Length)
src\libraries\System.Private.CoreLib\src\System\Buffers\ConfigurableArrayPool.cs (14)
43for (int i = 0; i < buckets.Length; i++) 70if (index < _buckets.Length) 84log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, _buckets[i].Id); 89while (++i < _buckets.Length && i != index + MaxBucketsToTry); 105log.BufferRented(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId); 106log.BufferAllocated(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId, index >= _buckets.Length ? 118if (array.Length == 0) 126int bucket = Utilities.SelectBucketIndex(array.Length); 129bool haveBucket = bucket < _buckets.Length; 149log.BufferReturned(bufferId, array.Length, Id); 152log.BufferDropped(bufferId, array.Length, Id, ArrayPoolEventSource.NoBucketId, ArrayPoolEventSource.BufferDroppedReason.OverMaximumSize); 196if (_index < buffers.Length) 234if (array.Length != _bufferLength)
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (27)
61if (tlsBuckets is not null && (uint)bucketIndex < (uint)tlsBuckets.Length) 69log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex); 77if ((uint)bucketIndex < (uint)perCoreBuckets.Length) 87log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex); 114log.BufferRented(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId); 115log.BufferAllocated(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId, bucketIndex >= _buckets.Length ? 130int bucketIndex = Utilities.SelectBucketIndex(array.Length); 140if ((uint)bucketIndex < (uint)tlsBuckets.Length) 151if (array.Length != Utilities.GetMaxSizeForBucket(bucketIndex)) 171if (log.IsEnabled() && array.Length != 0) 173log.BufferReturned(array.GetHashCode(), array.Length, Id); 176log.BufferDropped(array.GetHashCode(), array.Length, Id, 197for (int i = 0; i < perCoreBuckets.Length; i++) 222for (int i = 0; i < buckets.Length; i++) 226log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id); 247for (int i = 0; i < buckets.Length; i++) 268log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id); 327for (int i = 0; i < partitions.Length; i++) 345for (int i = 0; i < partitions.Length; i++) 348if (++index == partitions.Length) index = 0; 365for (int i = 0; i < partitions.Length; i++) 368if (++index == partitions.Length) index = 0; 376for (int i = 0; i < partitions.Length; i++) 399if ((uint)count < (uint)arrays.Length) 423if ((uint)count < (uint)arrays.Length) 482log.BufferTrimmed(array.GetHashCode(), array.Length, id);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (2)
90Debug.Assert(destination.Length == bytesWritten); 141Debug.Assert(destination.Length == charsWritten);
src\libraries\System.Private.CoreLib\src\System\Collections\ArrayList.cs (10)
73get => _items.Length; 83if (value != _items.Length) 155if (_size == _items.Length) EnsureCapacity(_size + 1); 279if (_items.Length < min) 281int newCapacity = _items.Length == 0 ? _defaultCapacity : _items.Length * 2; 389if (_size == _items.Length) EnsureCapacity(_size + 1); 825if (array.Length - arrayIndex < count) 2284if (array.Length - index < _baseSize) 2299if (array.Length - arrayIndex < count)
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (4)
359return head < tail ? tail - head : s._slots.Length - head + tail; 390head._slots.Length - headHead + headTail; 455if (index > array.Length - count) 565for (int i = headHead; i < head._slots.Length; i++) yield return GetItemWhenAvailable(head, i);
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueueSegment.cs (4)
70for (int i = 0; i < _slots.Length; i++) 77internal int Capacity => _slots.Length; 80internal int FreezeOffset => _slots.Length * 2; 149Volatile.Write(ref slots[slotsIndex].SequenceNumber, currentHead + slots.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (2)
76Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 327Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (2)
94if (list._items.Length - list._size < source.Length) 126if (list._items.Length - list._size < source.Length)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (43)
131Debug.Assert(_entries.Length >= source.Count); 214public int Capacity => _entries?.Length ?? 0; 349if ((uint)index > (uint)array.Length) 354if (array.Length - index < Count) 387info.AddValue(HashSizeName, _buckets == null ? 0 : _buckets.Length); // This is the length of the bucket array 422if ((uint)i >= (uint)entries.Length) 436} while (collisionCount <= (uint)entries.Length); 453if ((uint)i >= (uint)entries.Length) 467} while (collisionCount <= (uint)entries.Length); 536while ((uint)i < (uint)entries.Length) 557if (collisionCount > (uint)entries.Length) 568while ((uint)i < (uint)entries.Length) 589if (collisionCount > (uint)entries.Length) 609if (count == entries.Length) 632Resize(entries.Length, true); 819if ((uint)i >= (uint)entries.Length) 833} while (collisionCount <= (uint)entries.Length); 927if (collisionCount > (uint)entries.Length) 982while ((uint)i < (uint)entries.Length) 994if (collisionCount > (uint)entries.Length) 1019if (count == entries.Length) 1042dictionary.Resize(entries.Length, true); 1101while ((uint)i < (uint)entries.Length) 1113if (collisionCount > (uint)entries.Length) 1124while ((uint)i < (uint)entries.Length) 1136if (collisionCount > (uint)entries.Length) 1156if (count == entries.Length) 1179dictionary.Resize(entries.Length, true); 1226for (int i = 0; i < array.Length; i++) 1353if (collisionCount > (uint)entries.Length) 1428if (collisionCount > (uint)entries.Length) 1479if ((uint)index > (uint)array.Length) 1484if (array.Length - index < Count) 1592int currentCapacity = oldEntries == null ? 0 : oldEntries.Length; 1746return ref buckets[HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)]; 1908if (index < 0 || index > array.Length) 1913if (array.Length - index < _dictionary.Count) 1968if ((uint)index > (uint)array.Length) 1973if (array.Length - index < _dictionary.Count) 2103if ((uint)index > array.Length) 2108if (array.Length - index < _dictionary.Count) 2162if ((uint)index > (uint)array.Length) 2167if (array.Length - index < _dictionary.Count)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (21)
114if (_count > 0 && _entries!.Length / _count > ShrinkThreshold) 158int capacity = source._buckets!.Length; 246if (collisionCount > (uint)entries.Length) 268if (collisionCount > (uint)entries.Length) 286return ref buckets[HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 344if (collisionCount > (uint)entries.Length) 362public int Capacity => _entries?.Length ?? 0; 486if (collisionCount > (uint)entries.Length) 508if (count == entries.Length) 532set.Resize(entries.Length, forceNewHashCodes: true); 591if (collisionCount > (uint)entries.Length) 645if ((uint)i >= (uint)entries.Length) 659} while (collisionCount <= (uint)entries.Length); 751for (int i = 0; i < array.Length; i++) 1190if (arrayIndex > array.Length || count > array.Length - arrayIndex) 1350int currentCapacity = oldEntries == null ? 0 : oldEntries.Length; 1447if (collisionCount > (uint)entries.Length) 1471if (collisionCount > (uint)entries.Length) 1490if (count == entries.Length) 1515Resize(entries.Length, forceNewHashCodes: true);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (2)
24var items = new DebugViewDictionaryItem<TKey, TValue>[keyValuePairs.Length]; 25for (int i = 0; i < items.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (13)
99get => _items.Length; 107if (value != _items.Length) 201if ((uint)size < (uint)array.Length) 216Debug.Assert(_size == _items.Length); 255if (_items.Length - _size < count) 439if (_items.Length < capacity) 444return _items.Length; 490Debug.Assert(_items.Length < capacity); 492int newCapacity = _items.Length == 0 ? DefaultCapacity : 2 * _items.Length; 777if (_size == _items.Length) 826if (_items.Length - _size < count) 1161int threshold = (int)(((double)_items.Length) * 0.9);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (26)
52if (_size != _array.Length) _tail = _size; 60public int Capacity => _array.Length; 80Array.Clear(_array, _head, _array.Length - _head); 99if (arrayIndex < 0 || arrayIndex > array.Length) 104if (array.Length - arrayIndex < _size) 112int firstPart = Math.Min(_array.Length - _head, numToCopy); 117Array.Copy(_array, 0, array, arrayIndex + _array.Length - _head, numToCopy); 135int arrayLen = array.Length; 151int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy; 157Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy); 169if (_size == _array.Length) 278Array.IndexOf(_array, item, _head, _array.Length - _head) >= 0 || 301Array.Copy(_array, _head, arr, 0, _array.Length - _head); 302Array.Copy(_array, 0, arr, _array.Length - _head, _tail); 322Array.Copy(_array, _head, newarray, 0, _array.Length - _head); 323Array.Copy(_array, 0, newarray, _array.Length - _head, _tail); 340if (tmp == _array.Length) 355int threshold = (int)(_array.Length * 0.9); 372if (capacity == _array.Length) 387if (_array.Length < capacity) 392return _array.Length; 397Debug.Assert(_array.Length < capacity); 402int newcapacity = GrowFactor * _array.Length; 409newcapacity = Math.Max(newcapacity, _array.Length + MinimumGrow); 462uint capacity = (uint)array.Length;
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (39)
430for (int i = 0; i < _buckets.Length; i++) 454int bucket = lbuckets.Length; 483uint hashcode = InitHash(key, lbuckets.Length, out uint seed, out uint incr); 487int bucketNumber = (int)(seed % (uint)lbuckets.Length); 498bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length); 499} while (b.hash_coll < 0 && ++ntry < lbuckets.Length); 513for (int i = _buckets.Length; --i >= 0;) 521for (int i = _buckets.Length; --i >= 0;) 540for (int i = lbuckets.Length; --i >= 0;) 559for (int i = lbuckets.Length; --i >= 0;) 579if (array.Length - arrayIndex < Count) 590for (int i = lbuckets.Length; --i >= 0;) 611for (int i = lbuckets.Length; --i >= 0;) 632uint hashcode = InitHash(key, lbuckets.Length, out uint seed, out uint incr); 636int bucketNumber = (int)(seed % (uint)lbuckets.Length); 677bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length); 678} while (b.hash_coll < 0 && ++ntry < lbuckets.Length); 694int rawsize = HashHelpers.ExpandPrime(_buckets.Length); 701rehash(_buckets.Length); 726for (nb = 0; nb < _buckets.Length; nb++) 845uint hashcode = InitHash(key, _buckets.Length, out uint seed, out uint incr); 849int bucketNumber = (int)(seed % (uint)_buckets.Length); 912bucketNumber = (int)(((long)bucketNumber + incr) % (uint)_buckets.Length); 913} while (++ntry < _buckets.Length); 943uint incr = unchecked((uint)(1 + ((seed * HashHelpers.HashPrime) % ((uint)newBuckets.Length - 1)))); 944int bucketNumber = (int)(seed % (uint)newBuckets.Length); 960bucketNumber = (int)(((long)bucketNumber + incr) % (uint)newBuckets.Length); 975uint hashcode = InitHash(key, _buckets.Length, out uint seed, out uint incr); 979int bn = (int)(seed % (uint)_buckets.Length); // bucketNumber 1003bn = (int)(((long)bn + incr) % (uint)_buckets.Length); 1004} while (b.hash_coll < 0 && ++ntry < _buckets.Length); 1065info.AddValue(HashSizeName, _buckets.Length); // This is the length of the bucket array. 1160if (serKeys.Length != serValues.Length) 1164for (int i = 0; i < serKeys.Length; i++) 1196if (array.Length - arrayIndex < _hashtable._count) 1231if (array.Length - arrayIndex < _hashtable._count) 1411_bucket = hashtable._buckets.Length; 1490_bucket = _hashtable._buckets.Length;
src\libraries\System.Private.CoreLib\src\System\Collections\ListDictionaryInternal.cs (2)
157if (array.Length - index < this.Count) 310if (array.Length - index < list.Count)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (1)
192if (array.Length - index < Count)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (2)
33ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length); 41if (array.Length - index < sourceCount)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
122if (array.Length - index < Count)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (6)
2338ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 2396int inArrayLength = inArray.Length; 2404int outArrayLength = outArray.Length; 2799ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 3068ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 3145ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length);
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (1)
562for (int i = 0; i < formats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (60)
35if (match == null || match.Length == 0) 51int[][] paramOrder = new int[candidates.Length][]; 53for (i = 0; i < candidates.Length; i++) 58paramOrder[i] = new int[(par.Length > args.Length) ? par.Length : args.Length]; 76Type[] paramArrayTypes = new Type[candidates.Length]; 78Type[] argTypes = new Type[args.Length]; 83for (i = 0; i < args.Length; i++) 99for (i = 0; i < candidates.Length; i++) 113if (args.Length != 0) 126else if (par.Length > args.Length) 131for (j = args.Length; j < par.Length - 1; j++) 152else if (par.Length < args.Length) 187int argsToCheck = (paramArrayType != null) ? par.Length - 1 : args.Length; 200if (index < args.Length) 255for (; j < args.Length; j++) 283if (j == args.Length) 303state = new BinderState((int[])paramOrder[0].Clone(), args.Length, paramArrayTypes[0] != null); 311if (parms.Length == args.Length) 323else if (parms.Length > args.Length) 330if (k < args.Length) 356objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[0], args.Length - paramArrayPos); 357Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 394state = new BinderState((int[])paramOrder[currentMin].Clone(), args.Length, paramArrayTypes[currentMin] != null); 401if (parameters.Length == args.Length) 413else if (parameters.Length > args.Length) 417for (i = 0; i < args.Length; i++) 441objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[currentMin], args.Length - paramArrayPos); 442Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 469for (i = 0; i < candidates.Length; i++) 545Type[] realTypes = new Type[types.Length]; 546for (i = 0; i < types.Length; i++) 555if (match == null || match.Length == 0) 563for (i = 0; i < candidates.Length; i++) 566if (par.Length != types.Length) 568for (j = 0; j < types.Length; j++) 598if (j == types.Length) 609int[] paramOrder = new int[types.Length]; 610for (i = 0; i < types.Length; i++) 645if (match == null || match.Length == 0) 654int indexesLength = (indexes != null) ? indexes.Length : 0; 655for (i = 0; i < candidates.Length; i++) 660if (par.Length != indexesLength) 761int paramArrayPos = args.Length - 1; 762if (args.Length == binderState._originalSize) 769object[] newArgs = new object[args.Length]; 771for (int i = paramArrayPos, j = 0; i < newArgs.Length; i++, j++) 780if (args.Length > binderState._originalSize) 795MethodBase[] aExactMatches = new MethodBase[match.Length]; 798for (int i = 0; i < match.Length; i++) 806for (j = 0; j < types.Length; j++) 814if (j < types.Length) 838int typesLength = (types != null) ? types.Length : 0; 839for (int i = 0; i < match.Length; i++) 877for (int i = 0; i < types.Length; i++) 1162object?[] varsCopy = new object[vars.Length]; 1163for (int i = 0; i < vars.Length; i++) 1168for (int i = 0, j = 0; i < vars.Length; j++) 1170if (paramOrder[j] < vars.Length) 1192for (int i = 0; i < names.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackFrame.cs (1)
218while (k < typars.Length)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (1)
275while (k < typars.Length)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (2)
118else if (eventSourceIndex >= s_counterGroups.Length) 121Array.Copy(s_counterGroups, newCounterGroups, s_counterGroups.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (3)
39for (int i = 0; i < bufferedValues.Length; i++) 156if (_bufferedValues.Length <= i) 177for (int i = 0; i < _bufferedValues.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (4)
120Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length); 125for (int i = 0; i < providers.Length; i++) 138for (int i = 0; i < providers.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
23EventParameterInfo[] eventParams = new EventParameterInfo[parameters.Length]; 24for (int i = 0; i < parameters.Length; i++) 51EventParameterInfo[] eventParams = new EventParameterInfo[typeInfos.Length]; 52for (int i = 0; i < typeInfos.Length; i++) 91if ((parameters.Length == 1) && (parameters[0].ParameterType == typeof(EmptyStruct))) 166WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length); 195WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length); 276EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length); 329EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length); 422EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs (2)
18object[] decodedFields = new object[parameters.Length]; 19for (int i = 0; i < parameters.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (9)
274*(int*)dataBuffer = blobRet.Length; 282dataDescriptor->Size = (uint)blobRet.Length; 469int argCount = eventPayload.Length; 501for (index = 0; index < eventPayload.Length; index++) 513if (eventPayload.Length + idx + 1 - index > EtwMaxNumberArguments) 1315while (idx < buffer.Length && buffer[idx] != 0) 1332while (dataStart < data.Length) 1337if (valueEnd < data.Length) 1361Marshal.Copy((IntPtr)(void*)filterData->Ptr, data, 0, data.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (63)
455return (manifestBytes == null) ? null : Encoding.UTF8.GetString(manifestBytes, 0, manifestBytes.Length); 535for (int i = 0; i < m_traits.Length - 1; i += 2) 785int cnt = m_eventData.Length; 793uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0; 1125if (arg1 == null || arg1.Length == 0) 1138int blobSize = arg1.Length; 1163if (arg2 == null || arg2.Length == 0) 1176int blobSize = arg2.Length; 1459var argValues = new object?[args.Length]; 1460for (int i = 0; i < args.Length; i++) 1639if (m_traits != null && m_traits.Length % 2 != 0) 1776for (int i = 0; i < decodedObjects.Length; i++, data++) 1926Marshal.Copy(data->DataPointer, blob, 0, blob.Length); 2086int paramCount = Math.Min(eventTypes.typeInfos.Length, args.Length); // parameter count mismatch get logged in LogEventArgsMismatches 2087var eventData = new object?[eventTypes.typeInfos.Length]; 2106if (args.Length != infos.Length) 2108ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventId, args.Length, infos.Length)); 2112for (int i = 0; i < args.Length; i++) 2137ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventCallbackArgs.EventId, eventDataCount, metadata.Parameters.Length)); 2147args = new object?[Math.Min(eventDataCount, metadata.Parameters.Length)]; 2151for (int i = 0; i < args.Length; i++, data++) 2160for (int i = 0; i < args.Length; i++, data++) 2281uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0; 2328for (int evtId = 0; evtId < dispatcher.m_EventEnabled.Length; ++evtId) 2380if (eventChannel != EventChannel.None && this.m_channelData != null && this.m_channelData.Length > (int)eventChannel) 2543var names = new string[parameters.Length]; 2544for (int i = 0; i < names.Length; i++) 2563var types = new Type[parameters.Length]; 2564for (int i = 0; i < types.Length; i++) 2682for (int i = 0; i < m_eventData.Length; i++) 2755for (int i = 0; i < m_eventData.Length; i++) 2824if (eventId >= m_eventData.Length) 2838if (eventId >= dispatcher.m_EventEnabled.Length) 2854for (int i = 0; i < m_eventData.Length; i++) 2896dispatcher.m_EventEnabled ??= new bool[m_eventData.Length]; 2928int dataLeft = rawManifest.Length; 3156eventData = new EventMetadata[methods.Length + 1]; 3230for (int i = 0; i < methods.Length; i++) 3321if (eventData != null && startEventId < eventData.Length) 3353for (int fieldIdx = 0; fieldIdx < args.Length; fieldIdx++) 3405bNeedsManifest = (flags & EventManifestOptions.OnlyIfNeededForRegistration) == 0 || manifest.GetChannelData().Length > 0; 3412res = (res.Length > 0) ? res : null; 3451if (args.Length > 0 && args[0].ParameterType == typeof(Guid) && 3454var newargs = new ParameterInfo[args.Length - 1]; 3455Array.Copy(args, 1, newargs, 0, args.Length - 1); 3503if (eventData.Length <= eventAttribute.EventId) 3505EventMetadata[] newValues = new EventMetadata[Math.Max(eventData.Length + 16, eventAttribute.EventId + 1)]; 3506Array.Copy(eventData, newValues, eventData.Length); 3532int eventListenerParameterCount = eventParameters.Length; 3570int idx = eventData.Length; 3577if (eventData.Length - idx > 2) // allow one wasted slot. 3580Array.Copy(eventData, newValues, newValues.Length); 3593enabledArray = new bool[m_eventData.Length]; 3613if (evtId < eventData.Length && eventData[evtId].Descriptor.EventId != 0) 3621for (int idx = 0; idx < eventData.Length; ++idx) 3712for (int idx = 0; idx < instrs.Length;) 3766for (int search = idx + 1; search < instrs.Length; search++) 3802if (idx >= instrs.Length || instrs[idx] >= 6) 4431for (int i = 0; i < eventDispatcher.m_EventEnabled.Length; ++i) 4633for (int i = 0; i < eventSourcesSnapshot.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.cs (1)
54if (eventID >= m_eventData!.Length)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs (4)
34count = array.Length; 35for (int i = 0; i < array.Length; i++) 48var serializedArray = new object?[array.Length]; 49for (int i = 0; i < array.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ConcurrentSet.cs (3)
33int hi = oldItems.Length; 78int hi = oldItems.Length; 100int oldLength = oldItems.Length;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (3)
281if (this.buffer == null || this.buffer.Length < required) 290if (this.buffer == null || this.buffer.Length < required) 298int newSize = this.buffer == null ? 64 : this.buffer.Length;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (3)
19Debug.Assert(payloadNames.Length == payloadValues.Length); 81public int Count => m_names.Length;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (1)
87checked((ushort)(custom == null ? 0 : custom.Length)),
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\InvokeTypeInfo.cs (4)
28if (typeAnalysis.properties.Length != 0) 73var membersNames = new string[this.properties.Length]; 74var membersValues = new object?[this.properties.Length]; 75for (int i = 0; i < this.properties.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\NameInfo.cs (1)
91uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (2)
339if (attributes.Length != 0) 351if (attributes.Length != 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingDataCollector.cs (1)
95DataCollector.ThreadInstance.AddArray(array, array == null ? 0 : array.Length, elementSize);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (4)
29if (eventID >= 0 && eventID < innerTable.Length) 43if (eventID >= m_innerTable.Length) 45int newSize = m_innerTable.Length * 2; 52Array.Copy(m_innerTable, newTable, m_innerTable.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (11)
442descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1); 443descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1); 455for (int i = 0; i < eventTypes.typeInfos.Length; i++) 537int descriptorsLength = eventTypes.dataCount + eventTypes.typeInfos.Length * 2 + 3; 549descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1); 550descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1); 553for (int i = 0; i < eventTypes.typeInfos.Length; i++) 620descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1); 621descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1); 746for (int i = 0; i < m_traits.Length - 1; i += 2) 773int startPos = providerMetadata.Length - traitMetaData.Count;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventTypes.cs (10)
97for (int i = 0; i < typeInfos.Length; ++i) 171this.nameInfos.GetOrAdd(new NameInfo(name, tags, this.typeMetadata.Length)); 178var recursionCheck = new List<Type>(paramInfos.Length); 179var result = new TraceLoggingTypeInfo[paramInfos.Length]; 180for (int i = 0; i < paramInfos.Length; ++i) 193var recursionCheck = new List<Type>(types.Length); 194var result = new TraceLoggingTypeInfo[types.Length]; 195for (int i = 0; i < types.Length; i++) 215string[] paramNames = new string[paramInfos.Length]; 216for (int i = 0; i < paramNames.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TypeAnalysis.cs (1)
38propertyInfo.GetIndexParameters().Length != 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
153HexConverter.EncodeToUtf16(byteArray, builder.AppendSpan(byteArray.Length * 2));
src\libraries\System.Private.CoreLib\src\System\Enum.cs (19)
187if (uint32Value < (uint)names.Length) 195if (ulong.CreateTruncating(value) < (ulong)names.Length) 206if ((uint)index < (uint)names.Length) 293var result = new TEnum[values.Length]; 294Array.Copy(values, result, values.Length); 502return ulong.CreateTruncating(value) < (ulong)values.Length; 534return values.Length <= NumberOfValuesThreshold ? 1083for (int i = 0; i < enumNames.Length; i++) 1095for (int i = 0; i < enumNames.Length; i++) 1933Debug.Assert(names.Length == values.Length); 1968Debug.Assert(names.Length == values.Length); 2032return values.Length > 0 && values[0] == TStorage.Zero ? 2041for (i = values.Length - 1; (uint)i < (uint)values.Length; i--) 2071if ((uint)index >= (uint)values.Length) 2269for (int i = 0; i < values.Length; i++) 2282for (int i = 1; i < values.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (7)
149if (this.saMonthGenitiveNames == null || this.saMonthGenitiveNames.Length == 0 || string.IsNullOrEmpty(this.saMonthGenitiveNames[0])) 151if (this.saAbbrevMonthGenitiveNames == null || this.saAbbrevMonthGenitiveNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevMonthGenitiveNames[0])) 153if (this.saLeapYearMonthNames == null || this.saLeapYearMonthNames.Length == 0 || string.IsNullOrEmpty(this.saLeapYearMonthNames[0])) 173this.iCurrentEra = this.saEraNames.Length; 265this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0]); 277if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevEraNames[0])) 318if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevEraNames[0]))
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (4)
64Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13); 101count = Interop.Globalization.GetCalendars(localeName, calendars, calendars.Length); 105if (count == 0 && calendars.Length > 0) 406if (calendarId != CalendarId.JAPAN && calendarId != CalendarId.JAPANESELUNISOLAR && eraNames?.Length > 0)
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
412pBytes, keyData.Length,
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (6)
1376_saLongTimes = longTimes != null && longTimes.Length != 0 ? longTimes : Invariant._saLongTimes!; 1397_saShortTimes = shortTimes != null && shortTimes.Length != 0 ? shortTimes : DeriveShortTimesFromLong(); 1411string[] shortTimes = new string[longTimes.Length]; 1413for (int i = 0; i < longTimes.Length; i++) 2168if (digits.Length < NumberFormatInfo.s_asciiDigits.Length) 2189for (int i = 0; i < result.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (3)
273for (int i = 0; i < array.Length; i++) 314for (i = 0, j = 0; i < win32Str.Length && j < values.Length; i += 2, j++) 501for (int i = 0; i < cultures.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (2)
855Calendar[] cals = new Calendar[calID.Length]; 856for (int i = 0; i < cals.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (4)
1737results = new string[allFormats.Length]; 1738for (int i = 0; i < allFormats.Length; i++) 1746results = new string[allFormats.Length]; 1747for (int i = 0; i < allFormats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (65)
172Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 186Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week"); 200Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 214Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13, 229Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13, 272Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 275Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 278Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 281Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 284Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 386for (int i = 0; i < OptionalCalendars.Length; i++) 482for (int i = 0; i < EraNames.Length; i++) 493for (int i = 0; i < AbbreviatedEraNames.Length; i++) 501for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++) 530if ((uint)era >= names.Length) 545if (AbbreviatedEraNames.Length == 0) 559if ((uint)era >= (uint)names.Length) 1038Debug.Assert(values.Length >= length); 1058if (value.Length != 7) 1063CheckNullValue(value, value.Length); 1083if (value.Length != 7) 1088CheckNullValue(value, value.Length); 1103if (value.Length != 7) 1108CheckNullValue(value, value.Length); 1125if (value.Length != 13) 1130CheckNullValue(value, value.Length - 1); 1146if (value.Length != 13) 1151CheckNullValue(value, value.Length - 1); 1177if ((uint)month >= (uint)monthNamesArray.Length) 1179ThrowHelper.ThrowArgumentOutOfRange_Range(nameof(month), month + 1, 1, monthNamesArray.Length); 1196Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13, 1206Debug.Assert(genitiveMonthNames.Length == 13, 1224Debug.Assert(leapYearMonthNames.Length == 13, 1235if ((uint)dow >= (uint)names.Length) 1250if ((uint)dow >= (uint)names.Length) 1267string[] result = new string[patterns1.Length * patterns2.Length]; 1271for (int i = 0; i < patterns1.Length; i++) 1273for (int j = 0; j < patterns2.Length; j++) 1323if ((uint)dow >= (uint)names.Length) 1335if ((uint)month >= (uint)names.Length) 1347if ((uint)month >= (uint)names.Length) 1366Debug.Assert(patterns != null && patterns.Length > 0, 1379for (i = 0; i < patterns.Length; i++) 1390if (i < patterns.Length) 1402newPatterns = new string[patterns.Length + 1]; 1405Array.Copy(patterns, 0, newPatterns, 1, patterns.Length); 1446Debug.Assert(allYearMonthPatterns.Length > 0, 1467Debug.Assert(allShortDatePatterns.Length > 0, 1488Debug.Assert(allLongDatePatterns.Length > 0, 1508Debug.Assert(allShortTimePatterns.Length > 0, 1528Debug.Assert(allLongTimePatterns.Length > 0, 1590if (patterns.Length == 0) 1595for (int i = 0; i < patterns.Length; i++) 1652if (value.Length != 13) 1657CheckNullValue(value, value.Length - 1); 1673if (value.Length != 13) 1678CheckNullValue(value, value.Length - 1); 2014for (int i = 0; i < dateWords.Length; i++) 2093for (int i = 1; i <= eras.Length; i++) 2114for (int i = 1; i <= jaDtfi.Calendar.Eras.Length; i++) 2127for (int i = 1; i <= twDtfi.Calendar.Eras.Length; i++) 2162for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (6)
486for (i = 0; i < datePatterns.Length; i++) 493for (i = 0; i < datePatterns.Length; i++) 499for (i = 0; i < datePatterns.Length; i++) 509for (i = 0; i < datePatterns.Length; i++) 516for (i = 0; i < datePatterns.Length; i++) 600for (int i = 0; i < array.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (7)
184if (formats.Length == 0) 196for (int i = 0; i < formats.Length; i++) 3672for (int i = 0; i < eras.Length; i++) 5268if (strs == null || strs.Length == 0) 5270if (strs.Length == 1) 5282for (int i = 1; i < strs.Length - 1; i++) 5707for (int i = 0; i < words.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\EastAsianLunisolarCalendar.cs (2)
96for (int i = 0; i < eraInfo.Length; i++) 126for (int i = 0; i < eraInfo.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\GregorianCalendarHelper.cs (3)
92for (int i = 0; i < eras.Length; i++) 328var eras = new int[eraInfo.Length]; 329for (int i = 0; i < eraInfo.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (3)
301private static readonly char s_maxHebrewNumberCh = (char)(minHebrewNumberCh + s_hebrewValues.Length - 1); 399Debug.Assert(s_numberPassingState.Length == HebrewTokenCount * ((int)HS.S9_DQ + 1)); 413if (index >= 0 && index < s_hebrewValues.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (1)
46if (actualLength == 0 || actualLength > outputHeap.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.cs (9)
211string[] eraNames = new string[eras.Length]; 213for (int i = 0; i < eras.Length; i++) 216eraNames[i] = eras[eras.Length - i - 1].eraName!; 225string[] erasAbbrev = new string[eras.Length]; 227for (int i = 0; i < eras.Length; i++) 230erasAbbrev[i] = eras[eras.Length - i - 1].abbrevEraName!; 239string[] erasEnglish = new string[eras.Length]; 241for (int i = 0; i < eras.Length; i++) 244erasEnglish[i] = eras[eras.Length - i - 1].englishEraName!;
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (3)
112int startIndex = abbrevEnglishEraNames == s_abbreviatedEnglishEraNames ? eras.Count - 1 : abbrevEnglishEraNames.Length - 1; 114Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 120if (startIndex < abbrevEnglishEraNames.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseLunisolarCalendar.cs (2)
169EraInfo[] newEras = new EraInfo[baseEras.Length]; 173for (int i = 0; i < baseEras.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (4)
108if (nativeDig.Length != 10) 113for (int i = 0; i < nativeDig.Length; i++) 285for (int i = 0; i < groupSize.Length; i++) 289if (i == groupSize.Length - 1 && groupSize[i] == 0)
src\libraries\System.Private.CoreLib\src\System\Globalization\StringInfo.cs (5)
67public int LengthInTextElements => Indexes?.Length ?? 0; 71return SubstringByTextElements(startingTextElement, (Indexes?.Length ?? 0) - startingTextElement); 78if ((uint)startingTextElement >= (uint)indexes.Length) 82if ((uint)lengthInTextElements > (uint)(indexes.Length - startingTextElement)) 90if ((uint)(startingTextElement + lengthInTextElements) < (uint)indexes.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (1)
503for (int i = 0; i < _literals.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (2)
1674if (formats.Length == 0) 1681for (int i = 0; i < formats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (1)
231for (int i = 0; i < mapping.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Guid.cs (1)
125if (d.Length != 8)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (4)
300if (buffer.Length - index < count) 419if (buffer.Length - index < count) 445int numRead = _stream.ReadAtLeast(result, result.Length, throwOnEndOfStream: false); 447if (numRead != result.Length)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (2)
160OutStream.Write(buffer, 0, buffer.Length); 235if (index > chars.Length - count)
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (1)
121if (_buffer.Length != _bufferSize || _bufferSize >= MaxShadowBufferSize)
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (2)
110FindNextEntry(entryBufferPtr, _entryBuffer == null ? 0 : _entryBuffer.Length); 171FindNextEntry(entryBufferPtr, _entryBuffer == null ? 0 : _entryBuffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (4)
1222if (bytesRead == rentedArray.Length) 1224uint newLength = (uint)rentedArray.Length * 2; 1227newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1); 1239Debug.Assert(bytesRead < rentedArray.Length);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (2)
66_length = _capacity = buffer.Length; 87if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
80if (TryGetHomeDirectoryFromPasswd(buf, heapBuf.Length, out userHomeDirectory))
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
25int len = array.Length;
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (2)
68while ((bytesRead = Read(buffer, 0, buffer.Length)) != 0) 960if ((uint)count > buffer.Length - offset)
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (16)
354if (buffer.Length - index < count) 433if (buffer.Length - index < count) 465_ = byteBuffer.Length; // allow JIT to prove object is not null 526int newMaxCharsPerBuffer = _encoding.GetMaxCharCount(byteBuffer.Length); 599int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos); 613_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length); 626_isBlocked = (_byteLen < _byteBuffer.Length); 703int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos); 717_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length); 730_isBlocked = (_byteLen < _byteBuffer.Length); 964else if ((arrayPoolBuffer.Length - arrayPoolBufferPos) < (charLen - charPos)) 1055if (buffer.Length - index < count) 1142int len = await tmpStream.ReadAsync(new Memory<byte>(tmpByteBuffer, tmpBytePos, tmpByteBuffer.Length - tmpBytePos), cancellationToken).ConfigureAwait(false); 1192_isBlocked = (_byteLen < tmpByteBuffer.Length); 1266if (buffer.Length - index < count) 1364_isBlocked = (_byteLen < tmpByteBuffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (11)
310(_byteBuffer = new byte[_encoding.GetMaxByteCount(_charBuffer.Length)]); 375if (buffer.Length - index < count) 432if (dstPos == charBuffer.Length) 438int n = Math.Min(charBuffer.Length - dstPos, count); 454for (int i = 0; i < coreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 685for (int i = 0; i < CoreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 735if (buffer.Length - index < count) 799for (int i = 0; i < CoreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 887if (buffer.Length - index < count) 984if (preamble.Length > 0) 990byte[] byteBuffer = _byteBuffer ??= new byte[_encoding.GetMaxByteCount(_charBuffer.Length)];
src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (3)
92if (buffer.Length - index < count) 293if (buffer.Length - index < count) 311if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\StringWriter.cs (1)
94if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (6)
76if (buffer.Length - index < count) 123while ((len = Read(chars, 0, chars.Length)) != 0) 266if (buffer.Length - index < count) 296if (buffer.Length - index < count) 396if (buffer.Length - index < count) 409if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (2)
38return writers.Length != 0 ? 49Debug.Assert(writers is { Length: > 0 });
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (4)
136Write(buffer, 0, buffer.Length); 150if (buffer.Length - index < count) 581return WriteAsync(buffer, 0, buffer.Length); 645return WriteLineAsync(buffer, 0, buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (2)
319if (array.Length - offset < count) 545if (array.Length - offset < count)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (1)
119stream.Write(buffer, 0, buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Memory.cs (4)
52_length = array.Length; 67if ((uint)start > (uint)array.Length) 72_length = array.Length - start; 101if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (8)
35if ((uint)start > (uint)array.Length) 38return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), array.Length - start); 58int actualIndex = startIndex.GetOffset(array.Length); 59if ((uint)actualIndex > (uint)array.Length) 62return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)actualIndex /* force zero-extension */), array.Length - actualIndex); 85(int start, int length) = range.GetOffsetAndLength(array.Length); 2765int actualIndex = startIndex.GetOffset(array.Length); 2799(int start, int length) = range.GetOffsetAndLength(array.Length);
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (3)
544if (decodedBytesCount < decodedBytes.Length) 594ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, bytes.Length); 597ArgumentOutOfRangeException.ThrowIfGreaterThan(count, bytes.Length - offset);
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (5)
56if (values.Length < Count) 75if ((index < 0) || ((values.Length - index) < Count)) 630if (destination.Length < Count) 649if ((uint)startIndex >= (uint)destination.Length) 654if ((destination.Length - startIndex) < Count)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (3)
612if (array.Length < Count) 635if ((uint)index >= (uint)array.Length) 640if ((array.Length - index) < Count)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (3)
645if (array.Length < Count) 668if ((uint)index >= (uint)array.Length) 673if ((array.Length - index) < Count)
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
352Shuffle(new Span<T>(ref MemoryMarshal.GetArrayDataReference(values), values.Length));
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (2)
52_length = array.Length; 79if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (2)
48_length = array.Length; 74if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (9)
32TypeInfo[] typeinfos = new TypeInfo[types.Length]; 33for (int i = 0; i < types.Length; i++) 45if (m.Length == 1) 51Type[][] moduleTypes = new Type[m.Length][]; 53for (int i = 0; i < moduleTypes.Length; i++) 56finalLength += moduleTypes[i].Length; 61for (int i = 0; i < moduleTypes.Length; i++) 63int length = moduleTypes[i].Length; 261if (rawAssembly.Length == 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
428if (dest is null || dest.Length < destPos + (currentInputPos - prevInputPos) + charsToAdd)
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (3)
16if (publicKey.Length == 0) 30for (int i = 0; i < publicKeyToken.Length; i++) 40uint publicKeyLength = (uint)(publicKey.Length);
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (1)
66_argCount = _argTypes.Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (5)
233_parameterTypes = new RuntimeType[signature.Length]; 234for (int i = 0; i < signature.Length; i++) 387if (position < 0 || position > _parameterTypes.Length) 418RuntimeParameterInfo[] parameters = new RuntimeParameterInfo[parameterTypes.Length]; 419for (int i = 0; i < parameterTypes.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilder.cs (1)
26if (names.Length == 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
70for (int i = 0; i < _inst.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
86for (int i = 0; i < args.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
235if (_iaLowerBound.Length <= _rank)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs (5)
89if (names.Length == 0) 127if (parameterTypeOptionalCustomModifiers != null && parameterTypeOptionalCustomModifiers.Length != parameterTypes.Length) 130if (parameterTypeRequiredCustomModifiers != null && parameterTypeRequiredCustomModifiers.Length != parameterTypes.Length)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (3)
118Type[] instSubstituted = new Type[inst.Length]; 120for (int i = 0; i < instSubstituted.Length; i++) 242for (int i = 0; i < _typeArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (1)
295for (int i = 0; i < genericArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBase.cs (1)
95for (int i = 0; i < parameterTypes.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (2)
34_argCount = _argTypes.Length; 326for (int i = 0; i < dest.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInfo.Internal.cs (1)
8internal virtual int GenericParameterCount => GetGenericArguments().Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (1)
84_argCount = _argTypes.Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (1)
35int argCount = argumentTypes.Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (1)
42for (int i = 0; i < parameterTypes.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
26for (int i = 0; i < genericArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Module.cs (4)
54for (int i = 0; i < types.Length; i++) 94for (int i = 0; i < c.Length; i++) 101if (cnt == c.Length) 106for (int i = 0; i < c.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (5)
396genericArgumentsState = new NullabilityInfo[genericArguments.Length]; 398for (int i = 0; i < genericArguments.Length; i++) 473if (nullability.GenericTypeArguments.Length > 0) 477for (int i = 0; i < genericArguments.Length; i++) 617if (nullability.GenericTypeArguments.Length > 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\ReflectionTypeLoadException.cs (1)
58if (exceptions.Length == 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeConstructorInfo.cs (4)
115int argCount = (parameters is null) ? 0 : parameters.Length; 116if (ArgumentTypes.Length != argCount) 147int argCount = (parameters is null) ? 0 : parameters.Length; 148if (ArgumentTypes.Length != argCount)
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs (2)
118int argCount = (parameters is null) ? 0 : parameters.Length; 119if (ArgumentTypes.Length != argCount)
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureConstructedGenericType.cs (3)
18for (int i = 0; i < typeArguments.Length; i++) 44for (int i = 0; i < _genericTypeArguments.Length; i++) 67for (int i = 0; i < _genericTypeArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureTypeExtensions.cs (4)
58int count = patternGenericTypeArguments.Length; 59if (count != actualGenericTypeArguments.Length) 132int count = genericTypeArguments.Length; 153if (position >= genericMethodParameters.Length)
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeInfo.cs (1)
127for (int i = 0; i < constraints.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (1)
76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!");
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (1)
441int length = resourceSetNames.Length;
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (2)
186if (typeCode < 0 || typeCode >= ResourceTypeCode.StartOfUserTypes + _typeTable.Length) 196if (bytes.Length != len)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (3)
412for (int i = 0; i < arr.Length; i++) 976if (typeIndex < 0 || typeIndex >= _typeTable.Length) 1044Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (18)
467for (int i = 0; i < _buckets.Length; i++) 485Debug.Assert(buckets.Length == entries.Length); 486Debug.Assert(BitOperations.IsPow2(buckets.Length)); 494internal bool HasCapacity => _firstFreeEntry < _entries.Length; 512int bucket = hashCode & (_buckets.Length - 1); 552int bucket = hashCode & (_buckets.Length - 1); 571if (index < _entries.Length) 650int newSize = _buckets.Length; 657for (int entriesIndex = 0; entriesIndex < _entries.Length; entriesIndex++) 680newSize = _buckets.Length * 2; 688Debug.Assert(newSize >= _buckets.Length); 694for (int bucketIndex = 0; bucketIndex < newBuckets.Length; bucketIndex++) 709for (; newEntriesIndex < _entries.Length; newEntriesIndex++) 717int bucket = hashCode & (newBuckets.Length - 1); 726for (int entriesIndex = 0; entriesIndex < _entries.Length; entriesIndex++) 740int bucket = hashCode & (newBuckets.Length - 1); 820for (int entriesIndex = 0; entriesIndex < entries.Length; entriesIndex++)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\FormattableStringFactory.cs (1)
38public override int ArgumentCount => _arguments.Length;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (4)
131return table.Length - 2; 250if (table.Length == 2) 326if (table.Length == 2) 371return table.Length - 1;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (2)
358Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (1)
33(int offset, int length) = range.GetOffsetAndLength(array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
31if ((uint)size > (uint)items.Length)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (1)
537for (int i = 0; i < mi.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (5)
39numElements = managed.Length; 141if (array.Length <= buffer.Length) 143_span = buffer[0..array.Length]; 147int bufferSize = checked(array.Length * sizeof(TUnmanagedElement)); 150_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (5)
40numElements = managed.Length; 142if (array.Length <= buffer.Length) 144_span = buffer[0..array.Length]; 148int bufferSize = checked(array.Length * sizeof(TUnmanagedElement)); 151_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (3)
413return index == 0 && length == array.Length ? 611if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
96Debug.Assert(tokens.Length != 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (2)
219if (array.Length - index < count) 307if (array.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (5)
775if (destination.Length < Vector128<T>.Count) 797if ((uint)startIndex >= (uint)destination.Length) 802if ((destination.Length - startIndex) < Vector128<T>.Count) 979if (values.Length < Vector128<T>.Count) 1000if ((index < 0) || ((values.Length - index) < Vector128<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (5)
614if (destination.Length < Vector256<T>.Count) 636if ((uint)startIndex >= (uint)destination.Length) 641if ((destination.Length - startIndex) < Vector256<T>.Count) 818if (values.Length < Vector256<T>.Count) 839if ((index < 0) || ((values.Length - index) < Vector256<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (5)
542if (destination.Length < Vector512<T>.Count) 563if ((uint)startIndex >= (uint)destination.Length) 568if ((destination.Length - startIndex) < Vector512<T>.Count) 736if (values.Length < Vector512<T>.Count) 756if ((index < 0) || ((values.Length - index) < Vector512<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (5)
558if (destination.Length < Vector64<T>.Count) 580if ((uint)startIndex >= (uint)destination.Length) 585if ((destination.Length - startIndex) < Vector64<T>.Count) 776if (values.Length < Vector64<T>.Count) 797if ((index < 0) || ((values.Length - index) < Vector64<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (6)
105Debug.Assert(_names.Length == _count, "[SerializationInfo.ExpandArrays]_names.Length == _count"); 235if (_count >= _names.Length) 310Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 311Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 327Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 328Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfoEnumerator.cs (3)
42Debug.Assert(members.Length >= numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 43Debug.Assert(info.Length >= numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 44Debug.Assert(types.Length >= numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (19)
135Array ret = Array.CreateInstance(this, values.Length); 136Array.Copy(values, ret, values.Length); 289for (int i = 0; i < constraints.Length; i++) 336if (namedParams.Length > providedArgs.Length) 341if (namedParams.Length != 0) 397int argCnt = (providedArgs != null) ? providedArgs.Length : 0; 455if (flds.Length == 1) 459else if (flds.Length > 0) 566for (int i = 0; i < semiFinalists.Length; i++) 580results ??= new List<MethodInfo>(semiFinalists.Length) { finalist }; 601for (int i = 0; i < semiFinalists.Length; i++) 626results ??= new List<MethodInfo>(semiFinalists.Length) { finalist }; 682for (int i = 0; i < constraints.Length; i++) 725for (int i = 0; i < genericArguments.Length; i++) 731if (genericArguments.Length != genericParameters.Length) 733SR.Format(SR.Argument_NotEnoughGenArguments, genericArguments.Length, genericParameters.Length));
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitmapCharSearchValues.cs (2)
32for (int i = 0; i < _bitmap.Length * 32; i++) 51return offset < (uint)bitmap.Length && (bitmap[offset] & (1u << value)) != 0;
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (2)
85ulong offset = FastMod(value, (uint)hashEntries.Length, multiplier); 86Debug.Assert(offset < (ulong)hashEntries.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeByteSearchValues.cs (1)
25for (int i = 0; i < values.Length; i++)
src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeCharSearchValues.cs (1)
28for (int i = 0; i < values.Length; i++)
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.T.cs (2)
54string display = $"{GetType().Name}, Count = {values.Length}"; 55if (values.Length > 0)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (4)
127Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 135Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 276Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 284Debug.Assert((uint)nodeIndex < (uint)_nodes.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (1)
45if (c < (uint)table.Length)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
86newBucket = new string[existingBucket.Length + 1];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (4)
50Debug.Assert(valueBuckets.Length <= 8); 55for (int i = 0; i < valueBuckets.Length; i++) 117for (int bucketIndex = 0; bucketIndex < buckets.Length; bucketIndex++) 129Debug.Assert(count == strings.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
373Debug.Assert(newValuesCount == newValues.Length);
src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (2)
305int iMax = s_escapeStringPairs.Length; 345int iMax = s_escapeStringPairs.Length;
src\libraries\System.Private.CoreLib\src\System\Span.cs (2)
50_length = array.Length; 79if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (1)
61for (int i = 0; i < startupHooks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\String.cs (4)
79if (value == null || value.Length == 0) 82string result = FastAllocateString(value.Length); 103ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, value.Length - length); 424ArgumentOutOfRangeException.ThrowIfGreaterThan(destinationIndex, destination.Length - count);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (9)
134for (int i = 0; i < strings.Length; i++) 780ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, value.Length - count); 1766if (!singleSeparator && (separators == null || separators.Length == 0)) 2353if (trimChars == null || trimChars.Length == 0) 2359return TrimHelper(pTrimChars, trimChars.Length, TrimType.Both); 2394if (trimChars == null || trimChars.Length == 0) 2400return TrimHelper(pTrimChars, trimChars.Length, TrimType.Head); 2435if (trimChars == null || trimChars.Length == 0) 2441return TrimHelper(pTrimChars, trimChars.Length, TrimType.Tail);
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (11)
91if (chars!.Length - index < count) 230if ((uint)byteIndex > bytes!.Length) 238return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 273if (chars!.Length - charIndex < charCount) 278if ((uint)byteIndex > bytes!.Length) 286return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 451if (bytes!.Length - index < count) 564if (bytes!.Length - byteIndex < byteCount) 569if ((uint)charIndex > (uint)chars!.Length) 577return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 741if (bytes!.Length - byteIndex < byteCount)
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (2)
230if (bytes.Length - byteIndex < byteCount) 234if (chars.Length - charIndex < charCount)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderExceptionFallback.cs (3)
50StringBuilder strBytes = new StringBuilder(bytesUnknown.Length * 4); 53for (int i = 0; i < bytesUnknown.Length && i < MaxLength; i++) 59if (bytesUnknown.Length > MaxLength)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (4)
112if (this.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length))) 167if (this.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length))) 298StringBuilder strBytes = new StringBuilder(bytesUnknown.Length * 3); 300for (i = 0; i < bytesUnknown.Length && i < 20; i++)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (6)
56if (bytes.Length - index < count) 95if (bytes.Length - byteIndex < byteCount) 99if (charIndex < 0 || charIndex > chars.Length) 103int charCount = chars.Length - charIndex; 148if (bytes.Length - byteIndex < byteCount) 152if (chars.Length - charIndex < charCount)
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (2)
228if (chars.Length - charIndex < charCount) 232if (bytes.Length - byteIndex < byteCount)
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (6)
51if (chars.Length - index < count) 85if (chars.Length - charIndex < charCount) 89if (byteIndex < 0 || byteIndex > bytes.Length) 93int byteCount = bytes.Length - byteIndex; 134if (chars.Length - charIndex < charCount) 138if (bytes.Length - byteIndex < byteCount)
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (8)
176return Convert(srcEncoding, dstEncoding, bytes, 0, bytes.Length); 529return GetByteCount(chars, 0, chars.Length); 540return GetByteCount(chars, 0, chars.Length); 596return GetBytes(chars, 0, chars.Length); 761return GetCharCount(bytes, 0, bytes.Length); 798return GetChars(bytes, 0, bytes.Length); 1002return GetString(bytes, 0, bytes.Length); 1383_bytes -= byteBuffer.Length; // Didn't use how many ever bytes we're falling back
src\libraries\System.Private.CoreLib\src\System\Text\EncodingProvider.cs (2)
69var newProviders = new EncodingProvider[providers.Length + 1]; 70Array.Copy(providers, newProviders, providers.Length);
src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (1)
131Debug.Assert(arrayEncodingInfoIdx == arrayEncodingInfo.Length);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (20)
68if (chars.Length - index < count) 209if (chars!.Length - charIndex < charCount) 214if ((uint)byteIndex > bytes!.Length) 222return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 276if ((uint)byteIndex > bytes!.Length) 284return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 355return bytes.Length; 370if (bytes.Length - index < count) 436if (bytes.Length == 0) 443char[] chars = new char[bytes.Length]; 448GetCharsCommon(pBytes, bytes.Length, pChars, chars.Length); 470if (bytes.Length - byteIndex < byteCount) 475if ((uint)charIndex > (uint)chars.Length) 483return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 503if (bytes.Length - index < count) 515GetCharsCommon(pBytes + index, count, pChars, chars.Length); 556string result = string.FastAllocateString(bytes.Length); 560GetCharsCommon(pBytes, bytes.Length, pChars, result.Length); 581if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (25)
238Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 248Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 266get => m_ChunkChars.Length + m_ChunkOffset; 334if ((uint)(chunkLength + chunkOffset) > (uint)result.Length || (uint)chunkLength > (uint)sourceArray.Length) 417int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length)); 419if (newLen > chunk.m_ChunkChars.Length) 431Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing."); 625if (_chunks.Length <= pos) 668if (((nuint)(uint)chunkLength + (nuint)(uint)repeatCount) <= (nuint)(uint)chunkChars.Length) 696int firstLength = chunkChars.Length - chunkLength; 700m_ChunkLength = chunkChars.Length; 733if (charCount > value.Length - startIndex) 845int length = Math.Min(m_ChunkChars.Length - m_ChunkLength, count); 849Debug.Assert(m_ChunkLength == 0 && m_ChunkChars.Length >= count); 876if (destinationIndex > destination.Length - count) 1008if ((uint)chars.Length > (uint)nextCharIndex) 1088Append(ref MemoryMarshal.GetArrayDataReference(value), value.Length); 1339Insert(index, ref MemoryMarshal.GetArrayDataReference(value), value.Length); 1363if (startIndex > value.Length - charCount) 2275if (((uint)chunkLength + (uint)valueCount) <= (uint)chunkChars.Length) 2311int firstLength = m_ChunkChars.Length - m_ChunkLength; 2315m_ChunkLength = m_ChunkChars.Length; 2392Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 2523get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength); 2658if (!doNotMoveFollowingChars && chunk.m_ChunkLength <= DefaultCapacity * 2 && chunk.m_ChunkChars.Length - chunk.m_ChunkLength >= count)
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (11)
92if (chars.Length - index < count) 152if (byteIndex < 0 || byteIndex > bytes.Length) 155int byteCount = bytes.Length - byteIndex; 187if (chars.Length - charIndex < charCount) 190if (byteIndex < 0 || byteIndex > bytes.Length) 198int byteCount = bytes.Length - byteIndex; 239if (bytes.Length - index < count) 279if (bytes.Length - byteIndex < byteCount) 282if (charIndex < 0 || charIndex > chars.Length) 290int charCount = chars.Length - charIndex; 331if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (11)
100if (chars.Length - index < count) 160if (byteIndex < 0 || byteIndex > bytes.Length) 163int byteCount = bytes.Length - byteIndex; 195if (chars.Length - charIndex < charCount) 198if (byteIndex < 0 || byteIndex > bytes.Length) 206int byteCount = bytes.Length - byteIndex; 247if (bytes.Length - index < count) 287if (bytes.Length - byteIndex < byteCount) 290if (charIndex < 0 || charIndex > chars.Length) 298int charCount = chars.Length - charIndex; 339if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (14)
62Debug.Assert(_base64Bytes.Length == 64); 136if (chars.Length - index < count) 196if (byteIndex < 0 || byteIndex > bytes.Length) 199int byteCount = bytes.Length - byteIndex; 231if (chars.Length - charIndex < charCount) 234if (byteIndex < 0 || byteIndex > bytes.Length) 242int byteCount = bytes.Length - byteIndex; 283if (bytes.Length - index < count) 323if (bytes.Length - byteIndex < byteCount) 326if (charIndex < 0 || charIndex > chars.Length) 334int charCount = chars.Length - charIndex; 375if (bytes.Length - index < count) 850Debug.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 903if (bytes.Length != 1)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (11)
141if (chars.Length - index < count) 277if ((uint)byteIndex > bytes.Length) 285return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 320if (chars.Length - charIndex < charCount) 325if ((uint)byteIndex > bytes.Length) 333return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 452if (bytes.Length - index < count) 515if (bytes.Length - byteIndex < byteCount) 520if ((uint)charIndex > (uint)chars.Length) 528return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 691if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (3)
123if (bytes?.Length <= MaxSmallInputElementCount) 136Debug.Assert(bytes.Length <= MaxSmallInputElementCount); 140int sourceLength = bytes.Length; // hoist this to avoid having the JIT auto-insert null checks
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (10)
392Debug.Assert(keyValues.Length is >= 5 and <= MaxMultiElements); 399for (int i = 0; i < _keyValues.Length; i++) 411else if (_keyValues.Length == 5) 428var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length - 1]; 430if (i != _keyValues.Length - 1) Array.Copy(_keyValues, i + 1, newValues, i, _keyValues.Length - i - 1); 446if (_keyValues.Length < MaxMultiElements) 448var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length + 1]; 449Array.Copy(_keyValues, newValues, _keyValues.Length); 450newValues[_keyValues.Length] = KeyValuePair.Create(key, value);
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (1)
979for (int i = 0; i < linkingRegistrations.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (1)
522int newNotificationIndex = newChangeNotifications.Length;
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
141handleCount += (nuint)((object[])userData).Length; 168for (int i = 0; i < objArray.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (1)
440Debug.Assert(numSamples <= samples.Length); // can't measure more samples than we have
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (2)
296Debug.Assert(_numPendingRemoves <= _pendingRemoves.Length); 298Debug.Assert(_numUserWaits <= _registeredWaits.Length);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (2)
1976if (tasks.Length == 0) ThrowHelper.ThrowArgumentException(ExceptionResource.Task_MultiTaskContinuation_EmptyTaskList, ExceptionArgument.tasks); 2027if (tasks.Length == 0) ThrowHelper.ThrowArgumentException(ExceptionResource.Task_MultiTaskContinuation_EmptyTaskList, ExceptionArgument.tasks);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (7)
5168Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5320for (int taskIndex = 0; taskIndex < tasks.Length; taskIndex++) 5337if (signaledTaskIndex == -1 && tasks.Length != 0) 6371Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6374m_count = tasks.Length; 6398T[] results = new T[m_tasks.Length]; 6406for (int i = 0; i < m_tasks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCache.cs (1)
36for (int i = 0; i < tasks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (1)
269for (int i = 0; i < combinedExceptions.Length - 1; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (12)
1554Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1556_count = tasksCopy.Length; 1603for (int i = 0; i < tasksCopy.Length; i++) 1624Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1626_count = tasksCopy.Length; 1673for (int i = 0; i < tasksCopy.Length; i++) 2970if (tasks.Length == 0) 2973Task[] tasksCopy = new Task[tasks.Length]; 2974for (int i = 0; i < tasks.Length; i++) 2989if (tasks.Length == 0) 2992Task<TResult>[] tasksCopy = new Task<TResult>[tasks.Length]; 2993for (int i = 0; i < tasks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (8)
262&& id < slotArray.Length // Is the table large enough? 286&& id < slotArray.Length // Is the table large enough? 350if (id >= slotArray.Length) 489return slotArray != null && id < slotArray.Length && slotArray[id].Value != null; 504if (slotArray == null || id >= slotArray.Length || (slot = slotArray[id].Value) == null || !_initialized) 519Debug.Assert(table.Length < minLength); 533for (int i = 0; i < table.Length; i++) 715for (int i = 0; i < slotArray.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (12)
37var newQueues = new WorkStealingQueue[oldQueues.Length + 1]; 38Array.Copy(oldQueues, newQueues, oldQueues.Length); 53if (oldQueues.Length == 0) 65var newQueues = new WorkStealingQueue[oldQueues.Length - 1]; 68Array.Copy(oldQueues, 1, newQueues, 0, newQueues.Length); 70else if (pos == oldQueues.Length - 1) 72Array.Copy(oldQueues, newQueues, newQueues.Length); 77Array.Copy(oldQueues, pos + 1, newQueues, pos, newQueues.Length - pos); 137var newArray = new object?[m_array.Length << 1]; 138for (int i = 0; i < m_array.Length; i++) 786int c = queues.Length; 1921for (int i = 0; i < items.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (2)
52for (int i = 0; i < queues.Length; i++) 514_associatedTimerQueue = TimerQueue.Instances[(uint)Thread.GetCurrentProcessorId() % TimerQueue.Instances.Length];
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
33var timers = new List<TimerQueue>(Instances.Length); 34s_scheduledTimersToFire ??= new List<TimerQueue>(Instances.Length);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (1)
219int currentLength = (safeWaitHandles != null) ? safeWaitHandles.Length : 0;
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (5)
79int currentLength = dataArray == null ? 0 : dataArray.Length; 134if (data._pinnedData == null || data._pinnedData.Length < objArray.Length) 135Array.Resize(ref data._pinnedData, objArray.Length); 137for (int i = 0; i < objArray.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
27for (int i = 0; i < _pinnedData.Length; i++)
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
714Debug.Assert(array.Length - offset < count);
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (1)
732for (int i = 0; i < formats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (7)
315if (ruleIndex.HasValue && 0 < ruleIndex.GetValueOrDefault() && ruleIndex.GetValueOrDefault() < _adjustmentRules.Length) 321for (int i = 1; i < _adjustmentRules.Length; i++) 1080if (!disableDaylightSavingTime && adjustmentRules?.Length > 0) 1180if (_adjustmentRules == null || _adjustmentRules.Length == 0) 1195int high = _adjustmentRules.Length - 1; 2165if (adjustmentRules != null && adjustmentRules.Length != 0) 2169for (int i = 0; i < adjustmentRules.Length; i++)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (16)
82for (int i = 0; i < dts.Length && dts[i] <= utcNow; i++) 96if (dts.Length == 0) 100for (int i = 0; i < transitionType.Length; i++) 155List<AdjustmentRule> rulesList = new List<AdjustmentRule>(_adjustmentRules.Length); 157for (int i = 0; i < _adjustmentRules.Length; i++) 488if (dts.Length > 0) 493while (index <= dts.Length) 499if (rules != null && rules.Length == 0) 526while (index < dts.Length && dts[index] == DateTime.MinValue) 531if (rulesList.Count == 0 && index < dts.Length) 556else if (index < dts.Length) 675if (transitionTypes.Length > 0) 1223if (data[index++] == '\n' && data[data.Length - 1] == '\n') 1225futureTransitionsPosixFormat = enc.GetString(data, index, data.Length - index - 1); 1292if (data == null || data.Length < index + Length) 1318if (data == null || data.Length < Length)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (4)
46fs.ReadExactly(bytes, 0, bytes.Length); 368if (fileLength == rawData.Length) 371int count = rawData.Length; 411byte[] buffer = new byte[rawData.Length];
src\libraries\System.Private.CoreLib\src\System\Type.cs (6)
191for (int i = 0; i < types.Length; i++) 338for (int i = 0; i < types.Length; i++) 382for (int i = 0; i < types.Length; i++) 484Type[] cls = new Type[args.Length]; 485for (int i = 0; i < cls.Length; i++) 614if (fields == null || fields.Length != 1)
src\libraries\System.Private.CoreLib\src\System\Type.Enum.cs (6)
113object[] values = new object[flds.Length]; 114string[] names = new string[flds.Length]; 116for (int i = 0; i < flds.Length; i++) 126for (int i = 1; i < values.Length; i++) 158ulong[] ulArray = new ulong[array.Length]; 159for (int i = 0; i < array.Length; ++i)
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (24)
56for (int i = 0; i < genericArguments.Length; i++) 125for (int i = 0; i < c.Length; i++) 132if (cnt == c.Length) 137for (int i = 0; i < c.Length; i++) 165for (i = 0; i < m.Length; i++) 173cnt += m.Length; 183for (i = 0; i < c.Length; i++) 191cnt += c.Length; 201for (i = 0; i < f.Length; i++) 209cnt += f.Length; 219for (i = 0; i < p.Length; i++) 227cnt += p.Length; 237for (i = 0; i < e.Length; i++) 245cnt += e.Length; 255for (i = 0; i < t.Length; i++) 263cnt += t.Length; 274for (i = 0; i < m.Length; i++) 282for (i = 0; i < c.Length; i++) 290for (i = 0; i < f.Length; i++) 298for (i = 0; i < p.Length; i++) 306for (i = 0; i < e.Length; i++) 314for (i = 0; i < t.Length; i++) 362for (int i = 0; i < constraints.Length; i++) 392for (int i = 0; i < interfaces.Length; i++)
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (3)
21if (flds.Length == 0) 31for (int i = 0; i < flds.Length; i++) 45if (i < (flds.Length - 1) && !fieldType.IsValueType)
src\System\Array.CoreCLR.cs (9)
616return Length; 629return Length - 1; 750int length = @this.Length; 760Array.Copy(@this, 0, array, index, @this.Length); 768return @this.Length; 776if ((uint)index >= (uint)@this.Length) 789if ((uint)index >= (uint)@this.Length) 808return Array.IndexOf(@this, value, 0, @this.Length) >= 0; 829return Array.IndexOf(@this, value, 0, @this.Length);
src\System\Attribute.CoreCLR.cs (24)
255for (int i = 0; i < objAttr.Length; i++) 265if (objAttr.Length == 0) 283for (int i = 0; i < objAttr.Length; i++) 302for (int i = 0; i < objAttr.Length; i++) 312ret = CreateAttributeArrayHelper(type, temp.Length + count); 313Array.Copy(temp, ret, temp.Length); 315int offset = temp.Length; 317for (int i = 0; i < attributes.Length; i++) 349for (int i = 0; i < objAttr.Length; i++) 369for (int i = 0; i < attributes.Length; i++) 384if (indexParams.Length > 0) 386Type[] indexParamTypes = new Type[indexParams.Length]; 387for (int i = 0; i < indexParams.Length; i++) 399for (int i = 0; i < attributes.Length; i++) 426if (obj.Length == 1) 429if (obj.Length == 0) 514if (attrib == null || attrib.Length == 0) 518if (attrib.Length == 1) 614if (attrib == null || attrib.Length == 0) 618if (attrib.Length == 1) 684if (attrib == null || attrib.Length == 0) 688if (attrib.Length == 1) 754if (attrib == null || attrib.Length == 0) 758if (attrib.Length == 1)
src\System\Buffer.CoreCLR.cs (1)
32Debug.Assert(src.Length - srcIndex >= len, "not enough bytes in src");
src\System\Collections\EmptyReadOnlyDictionaryInternal.cs (1)
45if (array.Length - index < this.Count)
src\System\Environment.CoreCLR.cs (1)
97for (int i = 0; i < mainMethodArgs.Length; i++)
src\System\MulticastDelegate.CoreCLR.cs (4)
249if (resultCount <= invocationList.Length) 272int allocCount = invocationList.Length; 299int allocCount = thisInvocationList.Length; 415for (int i = 0; i < del.Length; i++)
src\System\Reflection\AssemblyName.CoreCLR.cs (1)
162nameParts._cbPublicKeyOrToken = (parts._publicKeyOrToken != null) ? parts._publicKeyOrToken.Length : 0;
src\System\Reflection\Associates.cs (4)
57genericArgumentHandles = genericArguments.Length <= 16 ? // arbitrary stackalloc limit 58stackalloc IntPtr[genericArguments.Length] : 59new IntPtr[genericArguments.Length]; 60for (int i = 0; i < genericArguments.Length; i++)
src\System\Reflection\Emit\CustomAttributeBuilder.cs (18)
67if (namedProperties.Length != propertyValues.Length) 69if (namedFields.Length != fieldValues.Length) 82m_constructorArgs = new object?[constructorArgs.Length]; 83Array.Copy(constructorArgs, m_constructorArgs, constructorArgs.Length); 92if (paramTypes.Length != constructorArgs.Length) 96for (i = 0; i < paramTypes.Length; i++) 101for (i = 0; i < paramTypes.Length; i++) 123for (i = 0; i < constructorArgs.Length; i++) 127writer.Write((ushort)(namedProperties.Length + namedFields.Length)); 130for (i = 0; i < namedProperties.Length; i++) 186for (i = 0; i < namedFields.Length; i++) 355uint length = (uint)utf8Str.Length; 432writer.Write(a.Length); 433for (int i = 0; i < a.Length; i++)
src\System\Reflection\Emit\DynamicILGenerator.cs (17)
198stackchange -= parameterTypes.Length; 201stackchange -= optionalParameterTypes.Length; 218cParams = parameterTypes.Length; 266stackchange -= methodInfo.GetParameterTypes().Length; 273stackchange -= optionalParameterTypes.Length; 409requiredCustomModifiers = new Type[parameterTypes.Length][]; 410optionalCustomModifiers = new Type[parameterTypes.Length][]; 459if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) 469if (requiredCustomModifiers != null && (parameterTypes == null || requiredCustomModifiers.Length != parameterTypes.Length)) 472if (optionalCustomModifiers != null && (parameterTypes == null || optionalCustomModifiers.Length != parameterTypes.Length)) 477for (int i = 0; i < parameterTypes.Length; i++) 691for (int i = 0; i < excp.Length; i++) 700if (m_exceptionHeader != null && m_exceptionHeader.Length != 0) 702if (m_exceptionHeader.Length < 4) 742for (int i = 0; i < m_exceptions.Length; i++)
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (2)
132int argCount = (parameters != null) ? parameters.Length : 0; 133if (Signature.Arguments.Length != argCount)
src\System\Reflection\Emit\RuntimeAssemblyBuilder.cs (1)
139nameParts._cbPublicKeyOrToken = (publicKey != null) ? publicKey.Length : 0;
src\System\Reflection\Emit\RuntimeILGenerator.cs (22)
25return EnlargeArray(incoming, incoming.Length * 2); 33Array.Copy(incoming, temp, incoming.Length); 110else if (m_RelocFixupList.Length <= m_RelocFixupCount) 253if (m_length + size >= m_ILStream.Length) 261byte[] temp = new byte[Math.Max(m_ILStream.Length * 2, m_length + size)]; 262Array.Copy(m_ILStream, temp, m_ILStream.Length); 299else if (m_fixupData.Length <= m_fixupCount) 342for (int i = 0; i < exceptions.Length; i++) 345for (int j = i + 1; j < exceptions.Length; j++) 541stackchange -= parameterTypes.Length; 544stackchange -= optionalParameterTypes.Length; 565cParams = parameterTypes.Length; 618stackchange -= parameters.Length; 626stackchange -= optionalParameterTypes.Length; 698stackchange -= parameters.Length; 782int count = labels.Length; 920if (m_exceptionCount >= m_exceptions.Length) 925if (m_currExcStackCount >= m_currExcStack.Length) 1104if (m_labelCount >= m_labelList.Length) 1121if (m_labelList is null || labelIndex < 0 || labelIndex >= m_labelList.Length) 1294if (currentCatch >= m_catchAddr.Length) 1569else if (m_iCount == m_iOffsets.Length)
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (13)
100m_parameterTypes = new Type[parameterTypes.Length]; 101Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length); 186for (int i = 0; i < excp.Length; i++) 280m_signature = SignatureHelper.GetMethodSigHelper(m_module, m_callingConvention, m_inst != null ? m_inst.Length : 0, 292signatureLength = m_localSignature.Length; 335for (int i = 0; i < excp.Length; i++) 525m_inst = new RuntimeGenericTypeParameterBuilder[names.Length]; 526for (int i = 0; i < names.Length; i++) 631m_parameterTypes = new Type[parameterTypes.Length]; 632Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length); 646if (position > 0 && (m_parameterTypes == null || position > m_parameterTypes.Length)) 776else if (m_iNameSpaceCount == m_namespace.Length) 795else if (m_iLocalSymCount == m_strName.Length)
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (17)
258Type[] parameterTypes = new Type[parameters.Length]; 259Type[][] requiredCustomModifiers = new Type[parameters.Length][]; 260Type[][] optionalCustomModifiers = new Type[parameters.Length][]; 262for (int i = 0; i < parameters.Length; i++) 317cGenericParameters = method.GetGenericArguments().Length; 342if (optionalParameterTypes?.Length > 0) 378if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) 461Type[][] requiredCustomModifiers = new Type[parameterTypes.Length][]; 462Type[][] optionalCustomModifiers = new Type[parameterTypes.Length][]; 1003Type[] tt = new Type[paramInfo.Length]; 1005for (int i = 0; i < paramInfo.Length; i++) 1021Type[] parameterTypes = new Type[parameters.Length]; 1022Type[][] requiredCustomModifiers = new Type[parameterTypes.Length][]; 1023Type[][] optionalCustomModifiers = new Type[parameterTypes.Length][]; 1025for (int i = 0; i < parameters.Length; i++) 1273byte[] localSigBytes = new byte[sigBytes.Length]; 1274Buffer.BlockCopy(sigBytes, 0, localSigBytes, 0, sigBytes.Length);
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (11)
408interfaceTokens = new int[interfaces.Length + 1]; 409for (i = 0; i < interfaces.Length; i++) 877for (int i = 0; i < interfaces.Length; i++) 1040m_inst = new RuntimeGenericTypeParameterBuilder[names.Length]; 1041for (int i = 0; i < names.Length; i++) 1371return DefineDataHelper(name, data, data.Length, attributes); 1619else if (body == null || body.Length == 0) 1630if ((body == null || body.Length == 0) && !meth.m_canBeRuntimeImpl) 1641body, (body != null) ? body.Length : 0, 1643exceptions, (exceptions != null) ? exceptions.Length : 0, 1644tokenFixups, (tokenFixups != null) ? tokenFixups.Length : 0);
src\System\Reflection\Emit\SignatureHelper.cs (19)
32sigHelp.AddData(inst.Length); 277for (int i = 0; i < optionalCustomModifiers.Length; i++) 298for (int i = 0; i < requiredCustomModifiers.Length; i++) 341AddData(args.Length); 464if (m_currSig + 4 > m_signature.Length) 492if (m_currSig + 1 > m_signature.Length) 551if (m_currSig + sizeof(void*) > m_signature.Length) 562return ExpandArray(inArray, inArray.Length * 2); 569if (requiredLength < inArray.Length) 570requiredLength = inArray.Length * 2; 573Buffer.BlockCopy(inArray, 0, outArray, 0, inArray.Length); 738for (int i = 0; i < optionalCustomModifiers.Length; i++) 761for (int i = 0; i < requiredCustomModifiers.Length; i++) 803if (requiredCustomModifiers != null && (arguments == null || requiredCustomModifiers.Length != arguments.Length)) 806if (optionalCustomModifiers != null && (arguments == null || optionalCustomModifiers.Length != arguments.Length)) 811for (int i = 0; i < arguments.Length; i++) 883if (m_signature.Length > m_currSig)
src\System\Reflection\Emit\SymbolMethod.cs (2)
37m_parameterTypes = new Type[parameterTypes.Length]; 38Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length);
src\System\Reflection\MdImport.cs (1)
140for (int i = 0; i < types.Length; i++)
src\System\Reflection\RuntimeAssembly.cs (3)
393nameParts._cbPublicKeyOrToken = (publicKeyOrToken != null) ? publicKeyOrToken.Length : 0; 461FileStream[] fs = new FileStream[m.Length]; 463for (int i = 0; i < fs.Length; i++)
src\System\Reflection\RuntimeCustomAttributeData.cs (22)
186if (records.Length == 0) 191CustomAttributeData[] customAttributes = new CustomAttributeData[records.Length]; 192for (int i = 0; i < records.Length; i++) 213for (int i = 0; i < records.Length; i++) 279m_namedParams = new CustomAttributeNamedParameter[properties.Length + fields.Length]; 404Debug.Assert(allCtors.Length == 1); 423if (m_ctorParams.Length != 0) 425CustomAttributeTypedArgument[] typedCtorArgs = new CustomAttributeTypedArgument[m_ctorParams.Length]; 427for (int i = 0; i < typedCtorArgs.Length; i++) 599CustomAttributeTypedArgument[] arrayValue = new CustomAttributeTypedArgument[encodedArg.ArrayValue.Length]; 600for (int i = 0; i < arrayValue.Length; i++) 674if (customAttributeCtorParameters.Length != 0 || customAttributeNamedParameters.Length != 0) 1263if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1305if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1368if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1380if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1497if (attributeFilterType is null && car.Length == 0) 1503for (int i = 0; i < car.Length; i++) 1780for (int i = 0; i < car.Length; i++) 1961HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length);
src\System\Reflection\RuntimeEventInfo.cs (1)
142for (int i = 0; i < m_otherMethod.Length; i++)
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (9)
250if (parameters.Length == 0) 253ParameterInfo[] ret = new ParameterInfo[parameters.Length]; 255Array.Copy(parameters, ret, parameters.Length); 304if (sig.Arguments.Length != 1) 401RuntimeType[] methodInstantionRuntimeType = new RuntimeType[methodInstantiation.Length]; 407for (int i = 0; i < methodInstantiation.Length; i++) 416Type[] methodInstantiationCopy = new Type[methodInstantiation.Length]; 417for (int iCopy = 0; iCopy < methodInstantiation.Length; iCopy++) 475for (int i = 0; i < pis.Length; i++)
src\System\Reflection\RuntimeModule.cs (7)
32int size = genericArguments.Length; 97if (genericTypeArguments?.Length > 0) 101if (genericMethodArguments?.Length > 0) 170if (genericTypeArguments?.Length > 0) 174if (genericMethodArguments?.Length > 0) 233if (genericTypeArguments?.Length > 0) 237if (genericMethodArguments?.Length > 0)
src\System\Reflection\RuntimeParameterInfo.cs (5)
38int sigArgCount = sig.Arguments.Length; 98if (cParamDefs < args.Length + 1) 100for (int i = 0; i < args.Length; i++) 322if (customAttributes.Length != 0) 326if (customAttributes.Length != 0)
src\System\Reflection\RuntimePropertyInfo.cs (6)
125if (arguments.Length > 0) 240for (int i = 0; i < m_otherMethod.Length; i++) 307for (int i = 0; i < propParams.Length; i++) 363var args = new object?[index.Length + 1]; 365for (int i = 0; i < index.Length; i++) 368args[index.Length] = value;
src\System\Runtime\CompilerServices\CastHelpers.cs (2)
393if ((nuint)index >= (uint)array.Length) 410if ((nuint)index >= (uint)array.Length)
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (6)
68new ReadOnlySpan<ushort>(ref Unsafe.As<byte, ushort>(ref src), array.Length), 69new Span<ushort>(ref Unsafe.As<byte, ushort>(ref dst), array.Length)); 73new ReadOnlySpan<uint>(ref Unsafe.As<byte, uint>(ref src), array.Length), 74new Span<uint>(ref Unsafe.As<byte, uint>(ref dst), array.Length)); 78new ReadOnlySpan<ulong>(ref Unsafe.As<byte, ulong>(ref src), array.Length), 79new Span<ulong>(ref Unsafe.As<byte, ulong>(ref dst), array.Length));
src\System\RuntimeHandles.cs (14)
150if (inHandles == null || inHandles.Length == 0) 155Span<IntPtr> outHandles = inHandles.Length <= stackScratch.Length ? 156stackScratch.Slice(0, inHandles.Length) : 157new IntPtr[inHandles.Length]; 158for (int i = 0; i < inHandles.Length; i++) 173if (inHandles == null || inHandles.Length == 0) 179IntPtr[] outHandles = new IntPtr[inHandles.Length]; 180for (int i = 0; i < inHandles.Length; i++) 184length = outHandles.Length; 1436sig.Length, 1478if (typeInstantiationContext?.Length > 0) 1483if (methodInstantiationContext?.Length > 0) 1584if (typeInstantiationContext?.Length > 0) 1589if (methodInstantiationContext?.Length > 0)
src\System\RuntimeType.CoreCLR.cs (71)
458int memberCount = m_allMembers!.Length; 502for (int i = 0; i < list.Length; i++) 528int cachedCount = cachedMembers.Length; 531for (int i = 0; i < list.Length; i++) 556if (freeSlotIndex >= cachedMembers.Length) 570newSize = cachedMembers.Length + 1; 574newSize = Math.Max(Math.Max(4, 2 * cachedMembers.Length), list.Length); 832for (int i = 0; i < interfaces.Length; i++) 845for (int i = 0; i < interfaces.Length; i++) 997for (int j = 0; j < iFaces.Length; j++) 1023for (int i = 0; i < ifaces.Length; i++) 1061for (int i = 0; i < constraints.Length; i++) 1068for (int j = 0; j < temp.Length; j++) 1839for (int i = 0; i < methodBases.Length; i++) 1992for (int i = 0; i < candidates.Length; i++) 2028for (int i = 0; i < genericArguments.Length; i++) 2297if (argumentTypes.Length != parameterInfos.Length) 2306bool excessSuppliedArguments = argumentTypes.Length > parameterInfos.Length; 2336if (!parameterInfos[argumentTypes.Length].IsOptional) 2348bool shortByMoreThanOneSuppliedArgument = argumentTypes.Length < parameterInfos.Length - 1; 2522ListBuilder<MethodInfo> candidates = new ListBuilder<MethodInfo>(cache.Length); 2523for (int i = 0; i < cache.Length; i++) 2547ListBuilder<ConstructorInfo> candidates = new ListBuilder<ConstructorInfo>(cache.Length); 2548for (int i = 0; i < cache.Length; i++) 2570ListBuilder<PropertyInfo> candidates = new ListBuilder<PropertyInfo>(cache.Length); 2571for (int i = 0; i < cache.Length; i++) 2576(types == null || (propertyInfo.GetIndexParameters().Length == types.Length))) 2593ListBuilder<EventInfo> candidates = new ListBuilder<EventInfo>(cache.Length); 2594for (int i = 0; i < cache.Length; i++) 2615ListBuilder<FieldInfo> candidates = new ListBuilder<FieldInfo>(cache.Length); 2616for (int i = 0; i < cache.Length; i++) 2637ListBuilder<Type> candidates = new ListBuilder<Type>(cache.Length); 2638for (int i = 0; i < cache.Length; i++) 2721Debug.Assert(i == members.Length); 2818if (types == null || types.Length == 0) 2854if (types.Length == 0 && candidates.Count == 1) 2882if (types == null || types.Length == 0) 2921for (int i = 0; i < cache.Length; i++) 2949for (int i = 0; i < cache.Length; i++) 2999for (int i = 0; i < cache.Length; i++) 3028for (int i = 0; i < cache.Length; i++) 3121Debug.Assert(i == compressMembers.Length); 3159for (int i = 0; i < cache.Length; i++) 3175for (int i = 0; i < cache.Length; i++) 3191for (int i = 0; i < cache.Length; i++) 3207for (int i = 0; i < cache.Length; i++) 3223for (int i = 0; i < cache.Length; i++) 3239for (int i = 0; i < cache.Length; i++) 3595if (genericParameters.Length != instantiation.Length) 3598if (instantiation.Length == 1 && instantiation[0] is RuntimeType rt) 3612RuntimeType[] instantiationRuntimeType = new RuntimeType[instantiation.Length]; 3616for (int i = 0; i < instantiation.Length; i++) 3807Debug.Assert(parameters.Length > 0); 3809if (parameters.Length == 1) 3878if (args.Length == 0 && (bindingAttr & BindingFlags.Public) != 0 && (bindingAttr & BindingFlags.Instance) != 0 3890Type[] argsType = args.Length != 0 ? new Type[args.Length] : EmptyTypes; 3891for (int i = 0; i < args.Length; i++) 3912if (consCount != cons.Length) 3938if (args.Length != 0) 4401int index = hashcode % keys.Length; 4425if (index >= keys.Length) 4426index -= keys.Length; 4459for (int i = 0; i < keys.Length; i++) 4487int index = hashcode % keys.Length; 4500if (index >= keys.Length) 4501index -= keys.Length; 4516if (requiredSize >= table.m_keys.Length)
src\System\StubHelpers.cs (2)
26cbLength = Marshal.StringToAnsiString(str, bufferPtr, buffer.Length, fBestFit, fThrowOnUnmappableChar); 695if (arr is not null && (uint)arr.Length < pState->m_cElements)
src\System\Text\StringBuilder.CoreCLR.cs (3)
31if (newLength > m_ChunkChars.Length) 47if (numChars > m_ChunkChars.Length) 61if (newLength > m_ChunkChars.Length)
src\System\ValueType.cs (1)
51for (int i = 0; i < thisFields.Length; i++)
System.Private.CoreLib.Generators (29)
EventSourceGenerator.Parser.cs (1)
109byte[] combinedBytes = new byte[namespaceBytes.Length + bytes.Length];
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (28)
254int arrayLen = decomposedLeft.Length + decomposedRight.Length; 258var retVal = new INamedTypeSymbol[decomposedLeft.Length + decomposedRight.Length]; 259Array.Copy(decomposedLeft, retVal, decomposedLeft.Length); 260Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length); 325if (decomposedLeft.Length == 0) 327else if (decomposedRight.Length == 0) 330if ((decomposedLeft.Length > 1) || (decomposedRight.Length > 1)) 339if (decomposedLeft.Length == 0 || decomposedRight.Length == 0) 341if (decomposedLeft.Length != 0 || decomposedRight.Length != 0) 347var retVal = new INamedTypeSymbol[decomposedLeft.Length + decomposedRight.Length][]; 348Array.Copy(decomposedLeft, retVal, decomposedLeft.Length); 349Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length); 354if (decomposedLeft.Length != 0 || decomposedRight.Length != 0) 364if (decomposedOperand.Length != 0) 371if (decomposedTrue.Length != 0 || decomposedFalse.Length != 0) 602if (decomposedCondition.Length == 0) 621for (int andClauseIndex = 0; andClauseIndex < decomposedCondition.Length; andClauseIndex++) 670if (decomposedCondition.Length == 1)
System.Private.DataContractSerialization (459)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (2)
107for (int i = 0; i < genericArgs.Length; i++) 286if (typeArguments != null && typeArguments.Length > 0)
src\libraries\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs (1)
53for (int i = 0; i < value.Length; i++)
System\Runtime\Serialization\BitFlagsGenerator.cs (4)
23for (int i = 0; i < _locals.Length; i++) 55return _locals.Length; 72_ilg.NewArray(typeof(byte), _locals.Length); 74for (int i = 0; i < _locals.Length; i++)
System\Runtime\Serialization\ClassDataContract.cs (19)
362int baseChildElementNamespaceCount = (baseChildElementNamespaces != null) ? baseChildElementNamespaces.Length : 0; 365Array.Copy(baseChildElementNamespaces!, childElementNamespaces, baseChildElementNamespaces!.Length); 701baseMemberCount = BaseClassContract.MemberNames!.Length; 706baseContractCount = BaseClassContract.ContractNamespaces!.Length; 817for (int i = 0; i < memberInfos.Length; i++) 823if (memberAttributes != null && memberAttributes.Length > 0) 825if (memberAttributes.Length > 1) 847if (getMethod.GetParameters().Length > 0) 886if (memberAttributes != null && memberAttributes.Length > 0) 888if (memberAttributes.Length > 1) 897if (getMethod == null || IsMethodOverriding(getMethod) || getMethod.GetParameters().Length > 0) 934if (optionalFields == null || optionalFields.Length == 0) 1073for (int i = 0; i < methods.Length; i++) 1111if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != Globals.TypeOfExtensionDataObject) 1134if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != Globals.TypeOfStreamingContext) 1336Type[] underlyingParamTypes = new Type[paramContracts.Length]; 1337for (int i = 0; i < paramContracts.Length; i++) 1346genericParams = new object[paramTypes.Length]; 1347for (int i = 0; i < paramTypes.Length; i++)
System\Runtime\Serialization\CodeGenerator.cs (8)
125Type[] paramTypes = new Type[parameters.Length]; 126for (int i = 0; i < parameters.Length; i++) 147for (int i = 0; i < argTypes.Length; i++) 418if (methodInfo.GetParameters().Length != expectedCount) 419throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ParameterCountMismatch, methodInfo.Name, methodInfo.GetParameters().Length, expectedCount)); 1215for (int i = 0; i < caseLabels.Length; i++) 1294NewArray(typeof(object), values.Length); 1297for (int i = 0; i < values.Length; i++)
System\Runtime\Serialization\CollectionDataContract.cs (3)
1053for (int i = 0; i < knownInterfaces.Length; i++) 1135for (int i = 0; i < knownInterfaces.Length; i++) 1390for (int i = 0; i < paramTypes.Length; i++)
System\Runtime\Serialization\ContextAware.cs (1)
19public int Length => _contracts.Length;
System\Runtime\Serialization\DataContract.cs (18)
1343if (dataContractAttributes != null && dataContractAttributes.Length > 0) 1346if (dataContractAttributes.Length > 1) 1368if (collectionContractAttributes != null && collectionContractAttributes.Length > 0) 1371if (collectionContractAttributes.Length > 1) 1488for (int i = 0; i < genParams.Length; i++) 1704for (int i = 0; i < nsAttributes.Length; i++) 1768int blocks = (namespaces.Length + 8) / 64 + 1; 1780if (offset + 64 > namespaces.Length) 1784for (int j = offset; j < namespaces.Length; j++) 1788if (offset <= namespaces.Length) 1790block[namespaces.Length - offset] = 0x80; 1796block[56] = (byte)(namespaces.Length << 3); 1797block[57] = (byte)(namespaces.Length >> 5); 1798block[58] = (byte)(namespaces.Length >> 13); 1799block[59] = (byte)(namespaces.Length >> 21); 1955for (int i = 0; i < knownTypeAttributes.Length; ++i) 2283_genericParams = new object[genericParams.Length]; 2292return _genericParams.Length;
System\Runtime\Serialization\EnumDataContract.cs (6)
220List<DataMember> tempMembers = new List<DataMember>(fields.Length); 221List<long> tempValues = new List<long>(fields.Length); 223for (int i = 0; i < fields.Length; i++) 230if (memberAttributes != null && memberAttributes.Length > 0) 232if (memberAttributes.Length > 1) 251if (dataMemberAttributes != null && dataMemberAttributes.Length > 0)
System\Runtime\Serialization\ExtensionDataObject.cs (1)
179for (int i = 0; i < element.attributes.Length; i++)
System\Runtime\Serialization\ExtensionDataReader.cs (7)
776else if (_elements.Length == _depth) 778ElementData[] newElements = new ElementData[_elements.Length * 2]; 779Array.Copy(_elements, newElements, _elements.Length); 787return (_elements == null || _elements.Length <= nextDepth || _elements[nextDepth] == null) 853else if (attributes.Length == attributeCount) 855AttributeData[] newAttributes = new AttributeData[attributes.Length * 2]; 856Array.Copy(attributes, newAttributes, attributes.Length);
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
157int memberCount = _traditionalClassDataContract.MemberNames.Length;
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
199if (nextId >= s_dataContractCache.Length)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (2)
189_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2); 266int size = Math.Min(_chars.Length, buffer.Length);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (7)
182Type[] paramTypes = new Type[parameters.Length]; 183for (int i = 0; i < parameters.Length; i++) 311int memberCount = classContract.MemberNames!.Length; 399for (int i = 0; i < requiredElements.Length; i++) 413_ilg.NewArray(typeof(byte), array.Length); 415for (int i = 0; i < array.Length; i++) 1064if (values != null && values.Length > 0)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (2)
117Type[] paramTypes = new Type[parameters.Length]; 118for (int i = 0; i < parameters.Length; i++)
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (1)
227context.IncrementItemCount(array.Length);
System\Runtime\Serialization\Json\JsonReaderWriterFactory.cs (1)
26return CreateJsonReader(buffer, 0, buffer.Length, null, quotas, null);
System\Runtime\Serialization\Json\JsonWriterDelegator.cs (8)
36ByteArrayHelperWithString.WriteArray(Writer, bytes, 0, bytes.Length); 123for (int i = 0; i < value.Length; i++) 131for (int i = 0; i < value.Length; i++) 139for (int i = 0; i < value.Length; i++) 147for (int i = 0; i < value.Length; i++) 155for (int i = 0; i < value.Length; i++) 222for (int i = 0; i < value.Length; i++) 230for (int i = 0; i < value.Length; i++)
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (1)
71for (int i = 0; i < entries.Length; i++)
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (2)
67int memberCount = classContract.MemberNames!.Length; 92if (memberIndex < members.Length)
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (2)
50for (int i = 0; i < array.Length; ++i) 73Type? dictionaryValueType = itemTypeGenericArguments.Length == 2 ? itemTypeGenericArguments[1] : null;
System\Runtime\Serialization\Json\XmlJsonReader.cs (18)
721if (offset > buffer.Length) 723throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 726if (count > buffer.Length - offset) 728throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 743if (offset > chars.Length) 745throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 748if (count > chars.Length - offset) 750throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 780if (offset > buffer.Length) 782throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.JsonOffsetExceedsBufferSize, buffer.Length)); 785if (count > buffer.Length - offset) 787throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - offset)); 821if (offset > array.Length) 823throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 826if (count > array.Length - offset) 828throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset)); 1011else if (_scopes.Length == _scopeDepth) 1493if ((_scopes != null) && (_scopes.Length > JsonGlobals.maxScopeSize))
System\Runtime\Serialization\Json\XmlJsonWriter.cs (11)
363if (count > buffer.Length - index) 365throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 379if (count > buffer.Length - index) 381throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 405if (count > buffer.Length - index) 407throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 694if (count > buffer.Length - index) 696throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 1130else if (_scopes.Length == _depth) 1161if ((_scopes != null) && (_scopes.Length > JsonGlobals.maxScopeSize)) 1469for (int i = 0; i < array.Length; i++)
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (2)
48int length = memberNames.Length; 323for (int i = 0; i < memberNames.Length; i++)
System\Runtime\Serialization\MemoryStreamAdapter.cs (3)
64if (slicedBuffer.Length < buffer.Length) 72count: buffer.Length, 98if (innerBuffer.Count == innerBuffer.Array!.Length)
System\Runtime\Serialization\ObjectReferenceStack.cs (5)
30if (_count == _objectArray.Length) 31Array.Resize<object>(ref _objectArray, _objectArray.Length * 2); 61_isReferenceArray = new bool[_objectArray.Length]; 63else if (_count >= _isReferenceArray.Length) 65Array.Resize<bool>(ref _isReferenceArray, _objectArray.Length);
System\Runtime\Serialization\ObjectToIdCache.cs (8)
22m_objs = new object[m_ids.Length]; 23m_isWrapped = new bool[m_ids.Length]; 42if (m_currentCount >= (m_objs.Length - 1)) 85if (i == (m_objs.Length - 1)) 98int cacheSize = m_objs.Length; 137return (RuntimeHelpers.GetHashCode(o) & 0x7FFFFFFF) % m_objs.Length; 142int size = GetPrime(m_objs.Length + 1); // The lookup does an inherent doubling 149for (int j = 0; j < oldObjs.Length; j++)
System\Runtime\Serialization\ReflectionReader.cs (1)
530int arraySize = ((Array)resultCollectionObject).Length;
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (3)
65int memberCount = classContract.MemberNames!.Length; 99if (memberIndex < members.Length) 133int memberCount = contract.MemberNames!.Length;
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (1)
46for (int i = 0; i < array.Length; ++i)
System\Runtime\Serialization\SchemaExporter.cs (5)
557for (int i = 0; i < schemaArray.Length; i++) 562for (int j = 0; j < itemArray.Length; j++) 611if (attrs == null || attrs.Length == 0) 815if (nodes == null || nodes.Length == 0) 818for (int i = 0; i < nodes.Length; i++)
System\Runtime\Serialization\SchemaImporter.cs (1)
1434for (int i = 0; i < markup.Length; i++)
System\Runtime\Serialization\ScopedKnownTypes.cs (2)
22else if (_count == dataContractDictionaries.Length) 24Array.Resize<DataContractDictionary>(ref dataContractDictionaries, dataContractDictionaries.Length * 2);
System\Runtime\Serialization\XmlDataContract.cs (1)
155if (xmlRootAttributes == null || xmlRootAttributes.Length == 0)
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (3)
377int memberCount = classContract.MemberNames!.Length; 431for (; nextRequiredIndex < requiredMembers.Length; nextRequiredIndex++) 467int memberCount = contract.MemberNames!.Length;
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
245if (classContract.ContractNamespaces!.Length > 1) 258for (int i = 0; i < classContract.ChildElementNamespaces!.Length; i++)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (8)
223for (int i = memberIndex + 1; i < memberNames.Length; i++) 229return memberNames.Length; 236for (int i = memberIndex + 1; i < memberNames.Length; i++) 246return memberNames.Length; 253if (requiredIndex == memberNames.Length) 453if (array.Length <= index) 463Array.Copy(array, newArray, array.Length); 471if (size != array.Length)
System\Runtime\Serialization\XmlReaderDelegator.cs (8)
105for (int i = 0; i < localNames.Length; i++) 827context.IncrementItemCount(array.Length); 857context.IncrementItemCount(array.Length); 887context.IncrementItemCount(array.Length); 917context.IncrementItemCount(array.Length); 947context.IncrementItemCount(array.Length); 977context.IncrementItemCount(array.Length); 1007context.IncrementItemCount(array.Length);
System\Runtime\Serialization\XmlSerializableServices.cs (1)
60for (int i = 0; i < nodes.Length; i++)
System\Runtime\Serialization\XmlWriterDelegator.cs (15)
532writer.WriteBase64(bytes, 0, bytes.Length); 680for (int i = 0; i < value.Length; i++) 687dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 695for (int i = 0; i < value.Length; i++) 702dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 710for (int i = 0; i < value.Length; i++) 717dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 725for (int i = 0; i < value.Length; i++) 732dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 740for (int i = 0; i < value.Length; i++) 747dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 755for (int i = 0; i < value.Length; i++) 762dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 770for (int i = 0; i < value.Length; i++) 777dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
System\Runtime\Serialization\XPathQueryGenerator.cs (1)
50for (int pathToMemberIndex = 0; pathToMemberIndex < pathToMember.Length; pathToMemberIndex++)
System\Runtime\Serialization\XsdDataContractExporter.cs (2)
117for (int j = 0; j < types.Length; j++) 320for (int j = 0; j < types.Length; j++)
System\Text\Base64Encoding.cs (32)
54if (index > chars.Length) 55throw new ArgumentOutOfRangeException(nameof(index), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 57if (count > chars.Length - index) 58throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - index)); 105if (charIndex > chars.Length) 106throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 109if (charCount > chars.Length - charIndex) 110throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)); 114if (byteIndex > bytes.Length) 115throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 130byte* pbMax = _bytes + bytes.Length - byteIndex; 178if (charIndex > chars.Length) 179throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 182if (charCount > chars.Length - charIndex) 183throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)); 187if (byteIndex > bytes.Length) 188throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 203byte* pbMax = _bytes + bytes.Length - byteIndex; 261if (byteIndex > bytes.Length) 262throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 264if (byteCount > bytes.Length - byteIndex) 265throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)); 270if (charIndex > chars.Length) 271throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 272if (charCount < 0 || charCount > chars.Length - charIndex) 345if (byteIndex > bytes.Length) 346throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 348if (byteCount > bytes.Length - byteIndex) 349throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)); 354if (charIndex > chars.Length) 355throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 357if (charCount < 0 || charCount > chars.Length - charIndex)
System\Text\BinHexEncoding.cs (14)
28if (charIndex > chars.Length) 29throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 31if (charCount > chars.Length - charIndex) 32throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)); 35if (byteIndex > bytes.Length) 36throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 38if (byteCount < 0 || byteCount > bytes.Length - byteIndex) 67if (byteIndex > bytes.Length) 68throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 70if (byteCount > bytes.Length - byteIndex) 71throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)); 75if (charIndex > chars.Length) 76throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 77if (charCount < 0 || charCount > chars.Length - charIndex)
System\Xml\ArrayHelper.cs (7)
34while (read < array.Length) 36int actual = ReadArray(reader, localName, namespaceUri, array, read, array.Length - read); 44if (read < array.Length || reader.NodeType == XmlNodeType.EndElement) 50if (totalRead != array.Length || arrayCount > 0) 56Array.Copy(arrays![i], 0, newArray, offset, arrays[i].Length); 57offset += arrays[i].Length; 75int actual = ReadArray(reader, localName, namespaceUri, array, 0, array.Length);
System\Xml\EncodingStreamWrapper.cs (9)
388if (encCount == s_encodingUTF8.Length && CompareCaseInsensitive(s_encodingUTF8, buffer, encStart)) 392else if (encCount == s_encodingUnicodeLE.Length && CompareCaseInsensitive(s_encodingUnicodeLE, buffer, encStart)) 396else if (encCount == s_encodingUnicodeBE.Length && CompareCaseInsensitive(s_encodingUnicodeBE, buffer, encStart)) 400else if (encCount == s_encodingUnicode.Length && CompareCaseInsensitive(s_encodingUnicode, buffer, encStart)) 403ThrowEncodingMismatch(DataContractSerializer.UTF8NoBom.GetString(buffer, encStart, encCount), DataContractSerializer.UTF8NoBom.GetString(s_encodingUTF8, 0, s_encodingUTF8.Length)); 416for (int i = 0; i < key.Length; i++) 601_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2); 700int size = _chars.Length < count ? _chars.Length : count;
System\Xml\StringHandle.cs (3)
148length = buffer.Length; 155length = buffer.Length; 163length = buffer.Length;
System\Xml\UniqueId.cs (13)
70if (offset > guid.Length) 71throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, guid.Length)); 72if (guidLength > guid.Length - offset) 99if (offset > chars.Length) 100throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 102if (count > chars.Length - offset) 103throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 205if (offset > chars.Length) 206throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 208if (count > chars.Length - offset) 285if (offset > buffer.Length) 286throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 288if (guidLength > buffer.Length - offset)
System\Xml\ValueHandle.cs (6)
444if (actualLength != buffer.Length) 512return DataContractSerializer.Base64Encoding.GetString(bytes, 0, bytes.Length); 690Debug.Assert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length)); 772Debug.Assert(byteOffset + actualByteCount < bytes.Length, 773$"byteOffset {byteOffset} + actualByteCount {actualByteCount} MUST BE < bytes.Length {bytes.Length}");
System\Xml\XmlBaseReader.cs (37)
272else if (_elementNodes.Length == _depth) 306else if (_attributeNodes.Length == attributeIndex) 466if (_attributeNodes != null && _attributeNodes.Length > 16) 468if (_elementNodes != null && _elementNodes.Length > 16) 1055for (int i = 0; i < localNames.Length; i++) 1070for (int i = 0; i < localNames.Length; i++) 1096for (int i = 0; i < localNames.Length; i++) 1111for (int i = 0; i < localNames.Length; i++) 1131if (offset > chars.Length) 1132throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 1134if (count > chars.Length - offset) 1135throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 1159if (offset > buffer.Length) 1160throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 1162if (count > buffer.Length - offset) 1163throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1304if (value.Length > _quotas.MaxArrayLength) 1312return ReadContentAsBase64(_quotas.MaxArrayLength, _bufferReader.Buffer.Length); 1347if (offset > buffer.Length) 1348throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 1350if (count > buffer.Length - offset) 1351throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1383if (offset > buffer.Length) 1384throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 1386if (count > buffer.Length - offset) 1387throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1900if (_chars == null || _chars.Length < count) 2625if (_indices != null && _indices.Length > 32) 2635if (_indices != null && _indices.Length == _attributeCount && IsSorted()) 2639for (int i = 0; i < newIndices.Length; i++) 2648for (int i = 0; i < _indices!.Length - 1; i++) 2725if (_namespaces != null && _namespaces.Length > 32) 2727if (_attributes != null && _attributes.Length > 4) 2741nameSpace.Uri.SetValue(3, xmlBuffer.Length - 3); 2776for (int i = 0; i < _shortPrefixUri.Length; i++) 2863else if (_attributes.Length == _attributeCount) 2901else if (_namespaces.Length == _nsCount)
System\Xml\XmlBaseWriter.cs (14)
670else if (_elements.Length == _depth) 1029if (count > chars.Length - offset) 1030throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 1081if (count > chars.Length - offset) 1082throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 1444if (count > buffer.Length - offset) 1445throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1781for (int i = 0; i < array.Length; i++) 1800for (int i = 0; i < array.Length; i++) 1998if (_namespaces != null && _namespaces.Length > 32) 2000if (_attributes != null && _attributes.Length > 4) 2080else if (_attributes.Length == _attributeCount) 2108for (int i = 0; i < s_prefixes.Length; i++) 2174if (_namespaces!.Length == _nsCount)
System\Xml\XmlBinaryReader.cs (9)
49if (offset > buffer.Length) 50throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 52if (count > buffer.Length - offset) 53throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1026BufferReader.InsertBytes(buffer, 0, buffer.Length); 1230if (offset > array.Length) 1231throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 1233if (count > array.Length - offset) 1234throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlBinaryReaderSession.cs (5)
45else if (id >= _strings.Length) 47XmlDictionaryString[] newStrings = new XmlDictionaryString[Math.Min(Math.Max(id + 1, _strings.Length * 2), MaxArrayEntries)]; 48Array.Copy(_strings, newStrings, _strings.Length); 58if (_strings != null && key >= 0 && key < _strings.Length) 78for (int i = 0; i < _strings.Length; i++)
System\Xml\XmlBinaryWriter.cs (8)
109Debug.Assert(offset >= 0 && offset + 1 + sizeof(T) <= buffer.Length, "WriteTextNodeRaw"); 124Debug.Assert(offset >= 0 && offset + sizeof(T) <= buffer.Length, "WriteRaw"); 1185while ((count = reader.ReadValueChunk(_chars, 0, _chars.Length)) > 0) 1207while ((count = reader.ReadValueAsBase64(_bytes, 0, _bytes.Length)) > 0) 1280if (offset > array.Length) 1281throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 1283if (count > array.Length - offset) 1284throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlBinaryWriterSession.cs (5)
173if (_listCount < _list.Length) 238if (index >= _array.Length) 245if (index >= _array.Length) 247int[] newArray = new int[Math.Max(index + 1, _array.Length * 2)]; 248Array.Copy(_array, newArray, _array.Length);
System\Xml\XmlBufferReader.cs (9)
79_windowOffsetMax = _streamBuffer.Length; 100if (_streamBuffer != null && _streamBuffer.Length > 4096) 194if (_offsetMax >= _buffer.Length) 226if (newOffsetMax > _buffer.Length) 228byte[] newBuffer = new byte[Math.Max(256, _buffer.Length * 2)]; 230newOffsetMax = Math.Min(newOffsetMax, newBuffer.Length); 255if (_offsetMax > buffer.Length - count) 507if (_chars == null || _chars.Length < count) 817int length2 = buffer2.Length;
System\Xml\XmlCanonicalWriter.cs (50)
93_inclusivePrefixes = new string[inclusivePrefixes.Length]; 94for (int i = 0; i < inclusivePrefixes.Length; ++i) 118if (_scopes != null && _scopes.Length > 16) 120if (_attributes != null && _attributes.Length > 16) 122if (_xmlnsBuffer != null && _xmlnsBuffer.Length > 1024) 153else if (_depth == _scopes.Length) 209if (prefixOffset > prefixBuffer.Length) 210throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length)); 212if (prefixLength > prefixBuffer.Length - prefixOffset) 213throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)); 217if (localNameOffset > localNameBuffer.Length) 218throw new ArgumentOutOfRangeException(nameof(localNameOffset), SR.Format(SR.OffsetExceedsBufferSize, localNameBuffer.Length)); 220if (localNameLength > localNameBuffer.Length - localNameOffset) 221throw new ArgumentOutOfRangeException(nameof(localNameLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, localNameBuffer.Length - localNameOffset)); 250for (int i = 0; i < _inclusivePrefixes!.Length; ++i) 348else if (_xmlnsOffset + byteCount > _xmlnsBuffer.Length) 350byte[] newBuffer = new byte[Math.Max(_xmlnsOffset + byteCount, _xmlnsBuffer.Length * 2)]; 385if (prefixOffset > prefixBuffer.Length) 386throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length)); 388if (prefixLength > prefixBuffer.Length - prefixOffset) 389throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)); 393if (nsOffset > nsBuffer.Length) 394throw new ArgumentOutOfRangeException(nameof(nsOffset), SR.Format(SR.OffsetExceedsBufferSize, nsBuffer.Length)); 396if (nsLength > nsBuffer.Length - nsOffset) 397throw new ArgumentOutOfRangeException(nameof(nsLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, nsBuffer.Length - nsOffset)); 436if (prefixOffset > prefixBuffer.Length) 437throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length)); 439if (prefixLength > prefixBuffer.Length - prefixOffset) 440throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)); 444if (localNameOffset > localNameBuffer.Length) 445throw new ArgumentOutOfRangeException(nameof(localNameOffset), SR.Format(SR.OffsetExceedsBufferSize, localNameBuffer.Length)); 447if (localNameLength > localNameBuffer.Length - localNameOffset) 448throw new ArgumentOutOfRangeException(nameof(localNameLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, localNameBuffer.Length - localNameOffset)); 507if (offset > chars.Length) 508throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 510if (count > chars.Length - offset) 511throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 562if (offset > chars.Length) 563throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 565if (count > chars.Length - offset) 566throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 599if (offset > chars.Length) 600throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 602if (count > chars.Length - offset) 603throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 663else if (_attributeCount == _attributes.Length) 681else if (_xmlnsAttributes.Length == _xmlnsAttributeCount) 877for (int i = 0; i < indices.Length; i++) 884Attribute[] attributes = new Attribute[_writer._attributes!.Length]; 885for (int i = 0; i < indices.Length; i++)
System\Xml\XmlConverter.cs (3)
432if (objects.Length == 0) 435if (objects.Length > 1) 438for (int i = 1; i < objects.Length; i++)
System\Xml\XmlDictionary.cs (1)
48else if (_nextId == _strings.Length)
System\Xml\XmlDictionaryReader.cs (20)
33return CreateBinaryReader(buffer, 0, buffer.Length, quotas); 92return CreateTextReader(buffer, 0, buffer.Length, quotas); 297for (int i = 0; i < localNames.Length; i++) 320for (int i = 0; i < localNames.Length; i++) 517while (read < buffer.Length) 521actual = ReadContentAsBase64(buffer, read, buffer.Length - read); 523actual = ReadContentAsBinHex(buffer, read, buffer.Length - read); 531if (read < buffer.Length) 539Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length); 540offset += buffers[i].Length; 593Guid[] guids = new Guid[values.Length]; 594for (int i = 0; i < values.Length; i++) 601UniqueId[] uniqueIds = new UniqueId[values.Length]; 602for (int i = 0; i < values.Length; i++) 615for (int i = 0; i < strings.Length; i++) 635for (int i = 0; i < strings.Length; i++) 1010if (offset > array.Length) 1011throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 1013if (count > array.Length - offset) 1014throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlDictionaryWriter.cs (4)
441if (offset > array.Length) 442throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 444if (count > array.Length - offset) 445throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlSigningNodeWriter.cs (1)
360int byteCount = Math.Min(_base64Chars.Length / 4 * 3, count - count % 3);
System\Xml\XmlStreamNodeWriter.cs (2)
383byte* bytesMax = _bytes + buffer.Length - offset; 388return (_encoding ?? DataContractSerializer.ValidatingUTF8).GetBytes(chars, charCount, _bytes, buffer.Length - offset);
System\Xml\XmlUTF8TextReader.cs (5)
561if (offset > buffer.Length) 562throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 564if (count > buffer.Length - offset) 565throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1423while (j < _rowOffsets.Length - 1 && _rowOffsets[j + 1] < offset)
System\Xml\XmlUTF8TextWriter.cs (3)
117if (_chars == null || _chars.Length < charCount) 409int isEscapedCharLength = isEscapedChar.Length; 427int isEscapedCharLength = isEscapedChar.Length;
System.Private.Uri (4)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
System\UriHelper.cs (2)
318ValueStringBuilder vsb = new ValueStringBuilder(dest.Length); 323if (vsb.Length > dest.Length)
System.Private.Windows.Core (36)
System\Collections\Generic\ArrayBuilder.cs (6)
39if ((uint)count < (uint)_items.Length) 52if (_items.Length == _maxCount) 57Debug.Assert(_count == _items.Length); 60Debug.Assert(_items.Length > 0); 61int newCapacity = Math.Min(_maxCount, 2 * _items.Length); 71Debug.Assert(_count == _items.Length);
System\IO\BinaryReaderExtensions.cs (1)
122Span<byte> arrayData = new(a, array.Length * sizeof(T));
System\Private\Windows\Core\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (3)
43_indices = new int[_lengths.Length]; 44_canIterate = _arrayOfT.Length > 0; 71int dimension = indices.Length - 1;
System\Private\Windows\Core\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
48while (_currentFieldIndex < _fieldInfo.Length)
System\Private\Windows\Core\BinaryFormat\Deserializer\PendingSerializationInfo.cs (1)
71if (parameters.Length == 2
System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs (1)
460for (int i = 0; i < keys.Length; i++)
Windows\Win32\System\Com\SafeArrayScope.cs (2)
133public SafeArrayScope(T[] array) : this((uint)array.Length) 135for (int i = 0; i < array.Length; i++)
Windows\Win32\System\Variant\VARIANT.cs (19)
285new Span<sbyte>(psa->pvData, array.Length) 289new Span<byte>(psa->pvData, array.Length) 293new Span<short>(psa->pvData, array.Length) 297new Span<ushort>(psa->pvData, array.Length) 302new Span<int>(psa->pvData, array.Length) 308new Span<uint>(psa->pvData, array.Length) 312new Span<long>(psa->pvData, array.Length) 316new Span<ulong>(psa->pvData, array.Length) 320new Span<float>(psa->pvData, array.Length) 324new Span<double>(psa->pvData, array.Length) 329Span<VARIANT_BOOL> data = new(psa->pvData, array.Length); 341Span<DECIMAL> data = new(psa->pvData, array.Length); 353Span<long> data = new(psa->pvData, array.Length); 365Span<double> data = new(psa->pvData, array.Length); 377Span<IntPtr> data = new(psa->pvData, array.Length); 390Span<IntPtr> data = new(psa->pvData, array.Length); 402Span<VARIANT> data = new(psa->pvData, array.Length); 416else if (array.Length != 0) 869=> MemoryMarshal.CreateSpan(ref Unsafe.AsRef<T>(Marshal.UnsafeAddrOfPinnedArrayElement(array, 0).ToPointer()), array.Length);
Windows\Win32\System\Variant\VARIANTVector.cs (2)
20var variants = new VARIANT[values.Length]; 23for (int i = 0; i < values.Length; ++i)
System.Private.Windows.Core.TestUtilities (7)
DebuggerAttributes.cs (7)
95if (attrs.Length != 1) 105if (genericTypeArguments.Length > 0) 121if (attrs.Length != 1) 133if (segments.Length % 2 == 0) 138if (segments.Length == 1) 145for (int i = 0; i < segments.Length; i += 2) 150if (i + 1 < segments.Length)
System.Private.Xml (852)
System\Xml\Base64Decoder.cs (2)
46ArgumentOutOfRangeException.ThrowIfGreaterThan(len, chars.Length - startPos); 89Debug.Assert(buffer.Length - index >= count);
System\Xml\Base64Encoder.cs (1)
31ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Base64EncoderAsync.cs (1)
17if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\BinaryXml\SqlUtils.cs (1)
85Debug.Assert(rgulU.Length == s_cNumeMax);
System\Xml\BinaryXml\XmlBinaryReader.cs (13)
1899if (symNum == symtable.Length) 1915if (qnameNum == qnametable.Length) 1962Array.Clear(_symbolTables.symtable, 1, _symbolTables.symtable.Length - 1); 2007if (cbKeep > 7 * (data.Length / 8)) 2010byte[] newdata = new byte[checked(data.Length * 2)]; 2038int cbFill = data.Length - end; 2411int newcount = _elementStack.Length * 2; 2414System.Array.Copy(_elementStack, n, _elementStack.Length); 2420int newcount = _attributes.Length * 2; 2497if (_attrCount == _attributes.Length) 2604if (_attrCount == _attributes.Length) 2715if (_attrHashTbl.Length < tblSize) 3044if (_elemDepth == _elementStack.Length)
System\Xml\BinHexDecoder.cs (3)
46ArgumentOutOfRangeException.ThrowIfGreaterThan(len, chars.Length - startPos); 93Debug.Assert(buffer.Length - index >= count); 124if (bytesDecoded < bytes.Length)
System\Xml\BinHexEncoder.cs (1)
16ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\BinHexEncoderAsync.cs (1)
13if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\BitStack.cs (1)
91len = _bitStack.Length;
System\Xml\Cache\XPathDocumentBuilder.cs (1)
832if (++_pageInfo.NodeCount >= _page.Length)
System\Xml\Cache\XPathNodeHelper.cs (2)
349idxPrec = pagePrec.Length - 1; 665if (++idxNode >= pageNode.Length)
System\Xml\Cache\XPathNodeInfoAtom.cs (6)
443infoNew = _hashTable[info.GetHashCode() & (_hashTable.Length - 1)]; 457if (_sizeTable >= _hashTable.Length) 460_hashTable = new XPathNodeInfoAtom[oldTable.Length * 2]; 462for (int i = 0; i < oldTable.Length; i++) 486int idx = info.GetHashCode() & (_hashTable.Length - 1); 500for (int i = 0; i < _hashTable.Length; i++)
System\Xml\Core\HtmlEncodedRawTextWriter.cs (2)
415Debug.Assert(count >= 0 && index + count <= buffer.Length); 702Debug.Assert(_uriEscapingBuffer?.Length > 0);
System\Xml\Core\HtmlUtf8RawTextWriter.cs (2)
394Debug.Assert(count >= 0 && index + count <= buffer.Length); 679Debug.Assert(_uriEscapingBuffer?.Length > 0);
System\Xml\Core\IncrementalReadDecoders.cs (2)
67Debug.Assert(chars.Length - startPos >= len); 114Debug.Assert(buffer.Length - index >= count);
System\Xml\Core\ReadContentAsBinaryHelper.cs (4)
68ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 111ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 154ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 197ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (4)
16if (index < 0 || (uint)count > buffer.Length - index) 60if (index < 0 || (uint)count > buffer.Length - index) 104if (index < 0 || (uint)count > buffer.Length - index) 148if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\Core\XmlCharCheckingReader.cs (2)
484ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 532ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlCharCheckingReaderAsync.cs (2)
308if (index < 0 || (uint)count > buffer.Length - index) 362if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\Core\XmlCharCheckingWriter.cs (1)
269ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlCharCheckingWriterAsync.cs (1)
216ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlEncodedRawTextWriter.cs (10)
148_bufBytes = new byte[_bufChars.Length]; 654Debug.Assert(count >= 0 && index + count <= buffer.Length); 678Debug.Assert(count >= 0 && index + count <= buffer.Length); 857_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _); 860if (_bufBytesUsed >= (_bufBytes.Length - 16)) 880_encoder!.Convert(_bufChars, 1, 0, _bufBytes!, 0, _bufBytes!.Length, true, out _, out bEnc, out _); 1689if (_lastMarkPos + 1 == _textContentMarks!.Length) 1698Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length); 1699int[] newTextContentMarks = new int[_textContentMarks.Length * 2]; 1700Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length);
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (5)
550Debug.Assert(count >= 0 && index + count <= buffer.Length); 572Debug.Assert(count >= 0 && index + count <= buffer.Length); 689_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _); 692if (_bufBytesUsed >= (_bufBytes.Length - 16)) 712_encoder!.Convert(_bufChars, 1, 0, _bufBytes!, 0, _bufBytes!.Length, true, out _, out bEnc, out _);
System\Xml\Core\XmlEventCache.cs (8)
119for (idxEvent = 0; idxEvent < page.Length; idxEvent++) 183writer.WriteBase64(bytes, 0, bytes.Length); 188writer.WriteBinHex(bytes, 0, bytes.Length); 273for (idxEvent = 0; idxEvent < page.Length; idxEvent++) 549else if (_pageSize >= _pageCurr!.Length) 565if (index != 0 || count != buffer.Length) 567if (buffer.Length - index > count) 568count = buffer.Length - index;
System\Xml\Core\XmlReader.cs (1)
1712int bytesToRead = Math.Min(bytes.Length, 2);
System\Xml\Core\XmlSubtreeReader.cs (3)
1305if (index == _nsAttributes.Length) 1307NodeData[] newNsAttrs = new NodeData[_nsAttributes.Length * 2]; 1586ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlTextEncoder.cs (2)
116ArgumentOutOfRangeException.ThrowIfGreaterThan(count, array.Length - offset); 442ArgumentOutOfRangeException.ThrowIfGreaterThan(count, array.Length - offset);
System\Xml\Core\XmlTextReaderImpl.cs (38)
1597ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1644ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1690ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1737ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1797ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 2856bufferSize = _ps.bytes.Length; 2869if (_ps.bytes == null || _ps.bytes.Length < bufferSize) 2876if (_ps.chars == null || _ps.chars.Length < bufferSize + 1) 2883if (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0) 2885int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed); 3346if (_ps.charsUsed == _ps.chars.Length - 1) 3354char[] newChars = new char[_ps.chars.Length * 2]; 3355BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3365if (_ps.bytes.Length - _ps.bytesUsed < MaxByteSequenceLen) 3367byte[] newBytes = new byte[_ps.bytes.Length * 2]; 3374charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3382int charsLen = _ps.chars.Length; 3405char[] newChars = new char[_ps.chars.Length * 2]; 3406BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3431charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3441if (_ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0) 3443int read = _ps.stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed); 3465charsRead = _ps.textReader.Read(_ps.chars, _ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1); 3477Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3490Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 5003if (_attrDuplSortingArray == null || _attrDuplSortingArray.Length < _attrCount) 7623Debug.Assert(nodeIndex < _nodes.Length); 7624Debug.Assert(_nodes[_nodes.Length - 1] == null); 7637Debug.Assert(nodeIndex < _nodes.Length); 7638if (nodeIndex >= _nodes.Length - 1) 7640NodeData[] newNodes = new NodeData[_nodes.Length * 2]; 7641Array.Copy(_nodes, newNodes, _nodes.Length); 7644Debug.Assert(nodeIndex < _nodes.Length); 8101else if (_parsingStatesStackTop + 1 == _parsingStatesStack.Length) 8103ParsingState[] newParsingStateStack = new ParsingState[_parsingStatesStack.Length * 2]; 8104Array.Copy(_parsingStatesStack, newParsingStateStack, _parsingStatesStack.Length); 8153if (array.Length - index < count) 9563Debug.Assert(endPos < chars.Length);
System\Xml\Core\XmlTextReaderImplAsync.cs (23)
393ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 449ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 514ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 570ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 622ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 882bufferSize = _ps.bytes.Length; 897if (_ps.bytes == null || _ps.bytes.Length < bufferSize) 904if (_ps.chars == null || _ps.chars.Length < bufferSize + 1) 911if (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0) 913int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed); 1035if (_ps.charsUsed == _ps.chars.Length - 1) 1043char[] newChars = new char[_ps.chars.Length * 2]; 1044BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 1053if (_ps.bytes!.Length - _ps.bytesUsed < MaxByteSequenceLen) 1055byte[] newBytes = new byte[_ps.bytes.Length * 2]; 1062charsRead = _ps.chars.Length - _ps.charsUsed - 1; 1070int charsLen = _ps.chars.Length; 1093char[] newChars = new char[_ps.chars.Length * 2]; 1094BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 1117charsRead = _ps.chars.Length - _ps.charsUsed - 1; 1125if (_ps.bytePos == _ps.bytesUsed && _ps.bytes!.Length - _ps.bytesUsed > 0) 1149charsRead = await _ps.textReader.ReadAsync(_ps.chars.AsMemory(_ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1)).ConfigureAwait(false); 1161Debug.Assert(_ps.charsUsed < _ps.chars.Length);
System\Xml\Core\XmlTextWriter.cs (6)
1442if (i <= _indentChars.Length) 1450_textWriter.Write(_indentChars, 0, Math.Min(i, _indentChars.Length)); 1451i -= _indentChars.Length; 1522if (nsIndex == _nsStack.Length) 1783if (_top == _stack.Length - 1) 1785TagInfo[] na = new TagInfo[_stack.Length + 10];
System\Xml\Core\XmlUtf8RawTextWriter.cs (2)
569Debug.Assert(count >= 0 && index + count <= buffer.Length); 591Debug.Assert(count >= 0 && index + count <= buffer.Length);
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (2)
494Debug.Assert(count >= 0 && index + count <= buffer.Length); 514Debug.Assert(count >= 0 && index + count <= buffer.Length);
System\Xml\Core\XmlWellFormedWriter.cs (6)
472if (top == _elemScopeStack.Length) 1066ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1092ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1144ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1752if (top == _nsStack.Length) 2098if (top == _attrStack.Length)
System\Xml\Core\XmlWellFormedWriterAsync.cs (4)
279if (top == _elemScopeStack.Length) 1004ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1030ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1082ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlWellFormedWriterHelpers.cs (1)
521else if (_items.Length == newItemIndex)
System\Xml\Core\XsdCachingReader.cs (8)
653Debug.Assert(attIndex < _attributeEvents.Length); 660if (attIndex >= _attributeEvents.Length - 1) 662ValidatingReaderNodeData[] newAttributeEvents = new ValidatingReaderNodeData[_attributeEvents.Length * 2]; 663Array.Copy(_attributeEvents, newAttributeEvents, _attributeEvents.Length); 671Debug.Assert(_contentIndex <= _contentEvents.Length); 679if (_contentIndex >= _contentEvents.Length - 1) 681ValidatingReaderNodeData[] newContentEvents = new ValidatingReaderNodeData[_contentEvents.Length * 2]; 682Array.Copy(_contentEvents, newContentEvents, _contentEvents.Length);
System\Xml\Core\XsdValidatingReader.cs (4)
2304Debug.Assert(attIndex < _attributePSVINodes.Length); 2312if (attIndex >= _attributePSVINodes.Length - 1) 2315AttributePSVIInfo[] newPSVINodes = new AttributePSVIInfo[_attributePSVINodes.Length * 2]; 2316Array.Copy(_attributePSVINodes, newPSVINodes, _attributePSVINodes.Length);
System\Xml\Dom\DocumentSchemaValidator.cs (3)
541else if (currentIndex >= _nodeSequenceToValidate.Length - 1) 543XmlNode[] newNodeSequence = new XmlNode[_nodeSequenceToValidate.Length * 2]; 544Array.Copy(_nodeSequenceToValidate, newNodeSequence, _nodeSequenceToValidate.Length);
System\Xml\Dom\DomNameTable.cs (2)
26Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two 97for (int i = 0; i < oldEntries.Length; i++)
System\Xml\NameTable.cs (5)
91if (start >= key.Length || start < 0 || (long)start + len > (long)key.Length) 148if (start >= key.Length || start < 0 || (long)start + len > (long)key.Length) 219for (int i = 0; i < oldEntries.Length; i++)
System\Xml\Resolvers\XmlPreloadedResolver.cs (6)
78: this(array, 0, array.Length) 203for (int i = 0; i < s_xhtml10_Dtd.Length; i++) 214Debug.Assert(s_rss091_Dtd.Length == 1); 287Add(uri, new ByteArrayChunk(value, 0, value.Length)); 297ArgumentOutOfRangeException.ThrowIfGreaterThan(count, value.Length - offset); 360for (int i = 0; i < dtdSet.Length; i++)
System\Xml\Schema\Asttree.cs (3)
558ArrayList AstArray = new ArrayList(xpath.Length); 559_fAxisArray = new ArrayList(xpath.Length); 565for (int i = 0; i < xpath.Length; ++i)
System\Xml\Schema\BitSet.cs (14)
45int bitsLength = _bits.Length; 85if ((++nBitSlot) == _bits.Length) 113int bitsLength = _bits.Length; 114int setLength = other._bits.Length; 133int setLength = other._bits.Length; 144for (int i = _bits.Length; --i >= 0;) 163int bitsLength = _bits.Length; 164int setLength = other._bits.Length; 209for (int i = 0; i < _bits.Length; i++) 219int i = Math.Min(_bits.Length, other._bits.Length); 238if (nRequiredLength > _bits.Length) 241int request = 2 * _bits.Length; 245Array.Copy(_bits, newBits, _bits.Length);
System\Xml\Schema\ConstraintStruct.cs (12)
33_tableDim = constraint.Fields.Length; 246_dim = ((Array)obj!).Length; 359return atomicValues1.Length == 1 && atomicValues1.GetValue(0)!.Equals(other.Value); 364return arr1.Length == 1 && arr1.GetValue(0)!.Equals(other.Value); 374return atomicValues2.Length == 1 && atomicValues2.GetValue(0)!.Equals(this.Value); 379return arr2.Length == 1 && arr2.GetValue(0)!.Equals(this.Value); 431for (int i = 0; i < _ks.Length; ++i) 446for (int i = 0; i < _ks.Length; i++) 466for (int j = 0; j < atomicValues.Length; j++) 473for (int j = 0; j < ((Array)_ks[i].Value!).Length; j++) 494for (int i = 0; i < _ks.Length; i++) 515for (int i = 1; i < _ks.Length; i++)
System\Xml\Schema\ContentValidator.cs (5)
1536for (int i = 0; i < transitionTable.Length; i++) 1623for (int i = 0; i < transition.Length - 1; i++) 1659for (int i = 0; i < transition.Length - 1; i++) 1985Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length); 2009Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length);
System\Xml\Schema\DataTypeImplementation.cs (13)
237for (int i = 0; i < s_xsdTypes.Length; i++) 258for (int i = 0; i < s_xsdTypes.Length; i++) 954int length = arr1.Length; 955if (length != arr2.Length) 966for (int i = 0; i < atomicValues1.Length; i++) 978for (int i = 0; i < arr1.Length; i++) 1038for (int i = 0; i < valuesToCheck.Length; i++) 1105for (int i = 0; i < splitString.Length; ++i) 1121for (int i = 0; i < splitString.Length; ++i) 1216for (int i = 0; i < _types.Length; ++i) 1228for (int i = 0; i < _types.Length; ++i) 1249for (int i = 0; i < _types.Length; ++i) 1291for (int i = 0; i < _types.Length; ++i)
System\Xml\Schema\DtdParser.cs (3)
1431else if (_condSectionEntityIds.Length == _condSectionDepth) 1433int[] tmp = new int[_condSectionEntityIds.Length * 2]; 1434Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length);
System\Xml\Schema\DtdParserAsync.cs (3)
1053else if (_condSectionEntityIds.Length == _condSectionDepth) 1055int[] tmp = new int[_condSectionEntityIds.Length * 2]; 1056Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length);
System\Xml\Schema\DtdValidator.cs (2)
366for (int i = 0; i < ss.Length; ++i) 584for (int i = 0; i < ss.Length; ++i)
System\Xml\Schema\FacetChecker.cs (4)
716for (int i = 0; i < s_map.Length; i++) 1570int length = value.Length; 1636int length = values.Length; 1677for (int j = 0; j < values.Length; ++j)
System\Xml\Schema\NamespaceList.cs (1)
45for (int i = 0; i < splitString.Length; ++i)
System\Xml\Schema\Preprocessor.cs (2)
1614baseTypeCount += union1.MemberTypes.Length; 1616for (int i = 0; i < qNames.Length; ++i)
System\Xml\Schema\SchemaCollectionCompiler.cs (1)
640for (int i = 0; i < mainMemberTypes.Length; ++i)
System\Xml\Schema\SchemaCollectionpreProcessor.cs (2)
1281baseTypeCount += union1.MemberTypes.Length; 1282for (int i = 0; i < union1.MemberTypes.Length; ++i)
System\Xml\Schema\SchemaSetCompiler.cs (2)
132int numberOfSchemaTypes = schemaSimpleTypes.Length - 3; //skip last 2 xquery types 730for (int i = 0; i < mainMemberTypes.Length; ++i)
System\Xml\Schema\XdrBuilder.cs (2)
449for (int i = 0; i < _CurState._Attributes!.Length; i++) 1491for (int i = 0; i < _CurState._NextStates.Length; i++)
System\Xml\Schema\XdrValidator.cs (2)
490for (int i = 0; i < ss.Length; ++i) 591for (int i = 0; i < ss.Length; ++i)
System\Xml\Schema\XmlSchemaCollection.cs (2)
234ArgumentOutOfRangeException.ThrowIfEqual(index, array.Length); 249ArgumentOutOfRangeException.ThrowIfEqual(index, array.Length);
System\Xml\Schema\XmlSchemaObjectTable.cs (2)
195Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 248Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
System\Xml\Schema\XmlSchemaSet.cs (2)
669ArgumentOutOfRangeException.ThrowIfGreaterThan(index, schemas.Length - 1); 857for (int i = 0; i < locationsTable.Length; i++)
System\Xml\Schema\XmlSchemaSimpleTypeUnion.cs (3)
41if (_memberTypes != null && _memberTypes.Length > 0) 44XmlQualifiedName[] newQNames = new XmlQualifiedName[_memberTypes.Length]; 46for (int i = 0; i < _memberTypes.Length; i++)
System\Xml\Schema\XmlSchemaValidator.cs (12)
1275for (int j = 0; j < locations.Length - 1; j += 2) 1994for (int i = 0; i < ss.Length; ++i) 2148_context.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length]; 2150for (int i = 0; i < currentElementDecl.Constraints.Length; ++i) 2157for (int i = 0; i < _context.Constr.Length; ++i) 2172for (int j = 0; j < constraintStructures.Length; ++j) 2222for (int j = 0; j < constraintStructures.Length; ++j) 2277for (int i = 0; i < constraintStructures.Length; ++i) 2323for (int i = 0; i < constraints.Length; ++i) 2441for (int i = 0; i < vcs.Length; ++i) 2733Debug.Assert(nsList.Length > 0); 2735for (int i = 1; i < nsList.Length; i++)
System\Xml\Schema\XmlValueConverter.cs (2)
3149_converters = new XmlValueConverter[memberTypes.Length]; 3150for (int i = 0; i < memberTypes.Length; i++)
System\Xml\Schema\XsdBuilder.cs (5)
729for (int i = 0; i < _currentEntry.Attributes.Length; i++) 2434for (int i = 0; i < _currentEntry.NextStates.Length; ++i) 2494for (int i = 0; i < values.Length; i++) 2523for (int i = 0; i < stringValues.Length; i++) 2526for (int j = 0; j < s_derivationMethodStrings.Length; j++)
System\Xml\Schema\XsdValidator.cs (10)
316for (int i = 0; i < xsiSchemaLocation.Length - 1; i += 2) 710for (int i = 0; i < ss.Length; ++i) 850context!.Constr = new ConstraintStruct[context.ElementDecl!.Constraints!.Length]; 852for (int i = 0; i < context.ElementDecl.Constraints.Length; ++i) 859for (int i = 0; i < context.Constr.Length; ++i) 874for (int j = 0; j < constraints.Length; ++j) 920for (int j = 0; j < constraints.Length; ++j) 975for (int i = 0; i < constraints.Length; ++i) 1029for (int i = 0; i < constraints.Length; ++i) 1132for (int i = 0; i < vcs.Length; ++i)
System\Xml\Serialization\CodeGenerator.cs (4)
98for (int i = 0; i < argTypes.Length; i++) 1615Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 1616for (int i = 0; i < parameterTypes.Length; ++i)
System\Xml\Serialization\CodeIdentifier.cs (2)
233for (int i = 0; i < parts.Length; i++) 287for (int i = 0; i < names.Length; i++)
System\Xml\Serialization\Compilation.cs (22)
53for (int i = 0; i < xmlMappings.Length; i++) 110for (int i = 0; i < xmlMappings.Length; i++) 147if (attrs.Length == 0) 269if (attrs.Length != 1) 282for (int i = 0; i < modules.Length; i++) 328for (int i = 0; i < types.Length; i++) 338if (assembly != null && types.Length > 0) 340for (int i = 0; i < types.Length; i++) 375if (types != null && types.Length == 1 && types[0] != null) 392string?[] writeMethodNames = new string[xmlMappings.Length]; 394for (int i = 0; i < xmlMappings.Length; i++) 406string?[] readMethodNames = new string[xmlMappings.Length]; 407for (int i = 0; i < xmlMappings.Length; i++) 416for (int i = 0; i < xmlMappings.Length; i++) 430stream.Write(info, 0, info.Length); 438var mainType = (types.Length > 0) ? types[0] : null; 450for (int i = 0; i < types.Length; i++) 487string[] writeMethodNames = new string[xmlMappings.Length]; 489for (int i = 0; i < xmlMappings.Length; i++) 503string[] readMethodNames = new string[xmlMappings.Length]; 504for (int i = 0; i < xmlMappings.Length; i++) 512for (int i = 0; i < xmlMappings.Length; i++)
System\Xml\Serialization\Compiler.cs (4)
45for (int i = 0; i < ctors.Length; i++) 48for (int j = 0; j < parms.Length; j++) 57for (int i = 0; i < arguments.Length; i++) 72if (typeForwardedFromAttribute.Length > 0)
System\Xml\Serialization\ImportContext.cs (2)
334for (int i = 0; i < memberTypes.Length; i++) 439for (int i = 0; i < attrs.Length; i++)
System\Xml\Serialization\Mappings.cs (13)
401_sortedElements = new ElementAccessor[_elements.Length]; 402Array.Copy(_elements, _sortedElements, _elements.Length); 594for (int i = 0; i < _members.Length; i++) 647for (int i = 0; i < _members.Length; i++) 717get { return _text != null && (_elements == null || _elements.Length == 0); } 722get { return (_elements != null && _elements.Length > 0); } 774_sortedElements = new ElementAccessor[_elements.Length]; 775Array.Copy(_elements, _sortedElements, _elements.Length); 811if (_elements != null && _elements.Length > 0) return _elements[0]; 826if (a.Length != b.Length) 828for (int i = 0; i < a.Length; i++) 838if (Elements != null && Elements.Length > 0)
System\Xml\Serialization\Models.cs (5)
165MemberInfo[] fieldsAndProps = new MemberInfo[members.Length]; 169for (int i = 0; i < members.Length; i++) 177for (int i = 0; i < members.Length; i++) 254if (parameters.Length > 0) return false; 432for (int i = 0; i < fields.Length; i++)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (26)
112object[] p = new object[mappings.Length]; 159for (int i = 0; i < mappings.Length; i++) 181for (int j = 0; j < mappings.Length; j++) 217for (int j = 0; j < mapping.Elements!.Length; j++) 241&& !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 258if (members.Length > 0 && members[0].Mapping.IsReturnValue) 307for (int i = 0; i < mappings.Length; i++) 335object?[] p = new object[mappings.Length]; 366Member[] members = new Member[mappings.Length]; 367for (int i = 0; i < mappings.Length; i++) 377for (int j = 0; j < mappings.Length; j++) 391if (members.Length > 0 && members[0].Mapping.IsReturnValue) 569if (collection is Array currentArray && currentArray.Length == collectionMember.Count) 786for (int i = 0; i < m.Mapping.Elements!.Length; i++) 851for (int i = 0; i < elements.Length; i++) 1325for (int i = 0; i < constants.Length; i++) 1380members = new Member[mappings.Length]; 1381for (int i = 0; i < mappings.Length; i++) 1437if (member.Mapping.Elements!.Length == 0) 1639var allMembersList = new List<Member>(mappings.Length); 1641for (int i = 0; i < mappings.Length; i++) 1666for (int j = 0; j < mapping.Elements!.Length; j++) 1683if (member.Source == null && mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1993Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.Type!.GetElementType()!, vals.Length); 1994for (int i = 0; i < vals.Length; i++) 2047length = currentArray.Length;
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (30)
122!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 135if (elements.Length == 0 && text == null) 147if (choiceSource == null || ((Array)choiceSource).Length < ((Array)o).Length) 189if (elements.Length == 0 && text == null) 192if (elements.Length == 1 && text == null) 207for (int i = 0; i < elements.Length; i++) 276if (elements.Length > 0 && o != null) 350if (mapping.Elements == null || mapping.Elements.Length != 1) 586for (int i = 0; i < members.Length; i++) 615for (int i = 0; i < members.Length; i++) 637bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 707if (constants.Length > 0) 711for (int i = 0; i < constants.Length; i++) 726string[] xmlNames = new string[constants.Length]; 727long[] valueIds = new long[constants.Length]; 729for (int i = 0; i < constants.Length; i++) 908for (int i = 0; i < members.Length; i++) 1210int pLength = p.Length; 1227for (int i = 0; i < mapping.Members!.Length; i++) 1237for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++) 1255for (int i = 0; i < mapping.Members!.Length; i++) 1268for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++) 1287for (int j = 0; j < mapping.Members.Length; j++) 1297if (isRpc && member.IsReturnValue && member.Elements!.Length > 0) 1318if (pLength > mapping.Members.Length) 1320for (int i = mapping.Members.Length; i < pLength; i++) 1352if (memberInfos == null || memberInfos.Length == 0) 1359if (memberInfos != null && memberInfos.Length != 0) 1381if (memberInfos.Length != 1)
System\Xml\Serialization\SchemaObjectWriter.cs (4)
215for (int i = 0; i < a.Length; i++) 526for (int ia = 0; ia < a.Length; ia++) 545for (int ia = 0; ia < a.Length; ia++) 596for (int i = 0; i < o.MemberTypes.Length; i++)
System\Xml\Serialization\SoapAttributes.cs (1)
33for (int i = 0; i < attrs.Length; i++)
System\Xml\Serialization\SoapReflectionImporter.cs (6)
58for (int i = 0; i < attrs.Length; i++) 465if (mapping.Elements!.Length == 1) 576for (int i = 0; i < model.Constants.Length; i++) 610MemberMapping[] mappings = new MemberMapping[xmlReflectionMembers.Length]; 611for (int i = 0; i < mappings.Length; i++) 784for (int i = 0; i < names.Length; i++)
System\Xml\Serialization\TypeExtensions.cs (1)
48parameters.Length == 1 &&
System\Xml\Serialization\Types.cs (14)
436if (typeDescs.Length == 0) return null; 440for (int i = 0; i < typeDescs.Length; i++) 452for (i = 0; i < typeDescs.Length; i++) 456if (i == typeDescs.Length) break; 544for (int i = 0; i < s_unsupportedTypes.Length; i++) 595for (int i = 0; i < s_unsupportedTypes.Length; i++) 1001for (int i = 0; i < arguments.Length; i++) 1050for (int i = 0; i < mapping.Members!.Length; i++) 1116for (int i = 0; i < mappings.Length; ++i) 1151for (int i = 0; i < mappings.Length; i++) 1240if (attrs != null && attrs.Length > 0) 1332if (defaultMembers != null && defaultMembers.Length > 0) 1336for (int i = 0; i < defaultMembers.Length; i++) 1344if (parameters.Length == 1 && parameters[0].ParameterType == typeof(int))
System\Xml\Serialization\XmlAttributes.cs (2)
84for (int i = 0; i < attrs.Length; i++) 179if (attrs.Length == 0) return null;
System\Xml\Serialization\Xmlcustomformatter.cs (6)
153for (int i = 0; i < toks.Length; i++) 176if (value.Length == 0) 186if (ids.Length != vals.Length) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Invalid enum")); 193for (int i = 0; i < ids.Length; i++) 458for (int i = 0; i < parts.Length; i++)
System\Xml\Serialization\XmlMapping.cs (1)
132for (int i = 0; i < mappings.Length; i++)
System\Xml\Serialization\XmlMembersMapping.cs (3)
23_mappings = new XmlMemberMapping[mapping.Members!.Length]; 24for (int i = 0; i < _mappings.Length; i++) 65get { return _mappings.Length; }
System\Xml\Serialization\XmlReflectionImporter.cs (22)
96for (int i = 0; i < attrs.Length; i++) 224if (mapping.Elements != null && mapping.Elements.Length > 0) 510if (attrs.Length > 0) 869if (member.Elements != null && member.Elements.Length != 0) 961for (int i = 0; i < names.Length; i++) 1001if (mapping.Elements!.Length == 1) 1086for (int i = 0; i < mapping.Elements!.Length; i++) 1196for (int i = 0; i < model.Constants.Length; i++) 1231MemberMapping[] mappings = new MemberMapping[xmlReflectionMembers.Length]; 1237for (int i = 0; i < mappings.Length; i++) 1372if (xmlReflectionMember.OverrideIsNullable && member.Elements!.Length > 0) 1379for (int i = 0; i < reflectionMembers.Length; i++) 1432for (int i = 0; i < xmlReflectionMembers.Length; i++) 1449if (infos == null || infos.Length == 0) 1461else if (infos.Length > 1) 1953if (accessor.TypeDesc.IsArrayLike && accessor.Elements.Length > 0 && !(accessor.Elements[0].Mapping is ArrayMapping)) 1963accessor.ChoiceIdentifier.MemberIds = new string[accessor.Elements.Length]; 1964for (int i = 0; i < accessor.Elements.Length; i++) 1969for (int j = 0; j < choiceMapping.Constants!.Length; j++) 2104for (int i = 0; i < choiceMapping.Constants!.Length; i++) 2191else if (!isSequence && member.Elements != null && member.Elements.Length > 0) 2193for (int i = 0; i < member.Elements.Length; i++)
System\Xml\Serialization\XmlSchemaExporter.cs (14)
45if (mapping.Members!.Length == 1 && mapping.Members[0].Elements![0].Mapping is SpecialMapping) 82else if (member.Elements == null || member.Elements.Length == 0) 650if (accessors.Length == 0) return; 651if (accessors.Length == 1) 660for (int i = 0; i < accessors.Length; i++) 883string[] names = new string[c.Length]; 884long[] ids = new long[c.Length]; 886for (int i = 0; i < c.Length; i++) 897for (int i = 0; i < c.Length; i++) 1042for (int i = 0; i < members.Length; i++) 1055if (member.Elements!.Length > 0) 1058!(member.Elements.Length == 1 && member.Elements[0].Mapping is ArrayMapping); 1113for (int i = 0; i < members.Length; i++) 1158for (int i = 0; i < mapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSchemaImporter.cs (17)
153if (mapping.Members!.Length != 1 || !mapping.Members[0].Accessor!.Any) 186MemberMapping[] members = new MemberMapping[names.Length]; 187for (int i = 0; i < names.Length; i++) 565for (int i = 0; i < structMapping.Members.Length; i++) 757Hashtable uniqueTypeDescs = new Hashtable(member.Elements.Length); 759for (int i = 0; i < member.Elements.Length; i++) 795for (int i = 0; i < typeDescs.Length; i++) 821member.ChoiceIdentifier.MemberIds = new string[member.Elements.Length]; 823for (int i = 0; i < member.Elements.Length; i++) 858if (arrayMapping.Elements!.Length != 1) 933for (int j = 0; j < elements.Length; j++) 982for (int i = 0; i < elements.Length; i++) 1066if (elements.Length == 0) 1069for (int i = 0; i < elements.Length; i++) 1486if (nodes != null && nodes.Length > 0) 1735if (isList && enumMapping.Constants.Length > 63) 1772for (int i = 0; i < choice.Length; i++)
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (9)
40if (scopes.Length > 0) 90if (index < a.Length) return a; 91TypeMapping[] b = new TypeMapping[a.Length + 32]; 151if (methods != null && methods.Length != 0 && xmlMappings != null && xmlMappings.Length == methods.Length) 153for (int i = 0; i < methods.Length; i++) 176for (int i = 0; i < types.Length; i++) 342for (int i = 0; i < xmlMappings.Length; i++)
System\Xml\Serialization\XmlSerializationILGen.cs (9)
41if (scopes.Length > 0) 134if (index < a.Length) return a; 135TypeMapping[] b = new TypeMapping[a.Length + 32]; 214if (methods != null && methods.Length != 0 && xmlMappings != null && xmlMappings.Length == methods.Length) 220for (int i = 0; i < methods.Length; i++) 244for (int i = 0; i < types.Length; i++) 452for (int i = 0; i < xmlMappings.Length; i++)
System\Xml\Serialization\XmlSerializationReader.cs (49)
480if (offset == buffer.Length) 489bytes = _r.ReadElementContentAsBase64(buffer, offset, buffer.Length - offset); 493bytes = _r.ReadElementContentAsBinHex(buffer, offset, buffer.Length - offset); 503currentSize = Math.Min(block.Length, total); 1053for (int i = 0; i < dimensions.Length; i++) 1347if (index < a.Length) return a; 1348Array b = Array.CreateInstance(elementType, a.Length * 2); 1360if (a.Length == length) return a; 1534for (int i = 0; i < array.Length; i++) 2438for (int j = 0; j < mappings.Length; j++) 2476Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture)); 2495for (int i = 0; i < mappings.Length; i++) 2512for (int j = 0; j < mappings.Length; j++) 2532for (int j = 0; j < mapping.Elements!.Length; j++) 2546else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 2561if (members.Length > 0 && members[0].Mapping.IsReturnValue) Writer.WriteLine("IsReturnValue = true;"); 2563WriteParamsRead(mappings.Length); 2618for (int i = 0; i < mappings.Length; i++) 2656Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture)); 2674Member[] members = new Member[mappings.Length]; 2675for (int i = 0; i < mappings.Length; i++) 2692for (int j = 0; j < mappings.Length; j++) 2706if (members.Length > 0 && members[0].Mapping.IsReturnValue) Writer.WriteLine("IsReturnValue = true;"); 2712WriteParamsRead(mappings.Length); 2920for (int i = 0; i < constants.Length; i++) 3020for (int i = 0; i < constants!.Length; i++) 3298var arraysToDeclareList = new List<Member>(mappings.Length); 3299var arraysToSetList = new List<Member>(mappings.Length); 3300var allMembersList = new List<Member>(mappings.Length); 3302for (int i = 0; i < mappings.Length; i++) 3320for (int j = 0; j < mapping.Elements!.Length; j++) 3335if (mapping.Attribute == null && mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping) 3349if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 3371WriteParamsRead(mappings.Length); 3441members = new Member[mappings.Length]; 3442for (int i = 0; i < mappings.Length; i++) 3460WriteParamsRead(mappings.Length); 3495for (int i = 0; i < members.Length; i++) 3671for (int i = 0; i < members.Length; i++) 3854for (int i = 0; i < members.Length; i++) 3857if (member.Mapping.Elements!.Length == 0) 3888for (int i = 0; i < members.Length; i++) 3966for (int i = 0; i < members.Length; i++) 3978for (int j = 0; j < elements.Length; j++) 4145for (int i = 0; i < elements.Length; i++) 4163for (int i = 0; i < members.Length; i++) 4183for (int i = 0; i < members.Length; i++) 4197for (int j = 0; j < elements.Length; j++) 4409for (int i = 0; i < members.Length; i++)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (29)
363for (int j = 0; j < mappings.Length; j++) 420ilg.NewArray(typeof(object), mappings.Length); 438for (int i = 0; i < mappings.Length; i++) 455for (int j = 0; j < mappings.Length; j++) 475for (int j = 0; j < mapping.Elements!.Length; j++) 489else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 504if (members.Length > 0 && members[0].Mapping.IsReturnValue) 516WriteParamsRead(mappings.Length); 620for (int i = 0; i < mappings.Length; i++) 998for (int i = 0; i < constants.Length; i++) 1088for (int i = 0; i < constants.Length; i++) 1548var arraysToDeclareList = new List<Member>(mappings.Length); 1549var arraysToSetList = new List<Member>(mappings.Length); 1550var allMembersList = new List<Member>(mappings.Length); 1552for (int i = 0; i < mappings.Length; i++) 1570for (int j = 0; j < mapping.Elements!.Length; j++) 1585if (mapping.Attribute == null && mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping) 1599if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1621WriteParamsRead(mappings.Length); 1839for (int i = 0; i < members.Length; i++) 2144for (int i = 0; i < members.Length; i++) 2221for (int i = 0; i < members.Length; i++) 2233for (int j = 0; j < elements.Length; j++) 2449for (int i = 0; i < elements.Length; i++) 2467for (int i = 0; i < members.Length; i++) 2483for (int i = 0; i < members.Length; i++) 2497for (int j = 0; j < elements.Length; j++) 2647for (int i = 0; i < members.Length; i++) 2849Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType)));
System\Xml\Serialization\XmlSerializationWriter.cs (41)
377for (int i = 0; i < xmlNodes.Length; i++) 406XmlCustomFormatter.WriteArrayBase64(_w, (byte[])o, 0, ((byte[])o).Length); 1005XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1021XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1040XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1126XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1263int arrayLength = a.Length; 1509for (int i = 0; i < parameterTypes.Length; i++) 1698for (int i = 0; i < structMapping.Members!.Length; i++) 1722for (int i = 0; i < enumFields.Length; i++) 1774for (int i = 0; i < memberInfos.Length; i++) 1821for (int i = 0; i < paramTypes.Length; i++) 1824if (i < (paramTypes.Length - 1)) 1886for (int i = 0; i < args.Length; i++) 2467for (int i = 0; i < values.Length; i++) 2644for (int i = 0; i < mapping.Members!.Length; i++) 2658for (int j = 0; j < mapping.Members.Length; j++) 2698for (int i = 0; i < mapping.Members!.Length; i++) 2712for (int j = 0; j < mapping.Members.Length; j++) 2743for (int j = 0; j < mapping.Members.Length; j++) 2761if (isRpc && member.IsReturnValue && member.Elements!.Length > 0) 2793Writer.Write(mapping.Members.Length.ToString(CultureInfo.InvariantCulture)); 2797WriteExtraMembers(mapping.Members.Length.ToString(CultureInfo.InvariantCulture), "pLength"); 2883if (constants.Length > 0) 2891for (int i = 0; i < constants.Length; i++) 2911for (int i = 0; i < constants.Length; i++) 2922for (int i = 0; i < constants.Length; i++) 3182for (int i = 0; i < members.Length; i++) 3221for (int i = 0; i < members.Length; i++) 3227bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 3485!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 3494if (elements.Length == 0 && text == null) return; 3612int count = elements.Length + (text == null ? 0 : 1); 3642if (elements.Length == 0 && text == null) return; 3643if (elements.Length == 1 && text == null) 3666for (int i = 0; i < elements.Length; i++) 3734if (elements.Length - anyCount > 0) Writer.Write("else "); 3830if (elements.Length > 0) 3852if (elements.Length > 0) 4390for (int i = 0; i < members.Length; i++) 4447for (int i = 0; i < choiceMapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (27)
216for (int i = 0; i < values.Length; i++) 418for (int i = 0; i < mapping.Members!.Length; i++) 431for (int j = 0; j < mapping.Members.Length; j++) 473for (int i = 0; i < mapping.Members!.Length; i++) 487for (int j = 0; j < mapping.Members.Length; j++) 521for (int j = 0; j < mapping.Members.Length; j++) 630if (constants.Length > 0) 641for (int i = 0; i < constants.Length; i++) 669ilg.NewArray(typeof(string), constants.Length); 671for (int i = 0; i < constants.Length; i++) 681ilg.NewArray(typeof(long), constants.Length); 684for (int i = 0; i < constants.Length; i++) 1084for (int i = 0; i < members.Length; i++) 1115for (int i = 0; i < members.Length; i++) 1121bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 1426!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 1436if (elements.Length == 0 && text == null) return; 1567int count = elements.Length + (text == null ? 0 : 1); 1588if (elements.Length == 0 && text == null) return; 1589if (elements.Length == 1 && text == null) 1612for (int i = 0; i < elements.Length; i++) 1675if (elements.Length - anyCount > 0) 1683if (elements.Length - anyCount > 0) ilg.InitElseIf(); 1826if (elements.Length > 0) 1840if (elements.Length > 0) 2235for (int i = 0; i < members.Length; i++) 2276for (int i = 0; i < choiceMapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSerializer.cs (14)
286for (int i = 0; i < extraTypes.Length; i++) 548if (mappings == null || mappings.Length == 0) return Array.Empty<XmlSerializer>(); 585XmlSerializer[] serializers = new XmlSerializer[mappings.Length]; 589for (int i = 0; i < serializers.Length; i++) 606XmlSerializer?[] serializers = new XmlSerializer?[mappings.Length]; 607for (int i = 0; i < serializers.Length; i++) 619var serializers = new XmlSerializer[mappings.Length]; 620for (int i = 0; i < serializers.Length; i++) 636if (types == null || types.Length == 0) 648for (int i = 0; i < types.Length; i++) 675XmlSerializer?[] serializers = new XmlSerializer?[mappings.Length]; 684for (int i = 0; i < mappings.Length; i++) 726XmlTypeMapping[] mappings = new XmlTypeMapping[types.Length]; 727for (int i = 0; i < types.Length; i++)
System\Xml\Serialization\XmlSerializerNamespaces.cs (1)
43_namespaces = new Dictionary<string, XmlQualifiedName>(namespaces.Length);
System\Xml\XmlConvert.cs (1)
303return BinHexEncoder.Encode(inArray, 0, inArray.Length);
System\Xml\XmlEncoding.cs (2)
236return chars.Length * 4; 277return bytes.Length / 4;
System\Xml\XmlException.cs (2)
227Debug.Assert(invCharIndex < data.Length); 229Debug.Assert(length <= data.Length);
System\Xml\XmlNamespacemanager.cs (3)
158if (_lastDecl == _nsdecls.Length - 1) 160NamespaceDeclaration[] newNsdecls = new NamespaceDeclaration[_nsdecls.Length * 2]; 161Array.Copy(_nsdecls, newNsdecls, _nsdecls.Length);
System\Xml\XPath\Internal\FunctionQuery.cs (1)
27for (int i = 0; i < tmp.Length; i++)
System\Xml\XPath\Internal\IdQuery.cs (1)
49for (int idx = 0; idx < ids.Length; idx++)
System\Xml\XPath\Internal\SortQuery.cs (6)
159Debug.Assert(_expressions.Length == _comparers.Length); 160Debug.Assert(0 < _expressions.Length); 161Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 163if (_numSorts == _expressions.Length) 175Debug.Assert(_numSorts < _expressions.Length);
System\Xml\XPath\Internal\StringFunctions.cs (3)
31for (int i = 0; i < tmp.Length; i++) 232for (int comparePos = 0; comparePos < chars.Length; comparePos++) 264for (int comparePos = 0; comparePos < chars.Length; comparePos++)
System\Xml\XPath\Internal\XPathMultyIterator.cs (9)
23for (int i = 0; i < this.arr.Length; i++) 34for (int i = 0; i < arr.Length; i++) 38for (int i = arr.Length - 2; firstNotEmpty <= i;) 69Debug.Assert(firstNotEmpty <= item && item < arr.Length); 71while (item + 1 < arr.Length) 104for (int i = 0; i < arr.Length; i++) 128Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false"); 138if (firstNotEmpty >= arr.Length) 148if (firstNotEmpty >= arr.Length)
System\Xml\XPath\Internal\XPathParser.cs (2)
550if (pi.ArgTypes.Length < argCount) 552argCount = pi.ArgTypes.Length; // argument we have the type specified (can be < pi.Minargs)
System\Xml\Xsl\IlGen\GenerateHelper.cs (2)
1646_writerDump!.Write(" {0, -10} (Label {1}", opcode.Name, arrLabels.Length != 0 ? _symbols![arrLabels[0]]!.ToString() : ""); 1647for (int i = 1; i < arrLabels.Length; i++)
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (1)
57private static readonly int s_patternCount = Enum.GetValues<OptimizerPatternName>().Length;
System\Xml\Xsl\IlGen\XmlILModule.cs (3)
137paramTypesNew = new Type[paramTypes.Length + 1]; 139Array.Copy(paramTypes, 0, paramTypesNew, 1, paramTypes.Length); 161for (int i = 0; i < paramNames.Length; i++)
System\Xml\Xsl\QIL\QilList.cs (1)
122if (_count == _members.Length)
System\Xml\Xsl\QIL\QilPatternFactory.cs (1)
374switch (args.Length)
System\Xml\Xsl\QIL\QilTypeChecker.cs (1)
950Check(actualArgs.Count == extFunc.Method!.GetParameters().Length, actualArgs, "InvokeEarlyBound argument count must match function's argument count");
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (2)
358else if (_numEntries >= _arrAttrs.Length) 361Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (1)
225if (pair.Length != 2)
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (9)
174if (methSearch.Name.Equals(_name, comparison) && (_numArgs == -1 || methSearch.GetParameters().Length == _numArgs)) 198if (methSearch.Name.Equals(_name, comparison) && (_numArgs == -1 || methSearch.GetParameters().Length == _numArgs)) 212if (methSearch.Name.Equals(_name, comparison) && methSearch.GetParameters().Length == _numArgs) 238_argClrTypes = new Type[paramInfo.Length]; 239for (i = 0; i < paramInfo.Length; i++) 246_argXmlTypes = new XmlQueryType[paramInfo.Length]; 247for (i = 0; i < paramInfo.Length; i++) 282Debug.Assert(args.Length == _argClrTypes!.Length, "Mismatched number of actual and formal arguments.");
System\Xml\Xsl\Runtime\XmlIterators.cs (1)
45if (_idx >= _idrefs.Length)
System\Xml\Xsl\Runtime\XmlNavigatorStack.cs (1)
36if (_sp >= _stkNav.Length)
System\Xml\Xsl\Runtime\XmlQueryContext.cs (3)
272XmlExtensionFunction extFunc = _extFuncsLate.Bind(name, namespaceUri, args.Length, instance.GetType(), XmlQueryRuntime.LateBoundFlags); 275objActualArgs = new object[args.Length]; 277for (int i = 0; i < args.Length; i++)
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (14)
83_earlyObjects = (_earlyInfo != null) ? new object[_earlyInfo.Length] : null; 87_globalValues = (_globalNames != null) ? new object[_globalNames.Length] : null; 98_atomizedNames = new string[names.Length]; 104for (i = 0; i < names.Length; i++) 113for (i = 0; i < names.Length; i++) 124_filters = new XmlNavigatorFilter[filters.Length]; 126for (i = 0; i < filters.Length; i++) 170for (int idx = 0; idx < _globalNames!.Length; idx++) 187for (int idx = 0; idx < _globalNames!.Length; idx++) 250Debug.Assert(_earlyObjects != null && index < _earlyObjects.Length, "Early bound object does not exist"); 272for (int idx = 0; idx < _earlyInfo.Length; idx++) 897if (_indexes != null && indexId < _indexes.Length) 938else if (indexId >= _indexes.Length) 942Array.Copy(_indexes, indexesNew, _indexes.Length);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (4)
387Debug.Assert(keys.Length >= _size, "Number of keys must be >= number of items."); 399if (_size >= _items.Length) 607for (iEach = 0; iEach < sortArray.Length; iEach++) 614for (iEach = 1; iEach < sortArray.Length; iEach++)
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (9)
223dataWriter.Write(_names.Length); 237dataWriter.Write(_prefixMappingsList.Length); 240dataWriter.Write(mappings.Length); 256dataWriter.Write(_filters.Length); 271dataWriter.Write(_types.Length); 285dataWriter.Write(_collations.Length); 299dataWriter.Write(_globalNames.Length); 314dataWriter.Write(_earlyBound.Length); 315ebTypes = new Type[_earlyBound.Length];
System\Xml\Xsl\Runtime\XmlSortKey.cs (8)
259cntCmp = (_sortKeyBytes.Length < that._sortKeyBytes.Length) ? _sortKeyBytes.Length : that._sortKeyBytes.Length; 276if (_sortKeyBytes.Length < that._sortKeyBytes.Length) 278else if (_sortKeyBytes.Length > that._sortKeyBytes.Length)
System\Xml\Xsl\Runtime\XmlSortKeyAccumulator.cs (2)
81if (_pos >= _keys.Length) 84Array.Copy(_keys, keysNew, _keys.Length);
System\Xml\Xsl\Runtime\XsltLibrary.cs (1)
94for (int i = 0; i < arr.Length; i++)
System\Xml\Xsl\XmlIlGenerator.cs (3)
369_helper.LoadInteger(data.Length); 380_helper.LoadInteger(ebTypes.Length); 384for (int idx = 0; idx < ebTypes.Length; idx++)
System\Xml\Xsl\XmlQueryType.cs (7)
450for (int i = 1; i < sa.Length; i++) 853var matrix = new BitMatrix(s_baseTypeCodes.Length); 855for (int i = 0; i < s_baseTypeCodes.Length; i++) 903Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range."); 908Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
System\Xml\Xsl\XmlQueryTypeFactory.cs (7)
65XmlQueryType[] queryMemberTypes = new XmlQueryType[baseMemberTypes!.Length]; 67for (int i = 0; i < baseMemberTypes.Length; i++) 91if (types.Length == 0) 93else if (types.Length == 1) 100for (int i = 1; i < types.Length; i++) 351Debug.Assert(arrEnum[arrEnum.Length - 1] == XmlTypeCode.DayTimeDuration, 541for (int idx = 0; idx < s_specialBuiltInItemTypes.Length; idx++)
System\Xml\Xsl\XPath\XPathBuilder.cs (1)
988Debug.Assert(maxArgs == 0 || maxArgs == Infinity || argTypes != null && argTypes.Length == maxArgs);
System\Xml\Xsl\XslException.cs (2)
60if (args != null && args.Length > 0) 65for (int idx = 1; idx < args.Length; idx++)
System\Xml\Xsl\Xslt\CompilerError.cs (1)
42for (int i = 0; i < value.Length; i++)
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (1)
137if (++_lastRecord == _records.Length)
System\Xml\Xsl\Xslt\MatcherBuilder.cs (1)
522Debug.Assert(priority == branches.Length - 1);
System\Xml\Xsl\Xslt\OutputScopeManager.cs (1)
70if (_lastRecord == _records.Length)
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (1)
26Debug.Assert(args == null || args.Length == 0, "Error message must already be composed in res");
System\Xml\Xsl\Xslt\XsltInput.cs (13)
84if (_records.Length <= position) 86int newSize = _records.Length * 2; 92Array.Copy(_records, tmp, _records.Length); 715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length); 731for (int i = 0; i < attributes.Length; i++) 766for (kwd = 0; kwd < attributes.Length; kwd++) 775if (kwd == attributes.Length) 823for (int i = 0; i < attributes.Length; i++) 960for (int idx = 0; idx < list.Length; idx++) 981for (int idx = 0; idx < list.Length; idx++) 1016for (col = 0; col < list.Length; col++) 1023if (col == list.Length)
System\Xml\Xsl\Xslt\XsltLoader.cs (6)
121for (int i = 0; i < attributes.Length; i++) 620for (int i = 0; i < qnames.Length; i++) 957Debug.Assert(NumCharAttrs == DefaultValues.Length); 2664List<QilName> modes = new List<QilName>(list.Length); 2668if (list.Length == 0) 2830for (int i = 0; i < tokens.Length; i++)
System\Xml\Xsl\XsltOld\ActionFrame.cs (2)
100Debug.Assert(_variables != null && index < _variables.Length); 106Debug.Assert(_variables != null && index < _variables.Length);
System\Xml\Xsl\XsltOld\Avt.cs (1)
54for (int i = 0; i < _events.Length; i++)
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
73if (this.TextInfo.Length < newSize)
System\Xml\Xsl\XsltOld\Compiler.cs (1)
442for (int idx = 0; idx < nsList.Length; idx++)
System\Xml\Xsl\XsltOld\ContainerAction.cs (1)
460for (int i = 0; i < elements.Length; i++)
System\Xml\Xsl\XsltOld\InputScopeManager.cs (2)
141for (int idx = 0; idx < nsList.Length; idx++) 164for (int idx = 0; idx < nsList.Length; idx++)
System\Xml\Xsl\XsltOld\Processor.cs (1)
361for (int i = 0; i < _keyList.Length; i++)
System\Xml\Xsl\XsltOld\SequentialOutput.cs (3)
631Debug.Assert(find.Length == replace.Length); 652for (i = find.Length - 1; 0 <= i; i--)
System\Xml\Xsl\XsltOld\UseAttributeSetsAction.cs (3)
42_useAttributeSets = new XmlQualifiedName[qnames.Length]; 44for (int i = 0; i < qnames.Length; i++) 72if (frame.Counter < _useAttributeSets!.Length)
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (17)
113int length = methods.Length; 141if (methods[i].GetParameters().Length == argTypes.Length) 159for (int par = 0; par < parameters.Length; par++) 243if (argTypes.Length < func.Minargs || func.Maxargs < argTypes.Length) 245throw XsltException.Create(SR.Xslt_WrongNumberArgs, name, argTypes.Length.ToString(CultureInfo.InvariantCulture)); 765if (args.Length > 0) 823if (args.Length == 2) 940DecimalFormat formatInfo = ((XsltCompileContext)xsltContext).ResolveFormatName(args.Length == 3 ? ToString(args[2]) : null); 969int minArgs = parameters.Length; 970int maxArgs = parameters.Length; 971_types = new Type[parameters.Length]; 972XPathResultType[] argTypes = new XPathResultType[parameters.Length]; 974for (int i = parameters.Length - 1; 0 <= i; i--) 995Debug.Assert(args.Length <= this.Minargs, "We are checking this on resolve time"); 996for (int i = args.Length - 1; 0 <= i; i--)
System\Xml\Xsl\XsltOld\XsltOutput.cs (2)
202_cdataElements ??= new Hashtable(qnames.Length); 204for (int i = 0; i < qnames.Length; i++)
System\Xml\Xslt\XslCompiledTransform.cs (1)
185GeneratedCodeAttribute? generatedCodeAttr = customAttrs.Length > 0 ? (GeneratedCodeAttribute)customAttrs[0] : null;
System.Private.Xml.Linq (20)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
65if (count == arr.Length)
System\Xml\Linq\XHashtable.cs (10)
165if (_numEntries < _buckets.Length) 172for (int bucketIdx = 0; bucketIdx < _buckets.Length; bucketIdx++) 204if (newSize < _buckets.Length / 2) 206newSize = _buckets.Length; 210newSize = _buckets.Length * 2; 222for (int bucketIdx = 0; bucketIdx < _buckets.Length; bucketIdx++) 287if (newEntry < 0 || newEntry >= _buckets.Length) 304entryIndex = Interlocked.CompareExchange(ref _buckets[hashCode & (_buckets.Length - 1)], newEntry, EndOfList); 339currentIndex = _buckets[hashCode & (_buckets.Length - 1)]; 364_buckets[hashCode & (_buckets.Length - 1)] = currentIndex;
System\Xml\Linq\XObject.cs (9)
98while (i < a.Length && a[i] != null) i++; 99if (i == a.Length) 131for (int i = 0; i < a.Length; i++) 155for (int i = 0; i < a.Length; i++) 181for (int i = 0; i < a.Length; i++) 216for (int i = 0; i < a.Length; i++) 244for (int i = 0; i < a.Length; i++) 273while (i < a.Length) 308while (i < a.Length)
System.Reflection.Context (43)
System\Reflection\Context\CollectionServices.cs (3)
17if (left.Length != right.Length) 20for (int i = 0; i < left.Length; i++)
System\Reflection\Context\Custom\AttributeUtils.cs (3)
134return attributes != null && attributes.Length > 0; 181if (usageAttributes == null || usageAttributes.Length == 0) 187else if (usageAttributes.Length == 1)
System\Reflection\Context\Custom\CustomType.cs (5)
101if (types != null && types.Length > 0) 207getPropertyGetter = (types == null || types.Length == 0) && name.StartsWith("get_", comparison); 210getPropertySetter = (types == null || types.Length == 1) && name.StartsWith("set_", comparison); 265Debug.Assert(types == null || types.Length == 0); 277Debug.Assert(getPropertySetter && types != null && types.Length == 1);
System\Reflection\Context\Projection\ProjectingType.cs (19)
240methods.Length + 241constructors.Length + 242properties.Length + 243events.Length + 244fields.Length + 245nestedTypes.Length]; 248Array.Copy(methods, 0, members, i, methods.Length); i += methods.Length; 249Array.Copy(constructors, 0, members, i, constructors.Length); i += constructors.Length; 250Array.Copy(properties, 0, members, i, properties.Length); i += properties.Length; 251Array.Copy(events, 0, members, i, events.Length); i += events.Length; 252Array.Copy(fields, 0, members, i, fields.Length); i += fields.Length; 253Array.Copy(nestedTypes, 0, members, i, nestedTypes.Length); i += nestedTypes.Length; 255Debug.Assert(i == members.Length);
System\Reflection\Context\Projection\Projector.cs (4)
26if (values == null || values.Length == 0) 87Type[] newTypes = new Type[values.Length]; 88for (int i = 0; i < values.Length; i++) 130for (int i = 0; i < projected.Length; i++)
System\Reflection\Context\Virtual\VirtualParameter.cs (1)
32int length = parameters.Length;
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (3)
122args = new object[index.Length + 1]; 124Array.Copy(index, args, index.Length); 126args[index.Length] = value;
System\Reflection\Context\Virtual\VirtualPropertyInfo.cs (1)
75return GetCustomAttributes(attributeType, inherit).Length > 0;
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertyGetter.cs (2)
31if (parameters != null && parameters.Length > 0) 57return GetCustomAttributes(attributeType, inherit).Length > 0;
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (2)
38if (parameters == null || parameters.Length != 1) 74return GetCustomAttributes(attributeType, inherit).Length > 0;
System.Reflection.DispatchProxy (14)
src\libraries\Common\src\System\Reflection\Emit\IgnoreAccessChecksToAttributeBuilder.cs (1)
79.Single(c => c.GetParameters().Length == 1 &&
System\Reflection\DispatchProxyGenerator.cs (13)
286for (int i = 0; i < args.Length; i++) 302for (int i = 0; i < args.Length; i++) 419Type[] paramTypes = new Type[parameters.Length]; 420Type[][] paramReqMods = new Type[paramTypes.Length][]; 422for (int i = 0; i < parameters.Length; i++) 439string[] ss = new string[ts.Length]; 440for (int i = 0; i < ts.Length; i++) 445for (int i = 0; i < genericParameters.Length; i++) 468GenericArray<object> argsArr = new GenericArray<object>(il, parameters.Length); 470for (int i = 0; i < parameters.Length; i++) 497GenericArray<Type> typeArr = new GenericArray<Type>(il, genericTypes.Length); 498for (int i = 0; i < genericTypes.Length; ++i) 530for (int i = 0; i < parameters.Length; i++)
System.Reflection.Emit (76)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
70for (int i = 0; i < _inst.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
235if (_iaLowerBound.Length <= _rank)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (1)
295for (int i = 0; i < genericArguments.Length; i++)
System\Reflection\Emit\ArrayMethod.cs (2)
27_parameterTypes = new Type[parameterTypes.Length]; 28for (int i = 0; i < parameterTypes.Length; i++)
System\Reflection\Emit\CustomAttributeWrapper.cs (2)
53info._ctorArgs = new object?[pi.Length]; 54for (int i = 0; i < pi.Length; ++i)
System\Reflection\Emit\GenericTypeParameterBuilderImpl.cs (1)
64_interfaces ??= new List<Type>(interfaceConstraints.Length);
System\Reflection\Emit\ILGeneratorImpl.cs (9)
454stackChange -= con.GetParameters().Length; 531SwitchInstructionEncoder switchEncoder = _il.Switch(labels.Length); 632if (optionalParameterTypes == null || optionalParameterTypes.Length == 0) 660stackChange -= sm.ParameterTypes.Length; 664stackChange -= methodInfo.GetParameters().Length; 677stackChange -= optionalParameterTypes.Length; 686if (optionalParameterTypes != null && optionalParameterTypes.Length > 0) 700stackChange -= optionalParameterTypes.Length; 732stackChange -= parameterTypes.Length;
System\Reflection\Emit\MethodBuilderImpl.cs (14)
67_parameterTypes = new Type[parameterTypes.Length]; 68_parameterBuilders = new ParameterBuilderImpl[parameterTypes.Length + 1]; // parameter 0 reserved for return type 69for (int i = 0; i < parameterTypes.Length; i++) 84internal int ParameterCount => _parameterTypes == null ? 0 : _parameterTypes.Length; 104_returnType, ModuleBuilderImpl.GetSignatureConvention(_callingConventions), GetGenericArguments().Length, !IsStatic, optionalParameterTypes: null, 120var typeParameters = new GenericTypeParameterBuilderImpl[names.Length]; 121for (int i = 0; i < names.Length; i++) 135if (position > 0 && (_parameterTypes == null || position > _parameterTypes.Length)) 229_parameterTypes = new Type[parameterTypes.Length]; 230_parameterBuilders = new ParameterBuilderImpl[parameterTypes.Length + 1]; // parameter 0 reserved for return type 231for (int i = 0; i < parameterTypes.Length; i++) 297_parameterBuilders ??= new ParameterBuilderImpl[_parameterTypes.Length + 1]; // parameter 0 reserved for return type 298ParameterInfo[] parameters = new ParameterInfo[_parameterTypes.Length]; 300for (int i = 0; i < _parameterTypes.Length; i++)
System\Reflection\Emit\ModuleBuilderImpl.cs (10)
69_coreTypes = new Type[s_coreTypes.Length]; 90_coreTypes = new Type[s_coreTypes.Length]; 96for (int i = 0; i < _coreTypes.Length; i++) 106for (int i = 0; i < _coreTypes.Length; i++) 374for (int i = 0; i < gParams.Length; i++) 792GetSignatureConvention(method.CallingConvention), method.GetGenericArguments().Length, !method.IsStatic, optionalParameterTypes); 827if (parameterInfos.Length == 0) 832Type[] parameterTypes = new Type[parameterInfos.Length]; 834for (int i = 0; i < parameterInfos.Length; i++) 851if (publicKeyOrToken != null && publicKeyOrToken.Length > 0)
System\Reflection\Emit\PseudoCustomAttributesData.cs (6)
40for (int i = 0; i < attr._namedParamNames.Length; ++i) 363for (int i = 0; i < paramNames.Length; i++) 392for (int i = 0; i < paramNames.Length; i++) 441for (int i = 0; i < paramNames.Length; i++) 478for (int i = 0; i < paramNames.Length; i++) 494for (int i = 0; i < paramNames.Length; i++)
System\Reflection\Emit\SignatureHelper.cs (10)
45Parameters(parameters.Length, out ReturnTypeEncoder retType, out ParametersEncoder parameterEncoder); 65GenericTypeArgumentsEncoder encoder = new BlobEncoder(methodSpecSignature).MethodSpecificationSignature(genericArguments.Length); 81int paramsLength = ((parameters == null) ? 0 : parameters.Length) + ((optionalParameterTypes == null) ? 0 : optionalParameterTypes.Length); 99if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) 134for (int i = 0; i < parameters.Length; i++) 138if (requiredModifiers != null && requiredModifiers.Length > i && requiredModifiers[i] != null) 143if (optionalModifiers != null && optionalModifiers.Length > i && optionalModifiers[i] != null) 159Parameters(property.ParameterTypes == null ? 0 : property.ParameterTypes.Length, out ReturnTypeEncoder retType, out ParametersEncoder paramEncoder); 199module.GetTypeHandle(type.GetGenericTypeDefinition()), genericArguments.Length, type.IsValueType);
System\Reflection\Emit\TypeBuilderImpl.cs (19)
76for (int i = 0; i < interfaces.Length; i++) 278var typeParameters = new GenericTypeParameterBuilderImpl[names.Length]; 279for (int i = 0; i < names.Length; i++) 291if (data.Length <= 0 || data.Length >= 0x003f0000) 293throw new ArgumentException(SR.Argument_BadSizeForData, nameof(data.Length)); 299return DefineDataHelper(name, data, data.Length, attributes); 521for (int i = 0; i < attributeInfo._namedParamNames.Length; ++i) 670for (int i = 0; i < types.Length; i++) 722if (argumentTypes.Length != parameterTypes.Length) 727for (int i = 0; i < parameterTypes.Length; i++) 928InterfaceMethods = new MethodInfo[interfaceMethods.Length], 929TargetMethods = new MethodInfo[interfaceMethods.Length] 932for (int i = 0; i < interfaceMethods.Length; i++) 950for (int i = 0; i < interfaceMethods.Length; i++) 967Type[] parameterTypes = new Type[parameterInfos.Length]; 968for (int i = 0; i < parameterInfos.Length; i++) 1020for (int i = 0; i < interfaces.Length; i++)
System.Reflection.Metadata (54)
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (3)
65if (pkt.Length > PUBLIC_KEY_TOKEN_LEN) 75if (keyOrToken.Length == 0) 81HexConverter.EncodeToUtf16(keyOrToken, vsb.AppendSpan(keyOrToken.Length * 2), HexConverter.Casing.Lower);
System\Reflection\Internal\Utilities\BlobUtilities.cs (1)
16Debug.Assert(buffer.Length > 0);
System\Reflection\Internal\Utilities\EncodingHelper.netcoreapp.cs (2)
38int prefixedByteCount = byteCount + prefix.Length; 48Marshal.Copy((IntPtr)bytes, buffer, prefix.Length, byteCount);
System\Reflection\Internal\Utilities\EnumerableExtensions.cs (1)
31for (int i = 0; i < map.Length; i++)
System\Reflection\Internal\Utilities\MemoryBlock.cs (5)
531var high = asciiKeys.Length - 1; 659int endRowNumber = ptrTable.Length - 1; 758while (endRowNumber + 1 < ptrTable.Length && 821for (int i = 0; i < ptrTable.Length; i++) 848Debug.Assert(i == result.Length);
System\Reflection\Internal\Utilities\ObjectPool`1.cs (2)
70for (int i = 0; i < items.Length; i++) 102for (int i = 0; i < items.Length; i++)
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
27int readSize = Math.Min(size, buffer.Length);
System\Reflection\Metadata\AssemblyNameInfo.cs (1)
61PublicKeyOrToken = parts._publicKeyOrToken is null ? default : parts._publicKeyOrToken.Length == 0
System\Reflection\Metadata\BlobBuilder.cs (6)
68return new BlobBuilder(Math.Max(_buffer.Length, minimalSize)); 125Debug.Assert(Length >= 0 && Length <= _buffer.Length); 160protected int FreeBytes => _buffer.Length - Length; 163protected internal int ChunkCapacity => _buffer.Length; 602if (result > _buffer.Length - byteCount) 787BlobUtilities.ValidateRange(buffer.Length, start, byteCount, nameof(byteCount));
System\Reflection\Metadata\BlobWriter.cs (3)
29: this(buffer, 0, buffer.Length) 42Debug.Assert(count <= buffer.Length - start); 232BlobUtilities.ValidateRange(buffer.Length, start, byteCount, nameof(byteCount));
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (5)
119for (int i = 0; i < rowCounts.Length; i++) 124for (int i = 0; i < heapSizes.Length; i++) 183var immutable = new ImmutableArray<T>[array.Length]; 184for (int i = 0; i < array.Length; i++) 197for (int t = 0; t < rowCounts.Length; t++)
System\Reflection\Metadata\IL\MethodBodyBlock.cs (2)
195for (int i = 0; i < result.Length; i++) 212for (int i = 0; i < result.Length; i++)
System\Reflection\Metadata\Internal\StringHeap.cs (4)
114for (int i = 0; i < s_virtualValues!.Length; i++) 186var bytes = new byte[prefix.Length + block.Length]; 187Buffer.BlockCopy(prefix, 0, bytes, 0, prefix.Length); 188Marshal.Copy((IntPtr)block.Pointer, bytes, prefix.Length, block.Length);
System\Reflection\Metadata\Internal\VirtualHeap.cs (1)
103var blob = new PinnedBlob(GCHandle.Alloc(value, GCHandleType.Pinned), value.Length);
System\Reflection\Metadata\MetadataReader.cs (6)
242for (int i = 0; i < streamHeaders.Length; i++) 497for (int i = 0; i < rowCounts.Length; i++) 787Debug.Assert(local.Length == external.Length); 789var rowCounts = new int[local.Length]; 795for (int i = (int)firstLocalTableIndex; i < rowCounts.Length; i++)
System\Reflection\Metadata\MetadataReader.WinMD.cs (7)
96Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 102Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 108Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 114Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 187Debug.Assert(k == keys.Length && v == keys.Length && k == v); 198for (int i = 0; i < keys.Length - 1; i++)
System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs (1)
2596Debug.Assert(blob.Length >= TemplateParameterOffset_AttributeUsageTarget + 4);
System\Reflection\PortableExecutable\PEBinaryReader.cs (1)
100for (int i = bytes.Length; i > 0; --i)
System\Reflection\PortableExecutable\PEBuilder.cs (1)
504if (signature == null || signature.Length > strongNameSignatureFixup.Length)
System\Reflection\PortableExecutable\PEReader.cs (1)
666if (algorithmName.Length == 0 || checksum.Length == 0)
System.Reflection.MetadataLoadContext (124)
System\CoreRtBridge.cs (2)
72return roMethod.GetGenericArgumentsOrParametersNoCopy().Length; 73return m.GetGenericArguments().Length;
System\Reflection\DefaultBinder.cs (31)
52Type[] realTypes = new Type[types.Length]; 53for (i = 0; i < types.Length; i++) 62if (match == null || match.Length == 0) 70for (i = 0; i < candidates.Length; i++) 73if (par.Length != types.Length) 75for (j = 0; j < types.Length; j++) 105if (j == types.Length) 116int[] paramOrder = new int[types.Length]; 117for (i = 0; i < types.Length; i++) 160if (match == null || match.Length == 0) 169int indexesLength = (indexes != null) ? indexes.Length : 0; 170for (i = 0; i < candidates.Length; i++) 175if (par.Length != indexesLength) 281MethodBase[] aExactMatches = new MethodBase[match.Length]; 284for (int i = 0; i < match.Length; i++) 287if (par.Length == 0) 292for (j = 0; j < types.Length; j++) 300if (j < types.Length) 327int typesLength = (types != null) ? types.Length : 0; 328for (int i = 0; i < match.Length; i++) 366for (int i = 0; i < types.Length; i++) 383if (paramArrayType1 != null && paramOrder1[i] >= p1.Length - 1) 388if (paramArrayType2 != null && paramOrder2[i] >= p2.Length - 1) 412if (p1.Length > p2.Length) 416else if (p2.Length > p1.Length) 569if (params1.Length != params2.Length) 572int numParams = params1.Length;
System\Reflection\MetadataLoadContext.KnownConstructors.cs (1)
37int count = parameterCoreTypes.Length;
System\Reflection\MetadataLoadContext.Loading.cs (2)
34if (pkt.Length == 0 && defNameData.PublicKey != null && defNameData.PublicKey.Length != 0)
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (9)
86if (p1.Length != p2.Length) 95for (int i = 0; i < p1.Length; i++) 107if (method1.GetGenericArguments().Length != method2.GetGenericArguments().Length) 109for (int i = 0; i < p1.Length; i++) 161if (ga1.Length != ga2.Length) 164for (int i = 0; i < ga1.Length; i++)
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (1)
180if (count == _members.Length)
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (3)
42if (argumentTypes.Length != parameterInfos.Length) 65for (int i = 0; i < parameterInfos.Length; i++)
System\Reflection\Runtime\SignatureTypeExtensions.cs (4)
61int count = patternGenericTypeArguments.Length; 62if (count != actualGenericTypeArguments.Length) 134int count = genericTypeArguments.Length; 155if (position >= genericMethodParameters.Length)
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.cs (1)
63if (pk.Length != 0)
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.GetName.cs (1)
25if (pk.Length != 0)
System\Reflection\TypeLoading\Assemblies\RoAssembly.cs (2)
148AssemblyName[] result = new AssemblyName[data.Length]; 149for (int i = 0; i < data.Length; i++)
System\Reflection\TypeLoading\Assemblies\RoAssembly.Modules.cs (5)
37FileStream[] fs = new FileStream[m.Length]; 38for (int i = 0; i < fs.Length; i++) 47List<Module> modules = new List<Module>(_loadedModules.Length + 1) 51for (int i = 0; i < _loadedModules.Length; i++) 90List<RoModule> modules = new List<RoModule>(_loadedModules.Length + 1);
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (2)
41int parameterCount = _parameterTypes.Length; 56int parameterCount = _parameterTypes.Length;
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (2)
18if (members.Length == 0) 21if (members.Length > 1)
System\Reflection\TypeLoading\General\Assignability.cs (2)
200for (int i = 0; i < genericTypeParameters.Length; i++) 341if (toTypeGenericTypeArguments.Length != 1)
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (2)
50for (int i = skip; i < _table.Length; i++) 62Array.Copy(_table, skip, newArray, 0, newArray.Length);
System\Reflection\TypeLoading\General\Helpers.cs (8)
27if (original.Length == 0) 32T[] copy = new T[original.Length]; 33Array.Copy(sourceArray: original, sourceIndex: 0, destinationArray: copy, destinationIndex: 0, length: original.Length); 46if (original.Length == 0) 49Type[] copy = new Type[original.Length]; 50for (int i = 0; i < original.Length; i++) 251int count = genericMethodArguments == null ? 0 : genericMethodArguments.Length; 265for (int position = 0; position < methodSigStrings.Parameters.Length; position++)
System\Reflection\TypeLoading\General\MethodSig.cs (2)
33Debug.Assert(position >= -1 && position < Parameters.Length); 39Debug.Assert(position >= -1 && position < Parameters.Length);
System\Reflection\TypeLoading\General\TypeContext.cs (2)
23if (GenericTypeArguments == null || ((uint)index) >= GenericTypeArguments.Length) 30if (GenericMethodArguments == null || ((uint)index) >= GenericMethodArguments.Length)
System\Reflection\TypeLoading\Methods\RoConstructedGenericMethod.cs (3)
62if (_genericMethodArguments.Length != other._genericMethodArguments.Length) 65for (int i = 0; i < _genericMethodArguments.Length; i++)
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (3)
97public sealed override bool IsGenericMethodDefinition => GetGenericTypeParametersNoCopy().Length != 0; 109int count = typeArguments.Length; 123if (count != GetGenericTypeParametersNoCopy().Length)
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
79for (int i = 0; i < pis.Length; i++)
System\Reflection\TypeLoading\Methods\RoSyntheticMethod.cs (2)
44int parameterCount = _parameterTypes.Length; 58int parameterCount = _parameterTypes.Length;
System\Reflection\TypeLoading\Modules\GetTypeCoreCache.cs (9)
83int bucket = ComputeBucket(hashCode, _buckets.Length); 105int bucket = ComputeBucket(hashCode, _buckets.Length); 120public bool HasCapacity => _nextFreeEntry != _entries.Length; 124int newSize = HashHelpers.GetPrime(_buckets.Length * 2); 126newSize = _buckets.Length + 3; 140for (int bucket = 0; bucket < _buckets.Length; bucket++) 177Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 179for (int bucket = 0; bucket < _buckets.Length; bucket++) 189int storedBucket = ComputeBucket(_entries[walk1]._hashCode, _buckets.Length);
System\Reflection\TypeLoading\Properties\RoProperty.cs (1)
138int count = methodParameters.Length;
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (6)
30if (types.Length == 0 && candidates.Count == 1) 34if (parameters.Length == 0) 95if (types.Length == 0 && candidates.Count == 1) 127if (types == null || (candidate.GetIndexParameters().Length == types.Length)) 137if (types == null || types.Length == 0)
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.cs (1)
81internal sealed override int GetGenericParameterCount() => GetGenericTypeParametersNoCopy().Length;
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (2)
75for (int i = 0; i < _genericTypeArguments.Length; i++) 93for (int i = 0; i < _genericTypeArguments.Length; i++)
System\Reflection\TypeLoading\Types\RoConstructedGenericType.Key.cs (4)
29if (GenericTypeArguments.Length != other.GenericTypeArguments.Length) 31for (int i = 0; i < GenericTypeArguments.Length; i++) 54for (int i = 0; i < GenericTypeArguments.Length; i++)
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (1)
98int count = typeArguments.Length;
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (4)
87for (int i = 0; i < _parameterTypes.Length; i++) 126if (!args.Length.Equals(otherArgs.Length)) 129for (int i = 0; i < args.Length; i++)
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (3)
26int count = parameterUnmodifiedTypes.Length; 53List<Type> builder = new(returnTypeOptionalModifiers.Length + 1); 71for (int i = 0; i < returnTypeOptionalModifiers.Length; i++)
System\Reflection\TypeLoading\Types\RoModifiedGenericType.cs (1)
21int count = unmodifiedTypes.Length;
System\Reflection\TypeLoading\Types\RoType.cs (1)
343int numValues = enumFields.Length;
System.Resources.Extensions (18)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (5)
594writer.Write(bytes.Length); 595writer.Write(bytes, 0, bytes.Length); 608writer.Write(arr.Length); 609writer.Write(arr, 0, arr.Length); 622while ((read = s.Read(buffer, 0, buffer.Length)) != 0)
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
25int len = array.Length;
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (1)
76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (4)
412for (int i = 0; i < arr.Length; i++) 610for (int i = 0; i < bits.Length; i++) 976if (typeIndex < 0 || typeIndex >= _typeTable.Length) 1044Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (3)
46_indices = new int[_lengths.Length]; 47_canIterate = _arrayOfT.Length > 0; 74int dimension = indices.Length - 1;
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
52while (_currentFieldIndex < _fieldInfo.Length)
System\Resources\Extensions\BinaryFormat\Deserializer\PendingSerializationInfo.cs (1)
72if (parameters.Length == 2
System\Resources\Extensions\PreserializedResourceWriter.cs (2)
250writer.Write7BitEncodedInt(data.Length); 274writer.Write7BitEncodedInt(data.Length);
System.Resources.Writer (5)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (5)
594writer.Write(bytes.Length); 595writer.Write(bytes, 0, bytes.Length); 608writer.Write(arr.Length); 609writer.Write(arr, 0, arr.Length); 622while ((read = s.Read(buffer, 0, buffer.Length)) != 0)
System.Runtime.Caching (22)
System\Runtime\Caching\CacheExpires.cs (14)
134for (int i = 0; i < _counts.Length; i++) 148for (int i = _counts.Length - 1; i >= ci; i--) 162for (int i = _counts.Length - 1; i >= ci; i--) 174if (ci >= _counts.Length) 383oldLength = _pages.Length; 401for (int i = oldLength; i < newPages.Length; i++) 408newPages[newPages.Length - 1]._pageNext = -1; 411_freePageList._tail = newPages.Length - 1; 422for (int i = 0; i < entries.Length - 1; i++) 426entries[entries.Length - 1]._next = ExpiresEntryRef.INVALID; 481for (int i = 1; i < entries.Length; i++) 635for (int i = 0; i < _pages.Length; i++) 641for (int j = 1; j < entries.Length; j++) 781for (byte b = 0; b < _buckets.Length; b++)
System\Runtime\Caching\CacheUsage.cs (8)
368oldLength = _pages.Length; 386for (int i = oldLength; i < newPages.Length; i++) 393newPages[newPages.Length - 1]._pageNext = -1; 396_freePageList._tail = newPages.Length - 1; 407for (int i = 0; i < entries.Length - 1; i++) 411entries[entries.Length - 1]._ref1._next = UsageEntryRef.INVALID; 464for (int i = 1; i < entries.Length; i++) 834for (byte b = 0; b < _buckets.Length; b++)
System.Runtime.InteropServices (7)
System\Runtime\InteropServices\ComAwareEventInfo.cs (2)
104if (comEventInterfaces == null || comEventInterfaces.Length == 0) 111if (comEventInterfaces.Length > 1)
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (5)
89var parameterTypes = new Type[parameters.Length]; 90var parameterOptionalModifiers = new Type[parameters.Length][]; 91var parameterRequiredModifiers = new Type[parameters.Length][]; 92for (int i = 0; i < parameters.Length; i++) 104for (int i = 0; i < parameters.Length; i++)
System.Runtime.Numerics (99)
src\libraries\Common\src\System\Number.Formatting.Common.cs (4)
485int groupSizeLen = groupDigits.Length; // The length of groupDigits array. 764if (groupDigits.Length != 0) // You can pass in 0 length arrays 777if (groupSizeIndex < groupDigits.Length - 1) 810if (groupSizeIndex < groupDigits.Length - 1)
System\Number.BigInteger.cs (2)
266bits = new uint[bits.Length + 1]; 787int cuSrc = value._bits.Length;
System\Numerics\BigInteger.cs (93)
428int len = val.Length - 1; 457if (len != val.Length) 480if ((rgu is not null) && (rgu.Length > MaxLength)) 641int iu = _bits.Length - 1; 769int size = dividend._bits.Length; 791if (dividend._bits.Length < divisor._bits.Length) 799int size = dividend._bits.Length; 805size = dividend._bits.Length - divisor._bits.Length + 1; 846ulong h = value._bits[value._bits.Length - 1]; 847ulong m = value._bits.Length > 1 ? value._bits[value._bits.Length - 2] : 0; 848ulong l = value._bits.Length > 2 ? value._bits[value._bits.Length - 3] : 0; 852long b = (long)value._bits.Length * 32 - c; 989int size = (modulus._bits?.Length ?? 1) << 1; 1061int size = BigIntegerCalculator.PowBound(power, value._bits!.Length); 1105if ((_sign ^ other) < 0 || (cu = _bits.Length) > 2) 1125int cu = _bits.Length; 1148if ((_sign ^ other) < 0 || (cu = _bits.Length) > 2) 1164int cu = _bits.Length; 1372Debug.Assert(bits.Length > 0); 1373Debug.Assert(bits[bits.Length - 1] != 0); 1379highDword = ~bits[bits.Length - 1]; 1380if (bits.Length - 1 == nonZeroDwordIndex) 1391highDword = bits[bits.Length - 1]; 1419length = checked(4 * (bits.Length - 1) + length); 1446for (int i = 0; i < bits.Length - 1; i++) 1510Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1522buffer = buffer.Slice(0, _bits.Length + 1); 1586if ((_bits is null) || (_bits.Length <= 4)) 1597double lowBitsCount32 = _bits.Length - 2; // if Length > int.MaxValue/32, counting in bits can cause overflow 1801int length = value._bits.Length; 1826int length = bits.Length; 1873if (value._bits.Length > 1) 1898int len = value._bits.Length; 1935int len = value._bits.Length; 2010else if (value._bits.Length > 1 || value._sign < 0) 2029int len = value._bits.Length; 2055int len = value._bits.Length; 2340int size = (left._bits?.Length ?? 1) + 1; 2347size = (right._bits?.Length ?? 1) + 1; 2396int size = (left._bits?.Length ?? 1) + 1; 2403size = (right._bits?.Length ?? 1) + 1; 2447int size = (left._bits?.Length ?? 1) + 1; 2454size = (right._bits?.Length ?? 1) + 1; 2501int xl = value._bits?.Length ?? 1; 2562int xl = value._bits?.Length ?? 1; 2793int size = dividend._bits.Length; 2813if (dividend._bits.Length < divisor._bits.Length) 2819int size = dividend._bits.Length - divisor._bits.Length + 1; 2863if (dividend._bits.Length < divisor._bits.Length) 2869int size = dividend._bits.Length; 3065bitsArrayLength = bits.Length; 3106Debug.Assert(_bits is null ? xd.Length == 1 : xd.Length == _bits.Length); 3127Debug.Assert(_bits.Length > 0); 3129Debug.Assert(_bits.Length > 1 || _bits[0] >= kuMaskHighBit); 3131Debug.Assert(_bits[_bits.Length - 1] != 0); 3133Debug.Assert(_bits.Length <= MaxLength); 3192for (int i = 0; i < value._bits.Length; i++) 3215while ((part == 0) && (i < value._bits.Length)); 3217while (i < value._bits.Length) 3235int byteCount = (value._bits is null) ? sizeof(int) : (value._bits.Length * 4); 3252int xl = value._bits?.Length ?? 1; 3370int byteCount = (value._bits is null) ? sizeof(int) : (value._bits.Length * 4); 3387int xl = value._bits?.Length ?? 1; 3517for (int i = 1; (part == 0) && (i < value._bits.Length); i++) 3562int result = (bits.Length - 1) * 32; 3576for (int index = 0; index < bits.Length - 1; index++) 3614ref byte address = ref Unsafe.Add(ref startAddress, (bits.Length - 1) * sizeof(uint)); 3616for (int i = 0; i < bits.Length; i++) 3655while ((part == 0) && (i < bits.Length)); 3657while (i < bits.Length) 3717for (int i = 0; i < bits.Length; i++) 3756while ((part == 0) && (i < bits.Length)); 3758while (i < bits.Length) 3807int result = bits.Length * 4; 3817for (int index = 0; index < bits.Length - 1; index++) 3862return ((value._bits.Length * 32) - 1) ^ uint.LeadingZeroCount(value._bits[^1]); 4919if (value._bits.Length >= 2) 4951if (value._bits.Length >= 4) 4957if (value._bits.Length >= 3) 4962if (value._bits.Length >= 2) 4995if (Environment.Is64BitProcess && (value._bits.Length >= 2)) 5100if (value._bits.Length >= 2) 5132if (value._bits.Length >= 4) 5138if (value._bits.Length >= 3) 5143if (value._bits.Length >= 2) 5176if (Environment.Is64BitProcess && (value._bits.Length >= 2))
System.Runtime.Serialization.Formatters (29)
System\Runtime\Serialization\FormatterServices.cs (12)
77var membersTemp = new FieldInfo[allMembers.Count + typeMembers.Length]; 78Array.Copy(typeMembers, membersTemp, typeMembers.Length); 79allMembers.CopyTo(membersTemp, typeMembers.Length); 95for (int i = 0; i < fields.Length; i++) 105if (countProper != fields.Length) 109for (int i = 0; i < fields.Length; i++) 155if (parentTypes == null || parentTypeCount == parentTypes.Length) 222if (members.Length != data.Length) 227for (int i = 0; i < members.Length; i++) 263object?[] data = new object[members.Length]; 264for (int i = 0; i < members.Length; i++)
System\Runtime\Serialization\ObjectIDGenerator.cs (1)
136for (int j = 0; j < oldObjs.Length; j++)
System\Runtime\Serialization\ObjectManager.cs (16)
54if (index >= _objects.Length) 96if (holder._id >= _objects.Length && _objects.Length != MaxArraySize) 102newSize = (_objects.Length * 2); 119Array.Copy(_objects, temp, _objects.Length); 294if ((currentFieldIndex + 1) >= fieldsTemp.Length) 296var temp = new FieldInfo[fieldsTemp.Length * 2]; 297Array.Copy(fieldsTemp, temp, fieldsTemp.Length); 802if (parameters.Length == 2 && 873for (int i = 0; i < _objects.Length; i++) 1419if (_count == _values.Length) 1428int newLength = _values.Length * 2; 1464if (_totalItems == _values.Length) 1512int newLength = _values.Length * 2; 1544if (_count == _values.Length) 1555int newLength = _values.Length * 2;
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
387for (int i = 0; i < markup.Length; i++)
System.Security.Claims (9)
System\Security\Claims\Claim.cs (2)
461if (userData != null && userData.Length > 0) 503writer.Write(userData!.Length);
System\Security\Claims\ClaimsIdentity.cs (2)
845if (userData != null && userData.Length > 0) 894writer.Write(userData!.Length);
System\Security\Claims\ClaimsPrincipal.cs (2)
528if (userData != null && userData.Length > 0) 547writer.Write(userData!.Length);
System\Security\Claims\GenericPrincipal.cs (3)
47if (roles != null && roles.Length > 0) 49List<Claim> roleClaims = new List<Claim>(roles.Length); 75for (int i = 0; i < m_roles.Length; ++i)
System.Security.Cryptography (397)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
79bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
158int ret = method(handle, bytes, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EcDsa.ImportExport.cs (8)
76p, p.Length, 77curve.A!, curve.A!.Length, 78curve.B!, curve.B!.Length, 79curve.G.X!, curve.G.X!.Length, 80curve.G.Y!, curve.G.Y!.Length, 81curve.Order!, curve.Order!.Length, 82curve.Cofactor, curve.Cofactor!.Length, 83curve.Seed, curve.Seed == null ? 0 : curve.Seed.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
39ErrErrorStringN(error, buf, buffer.Length);
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
77ReportDownloadStop(ret?.Length ?? 0);
src\libraries\Common\src\System\Security\Cryptography\Asn1\AttributeAsn.xml.cs (1)
37for (int i = 0; i < AttrValues.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\SafeBagAsn.xml.cs (1)
51for (int i = 0; i < BagAttributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\EncryptedDataAsn.xml.cs (1)
35for (int i = 0; i < UnprotectedAttributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml.cs (1)
37for (int i = 0; i < Attributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (5)
76ret.G = parms.G.ExportKeyParameter(ret.P.Length); 77ret.X = x.ExportKeyParameter(ret.Q.Length); 81ret.Y = y.ExportKeyParameter(ret.P.Length); 139ret.G = parms.G.ExportKeyParameter(ret.P.Length); 140ret.Y = y.ExportKeyParameter(ret.P.Length);
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (12)
106if (parameters.J != null && parameters.J.Length >= parameters.P.Length) 111int keySize = parameters.P.Length; 112if (parameters.G.Length != keySize || parameters.Y.Length != keySize) 115if (hasPrivateKey && parameters.X!.Length != parameters.Q.Length) 123parameters.P, parameters.P.Length, 124parameters.Q, parameters.Q.Length, 125parameters.G, parameters.G.Length, 126parameters.Y, parameters.Y.Length, 127parameters.X, parameters.X != null ? parameters.X.Length : 0))
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (14)
431curve.A = specifiedParameters.Curve.A.ToUnsignedIntegerBytes(primeOrPoly.Length); 432curve.B = specifiedParameters.Curve.B.ToUnsignedIntegerBytes(primeOrPoly.Length); 433curve.Order = specifiedParameters.Order.ToUnsignedIntegerBytes(primeOrPoly.Length); 438if (baseSpan[0] != 0x04 || baseSpan.Length != 2 * primeOrPoly.Length + 1) 443curve.G.X = baseSpan.Slice(1, primeOrPoly.Length).ToArray(); 444curve.G.Y = baseSpan.Slice(1 + primeOrPoly.Length).ToArray(); 520for (int i = 0; i < attributes.Length; i++) 657int lastIndex = polynomial.Length - 1; 677for (int inverseIndex = 0; inverseIndex < polynomial.Length; inverseIndex++) 757while (start < fieldElement.Length - 1 && fieldElement[start] == 0) 767int basePointLength = ecParameters.Curve.G.X!.Length * 2 + 1; 782ecParameters.Curve.G.Y.CopyTo(basePointBytes.Slice(1 + ecParameters.Curve.G.X.Length)); 795int publicKeyLength = ecParameters.Q.X!.Length * 2 + 1; 810ecParameters.Q.Y.CopyTo(publicKeyBytes.Slice(1 + ecParameters.Q.X!.Length));
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (4)
136int half = secretAgreement.Length / 2; 137int odd = secretAgreement.Length & 1; 150Span<byte> part2 = stackalloc byte[ret.Length]; 160for (int i = 0; i < ret.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.ImportExport.cs (25)
117parameters.Q.X, parameters.Q.X?.Length ?? 0, 118parameters.Q.Y, parameters.Q.Y?.Length ?? 0, 119parameters.D, parameters.D == null ? 0 : parameters.D.Length); 129parameters.Q.X, parameters.Q.X?.Length ?? 0, 130parameters.Q.Y, parameters.Q.Y?.Length ?? 0, 131parameters.D, parameters.D == null ? 0 : parameters.D.Length, 132parameters.Curve.Prime!, parameters.Curve.Prime!.Length, 133parameters.Curve.A!, parameters.Curve.A!.Length, 134parameters.Curve.B!, parameters.Curve.B!.Length, 135parameters.Curve.G.X!, parameters.Curve.G.X!.Length, 136parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length, 137parameters.Curve.Order!, parameters.Curve.Order!.Length, 138parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length, 139parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length); 149parameters.Q.X, parameters.Q.X?.Length ?? 0, 150parameters.Q.Y, parameters.Q.Y?.Length ?? 0, 151parameters.D, parameters.D == null ? 0 : parameters.D.Length, 152parameters.Curve.Polynomial!, parameters.Curve.Polynomial!.Length, 153parameters.Curve.A!, parameters.Curve.A!.Length, 154parameters.Curve.B!, parameters.Curve.B!.Length, 155parameters.Curve.G.X!, parameters.Curve.G.X!.Length, 156parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length, 157parameters.Curve.Order!, parameters.Curve.Order!.Length, 158parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length, 159parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length);
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
60{ Length: 0 } => src,
src\libraries\Common\src\System\Security\Cryptography\KeySizeHelpers.cs (1)
60for (int i = 0; i < legalSizes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (5)
378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 385if (length != pwdTmpBytes!.Length) 393Debug.Assert(pwdTmpBytes!.Length == 0); 438return written + lastBlock.Length; 962return writeOffset + tmpEnd.Length;
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (2)
43int halfModulusLength = (n.Length + 1) / 2; 49D = key.PrivateExponent.ExportKeyParameter(n.Length),
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (6)
222if (!encrypted || bytesWritten != buf.Length) 224Debug.Fail($"TryEncrypt behaved unexpectedly: {nameof(encrypted)}=={encrypted}, {nameof(bytesWritten)}=={bytesWritten}, {nameof(buf.Length)}=={buf.Length}"); 740if (written != signature.Length) 742Debug.Fail($"RsaSignHash behaved unexpectedly: {nameof(written)}=={written}, {nameof(signature.Length)}=={signature.Length}");
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (9)
380int newCount = (bag.BagAttributes?.Length).GetValueOrDefault(0) + 1; 398if (!duplicateAttributeCheck.Add(attrSet.AttrType) || attrSet.AttrValues.Length > 1) 418for (int i = 0; i < bag.BagAttributes.Length; i++) 439if (attrLen < bag.BagAttributes.Length) 664Debug.Assert(_decryptBuffer.Length >= upperBound); 674Debug.Assert(_decryptBuffer.Length - _decryptBufferOffset >= encryptedContent.Length); 678_decryptBufferOffset = _decryptBuffer.Length; 758if (array.Length <= index) 858Debug.Assert(_keyDecryptBuffer.Length - _keyDecryptBufferOffset >= decrypted.Count);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
22Debug.Fail($"Convert.TryToBase64 failed with {input.Length} bytes to a {base64.Length} buffer");
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
80if (TryGetHomeDirectoryFromPasswd(buf, heapBuf.Length, out userHomeDirectory))
System\Security\Cryptography\AesCcm.cs (1)
31AesAEAD.CheckKeySize(key.Length);
System\Security\Cryptography\AesImplementation.cs (2)
187long keySize = rgbKey.Length * (long)BitsPerByte; 193long ivSize = rgbIV.Length * (long)BitsPerByte;
System\Security\Cryptography\AesImplementation.OpenSsl.cs (1)
21IntPtr algorithm = GetAlgorithm(key.Length * 8, feedback * 8, cipherMode);
System\Security\Cryptography\AsnEncodedData.cs (1)
127if (_rawData == null || _rawData.Length == 0)
System\Security\Cryptography\AsnEncodedDataCollection.cs (3)
72if (index < 0 || index >= array.Length) 74if (Count > array.Length - index) 91if (index < 0 || index >= array.Length)
System\Security\Cryptography\AsnFormatter.cs (3)
21Debug.Assert(sArray != null && sArray.Length != 0); 23int length = (sArray.Length * 3) - 1; // two chars per byte, plus 1 space between each 29for (int i = 0; i < sArray.Length; i++)
System\Security\Cryptography\AsymmetricAlgorithm.cs (2)
790bufSize = buf.Length; 820bufSize = buf.Length;
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (1)
225fieldSizeBits = pars.Q!.Length * 8;
System\Security\Cryptography\Base64Transforms.cs (5)
45if (requiredOutputLength > outputBuffer.Length - outputOffset) 78Debug.Assert(written == output.Length); 300Debug.Assert(_inputIndex < _inputBuffer.Length); 373if ((uint)inputCount > inputBuffer.Length) 379if ((inputBuffer.Length - inputCount) < inputOffset)
System\Security\Cryptography\CapiHelper.DSA.Shared.cs (17)
25if (dsaParameters.P == null || dsaParameters.P.Length == 0 || dsaParameters.Q == null || dsaParameters.Q.Length != DSS_Q_LEN) 29if (dsaParameters.G == null || dsaParameters.G.Length != dsaParameters.P.Length) 34if (dsaParameters.J != null && dsaParameters.J.Length >= dsaParameters.P.Length) 38if (dsaParameters.Y != null && dsaParameters.Y.Length != dsaParameters.P.Length) 42if (dsaParameters.Seed != null && dsaParameters.Seed.Length != 20) 45bool isPrivate = (dsaParameters.X != null && dsaParameters.X.Length > 0); 48if (isPrivate && dsaParameters.X!.Length != DSS_Q_LEN) 51uint bitLenP = (uint)dsaParameters.P.Length * 8; 52uint bitLenJ = dsaParameters.J == null ? 0 : (uint)dsaParameters.J.Length * 8; 81bw.Write((uint)(dsaParameters.Q.Length * 8)); 86bw.Write((uint)dsaParameters.X!.Length * 8); 299Debug.Assert(dsaParameters.Y.Length > 0); 339if (dsaParameters.Seed == null || dsaParameters.Seed.Length == 0)
System\Security\Cryptography\CapiHelper.Shared.cs (13)
75if (rsaParameters.Exponent == null || rsaParameters.Exponent.Length > 4) 78int modulusLength = rsaParameters.Modulus.Length; 84if (rsaParameters.P.Length != halfModulusLength) 87if (rsaParameters.Q == null || rsaParameters.Q.Length != halfModulusLength) 90if (rsaParameters.DP == null || rsaParameters.DP.Length != halfModulusLength) 93if (rsaParameters.DQ == null || rsaParameters.DQ.Length != halfModulusLength) 96if (rsaParameters.InverseQ == null || rsaParameters.InverseQ.Length != halfModulusLength) 99if (rsaParameters.D == null || rsaParameters.D.Length != modulusLength) 103bool isPrivate = (rsaParameters.P != null && rsaParameters.P.Length != 0); 119for (int i = 0; i < rsaParameters.Exponent.Length; i++) 203if (cspBlob.Length < 8) 268if (currentIV?.Length > blockSizeBytes) 271Buffer.BlockCopy(currentIV, 0, tmp, 0, tmp.Length);
System\Security\Cryptography\ChaCha20Poly1305.cs (1)
38CheckKeySize(key.Length);
System\Security\Cryptography\CngProperty.cs (1)
93for (int i = 0; i < _value.Length; i++)
System\Security\Cryptography\CryptoConfig.cs (13)
313string[] algorithmNames = new string[names.Length]; 314Array.Copy(names, algorithmNames, algorithmNames.Length); 413(args == null || args.Length == 1) && 445for (int i = 0; i < cons.Length; i++) 448if (con.GetParameters().Length == args.Length) 505string[] oidNames = new string[names.Length]; 506Array.Copy(names, oidNames, oidNames.Length); 557uint[] oidNums = new uint[oidString.Length]; 558for (int i = 0; i < oidString.Length; i++) 564if (oidNums.Length < 2) 572for (int i = 2; i < oidNums.Length; i++) 583for (int i = 2; i < oidNums.Length; i++)
System\Security\Cryptography\CryptoStream.cs (2)
153_stream.Write(finalBytes, 0, finalBytes.Length); 443_outputBufferIndex = _outputBuffer.Length;
System\Security\Cryptography\DES.cs (2)
53if (!(value.Length * 8).IsLegalSize(s_legalKeySizes)) 112if (rgbKey != null && rgbKey.Length == 8)
System\Security\Cryptography\DesImplementation.cs (2)
64long keySize = rgbKey.Length * (long)BitsPerByte; 75long ivSize = rgbIV.Length * (long)BitsPerByte;
System\Security\Cryptography\DSA.cs (11)
101return SignData(data, 0, data.Length, hashAlgorithm); 141ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 144ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 198ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 201ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 303return VerifyData(data, 0, data.Length, signature, hashAlgorithm); 311ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 314ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 371ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 374ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 1107int qLength = dsaParameters.Q!.Length;
System\Security\Cryptography\DSA.Xml.cs (4)
36byte[] g = ReadRequiredElement(ref state, nameof(DSAParameters.G), p.Length); 37byte[] y = ReadRequiredElement(ref state, nameof(DSAParameters.Y), p.Length); 41byte[]? x = XmlKeyHelper.ReadCryptoBinary(ref state, nameof(DSAParameters.X), q.Length); 107StringBuilder builder = new StringBuilder((keyParameters.P.Length << 1) / 3);
System\Security\Cryptography\DSACryptoServiceProvider.Unix.cs (2)
134if (parameters.Y != null && parameters.Y.Length > 1024 / 8) 234if (rgbHash.Length != SHA1_HASHSIZE)
System\Security\Cryptography\ECCurve.cs (11)
203B == null || B.Length != A.Length || 204G.X == null || G.X.Length != A.Length || 205G.Y == null || G.Y.Length != A.Length || 206Order == null || Order.Length == 0 || 207Cofactor == null || Cofactor.Length == 0) 216if (Prime == null || Prime.Length != A!.Length) 229if (Polynomial == null || Polynomial.Length == 0)
System\Security\Cryptography\ECDsa.cs (12)
47return SignData(data, 0, data.Length, hashAlgorithm); 55ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 58ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 112ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 115ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 723return VerifyData(data, 0, data.Length, signature, hashAlgorithm); 731ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 734ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 791ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 794ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 1018if (hash.Length <= destination.Length) 1021bytesWritten = hash.Length;
System\Security\Cryptography\ECParameters.cs (6)
38if (Q.Y != null && Q.X != null && Q.Y.Length == Q.X.Length) 46hasErrors = (D != null && (D.Length != Curve.Order!.Length)); 52hasErrors = (D != null && (D.Length != Q.X.Length));
System\Security\Cryptography\HashAlgorithm.cs (8)
49HashCore(buffer, 0, buffer.Length); 81if (count < 0 || (count > buffer.Length)) 83if ((buffer.Length - count) < offset) 102while ((bytesRead = inputStream.Read(buffer, 0, buffer.Length)) > 0) 239if (inputCount < 0 || inputCount > inputBuffer.Length) 241if ((inputBuffer.Length - inputCount) < inputOffset) 268if (final.Length == hashSizeInBytes) 271bytesWritten = final.Length;
System\Security\Cryptography\HashProvider.cs (1)
26if (data.Length - offset < count)
System\Security\Cryptography\Helpers.cs (5)
48byte[] oddParityKey = new byte[key.Length]; 49for (int index = 0; index < key.Length; index++) 70char[] chars = new char[bytes.Length * 2]; 145if (a2 == null || a1.Length != a2.Length)
System\Security\Cryptography\HKDF.cs (1)
90if (prk.Length < hashLength)
System\Security\Cryptography\HMACMD5.cs (1)
109Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA1.cs (1)
113Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA256.cs (1)
105Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA3_256.cs (1)
141Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA3_384.cs (1)
141Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA3_512.cs (1)
141Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA384.cs (1)
122Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA512.cs (1)
119Debug.Assert(written == buffer.Length);
System\Security\Cryptography\IncrementalHash.cs (4)
79/// the <see cref="Array.Length"/> value of <paramref name="data"/>. 83/// <paramref name="data"/>.<see cref="Array.Length"/> - <paramref name="offset"/>. 92ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length); 93if ((data.Length - count) < offset)
System\Security\Cryptography\LiteHashProvider.cs (1)
179Debug.Assert(written == result.Length);
System\Security\Cryptography\MD5.cs (1)
71Debug.Assert(written == buffer.Length);
System\Security\Cryptography\OidCollection.cs (4)
28if (count == _oids.Length) 78if (index < 0 || index >= array.Length) 80if (index + Count > array.Length) 96if (index < 0 || index >= array.Length)
System\Security\Cryptography\OpenSslAsnFormatter.cs (1)
34if (!Interop.Crypto.Asn1OctetStringSet(octetString, rawData, rawData.Length))
System\Security\Cryptography\PasswordDeriveBytes.cs (6)
126ib = _extra.Length - _extraCount; 153if (rgb.Length + ib > cb) 203_hash.TransformBlock(_password, 0, _password.Length, _password, 0); 207_hash.TransformBlock(_salt, 0, _salt.Length, _salt, 0); 236cs.Write(_baseValue!, 0, _baseValue!.Length); 249cs.Write(_baseValue, 0, _baseValue.Length);
System\Security\Cryptography\PemKeyHelpers.cs (2)
34bufferSize = buffer.Length; 70bufferSize = buffer.Length;
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (5)
43for (int ib = 0; ib < rgbT.Length;) 47hasher.TransformBlock(rgbSeed, 0, rgbSeed.Length, rgbSeed, 0); 52Buffer.BlockCopy(hash, 0, rgbT, ib, Math.Min(rgbT.Length - ib, hash.Length)); 54ib += hasher.Hash.Length;
System\Security\Cryptography\RandomNumberGenerator.cs (2)
41if (offset == 0 && count == data.Length) 442if (count > data.Length - offset)
System\Security\Cryptography\RC2Implementation.cs (6)
63if (!ValidKeySize(rgbKey.Length)) 68long ivSize = rgbIV.Length * (long)BitsPerByte; 88if (!ValidKeySize(Key.Length)) 112if (!ValidKeySize(Key.Length)) 137if (!ValidKeySize(Key.Length)) 162if (!ValidKeySize(Key.Length))
System\Security\Cryptography\Rfc2898DeriveBytes.cs (6)
141return _salt.AsSpan(0, _salt.Length - sizeof(uint)).ToArray(); 147_salt = new byte[value.Length + sizeof(uint)]; 219_endIndex = _buffer.Length; 286BinaryPrimitives.WriteUInt32BigEndian(_salt.AsSpan(_salt.Length - sizeof(uint)), _block + 1); 287Debug.Assert(_blockSize == _buffer.Length); 307for (int j = _buffer.Length - 1; j >= 0; j--)
System\Security\Cryptography\RSA.cs (17)
106if (destination.Length >= result.Length) 109bytesWritten = result.Length; 121if (destination.Length >= result.Length) 124bytesWritten = result.Length; 330if (destination.Length >= result.Length) 333bytesWritten = result.Length; 345if (destination.Length >= result.Length) 348bytesWritten = result.Length; 376return SignData(data, 0, data.Length, hashAlgorithm, padding); 389ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 392ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 638return VerifyData(data, 0, data.Length, signature, hashAlgorithm, padding); 652ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 655ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 735rentSize = rented.Length; 778rentSize = rented.Length; 1454if (written > rented.Length)
System\Security\Cryptography\RSA.Xml.cs (2)
34int halfN = (n.Length + 1) / 2; 43byte[]? d = XmlKeyHelper.ReadCryptoBinary(ref state, nameof(RSAParameters.D), n.Length);
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (3)
47if (rgb.Length != (KeySize / 8)) 133if (parameters.Exponent == null || parameters.Exponent.Length > 4) 139_publicOnly = (parameters.P == null || parameters.P.Length == 0);
System\Security\Cryptography\SHA1.cs (1)
68Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA256.cs (1)
67Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA3_256.cs (1)
93Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA3_384.cs (1)
93Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA3_512.cs (1)
93Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA384.cs (1)
67Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA512.cs (1)
67Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SymmetricAlgorithm.cs (4)
75if (value.Length != this.BlockSize / 8) 95long bitLength = value.Length * 8L; 476|| (uint)written > decryptBuffer.Length) 1078|| (uint)written > decryptBuffer.Length)
System\Security\Cryptography\TripleDES.cs (5)
53if (!(value.Length * 8).IsLegalSize(s_legalKeySizes)) 68if (!(rgbKey.Length * 8).IsLegalSize(s_legalKeySizes)) 74if ((rgbOddParityKey.Length == 24) && EqualBytes(rgbOddParityKey, 8, 16, 8)) 83Debug.Assert((start1 + count) <= rgbKey.Length); 84Debug.Assert((start2 + count) <= rgbKey.Length);
System\Security\Cryptography\TripleDesImplementation.cs (3)
56long keySize = rgbKey.Length * (long)BitsPerByte; 62long ivSize = rgbIV.Length * (long)BitsPerByte; 67if (rgbKey.Length == 16)
System\Security\Cryptography\UniversalCryptoDecryptor.cs (6)
54Debug.Assert(inputBuffer.Length >= _heldoverCipher.Length); 55inputBuffer.Slice(inputBuffer.Length - _heldoverCipher.Length).CopyTo(_heldoverCipher); 56inputBuffer = inputBuffer.Slice(0, inputBuffer.Length - _heldoverCipher.Length); 95rentedCiphertextSize = _heldoverCipher.Length + inputBuffer.Length; 99inputBuffer.CopyTo(ciphertext.Slice(_heldoverCipher.Length)); 157Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (1)
52Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoTransform.cs (6)
73ArgumentOutOfRangeException.ThrowIfGreaterThan(inputOffset, inputBuffer.Length); 77if (inputCount > inputBuffer.Length - inputOffset) 81ArgumentOutOfRangeException.ThrowIfGreaterThan(outputOffset, outputBuffer.Length); 82if (inputCount > outputBuffer.Length - outputOffset) 96ArgumentOutOfRangeException.ThrowIfGreaterThan(inputOffset, inputBuffer.Length); 97if (inputCount > inputBuffer.Length - inputOffset)
System\Security\Cryptography\X509Certificates\Asn1\CertificationRequestInfoAsn.xml.cs (1)
50for (int i = 0; i < Attributes.Length; i++)
System\Security\Cryptography\X509Certificates\Asn1\DistributionPointAsn.xml.cs (1)
47for (int i = 0; i < CRLIssuer.Length; i++)
System\Security\Cryptography\X509Certificates\Asn1\DistributionPointNameAsn.xml.cs (1)
48for (int i = 0; i < FullName.Length; i++)
System\Security\Cryptography\X509Certificates\Asn1\TbsCertificateAsn.xml.cs (1)
125for (int i = 0; i < Extensions.Length; i++)
System\Security\Cryptography\X509Certificates\CertificatePolicy.cs (4)
68for (int i = 1; i <= _policies.Length; i++) 75int dataIdx = _policies.Length - i; 127for (int i = 1; i <= _policies.Length; i++) 134int dataIdx = _policies.Length - i;
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (2)
222if (attr.AttrValues.Length != 1) 264if (attr.AttrValues.Length == 0)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
52if (bytesConsumed != currentCrl.Length)
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (1)
193if (chainPal.ChainElements!.Length > 0)
System\Security\Cryptography\X509Certificates\ECDsaX509SignatureGenerator.cs (7)
100Debug.Assert(ecParameters.Q.X!.Length == ecParameters.Q.Y!.Length); 101byte[] uncompressedPoint = new byte[1 + ecParameters.Q.X.Length + ecParameters.Q.Y.Length]; 106Buffer.BlockCopy(ecParameters.Q.X, 0, uncompressedPoint, 1, ecParameters.Q.X.Length); 107Buffer.BlockCopy(ecParameters.Q.Y, 0, uncompressedPoint, 1 + ecParameters.Q.X.Length, ecParameters.Q.Y.Length);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
45if (thumbprint.Length != SHA1.HashSizeInBytes)
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (7)
129for (int i = 0; i < s_rootStoreDirectories.Length; i++) 161s_directoryLastWrite = new DateTime[s_rootStoreDirectories.Length]; 177for (int i = 0; i < s_rootStoreDirectories.Length; i++) 342for (int i = 0; i < directories.Length; i++) 348if (directories.Length > 1) 351if (set.Count != directories.Length) 356for (int i = 0; i < directories.Length; i++)
System\Security\Cryptography\X509Certificates\OpenSslCertificateAssetDownloader.cs (3)
20if (data == null || data.Length == 0) 68SafeX509CrlHandle handle = Interop.Crypto.DecodeX509Crl(data, data.Length); 81Interop.Crypto.BioWrite(bio, data, data.Length);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
216stream.Write(pkcs12, 0, pkcs12.Length);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (5)
795bytes.Length == 13 || bytes.Length == 15, 798bytes[bytes.Length - 1] == 'Z', 801if (bytes != null && bytes.Length is 13 or 15 && bytes[^1] == 'Z') 819bytes.Length == 13 ? "yyMMddHHmmss'Z'" : "yyyyMMddHHmmss'Z'",
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (3)
949for (int i = 0; i < elements.Length; i++) 1387else if (errorDepth >= _errors.Length) 1394_errors.AsSpan(toReturn.Length).Clear();
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (1)
59for (int i = 0; i < attributes.Length; i++)
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
181for (int i = 0; i < _decoded.Length; i++)
System\Security\Cryptography\X509Certificates\X509Certificate.cs (3)
92if (rawData == null || rawData.Length == 0) 108if (rawData == null || rawData.Length == 0) 436for (int i = 0; i < thumbPrint.Length && i < 4; ++i)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
389if (rawData == null || rawData.Length == 0)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
62for (; i < certificates.Length; i++) 284for (; i < certificates.Length; i++)
System\Security\Cryptography\X509Certificates\X509CertificateCollection.cs (1)
48for (int i = 0; i < value.Length; i++)
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (4)
321if (attr.AttrType == Oids.LocalKeyId && attr.AttrValues.Length > 0) 419if (attr.AttrType == Oids.LocalKeyId && attr.AttrValues.Length > 0) 497return (certKeyParameters?.Length ?? 0) == 0; 515sizeHint = checked(buf.Length * 2);
System\Security\Cryptography\X509Certificates\X509Chain.cs (1)
185if (!success && throwOnException && _pal?.ChainStatus is not { Length: > 0 })
System\Security\Cryptography\X509Certificates\X509ChainElementCollection.cs (4)
27get { return _elements.Length; } 46if (index >= _elements.Length) 64if (index < 0 || index >= array.Length) 66if (index + Count > array.Length)
System\Security\Cryptography\X509Certificates\X509ExtensionCollection.cs (2)
83if (index < 0 || index >= array.Length) 85if (index + Count > array.Length)
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (1)
112if (!gotContents || consumed != encoded.Length)
System\Security\Cryptography\XmlKeyHelper.cs (2)
81int idx = Math.Max(0, buf.Length - sizeof(int)); 87for (; idx < buf.Length; idx++)
System.Security.Cryptography.Cose (17)
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
193retVal += GetByteStringEncodedSize(content.Length);
System\Security\Cryptography\Cose\CoseMessage.cs (3)
270if (protectedHeaderAsBstr.Length == 0) 442while ((bytesRead = contentStream.Read(contentBuffer, 0, contentBuffer.Length)) > 0) 599Debug.Assert(bytesWritten == buffer.Length);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (6)
290Debug.Assert(buffer.Length == bytesWritten); 543int encodedLength = CoseHelpers.GetCoseSignEncodedLengthMinusSignature(_isTagged, MultiSignSizeOfCborTag, _protectedHeaderAsBstr.Length, UnprotectedHeaders, _content); 549encodedLength += CoseHelpers.GetByteStringEncodedSize(signature._encodedSignProtectedHeaders.Length); 551encodedLength += CoseHelpers.GetByteStringEncodedSize(signature._signature.Length); 788_protectedHeaderAsBstr.Length, 864_protectedHeaderAsBstr.Length,
System\Security\Cryptography\Cose\CoseSign1Message.cs (5)
240Debug.Assert(buffer.Length == bytesWritten); 625_protectedHeaderAsBstr.Length, 726_protectedHeaderAsBstr.Length, 790CoseHelpers.GetCoseSignEncodedLengthMinusSignature(_isTagged, Sign1SizeOfCborTag, _protectedHeaderAsBstr.Length, UnprotectedHeaders, _content) + 791CoseHelpers.GetByteStringEncodedSize(_signature.Length);
System\Security\Cryptography\Cose\CoseSignature.cs (2)
402_encodedSignProtectedHeaders.Length, 434_encodedSignProtectedHeaders.Length,
System.Security.Cryptography.Pkcs (107)
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (1)
124if (alg.IV.Length != alg.BlockSize / 8)
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decode.cs (1)
65for (int i = 0; i < recipientInfo.Kari.Value.RecipientEncryptedKeys.Length; i++)
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decrypt.cs (1)
77Array.Clear(cek, 0, cek.Length);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Encrypt.cs (2)
48Array.Clear(cek, 0, cek.Length); 174if (contentInfo.ContentType.Value == Oids.Pkcs7Data || contentInfo.Content.Length == 0)
Internal\Cryptography\PkcsHelpers.cs (11)
131Debug.Assert(idx < arr.Length); 133if (arr.Length == 1) 139T[] tmp = new T[arr.Length - 1]; 146if (idx < tmp.Length) 148Array.Copy(arr, idx + 1, tmp, idx, tmp.Length - idx); 177AttributeAsn[] decodedSet = new AttributeAsn[setItems.Length]; 243if (octets.Length < 2) 246int end = octets.Length; 399for (int i = 0; i < ba.Length; i++) 445return OneShot(transform, data, 0, data.Length); 592if (consumed != encodedUtcTime.Length)
src\libraries\Common\src\System\Security\Cryptography\Asn1\AttributeAsn.xml.cs (1)
37for (int i = 0; i < AttrValues.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\SafeBagAsn.xml.cs (1)
51for (int i = 0; i < BagAttributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\EncryptedDataAsn.xml.cs (1)
35for (int i = 0; i < UnprotectedAttributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml.cs (1)
37for (int i = 0; i < Attributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
60{ Length: 0 } => src,
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (5)
378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 385if (length != pwdTmpBytes!.Length) 393Debug.Assert(pwdTmpBytes!.Length == 0); 438return written + lastBlock.Length; 962return writeOffset + tmpEnd.Length;
System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (4)
145if (index < 0 || index >= array.Length) 147if (index > array.Length - Count) 164if (index < 0 || index >= array.Length) 166if (index > array.Length - Count)
System\Security\Cryptography\Pkcs\Asn1\CadesIssuerSerial.xml.cs (1)
29for (int i = 0; i < Issuer.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\EnvelopedDataAsn.xml.cs (2)
39for (int i = 0; i < RecipientInfos.Length; i++) 51for (int i = 0; i < UnprotectedAttributes.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\KeyAgreeRecipientInfoAsn.xml.cs (1)
45for (int i = 0; i < RecipientEncryptedKeys.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\OriginatorInfoAsn.xml.cs (2)
32for (int i = 0; i < CertificateSet.Length; i++) 45for (int i = 0; i < RevocationInfoChoices.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\PolicyInformation.xml.cs (1)
40for (int i = 0; i < PolicyQualifiers.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\Rfc3161TimeStampReq.xml.cs (1)
84for (int i = 0; i < Extensions.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\Rfc3161TstInfo.xml.cs (1)
99for (int i = 0; i < Extensions.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\SignedAttributesSet.xml.cs (1)
46for (int i = 0; i < SignedAttributes.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\SignedDataAsn.xml.cs (4)
34for (int i = 0; i < DigestAlgorithms.Length; i++) 46for (int i = 0; i < CertificateSet.Length; i++) 59for (int i = 0; i < Crls.Length; i++) 76for (int i = 0; i < SignerInfos.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\SignerInfoAsn.xml.cs (1)
64for (int i = 0; i < UnsignedAttributes.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\SigningCertificateAsn.xml.cs (2)
29for (int i = 0; i < Certs.Length; i++) 40for (int i = 0; i < Policies.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\SigningCertificateV2Asn.xml.cs (2)
29for (int i = 0; i < Certs.Length; i++) 40for (int i = 0; i < Policies.Length; i++)
System\Security\Cryptography\Pkcs\CmsRecipientCollection.cs (4)
97if (index < 0 || index >= array.Length) 99if (index > array.Length - Count) 116if (index < 0 || index >= array.Length) 118if (index > array.Length - Count)
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (1)
77int bufSize = 2 * dsaParameters.Q!.Length;
System\Security\Cryptography\Pkcs\CmsSignature.RSA.cs (1)
135if (signed && signature.Length == bytesWritten)
System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
201rentedMac = CryptoPool.Rent(macKey.Length); 202macSpan = rentedMac.AsSpan(0, macKey.Length); 206Debug.Assert(macKey.Length <= 128); 207salt = stackalloc byte[Math.Min(macKey.Length, 128)];
System\Security\Cryptography\Pkcs\Pkcs12Info.cs (1)
125for (int i = 0; i < contentsArray.Length; i++)
System\Security\Cryptography\Pkcs\RecipientInfoCollection.cs (5)
33if (index < 0 || index >= _recipientInfos.Length) 43return _recipientInfos.Length; 66if (index < 0 || index >= array.Length) 68if (index > array.Length - Count) 84if (index < 0 || index >= array.Length)
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (3)
31public bool HasExtensions => _parsedData.Extensions?.Length > 0; 153if (destination.Length < _encodedBytes.Length) 160bytesWritten = _encodedBytes.Length;
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (4)
437if (issuerNames == null || issuerNames.Length != 1) 464if (issuerNames == null || issuerNames.Length != 1) 607if (signingCert.Certs.Length < 1) 634if (signingCert.Certs.Length < 1)
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (3)
136public bool HasExtensions => _parsedData.Extensions?.Length > 0; 215if (destination.Length < _encodedBytes.Length) 222bytesWritten = _encodedBytes.Length;
System\Security\Cryptography\Pkcs\SignedCms.cs (10)
312if (ContentInfo.Content.Length == 0) 376int newIdx = _signedData.SignerInfos.Length; 399if (index < 0 || index >= _signedData.SignerInfos.Length) 512int curLength = _signedData.DigestAlgorithms.Length; 532for (int i = 0; i < _signedData.SignerInfos.Length; i++) 548for (int i = 0; i < _signedData.DigestAlgorithms.Length; i++) 567int existingLength = _signedData.CertificateSet?.Length ?? 0; 599for (int i = existingLength; i < _signedData.CertificateSet.Length; i++) 675int existingLength = _signedData.CertificateSet?.Length ?? 0; 709int existingLength = _signedData.CertificateSet?.Length ?? 0;
System\Security\Cryptography\Pkcs\SignerInfo.cs (14)
81_unsignedAttributes.Length == 0) 135for (int i = 0; i < unsignedAttrs.Length; i++) 141for (int j = 0; j < attributeAsn.AttrValues.Length; j++) 195newAttributeIdx = mySigner.UnsignedAttributes.Length; 205int newIndex = modifiedAttr.AttrValues.Length; 318newExtensionIdx = mySigner.UnsignedAttributes.Length; 363for (var i = 0; i < unsignedAttrs.Length; i++) 369if (index < csIndex + attributeAsn.AttrValues.Length) 373if (removeValueIndex == 0 && attributeAsn.AttrValues.Length == 1) 380csIndex += attributeAsn.AttrValues.Length; 393if (unsignedAttrs.Length == 1) 823for (int i = startIndex; i < attributes.Length; i++) 839for (int i = 0; i < attributeValues.Length; i++) 844isOnlyValue = attributeValues.Length == 1;
System\Security\Cryptography\Pkcs\SignerInfoCollection.cs (7)
31_signerInfos = new SignerInfo[signedDataSignerInfos.Length]; 33for (int i = 0; i < signedDataSignerInfos.Length; i++) 43if (index < 0 || index >= _signerInfos.Length) 49public int Count => _signerInfos.Length; 63if (index < 0 || index >= array.Length) 65if (index + Count > array.Length) 86for (int i = 0; i < signerInfos.Length; i++)
System.Security.Cryptography.ProtectedData (3)
System\Security\Cryptography\ProtectedData.cs (3)
42byte[] relevantData = inputData.Length == 0 ? s_nonEmpty : inputData; 46DATA_BLOB userDataBlob = new DATA_BLOB((IntPtr)pInputData, (uint)(inputData.Length)); 50optionalEntropyBlob = new DATA_BLOB((IntPtr)pOptionalEntropy, (uint)(optionalEntropy.Length));
System.Security.Cryptography.Xml (84)
System\Security\Cryptography\Xml\CanonicalXmlAttribute.cs (3)
36hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 38hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 41hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlCDataSection.cs (1)
35hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlComment.cs (5)
56hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 60hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 62hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 64hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 68hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlElement.cs (3)
140hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 150hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 168hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlProcessingInstruction.cs (6)
51hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 55hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 58hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 63hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 67hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0); 72hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlSignificantWhitespace.cs (1)
37hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlText.cs (1)
37hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\CanonicalXmlWhitespace.cs (1)
37hash.TransformBlock(rgbData, 0, rgbData.Length, rgbData, 0);
System\Security\Cryptography\Xml\EncryptedXml.cs (9)
302Buffer.BlockCopy(cipherValue, 0, IV, 0, IV.Length); 721cipher = enc.TransformFinalBlock(plaintext, 0, plaintext.Length); 738output = new byte[cipher.Length + IV.Length]; 739Buffer.BlockCopy(IV, 0, output, 0, IV.Length); 740Buffer.BlockCopy(cipher, 0, output, IV.Length, cipher.Length); 793lengthIV = decryptionIV.Length; 799output = dec.TransformFinalBlock(cipherValue, lengthIV, cipherValue.Length - lengthIV);
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (3)
68if ((chain.ChainStatus.Length > 0) && 89if ((chain.ChainStatus.Length > 0) && 176Array.Resize(ref bytes, bytes.Length + 1);
System\Security\Cryptography\Xml\SignedXml.cs (5)
979if (a.Length != b.Length) 985int aLength = a.Length; 1076if (m_signature.SignatureValue.Length != signatureLength / 8) 1083return m_signature.SignatureValue.AsSpan().SequenceEqual(hashValue.AsSpan(0, m_signature.SignatureValue.Length));
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (2)
598readBytes = data!.Read(buffer, 0, buffer.Length); 600} while (readBytes == buffer.Length);
System\Security\Cryptography\Xml\SymmetricKeyWrap.cs (35)
38byte[] rgbWKCKS = new byte[rgbWrappedKeyData.Length + 8]; 51Buffer.BlockCopy(rgbWrappedKeyData, 0, rgbWKCKS, 0, rgbWrappedKeyData.Length); 52Buffer.BlockCopy(rgbCKS, 0, rgbWKCKS, rgbWrappedKeyData.Length, 8); 53byte[] temp1 = enc1.TransformFinalBlock(rgbWKCKS, 0, rgbWKCKS.Length); 54byte[] temp2 = new byte[rgbIV.Length + temp1.Length]; 55Buffer.BlockCopy(rgbIV, 0, temp2, 0, rgbIV.Length); 56Buffer.BlockCopy(temp1, 0, temp2, rgbIV.Length, temp1.Length); 60return enc2.TransformFinalBlock(temp2, 0, temp2.Length); 74if (rgbEncryptedWrappedKeyData.Length != 32 && rgbEncryptedWrappedKeyData.Length != 40 75&& rgbEncryptedWrappedKeyData.Length != 48) 89byte[] temp2 = dec1.TransformFinalBlock(rgbEncryptedWrappedKeyData, 0, rgbEncryptedWrappedKeyData.Length); 94byte[] temp1 = new byte[temp2.Length - rgbIV.Length]; 95Buffer.BlockCopy(temp2, 8, temp1, 0, temp1.Length); 98byte[] rgbWKCKS = dec2.TransformFinalBlock(temp1, 0, temp1.Length); 101byte[] rgbWrappedKeyData = new byte[rgbWKCKS.Length - 8]; 102Buffer.BlockCopy(rgbWKCKS, 0, rgbWrappedKeyData, 0, rgbWrappedKeyData.Length); 106for (int index = rgbWrappedKeyData.Length, index1 = 0; index < rgbWKCKS.Length; index++, index1++) 123int N = rgbWrappedKeyData.Length >> 3; 125if ((rgbWrappedKeyData.Length % 8 != 0) || N <= 0) 143byte[] temp = new byte[s_rgbAES_KW_IV.Length + rgbWrappedKeyData.Length]; 144Buffer.BlockCopy(s_rgbAES_KW_IV, 0, temp, 0, s_rgbAES_KW_IV.Length); 145Buffer.BlockCopy(rgbWrappedKeyData, 0, temp, s_rgbAES_KW_IV.Length, rgbWrappedKeyData.Length); 146return enc.TransformFinalBlock(temp, 0, temp.Length); 152Buffer.BlockCopy(rgbWrappedKeyData, 0, rgbOutput, 8, rgbWrappedKeyData.Length); 185int N = (rgbEncryptedWrappedKeyData.Length >> 3) - 1; 187if ((rgbEncryptedWrappedKeyData.Length % 8 != 0) || N <= 0) 206byte[] temp = dec.TransformFinalBlock(rgbEncryptedWrappedKeyData, 0, rgbEncryptedWrappedKeyData.Length); 218Buffer.BlockCopy(rgbEncryptedWrappedKeyData, 8, rgbOutput, 0, rgbOutput.Length);
System\Security\Cryptography\Xml\Transform.cs (1)
103for (int i = 0; i < InputTypes.Length; i++)
System\Security\Cryptography\Xml\Utils.cs (4)
90while (!attrIsAllowed && expectedAttrNames != null && expectedInd < expectedAttrNames.Length) 602for (int i = 0; i < input.Length; i++) 612int index = hex.Length; 667for (int index = 0; index < stores.Length; index++)
System\Security\Cryptography\Xml\XmlDsigBase64Transform.cs (2)
104while ((j < buffer.Length) && (!char.IsWhiteSpace((char)buffer[j]))) j++; 106while (j < buffer.Length)
System\Security\Cryptography\Xml\XmlDsigXsltTransform.cs (2)
95_inputStream.Write(buffer, 0, buffer.Length); 104_inputStream.Write(buffer, 0, buffer.Length);
System.Security.Permissions (5)
System\Security\Permissions\PrincipalPermission.cs (5)
192IDRole[] idrolesArray = new IDRole[_idArray.Length + operand._idArray.Length]; 193Array.Copy(_idArray, idrolesArray, _idArray.Length); 194Array.Copy(operand._idArray, 0, idrolesArray, _idArray.Length, operand._idArray.Length);
System.ServiceModel.Http (20)
System\ServiceModel\Channels\ConnectionUtilities.cs (1)
20ValidateBufferBounds(buffer.Length, offset, size);
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
1175for (int i = 0; i < headerKeys.Length; i++)
System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (5)
47if (handlers.Length == 0) 52_handlerCtors = new ConstructorInfo[handlers.Length]; 53for (int cnt = 0; cnt < handlers.Length; cnt++) 153DelegatingHandler[] instances = new DelegatingHandler[_handlerCtors.Length]; 154for (int cnt = 0; cnt < _handlerCtors.Length; cnt++)
System\ServiceModel\Channels\HttpTransportSecurityHelpers.cs (4)
120if (rawData.Length != certRawData.Length) 129if ((i + Vector<byte>.Count) > certRawData.Length) 132for (; i < certRawData.Length; i++)
System\ServiceModel\Channels\MessageContent.cs (3)
64for (int i = 0; i < headerKeys.Length; i++) 103Contract.Assert(actionParams.Length <= 1, "action MUST only appear as a content type parameter at most 1 time"); 104if (actionParams.Length > 0)
System\ServiceModel\Channels\WebSocketHelper.cs (1)
84for (int i = 0; i < chars.Length; i++)
System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (4)
553new ArraySegment<byte>(internalBuffer, receivedByteCount, internalBuffer.Length - receivedByteCount), 560if (receivedByteCount >= internalBuffer.Length && !result.EndOfMessage) 562if (internalBuffer.Length >= _maxBufferSize) 568int newSize = (int)Math.Min(((double)internalBuffer.Length) * 2, _maxBufferSize);
System\ServiceModel\Channels\WebSocketTransportSettings.cs (1)
104if (value.Split(WebSocketHelper.ProtocolSeparators).Length > 1)
System.ServiceModel.NetFramingBase (9)
System\ServiceModel\Channels\FramingDecoders.cs (2)
137if (_encodedBytes == null || _encodedBytes.Length < _encodedSize) 185for (int i = 0; i < buffer1.Length; i++)
System\ServiceModel\Channels\IdlingCommunicationPool.cs (2)
244for (int i = 0; i < connectionsCopy.Length; i++) 256for (int i = 0; i < connectionsCopy.Length; i++)
System\ServiceModel\Channels\SessionConnectionReader.cs (1)
111if (EnvelopeBuffer != null && (EnvelopeSize - EnvelopeOffset) >= _buffer.Length)
System\ServiceModel\Channels\SingletonConnectionReader.cs (3)
97int bytesRead = _inputStream.Read(dummy, 0, dummy.Length); 275Fx.Assert(size <= _chunkBuffer.Length, ""); 409_chunkBufferSize = ReadCore(_chunkBuffer, 0, _chunkBuffer.Length);
System\ServiceModel\Pool.cs (1)
34if (Count < _items.Length)
System.ServiceModel.NetNamedPipe (3)
System\ServiceModel\Channels\PipeConnectionInitiator.cs (3)
79for (int i = 0; i < hostChoices.Length; i++) 81for (int iGlobal = 0; iGlobal < globalChoices.Length; iGlobal++) 361if (canonicalBytes.Length >= 128)
System.ServiceModel.NetTcp (3)
System\ServiceModel\Channels\SocketConnection.cs (3)
907if (addresses.Length == 0) 936invalidAddressCount, addresses.Length, addressStringBuilder.ToString()), innerException)); 953for (int i = 0; i < addresses.Length; i++)
System.ServiceModel.Primitives (511)
Internals\System\Runtime\BufferedOutputStream.cs (10)
113if (_currentChunk.Length > (int.MaxValue / 2)) 119newChunkSize = _currentChunk.Length * 2; 126if (_chunkCount == _chunks.Length) 128byte[][] newChunks = new byte[_chunks.Length * 2][]; 129Array.Copy(_chunks, newChunks, _chunks.Length); 231Buffer.BlockCopy(chunk, 0, buffer, offset, chunk.Length); 232offset += chunk.Length; 278int remainingSizeInChunk = _currentChunk.Length - _currentChunkSize; 287_currentChunkSize = _currentChunk.Length; 311if (_currentChunkSize == _currentChunk.Length)
Internals\System\Runtime\Fx.cs (3)
248if (typeNames != null && typeNames.Length > 0) 250List<Type> types = new List<Type>(typeNames.Length); 251for (int i = 0; i < typeNames.Length; i++)
Internals\System\Runtime\InputQueue.cs (8)
438for (int i = 0; i < outstandingReaders.Length; i++) 602for (int i = 0; i < outstandingReaders.Length; i++) 610for (int i = 0; i < waiters.Length; i++) 1057_head = (_head + 1) % _items.Length; 1063if (ItemCount == _items.Length) 1065Item[] newItems = new Item[_items.Length * 2]; 1068newItems[i] = _items[(_head + i) % _items.Length]; 1073int tail = (_head + ItemCount) % _items.Length;
Internals\System\Runtime\InternalBufferManager.cs (9)
95_bufferSizes = new int[_bufferPools.Length]; 96for (int i = 0; i < _bufferPools.Length; i++) 108for (int i = 0; i < _bufferPools.Length; i++) 149for (int i = 0; i < _bufferPools.Length; i++) 173for (int i = 0; i < _bufferPools.Length; i++) 194for (int i = 0; i < _bufferSizes.Length; i++) 215BufferPool bufferPool = FindPool(buffer.Length); 218if (buffer.Length != bufferPool.BufferSize) 335for (int i = 0; i < _bufferPools.Length; i++)
Internals\System\Runtime\IOThreadScheduler.cs (4)
83Contract.Assert((_slots.Length & SlotMask) == 0, "Capacity must be a power of two."); 164new IOThreadScheduler(Math.Min(_slots.Length * 2, MaximumCapacity)); 230return _slots.Length - 1; 267for (int i = 0; i < _slots.Length; i++)
Internals\System\Runtime\IOThreadTimer.cs (4)
451if (index == timers.Length) 453timers = new IOThreadTimer[timers.Length * 2]; 454Array.Copy(this.timers, timers, this.timers.Length); 638for (int i = 1; i < waitableTimers.Length; i++)
Internals\System\Runtime\Remoting\SoapHexBinary.cs (4)
28for (int i = 0; i < Value.Length; i++) 49if (cA.Length % 2 != 0) 53Byte[] bA = new Byte[cA.Length / 2]; 54for (int i = 0; i < cA.Length / 2; i++)
Internals\System\Runtime\SynchronizedPool.cs (11)
86for (int i = 0; i < entries.Length; i++) 102_entries = new Entry[_entries.Length]; 119for (int i = 0; i < _entries.Length; i++) 143for (int i = 0; i < localPending.Length; i++) 177for (int i = 0; i < localPending.Length; i++) 198if (localPending.Length >= MaxPendingEntries) 200_pending = new PendingEntry[localPending.Length]; 204PendingEntry[] newPending = new PendingEntry[localPending.Length * 2]; 205Array.Copy(localPending, newPending, localPending.Length); 231for (int i = 0; i < entries.Length; i++) 286for (int i = 0; i < entries.Length; i++)
Internals\System\Runtime\UrlUtility.cs (4)
91return AsciiEncoding.GetString(bytes, 0, bytes.Length); 155bytes = UrlEncodeBytesToBytesInternalNonAscii(bytes, 0, bytes.Length, false); 157return AsciiEncoding.GetString(bytes, 0, bytes.Length); 177return UrlEncodeBytesToBytesInternal(bytes, 0, bytes.Length, false);
Internals\System\Text\BinHexEncoding.cs (14)
66if (charIndex > chars.Length) 67throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(charIndex), SRP.Format(SRP.OffsetExceedsBufferSize, chars.Length))); 70if (charCount > chars.Length - charIndex) 71throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(charCount), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, chars.Length - charIndex))); 76if (byteIndex > bytes.Length) 77throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(byteIndex), SRP.Format(SRP.OffsetExceedsBufferSize, bytes.Length))); 79if (byteCount < 0 || byteCount > bytes.Length - byteIndex) 132if (byteIndex > bytes.Length) 133throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(byteIndex), SRP.Format(SRP.OffsetExceedsBufferSize, bytes.Length))); 136if (byteCount > bytes.Length - byteIndex) 137throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(byteCount), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex))); 143if (charIndex > chars.Length) 144throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(charIndex), SRP.Format(SRP.OffsetExceedsBufferSize, chars.Length))); 145if (charCount < 0 || charCount > chars.Length - charIndex)
Internals\System\Xml\XmlMtomReader.cs (47)
108for (int i = 0; i < encodings.Length; i++) 114_encodings = new Encoding[encodings.Length]; 234for (int i = 0; i < _encodings.Length; i++) 247for (int i = 0; i < _encodings.Length; i++) 258for (int i = 0; i < _encodings.Length; i++) 271for (int i = 0; i < _encodings.Length; i++) 1214if (offset > buffer.Length) 1215throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length))); 1218if (count > buffer.Length - offset) 1219throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1261if (offset > buffer.Length) 1262throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length))); 1265if (count > buffer.Length - offset) 1266throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1306if (offset > buffer.Length) 1307throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length))); 1310if (count > buffer.Length - offset) 1311throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 1364if (offset > chars.Length) 1365throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, chars.Length))); 1368if (count > chars.Length - offset) 1369throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, chars.Length - offset))); 1411else if (_valueBuffer.Length < byteCount) 1956while (0 != Read(caller, scratch, 0, scratch.Length)) 1994if (delimitter.Length > end - start) 2003for (int i = delimitter.Length - 1; i >= 1; i--) 2026ptr += delimitter.Length; 2075if (matchBuffer == null || matchBuffer.Length < delimitter.Length - read) 2076matchBuffer = new byte[delimitter.Length - read]; 2078int matched = stream.ReadBlock(matchBuffer, 0, delimitter.Length - read); 2108if (start + count != delimitter.Length) 2189if (offset > buffer.Length) 2190throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length))); 2193if (count > buffer.Length - offset) 2194throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 2668maxOffset = stream.Read(buffer, 0, buffer.Length); 2927if (offset > buffer.Length) 2928throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SRP.Format(SRP.OffsetExceedsBufferSize, buffer.Length))); 2931if (count > buffer.Length - offset) 2932throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - offset))); 2974if (storedBuffer == null || storedBuffer.Length < count) 2985else if (count <= storedBuffer.Length - storedLength + storedOffset) 3124else if (!(data[offset] < s_fqtext.Length && s_fqtext[data[offset]])) 3156if (data[offset] > s_ttext.Length) 3172for (; offset < data.Length && data[offset] < s_digits.Length && s_digits[data[offset]]; offset++) 3186if (!(data[i] < s_boundary.Length && s_boundary[data[i]]))
Internals\System\Xml\XmlMtomWriter.cs (18)
321if (count > buffer.Length - index) 322throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SRP.Format(SRP.SizeExceedsRemainingBufferSpace, buffer.Length - index))); 377Writer.WriteBase64(data.chunk, 0, data.chunk.Length); 396await Writer.WriteBase64Async(data.chunk, 0, data.chunk.Length); 526s.Write(data.chunk, 0, data.chunk.Length); 565await s.WriteAsync(data.chunk, 0, data.chunk.Length); 799while ((count = reader.ReadValueChunk(_chars, 0, _chars.Length)) > 0) 823while ((count = reader.ReadValueAsBase64(_bytes, 0, _bytes.Length)) > 0) 1079int size = XmlMtomWriter.ValidateSizeOfMessage(maxSizeInBytes, 0, MimeGlobals.CRLF.Length * 3); 1175int size = XmlMtomWriter.ValidateSizeOfMessage(maxSizeInBytes, 0, MimeGlobals.COLONSPACE.Length + MimeGlobals.CRLF.Length); 1183byte[] boundaryBytes = new byte[boundary.Length + MimeGlobals.BoundaryPrefix.Length]; 1184for (int i = 0; i < MimeGlobals.BoundaryPrefix.Length; i++) 1186Encoding.ASCII.GetBytes(boundary, 0, boundary.Length, boundaryBytes, MimeGlobals.BoundaryPrefix.Length); 1200return boundaryBytes.Length; 1407int currSize = buffer.Length; 1444Write(value, 0, value.Length); 1541return chunk.Length;
System\IdentityModel\CanonicalFormWriter.cs (5)
19if (s.Length > workBuffer.Length) 44EncodeAndWrite(stream, workBuffer, chars, chars.Length); 49if (count > workBuffer.Length) 75stream.Write(buffer, 0, buffer.Length); 81stream.Write(buffer, 0, buffer.Length);
System\IdentityModel\Claims\ClaimComparer.cs (5)
231if (bytes1.Length != bytes2.Length) 236for (int i = 0; i < bytes1.Length; ++i) 256for (int i = 0; i < bytes.Length && i < 4; ++i) 261return hashCode ^ bytes.Length;
System\IdentityModel\Claims\X509CertificateClaimSet.cs (5)
191if (dnsEntries.Length > 0) 193for (int i = 0; i < dnsEntries.Length; ++i) 281if (dnsEntries.Length > 0) 283for (int i = 0; i < dnsEntries.Length; ++i) 341for (int i = 0; i < rawDnsEntries.Length; i++)
System\IdentityModel\Psha1DerivedKeyGenerator.cs (6)
51_seed = Fx.AllocateByteArray(checked(label.Length + seed.Length)); 53seed.CopyTo(_seed, label.Length); 61_buffer = Fx.AllocateByteArray(checked(_hmac.HashSize / 8 + _seed.Length)); 91if (_index >= _chunk.Length) 98_seed.CopyTo(_buffer, _aValue.Length);
System\IdentityModel\Security\WSTrust.cs (1)
113writer.WriteBase64(secret, 0, secret.Length);
System\IdentityModel\SecurityUtils.cs (8)
72return CloneBuffer(buffer, 0, buffer.Length); 79DiagnosticUtility.DebugAssert(buffer.Length - offset >= len, "Invalid parameters to CloneBuffer."); 102if (src == null || srcOffset >= src.Length) 107if (dst == null || dstOffset >= dst.Length) 112if ((src.Length - srcOffset) != (dst.Length - dstOffset)) 117for (int i = srcOffset, j = dstOffset; i < src.Length; i++, j++) 245certificate = (rawData == null || rawData.Length == 0) ? null : new X509Certificate2(rawData);
System\IdentityModel\Selectors\SecurityTokenSerializer.cs (1)
224for (int i = 0; i < tokenTypes.Length; ++i)
System\IdentityModel\Selectors\X509CertificateValidator.cs (1)
228for (int i = 0; i < chainStatus.Length; ++i)
System\IdentityModel\Tokens\BinaryKeyIdentifierClause.cs (1)
26if (identificationData.Length == 0)
System\IdentityModel\Tokens\LocalIdKeyIdentifierClause.cs (2)
54get { return (_ownerTypes == null || _ownerTypes.Length == 0) ? null : _ownerTypes[0]; } 80for (int i = 0; i < _ownerTypes.Length; ++i)
System\IdentityModel\Tokens\SecurityKeyIdentifier.cs (2)
30_clauses = new List<SecurityKeyIdentifierClause>(clauses.Length); 31for (int i = 0; i < clauses.Length; i++)
System\IdentityModel\Tokens\SymmetricKey.cs (7)
27if (symmetricKey.Length == 0) 29throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SRP.Format(SRP.SymmetricKeyLengthTooShort, symmetricKey.Length))); 31_keySize = symmetricKey.Length * 8; 35_symmetricKey = new byte[symmetricKey.Length]; 36Buffer.BlockCopy(symmetricKey, 0, _symmetricKey, 0, symmetricKey.Length); 91byte[] local = new byte[_symmetricKey.Length]; 92Buffer.BlockCopy(_symmetricKey, 0, local, 0, _symmetricKey.Length);
System\IdentityModel\Tokens\WSSecurityJan2004.cs (3)
338writer.WriteBase64(keyIdentifier, 0, keyIdentifier.Length); 342writer.WriteBinHex(keyIdentifier, 0, keyIdentifier.Length); 346writer.WriteString(new UTF8Encoding().GetString(keyIdentifier, 0, keyIdentifier.Length));
System\IdentityModel\Tokens\X509SubjectKeyIdentifierClause.cs (1)
69byte[] ski = SecurityUtils.CloneBuffer(data, SkiDataOffset, data.Length - SkiDataOffset);
System\IdentityModel\Tokens\XmlDsigSep2000.cs (2)
187writer.WriteBase64(certBytes, 0, certBytes.Length); 211writer.WriteBase64(ski, 0, ski.Length);
System\ServiceModel\Channels\BinaryMessageEncoder.cs (11)
398if (buffer.Length < requiredBufferSize) 1127if (size < buffer2.Length) 1132for (int i = 0; i < buffer2.Length; i++, j++) 1139return buffer2.Length; 1369totalBytesMatched = s_requestFragment1.Length + messageIDSize + s_requestFragment2.Length; 1411totalBytesMatched = s_responseFragment1.Length + messageIDSize + s_responseFragment2.Length; 1414totalBytesMatched += s_commonFragment.Length + actionSize; 1431int abandonedSize = totalBytesMatched - s_bodyFragment.Length; 1436Buffer.BlockCopy(s_bodyFragment, 0, buffer, offset, s_bodyFragment.Length);
System\ServiceModel\Channels\BindingElementCollection.cs (2)
38for (int i = 0; i < elements.Length; i++) 62for (int i = 0; i < elements.Length; i++)
System\ServiceModel\Channels\BindingParameterCollection.cs (1)
25for (int i = 0; i < parameters.Length; i++)
System\ServiceModel\Channels\BufferedReadStream.cs (2)
199Contract.Assert(count <= array.Length - offset); 308Contract.Assert(count <= buffer.Length - offset);
System\ServiceModel\Channels\BufferedWriteStream.cs (3)
85if (_buffer.Length != _bufferSize || _bufferSize >= MaxShadowBufferSize) 279Contract.Assert(count <= array.Length - offset); 410Contract.Assert(count <= buffer.Length - offset);
System\ServiceModel\Channels\Message.cs (5)
1950for (int i = 0; i < attributes.Length; i++) 1971for (int i = 0; i < attributes.Length; i++) 2013for (int i = 0; i < attributes.Length; i++) 2256if (_count < _entries.Length) 2262Array.Copy(_entries, 1, _entries, 0, _entries.Length - 1);
System\ServiceModel\Channels\MessageBuffer.cs (3)
74for (int i = 0; i < _understoodHeaders.Length; ++i) 106for (int i = 0; i < _properties.Length; i++) 139for (int i = 0; i < _understoodHeaders.Length; ++i)
System\ServiceModel\Channels\MessageEncoder.cs (1)
65int currentBufferSize = Math.Min(buffer.Length, maxBufferSize);
System\ServiceModel\Channels\MessageHeaders.cs (12)
124Init(collection.MessageVersion, collection._headers.Length); 165get { return _headers.Length <= MaxRecycledArrayLength; } 633if (index < 0 || (index + _headerCount) > array.Length) 637SRP.Format(SRP.ValueMustBeInRange, 0, array.Length - _headerCount))); 733for (int j = 0; j < actors.Length; j++) 739if (actors.Length == 1) 778for (int j = 0; j < actors.Length; j++) 784if (actors.Length == 1) 1274for (int actorIndex = 0; actorIndex < actors.Length; ++actorIndex) 1403if (_headerCount == _headers.Length) 1405if (_headers.Length == 0) 1411Header[] newHeaders = new Header[_headers.Length * 2];
System\ServiceModel\Channels\MessageProperties.cs (19)
93return _properties == null || _properties.Length <= MaxRecycledArrayLength; 219for (int i = 0; i < _properties.Length; i++) 291for (int i = 0; i < _properties.Length; i++) 371for (int i = 0; i < _properties.Length; i++) 407for (int i = 0; i < properties._properties.Length; i++) 445for (int i = 0; i < properties._properties.Length; i++) 478for (int i = 0; i < array.Length; i++) 545for (int i = 0; i < _properties.Length; i++) 582for (int i = 0; i < _properties.Length; i++) 731for (shiftIndex = index + 1; shiftIndex < _properties.Length; shiftIndex++) 786for (newIndex = 0; newIndex < _properties.Length; newIndex++) 794if (newIndex == _properties.Length) 796Property[] newProperties = new Property[_properties.Length * 2]; 797Array.Copy(_properties, newProperties, _properties.Length); 820if (array.Length < _propertyCount) 825if (index < 0 || index > array.Length - _propertyCount) 828SRP.Format(SRP.ValueMustBeInRange, 0, array.Length - _propertyCount))); 853for (int i = 0; i < _properties.Length; i++) 948for (int i = 0; i < _properties.Length; i++)
System\ServiceModel\Channels\MethodCall.cs (2)
49if (inCount == Args.Length) // All parameters are InArgs so do nothing and fallback to returning Args 56for(int argPos = 0; argPos < parameters.Length; argPos++)
System\ServiceModel\Channels\MtomMessageEncoder.cs (2)
257Encoding[] enc = new Encoding[supported.Length]; 258Array.Copy(supported, enc, supported.Length);
System\ServiceModel\Channels\ProducerConsumerStream.cs (4)
62if (offset < 0 || offset > buffer.Length) 66if (count < 0 || count > buffer.Length - offset) 113if (offset < 0 || offset > buffer.Length) 117if (count < 0 || count > buffer.Length - offset)
System\ServiceModel\Channels\SequenceRangeCollection.cs (19)
25if (sortedRanges.Length == 0) 29else if (sortedRanges.Length == 1) 41if (sortedRanges.Length == 0) 48if (sortedRanges.Length == 1) 78if (lowerBound == sortedRanges.Length) 80SequenceRange[] returnedRanges = new SequenceRange[sortedRanges.Length + 1]; 81Array.Copy(sortedRanges, returnedRanges, sortedRanges.Length); 82returnedRanges[sortedRanges.Length] = range; 89if (sortedRanges.Length == 1) 116if ((upperBound == sortedRanges.Length) || (sortedRanges[upperBound].Lower != range.Upper + 1)) 123SequenceRange[] returnedRanges = new SequenceRange[sortedRanges.Length + 1]; 124Array.Copy(sortedRanges, 0, returnedRanges, 1, sortedRanges.Length); 134int rangesRemaining = sortedRanges.Length - rangesRemoved + 1; 144Array.Copy(sortedRanges, upperBound + 1, returnedRanges, lowerBound + 1, sortedRanges.Length - upperBound - 1); 193if (index < 0 || index >= _ranges.Length) 195SRP.Format(SRP.ValueMustBeInRange, 0, _ranges.Length - 1))); 200public override int Count => _ranges.Length; 204if (_ranges.Length == 0) 208else if (_ranges.Length == 1)
System\ServiceModel\Channels\ServiceChannelProxy.cs (5)
448for (int i = 0; i < methodDatas.Length; i++) 470for (int i = 0; i < _methodDatas.Length; i++) 478MethodData[] newMethodDatas = new MethodData[_methodDatas.Length * 2]; 479Array.Copy(_methodDatas, newMethodDatas, _methodDatas.Length); 480newMethodDatas[_methodDatas.Length] = methodData;
System\ServiceModel\Channels\TextMessageEncoder.cs (5)
57Encoding[] enc = new Encoding[supported.Length]; 58Array.Copy(supported, enc, supported.Length); 102ContentEncoding[] map = new ContentEncoding[readEncodings.Length]; 103for (int i = 0; i < readEncodings.Length; i++) 121for (int i = 0; i < contentMap.Length; i++)
System\ServiceModel\Channels\TransportDefaults.cs (4)
66for (int i = 0; i < supportedEncodings.Length; i++) 80for (int i = 0; i < charSetEncodings.Length; i++) 101for (int i = 0; i < charSetEncodings.Length; i++) 111for (int i = 0; i < charSetEncodings.Length; i++)
System\ServiceModel\ClientBase.cs (10)
918object[] inArgs = new object[args.Length + 2]; 919Array.Copy(args, inArgs, args.Length); 920inArgs[inArgs.Length - 2] = callback; 921inArgs[inArgs.Length - 1] = state; 931object[] inArgs = new object[args.Length + 1]; 932Array.Copy(args, inArgs, args.Length); 933inArgs[inArgs.Length - 1] = result; 943Fx.Assert(retArgs.Length == inArgs.Length, "retArgs.Length should be equal to inArgs.Length"); 944Array.Copy(retArgs, args, args.Length);
System\ServiceModel\Description\ServiceReflector.cs (15)
67for (int i = 0; i < args.Length; ++i) 553if (attrs.Length == 0) 568if (attrs == null || attrs.Length == 0) 572else if (attrs.Length > 1) 605if (attrs != null && attrs.Length > 0) 735int len = parameters.Length; 771int len = parameters.Length; 805int len = parameters.Length; 828if (endMethods.Length == 0) 832if (endMethods.Length > 1) 862parameters.Length < 2 || 863parameters[parameters.Length - 2].ParameterType != s_asyncCallbackType || 864parameters[parameters.Length - 1].ParameterType != s_objectType || 922parameters.Length < 1 || 923parameters[parameters.Length - 1].ParameterType != s_asyncResultType)
System\ServiceModel\Description\TypeLoader.cs (25)
308for (int i = 0; i < ifaceAttributes.Length; i++) 362if (knownTypeAttributes.Length == 1) 392for (int i = 0; i < knownTypeAttributes.Length; ++i) 467for (int k = 0; k < methodAttributes.Length; k++) 549if (parameters1.Length != parameters2.Length) 554for (int i = 0; i < parameters1.Length; ++i) 989if (opAttr.IsOneWay && methodAttributes.Length > 0) 994for (int i = 0; i < methodAttributes.Length; i++) 1158if (parameters.Length == 1 && parameters[0].ParameterType.IsDefined(typeof(MessageContractAttribute), false)) 1185if (responseType.IsDefined(typeof(MessageContractAttribute), false) && parameters.Length == 0) 1253for (int index = 0; index < parameters.Length; index++) 1601if (partDescriptions.Length > 1) 1648if (_syncInputs.Length != _asyncInputs.Length || _syncOutputs.Length != _asyncOutputs.Length) 1662for (int i = 0; i < _syncInputs.Length; i++) 1679for (int i = 0; i < _syncOutputs.Length; i++) 1789if (_syncInputs.Length != _taskInputs.Length) 1802for (int i = 0; i < _syncInputs.Length; i++) 1906if (_taskInputs.Length != _asyncInputs.Length) 1920for (int i = 0; i < _taskInputs.Length; i++)
System\ServiceModel\Description\XmlSerializerOperationBehavior.cs (4)
665Array.Copy(members, newMembers, newMembers.Length); 1254if (mappings == null || mappings.Length == 0) 1264XmlSerializer[] serializers = new XmlSerializer[mappings.Length]; 1267for (int i = 0; i < serializers.Length; i++)
System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (6)
169if (headerParts == null || headerParts.Length == 0) 175for (int i = 0; i < headerParts.Length; i++) 261for (int i = 0; i < parts.Length; i++) 350multipleHeaderValues = new KeyValuePair<Type, ArrayList>[parameters.Length]; 387for (int i = 0; i < parameters.Length; i++) 479for (int i = nextPartIndex; i < parts.Length; i++)
System\ServiceModel\Dispatcher\DispatchOperationRuntime.cs (4)
124if (ParameterInspectors.Length > 0) 132for (int i = 0; i < ParameterInspectors.Length; i++) 145if (ParameterInspectors.Length > 0) 153for (int i = ParameterInspectors.Length - 1; i >= 0; i--)
System\ServiceModel\Dispatcher\DuplexChannelBinder.cs (2)
215if (array != null && array.Length > 0) 588if (array != null && array.Length > 0)
System\ServiceModel\Dispatcher\ErrorBehavior.cs (2)
122for (int i = 0; i < _handlers.Length; i++) 194for (int i = 0; i < _handlers.Length; i++)
System\ServiceModel\Dispatcher\FaultFormatter.cs (3)
24for (int i = 0; i < detailTypes.Length; i++) 81for (int i = 0; i < _faultContractInfos.Length; i++) 110for (int i = 0; i < _faultContractInfos.Length; i++)
System\ServiceModel\Dispatcher\ImmutableClientRuntime.cs (6)
45CorrelationCount = _messageInspectors.Length + behavior.MaxParameterInspectors; 55get { return _messageInspectors.Length; } 77for (int i = 0; i < _messageInspectors.Length; i++) 105for (int i = 0; i < _messageInspectors.Length; i++) 148for (int i = 0; i < _channelInitializers.Length; ++i) 250while (++_index < _initializers.Length)
System\ServiceModel\Dispatcher\ImmutableDispatchRuntime.cs (4)
95if (_messageInspectors.Length > 0) 106for (int i = 0; i < _messageInspectors.Length; i++) 131if (_messageInspectors.Length > 0) 140for (int i = 0; i < _messageInspectors.Length; i++)
System\ServiceModel\Dispatcher\InvokerUtil.cs (4)
52var inputCount = parameters.Length; 65outputParameterCount = outputPos.Length; 95for (var i = 0; i < outputPos.Length; i++) 126for (int i = 0; i < parameters.Length; i++)
System\ServiceModel\Dispatcher\ListenerHandler.cs (4)
134for (int index = 0; index < channels.Length; index++) 178for (int index = 0; index < channels.Length; index++) 209Task[] closeTasks = new Task[channels.Length]; 210for (int index = 0; index < channels.Length; index++)
System\ServiceModel\Dispatcher\MessageOperationFormatter.cs (4)
35if (parameters != null && parameters.Length > 0) 55if (parameters.Length != 1) 70if (parameters != null && parameters.Length > 0) 85if (parameters.Length != 1 || !(parameters[0] is Message))
System\ServiceModel\Dispatcher\OperationFormatter.cs (3)
678for (int i = 0; i < _members.Length; i++) 686for (int i = 0; i < _members.Length; i++) 694get { return _members.Length; }
System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (18)
651if (parts.Length != parameters.Length) 654new ArgumentException(SRP.Format(SRP.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters")); 660for (int i = nextPartIndex; i < parts.Length; i++) 730if (parts.Length != parameters.Length) 733new ArgumentException(SRP.Format(SRP.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters")); 736for (int i = 0; i < parts.Length; i++) 958writer.WriteBase64(arrayValue, 0, arrayValue.Length); 964writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 970writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 976writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 982writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 988writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 994writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length); 1000writer.WriteArray(null, _itemName, _itemNamespace, arrayValue, 0, arrayValue.Length);
System\ServiceModel\Dispatcher\ProxyOperationRuntime.cs (14)
152for (int i = _parameterInspectors.Length - 1; i >= 0; i--) 193for (int i = 0; i < _parameterInspectors.Length; i++) 289if (_outParams.Length == 0) 295outs = new object[_outParams.Length]; 297if (_inParams.Length == 0) 308if (_inParams.Length == 0) 314ins = new object[_inParams.Length]; 318for (int i = 0; i < ins.Length; i++) 323callback = args[methodCall.Args.Length - 2] as AsyncCallback; 324asyncState = args[methodCall.Args.Length - 1]; 330outs = new object[_endOutParams.Length]; 331result = methodCall.Args[methodCall.Args.Length - 1] as IAsyncResult; 351if (parameters.Length == 0) 357for (int i = 0; i < parameters.Length; i++)
System\ServiceModel\Dispatcher\StreamFormatter.cs (1)
346if (buffer.Length - offset < count)
System\ServiceModel\Dispatcher\SyncMethodInvoker.cs (2)
82else if (inputs.Length != _inputParameterCount) 84throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SRP.Format(SRP.SFxInputParametersToServiceInvalid, _inputParameterCount, inputs.Length)));
System\ServiceModel\Dispatcher\TaskMethodInvoker.cs (2)
142else if (inputs.Length != _inputParameterCount) 146inputs.Length)));
System\ServiceModel\Dispatcher\XmlSerializerObjectSerializer.cs (1)
103if (deserializedObjects != null && deserializedObjects.Length > 0)
System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (7)
78messageHeaderOfTHelper = new MessageHeaderOfTHelper(parameters.Length); 207messageHeaderOfTHelper = new MessageHeaderOfTHelper(parameters.Length); 531MessageHeader<object>[] messageHeaderOfTAttributes = new MessageHeader<object>[messageHeaderOfTArray.Length]; 532Array tArray = Array.CreateInstance(headerDescription.Type, messageHeaderOfTArray.Length); 533for (int i = 0; i < tArray.Length; i++) 555for (int i = 0; i < messageHeaderOfTAttributes.Length; i++) 600for (int i = 0; i < messageHeaderOfTArray.Length; i++)
System\ServiceModel\EndpointAddress.cs (1)
149if (headers == null || headers.Length == 0)
System\ServiceModel\FaultException.cs (4)
282for (int i = nodes.Length - 1; i >= 0; i--) 294for (int i = 0; i < array.Length; i++) 328FaultReasonText[] reasons = new FaultReasonText[nodes.Length]; 330for (int i = 0; i < nodes.Length; i++)
System\ServiceModel\OperationContractAttribute.cs (1)
108|| methodInfo.GetParameters().Length > 0)
System\ServiceModel\Security\BinaryNegotiation.cs (1)
59writer.WriteBase64(_negotiationData, 0, _negotiationData.Length);
System\ServiceModel\Security\InMemoryNonceCache.cs (4)
73if (nonce.Length < s_minimumNonceLength) 89if (nonce.Length < s_minimumNonceLength) 144int length1 = nonce1.Length; 146int length2 = nonce2.Length;
System\ServiceModel\Security\MessagePartSpecification.cs (3)
181if (headerTypes != null && headerTypes.Length > 0) 183_headerTypes = new List<XmlQualifiedName>(headerTypes.Length); 184for (int i = 0; i < headerTypes.Length; i++)
System\ServiceModel\Security\ReceiveSecurityHeaderElementManager.cs (2)
59if (Count == _elements.Length) 61ReceiveSecurityHeaderEntry[] newElements = new ReceiveSecurityHeaderEntry[_elements.Length * 2];
System\ServiceModel\Security\RequestSecurityTokenResponse.cs (2)
546byte[] result = Fx.AllocateByteArray(_authenticator.Length); 547Buffer.BlockCopy(_authenticator, 0, result, 0, _authenticator.Length);
System\ServiceModel\Security\SecurityHeaderTokenResolver.cs (2)
60if (_tokenCount == _tokens.Length) 62SecurityTokenEntry[] newTokens = new SecurityTokenEntry[_tokens.Length * 2];
System\ServiceModel\Security\SecuritySessionSecurityTokenAuthenticator.cs (1)
27for (int i = 0; i < _actions.Length; ++i)
System\ServiceModel\Security\SecurityUtils.cs (11)
126for (int i = 0; i < s_tokenImpersonationLevelOrder.Length; i++) 354if (a == null || b == null || a.Length != b.Length) 359for (int i = 0; i < a.Length; i++) 812byte[] copy = Fx.AllocateByteArray(buffer.Length); 813Buffer.BlockCopy(buffer, 0, copy, 0, buffer.Length); 948if (partsWithSlashDelimiter.Length == 2 && partsWithAtDelimiter.Length == 1) 955else if (partsWithSlashDelimiter.Length == 1 && partsWithAtDelimiter.Length == 2) 1013certificate = (rawData == null || rawData.Length == 0) ? null : new X509Certificate2(rawData);
System\ServiceModel\Security\SecurityVerifiedMessage.cs (4)
145XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(_decryptedBuffer, 0, _decryptedBuffer.Length, ReceivedSecurityHeader.ReaderQuotas); 509byte[] splicedBuffer = Fx.AllocateByteArray(checked(middle.Length + wrapperLength - 1)); 514count = middle.Length; 527for (int i = 0; i < attributes.Length; i++)
System\ServiceModel\Security\SecurityVersion.cs (1)
259writer.WriteBase64(signature, 0, signature.Length);
System\ServiceModel\Security\SendSecurityHeader.cs (12)
298for (int i = 0; i < signedTokens.Length; ++i) 307for (int i = 0; i < basicTokensXml.Length; ++i) 319for (int i = 0; i < endorsingTokens.Length; ++i) 330for (int i = 0; i < endorsingDerivedTokens.Length; ++i) 338for (int i = 0; i < signedEndorsingTokens.Length; ++i) 347for (int i = 0; i < signedEndorsingDerivedTokens.Length; ++i) 355for (int i = 0; i < signatureConfirmations.Length; ++i) 367for (int i = 0; i < endorsingSignatures.Length; ++i) 494if (id < s_ids.Length) 566for (int i = 0; i < signatureConfirmationElements.Length; ++i) 656for (int i = 0; i < endorsingTokens.Length; ++i) 684for (int i = 0; i < signedEndorsingSupportingTokens.Length; ++i)
System\ServiceModel\Security\SignatureConfirmations.cs (1)
31if (_confirmations.Length == Count)
System\ServiceModel\Security\Tokens\BinarySecretSecurityToken.cs (3)
64_key = new byte[key.Length]; 65Buffer.BlockCopy(key, 0, _key, 0, key.Length); 94get { return (_key.Length * 8); }
System\ServiceModel\Security\Tokens\DerivedKeySecurityToken.cs (2)
45Fx.Assert(nonce.Length == minNonceLength, "Returned random bytes for nonce is not the expected length"); 203if ((_key == null) || (_key.Length == 0))
System\ServiceModel\Security\Tokens\SecurityContextSecurityToken.cs (3)
132if (key == null || key.Length == 0) 157_key = new byte[key.Length]; 158Buffer.BlockCopy(key, 0, _key, 0, key.Length);
System\ServiceModel\Security\WSSecureConversation.cs (4)
204if (nonce != null && nonce.Length > _maxKeyDerivationNonceLength) 206throw DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(new MessageSecurityException(SRP.Format(SRP.DerivedKeyTokenNonceTooLong, nonce.Length, _maxKeyDerivationNonceLength))); 298writer.WriteBase64(derivedKeyToken.Nonce, 0, derivedKeyToken.Nonce.Length); 499writer.WriteBase64(sct.CookieBlob, 0, sct.CookieBlob.Length);
System\ServiceModel\Security\WSSecurityJan2004.cs (1)
183writer.WriteBase64(rawData, 0, rawData.Length);
System\ServiceModel\Security\WSSecurityOneDotZeroSendSecurityHeader.cs (2)
84for (int i = 0; i < elements.Length; ++i) 126for (int i = 0; i < tokens.Length; ++i)
System\ServiceModel\Security\WSSecurityTokenSerializer.cs (1)
450for (int i = 0; i < tokenTypes.Length; ++i)
System\ServiceModel\Security\WSTrust.cs (2)
153writer.WriteBase64(secret, 0, secret.Length); 1140writer.WriteBase64(authenticator, 0, authenticator.Length);
System\ServiceModel\Security\WSUtilitySpecificationVersion.cs (6)
122writer.WriteChars(creationTime, 0, creationTime.Length); 127writer.WriteChars(expiryTime, 0, expiryTime.Length); 173stream.Write(_fragment1, 0, _fragment1.Length); 175stream.Write(_fragment2, 0, _fragment2.Length); 177stream.Write(_fragment3, 0, _fragment3.Length); 179stream.Write(_fragment4, 0, _fragment4.Length);
System\ServiceModel\Security\XmlHelper.cs (3)
257if (value == null || value.Length == 0) 283if (parts.Length > 2) 288if (parts.Length == 2)
System\ServiceModel\ServiceChannelManager.cs (1)
212for (int index = 0; index < channels.Length; index++)
System\ServiceModel\SynchronizedCollection.cs (2)
46Items = new List<T>(list.Length); 47for (int i = 0; i < list.Length; i++)
System\ServiceModel\SynchronizedReadOnlyCollection.cs (2)
45Items = new List<T>(list.Length); 46for (int i = 0; i < list.Length; i++)
System\ServiceModel\UriSchemeKeyedCollection.cs (1)
24for (int i = 0; i < addresses.Length; i++)
System\ServiceModel\XmlBuffer.cs (1)
69return _buffer.Length;
System.ServiceModel.Primitives.Tests (7)
ServiceModel\MessageContractTest.4.4.0.cs (7)
314Assert.True(values.Length == headerValues.Count, 315String.Format("Expected header '{0}' to have {1} values, actual = {2}", name, values.Length, headerValues.Count)); 330Assert.True(array1.Length == array2.Length, 332elementName, array1.Length, array2.Length)); 334for (int i = 0; i < array1.Length; ++i)
System.ServiceModel.Syndication (3)
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (2)
433uri = (Uri)args[args.Length - 1]; 459dateTimeOffset = (DateTimeOffset)args[args.Length - 1];
System\ServiceModel\XmlBuffer.cs (1)
53public int BufferSize => _buffer.Length;
System.Text.Encoding.CodePages (62)
System\Text\BaseCodePageEncoding.cs (9)
106int bytesRead = stream.Read(codePageDataFileHeader, 0, codePageDataFileHeader.Length); 107Debug.Assert(bytesRead == codePageDataFileHeader.Length); 144int bytesRead = stream.Read(codePageIndex, 0, codePageIndex.Length); 145Debug.Assert(bytesRead == codePageIndex.Length); 190int bytesRead = stream.Read(codePageHeader, 0, codePageHeader!.Length); 191Debug.Assert(bytesRead == codePageHeader.Length); 266Debug.Assert(m_codePageHeader != null && m_codePageHeader.Length == CODEPAGE_HEADER_SIZE, "m_codePageHeader expected to match in size the struct CodePageHeader"); 300m_dataSize = (int)(s_codePagesEncodingDataStream.Length - pCodePageIndex->Offset - m_codePageHeader.Length); 308m_dataSize = pCodePageIndex->Offset - currentOffset - m_codePageHeader.Length;
System\Text\DBCSCodePageEncoding.cs (7)
87Debug.Assert(m_codePageHeader?.Length > 0); 403Debug.Assert((arrayTemp.Length / 2) < 20, 404$"[DBCSCodePageEncoding.ReadBestFitTable]Expected small best fit table < 20 for code page {CodePage}, not {arrayTemp.Length / 2}"); 406for (int i = 0; i < arrayTemp.Length - 2; i += 2) 411for (int j = i + 2; j < arrayTemp.Length; j += 2) 1065Debug.Assert(bytes >= byteStart + byteBuffer.Length, 1067bytes -= byteBuffer.Length; // didn't use these byte(s)
System\Text\DecoderBestFitFallback.cs (6)
148int highBound = _oFallback.arrayBestFit!.Length; 157if (bytesCheck.Length == 0 || bytesCheck.Length > 2) 160if (bytesCheck.Length == 1) 182Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 203Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\DecoderFallbackBufferHelper.cs (2)
50if (_fallbackBuffer!.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length))) 106if (_fallbackBuffer!.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length)))
System\Text\DecoderNLS.cs (6)
88if (bytes.Length - index < count) 132if (bytes.Length - byteIndex < byteCount) 135if (charIndex < 0 || charIndex > chars.Length) 138int charCount = chars.Length - charIndex; 187if (bytes.Length - byteIndex < byteCount) 190if (chars.Length - charIndex < charCount)
System\Text\EncoderBestFitFallback.cs (3)
171int highBound = _oFallback.arrayBestFit!.Length; 187Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 208Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderNLS.cs (6)
86if (chars.Length - index < count) 121if (chars.Length - charIndex < charCount) 124if (byteIndex < 0 || byteIndex > bytes.Length) 127int byteCount = bytes.Length - byteIndex; 172if (chars.Length - charIndex < charCount) 175if (bytes.Length - byteIndex < byteCount)
System\Text\EncodingCharBuffer.cs (1)
158_bytes -= byteBuffer.Length; // Didn't use how many ever bytes we're falling back
System\Text\EncodingNLS.cs (16)
57if (chars.Length - index < count) 61if (chars.Length == 0) 114if (byteIndex < 0 || byteIndex > bytes.Length) 117int byteCount = bytes.Length - byteIndex; 151if (chars.Length - charIndex < charCount) 154if (byteIndex < 0 || byteIndex > bytes.Length) 158if (chars.Length == 0) 162int byteCount = bytes.Length - byteIndex; 203if (bytes.Length - index < count) 207if (bytes.Length == 0) 243if (bytes.Length - byteIndex < byteCount) 246if (charIndex < 0 || charIndex > chars.Length) 250if (bytes.Length == 0) 254int charCount = chars.Length - charIndex; 295if (bytes.Length - index < count) 299if (bytes.Length == 0) return string.Empty;
System\Text\GB18030Encoding.cs (1)
140for (int index = 0; index < _tableUnicodeToGBDiffs.Length; index++)
System\Text\SBCSCodePageEncoding.cs (5)
62Debug.Assert(m_codePageHeader?.Length > 0); 102int bytesRead = s_codePagesEncodingDataStream.Read(buffer, 0, buffer.Length); 103Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 166int bytesRead = s_codePagesEncodingDataStream.Read(buffer, 0, buffer.Length); 167Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer.");
System.Text.Encodings.Web (5)
System\Text\Encodings\Web\TextEncoder.cs (1)
250ValidateRanges(startIndex, characterCount, actualInputLength: value.Length);
System\Text\Encodings\Web\TextEncoderSettings.cs (4)
69for (int i = 0; i < characters.Length; i++) 125for (int i = 0; i < ranges.Length; i++) 157for (int i = 0; i < characters.Length; i++) 193for (int i = 0; i < ranges.Length; i++)
System.Text.Json (105)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (10)
56Debug.Assert(_index <= _rentedBuffer.Length); 75return _rentedBuffer.Length; 84return _rentedBuffer.Length - _index; 106Debug.Assert(_index <= _rentedBuffer.Length); 141Debug.Assert(_index <= _rentedBuffer.Length - count); 175int currentLength = _rentedBuffer.Length; 204Debug.Assert(oldBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length >= _index); 213Debug.Assert(_rentedBuffer.Length - _index > 0); 214Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\libraries\System.Text.Json\Common\JsonHelpers.cs (3)
131if (index >= adjacencyRow.Length) 148int idx = sortedNodes.Length; 158if (adjacency[i] is { } childMap && nextIndex < childMap.Length && childMap[nextIndex])
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (2)
239if (constructors.Length == 1) 256else if (constructor.GetParameters().Length == 0)
System\ReflectionExtensions.cs (2)
80if (attributes.Length == 0) 85if (attributes.Length == 1)
System\Text\Json\BitStack.cs (15)
67Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}"); 70Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}"); 76if (elementIndex >= _array.Length) 79Debug.Assert(index >= 0 && index > (int)((uint)_array.Length * 32 - 1), $"Only grow when necessary - index: {index}, arrayLength: {_array.Length}"); 83Debug.Assert(elementIndex < _array.Length, $"Set - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 123Debug.Assert(index >= 0, $"Get - Negative - index: {index}, arrayLength: {_array.Length}"); 127Debug.Assert(elementIndex < _array.Length, $"Get - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 135Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}"); 136Debug.Assert(minSize >= 0 && minSize >= _array.Length); 138int nextDouble = Math.Max(minSize + 1, _array.Length * 2);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (8)
115Length = completeDb.Length; 195if (Length <= _data.Length / 2) 200if (newRent.Length < _data.Length) 223if (Length >= _data.Length - DbRow.Size) 247int newCapacity = toReturn.Length * 2; 255if (newCapacity == toReturn.Length) newCapacity = int.MaxValue; 258Buffer.BlockCopy(toReturn, 0, _data, 0, toReturn.Length);
System\Text\Json\Document\JsonDocument.Parse.cs (11)
690MetadataDb database = MetadataDb.CreateLocked(utf8Json.Length); 691database.Append(tokenType, startLocation: 0, utf8Json.Length); 788Debug.Assert(rented.Length >= utf8Bom.Length); 807if (rented.Length == written) 810rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2)); 811Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length); 816lastRead = stream.Read(rented, written, rented.Length - written); 871Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length); 895if (rented.Length == written) 898rented = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2); 899Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length);
System\Text\Json\Document\JsonDocument.StackRowStack.cs (8)
24_topOfStack = _rentedBuffer.Length; 56Debug.Assert(_topOfStack <= _rentedBuffer!.Length - StackRow.Size); 66_rentedBuffer = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2); 72_rentedBuffer.Length - toReturn.Length + _topOfStack, 73toReturn.Length - _topOfStack); 75_topOfStack += _rentedBuffer.Length - toReturn.Length;
System\Text\Json\Serialization\Converters\Collection\ArrayConverter.cs (2)
42for (; index < array.Length; index++) 49for (; index < array.Length; index++)
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (1)
182int numberOfGenericArgs = converterType.GetGenericArguments().Length;
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactoryHelpers.cs (4)
31method.GetParameters().Length == 1 && 33method.GetGenericArguments().Length == 1) 55method.GetParameters().Length == 1 && 57method.GetGenericArguments().Length == 2)
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (2)
54if (constructor == null || typeToConvert.IsAbstract || parameters!.Length == 0) 60int parameterCount = parameters.Length;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (4)
352else if (argumentState.FoundPropertyCount == argumentState.FoundProperties.Length) 357var newCache = ArrayPool<FoundProperty>.Shared.Rent(argumentState.FoundProperties.Length * 2); 548else if (argumentState.FoundPropertyCount == argumentState.FoundPropertiesAsync!.Length) 552var newCache = ArrayPool<FoundPropertyAsync>.Shared.Rent(argumentState.FoundPropertiesAsync!.Length * 2);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (4)
531Debug.Assert(names.Length == values.Length); 542var enumFields = new EnumFieldInfo[names.Length]; 543for (int i = 0; i < names.Length; i++)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
121Debug.Assert(genericArgs.Length == 2);
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
460for (int i = 0; i < trackedContexts.Length; i++)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (2)
157if (propertyInfo.GetIndexParameters().Length > 0 || 290int parameterCount = parameters.Length;
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (1)
103if (Position < parameters.Length)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (2)
162if ((cacheBuilder?.TotalCount ?? utf8PropertyCache.Length) < PropertyRefCacheBuilder.MaxCapacity) 184Debug.Assert(newCache.Length <= PropertyRefCacheBuilder.MaxCapacity);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (3)
1159if (parameterInfoValues.Length == 0) 1164Dictionary<ParameterLookupKey, JsonParameterInfoValues> parameterIndex = new(parameterInfoValues.Length); 1171ParameterCount = parameterInfoValues.Length;
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (3)
15Debug.Assert(modifiers.Length > 0); 22var newModifiers = new Action<JsonTypeInfo>[_modifiers.Length + 1]; 24newModifiers[_modifiers.Length] = modifier;
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (3)
26Debug.Assert(constructorInfo is null || constructorInfo.GetParameters().Length == 0); 87int parameterCount = parameters.Length; 130int parameterCount = parameters.Length;
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (3)
24Debug.Assert(ctorInfo is null || ctorInfo.GetParameters().Length == 0); 48int parameterCount = constructor.GetParameters().Length; 83int parameterCount = constructor.GetParameters().Length;
System\Text\Json\Serialization\ReadBufferState.cs (6)
70int minBufferCount = fillBuffer || _unsuccessfulReadCount > UnsuccessfulReadCountThreshold ? bufferState._buffer.Length : 0; 119while (_count < _buffer.Length); 137if ((uint)_count > ((uint)_buffer.Length / 2)) 142byte[] newBuffer = ArrayPool<byte>.Shared.Rent((_buffer.Length < (int.MaxValue / 2)) ? _buffer.Length * 2 : int.MaxValue); 175Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Serialization\ReadStack.cs (2)
90else if (_count - 1 == _stack.Length) 92Array.Resize(ref _stack, 2 * _stack.Length);
System\Text\Json\Serialization\WriteStack.cs (2)
138else if (_count - _indexOffset == _stack.Length) 140Array.Resize(ref _stack, 2 * _stack.Length);
System.Text.Json.SourceGeneration (11)
JsonSourceGenerator.Parser.cs (4)
1507int paramCount = constructorParameters?.Length ?? 0; 1641capacity: EncodedPropName.Length + utf8Json.Length * 2); 1643for (int i = 0; i < utf8Json.Length; i++) 1732if (publicCtors.Length == 1)
src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (2)
22public int Count => _values.Length; 63if ((uint)newIndex < (uint)_values.Length)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
76(TKey, int)[] keys = new (TKey, int)[arrayCopy.Length]; 77for (int i = 0; i < keys.Length; i++) 131if (index >= adjacencyRow.Length) 148int idx = sortedNodes.Length; 158if (adjacency[i] is { } childMap && nextIndex < childMap.Length && childMap[nextIndex])
System.Text.RegularExpressions (192)
System\Text\RegularExpressions\CaptureCollection.cs (2)
99if ((uint)arrayIndex > (uint)array.Length) 103if (array.Length - arrayIndex < Count)
System\Text\RegularExpressions\GroupCollection.cs (6)
36public int Count => _match._matchcount.Length; 58else if ((uint)groupnum < _match._matchcount.Length) 79_groups = new Group[_match._matchcount.Length - 1]; 80for (int i = 0; i < _groups.Length; i++) 115ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length); 117if (array.Length - arrayIndex < Count)
System\Text\RegularExpressions\Match.cs (7)
72for (int i = 0; i < matchcount.Length; i++) 141GroupToStringImpl(_matchcount.Length - 1); 154int numgroups = inner._matchcount.Length; 176if (capcount * 2 + 2 > matches[cap].Length) 237(uint)cap < (uint)matchcount.Length && 300for (int groupNumber = 0; groupNumber < matches.Length; groupNumber++) 327for (int cap = 0; cap < matchcount.Length; cap++)
System\Text\RegularExpressions\Regex.cs (6)
241for (int i = 0; i < regexinfos.Length; i++) 324for (int i = 0; i < result.Length; i++) 347for (int i = 0; i < result.Length; i++) 594runner.runtrackpos = runner.runtrack!.Length; 595runner.runstackpos = runner.runstack!.Length; 596runner.runcrawlpos = runner.runcrawl!.Length;
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (2)
160Ldc(tree.CaptureNames.Length); 164for (int i = 0; i < tree.CaptureNames.Length; i++)
System\Text\RegularExpressions\RegexCharClass.cs (5)
329int len = s_propTable.Length; 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1276if ((uint)index < (uint)cache.Length) 1567if (chars[0] < asciiStrings.Length) 1824int max = s_propTable.Length;
System\Text\RegularExpressions\RegexCompiler.cs (1)
1288switch (literalChars.Length)
System\Text\RegularExpressions\RegexFindOptimizations.cs (5)
108chars is { Length: 1 }) 146if (RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: true) is { Length: > 1 } caseInsensitivePrefixes) 327bool invalidChars = chars is not { Length: 1 } || fixedDistanceSets[i].Negated; 354Debug.Assert(chars is { Length: 1 }); 623if (chars is { Length: <= 5 }) // 5 == currently the max length efficiently handled by IndexOfAny{Except} without SearchValues
System\Text\RegularExpressions\RegexParser.cs (4)
116if (captureNumberList == null || captop == captureNumberList.Length) 126captureCount = captureNumberList.Length; 127for (int i = 0; i < captureNumberList.Length; i++) 2127(uint)i < (uint)capslist.Length)
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (2)
795int s1CharsLength = s1Chars?.Length ?? 0; 796int s2CharsLength = s2Chars?.Length ?? 0;
System\Text\RegularExpressions\RegexReplacement.cs (5)
159for (int i = _rules.Length - 1; i >= 0; i--) 215Debug.Assert(_rules.Length <= 1); 216Debug.Assert(_rules.Length == 0 || (_rules[0] == 0 && _strings.Length == 1)); 218return ReplaceSimpleText(regex, input, _rules.Length != 0 ? _strings[0] : "", count, startat);
System\Text\RegularExpressions\RegexRunner.cs (19)
260runtrackpos = runtrack!.Length; 261runstackpos = runstack!.Length; 262runcrawlpos = runcrawl!.Length; 306runtrackpos = runtrack!.Length; 307runstackpos = runstack!.Length; 308runcrawlpos = runcrawl.Length; 455int[] newtrack = new int[runtrack!.Length * 2]; 457Array.Copy(runtrack, 0, newtrack, runtrack.Length, runtrack.Length); 458runtrackpos += runtrack.Length; 468int[] newstack = new int[runstack!.Length * 2]; 470Array.Copy(runstack, 0, newstack, runstack.Length, runstack.Length); 471runstackpos += runstack.Length; 480int[] newcrawl = new int[runcrawl!.Length * 2]; 482Array.Copy(runcrawl, 0, newcrawl, runcrawl.Length, runcrawl.Length); 483runcrawlpos += runcrawl.Length; 511return runcrawl!.Length - runcrawlpos;
System\Text\RegularExpressions\RegexTree.cs (2)
49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 55for (int i = 0; i < captureNames.Length; i++)
System\Text\RegularExpressions\Symbolic\BDD.cs (9)
174Debug.Assert(nodes[nodes.Length - 1] == this); 175Debug.Assert(nodes.Length <= (1 << 24)); 187while (nodes.Length >= (1 << node_bits)) 193long[] result = new long[nodes.Length + 2]; 209for (int i = 0; i < nodes.Length; i++) 283for (int i = 0; i < nonterminals.Length; i++) 312for (int i = 0; i < serialized.Length; i++) 323byte[] result = new byte[(k * serialized.Length) + 1]; 325for (int i = 0; i < serialized.Length; i += 1)
System\Text\RegularExpressions\Symbolic\BDDRangeConverter.cs (22)
55var result = new (uint, uint)[(1 << newBits) * ranges.Length]; 70if (ranges[0].Item1 == 0 && ranges[ranges.Length - 1].Item2 == maximal) 76for (int i = 1; i < result.Length; i++) 115ranges = new (uint, uint)[ranges1.Length]; 116for (int i = 0; i < ranges1.Length; i++) 136ranges = new (uint, uint)[rangesR.Length]; 138for (int i = 1; i < rangesR.Length; i++) 145ranges = new (uint, uint)[rangesR.Length + 1]; 147for (int i = 0; i < rangesR.Length; i++) 159(uint, uint) last = rangesL[rangesL.Length - 1]; 169for (int i = 0; i < rangesL.Length - 1; i++) 195ranges = new (uint, uint)[rangesL.Length + rangesR.Length - 1]; 196for (int i = 0; i < rangesL.Length - 1; i++) 201ranges[rangesL.Length - 1] = (last.Item1, first.Item2 | mask); 202for (int i = 1; i < rangesR.Length; i++) 204ranges[rangesL.Length - 1 + i] = (rangesR[i].Item1 | mask, rangesR[i].Item2 | mask); 209ranges = new (uint, uint)[rangesL.Length + rangesR.Length]; 210for (int i = 0; i < rangesL.Length; i++) 215for (int i = 0; i < rangesR.Length; i++) 217ranges[rangesL.Length + i] = (rangesR[i].Item1 | mask, rangesR[i].Item2 | mask);
System\Text\RegularExpressions\Symbolic\BitVector.cs (8)
94var blocks = new ulong[xBlocks.Length]; 95for (int i = 0; i < blocks.Length; i++) 111var blocks = new ulong[xBlocks.Length]; 112for (int i = 0; i < blocks.Length; i++) 127var blocks = new ulong[firstOther._blocks.Length]; 131for (int i = 0; i < blocks.Length; i++) 145var blocks = new ulong[xBlocks.Length]; 146for (int i = 0; i < blocks.Length; i++)
System\Text\RegularExpressions\Symbolic\BitVectorSolver.cs (7)
19var singleBitVectors = new BitVector[minterms.Length]; 20for (int i = 0; i < singleBitVectors.Length; i++) 22singleBitVectors[i] = BitVector.CreateSingleBit(minterms.Length, i); 26Empty = BitVector.CreateFalse(minterms.Length); 27Full = BitVector.CreateTrue(minterms.Length); 54for (int i = 0; i < partition.Length; i++) 79for (int i = 0; i < partition.Length; i++)
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (1)
51if (c < (uint)ascii.Length)
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (11)
37Debug.Assert(minterms.Length > 0, "Requires at least"); 39if (minterms.Length == 1) 53object[] arrayPoolArray = ArrayPool<object>.Shared.Rent(minterms.Length); 54Span<object> charRangesPerMinterm = arrayPoolArray.AsSpan(0, minterms.Length); 57for (int mintermId = 1; mintermId < minterms.Length; mintermId++) 66if (minterms.Length > 255) 83for (int mintermId = 1; mintermId < minterms.Length; mintermId++) 103return (uint)c < (uint)lookup.Length ? lookup[c] : 0; 110return (uint)c < (uint)lookup.Length ? lookup[c] : 0; 123public int MaxChar => (_lookup?.Length ?? _intLookup!.Length) - 1;
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (6)
47Debug.Assert(childResults is null || childResults.Length != 0); 90Debug.Assert(childResults is not null && childResults.Length == node.ChildCount()); 206Debug.Assert(childResults.Length == node.ChildCount()); 229for (int i = childResults.Length - 1; i >= 0; i--) 253Debug.Assert(childResults.Length == 1); 269Debug.Assert(childResults.Length == 1);
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (4)
34if ((uint)key < (uint)sparse.Length) 41Debug.Assert(entryKey < sparse.Length); 76Debug.Assert(newLength > _sparse.Length); 79newLength = Math.Max(2 * _sparse.Length, newLength);
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (1)
348for (int i = 0; i < reverseTransformed.Length; i++)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (13)
111Debug.Assert(newSize >= array.Length); 113Array.Copy(array, newArray, array.Length); 131int numMinterms = _minterms.Length; 150int numMinterms = _minterms.Length; 262if (state.Id == _stateArray.Length) 265int newsize = _stateArray.Length * 2; 318if (nfaStateId == _nfaCoreIdArray.Length) 321int newsize = Math.Max(_nfaCoreIdArray.Length * 2, InitialNfaStateCapacity); 328Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 351Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 352Debug.Assert(_nfaCoreIdArray[nfaStateId] < _stateArray.Length); 360Debug.Assert(offset < _dfaDelta.Length); 389Debug.Assert(nfaOffset < _nfaDelta.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (16)
183_mintermsLog = BitOperations.Log2((uint)_minterms.Length) + 1; 198_positionKinds = new uint[_minterms.Length + 2]; 199for (int mintermId = -1; mintermId < _positionKinds.Length - 1; mintermId++) 229for (uint charKind = 0; charKind < initialStates.Length; charKind++) 239for (uint charKind = 0; charKind < dotstarredInitialStates.Length; charKind++) 259for (uint charKind = 0; charKind < reverseInitialStates.Length; charKind++) 280if ((uint)mintermId == (uint)_minterms.Length) 323if ((uint)mintermId < (uint)minterms.Length) 1043for (int j = 0; j < transitions.Length; ++j) 1053Registers newRegisters = j != transitions.Length - 1 ? sourceRegisters.Clone() : sourceRegisters; 1100c < (uint)mintermLookup.Length ? 1157Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 1158Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 1160Array.Copy(other.CaptureStarts, CaptureStarts, CaptureStarts.Length); 1161Array.Copy(other.CaptureEnds, CaptureEnds, CaptureEnds.Length); 1676matcher.IsNullableWithContext(stateNullability, c < (uint)lookup.Length ? lookup[c] : 0);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (2)
152Debug.Assert(deltas.Length == matcher._minterms.Length); 187sb.Append($"Min Terms ({matcher.Solver.GetMinterms()!.Length}) = ").AppendJoin(',',
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Explore.cs (4)
40int maxMinterm = state.StartsWithLineAnchor ? _minterms!.Length : _minterms!.Length - 1; 83int maxMinterm = state.StartsWithLineAnchor ? _minterms.Length : _minterms.Length - 1;
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (5)
55int[] mintermIdsWithoutZ = new int[_minterms.Length]; 56int[] mintermIdsWithZ = new int[_minterms.Length + 1]; 57for (int i = 0; i < _minterms.Length; ++i) 62mintermIdsWithZ[_minterms.Length] = _minterms.Length;
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (1)
42_matcher = minterms.Length > 64 ?
System\Text\RegularExpressions\Symbolic\UInt64Solver.cs (7)
17Debug.Assert(minterms.Length <= 64); 22Full = minterms.Length == 64 ? ulong.MaxValue : ulong.MaxValue >> (64 - minterms.Length); 66for (int i = 0; i < partition.Length; i++) 83ulong[] minterms = new ulong[_minterms.Length]; 84for (int i = 0; i < minterms.Length; i++) 104for (int i = 0; i < partition.Length; i++)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryConditions.cs (1)
30Debug.Assert(Enum.GetValues<UnicodeCategory>().Length == UnicodeCategoryValueCount);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (4)
68for (int c = 0; c < catBDDs.Length; c++) 78for (int i = 0; i < catBDDs.Length; i++) 85for (int i = 0; i < catBDDs.Length; i++) 100for (int i = 0; i < values.Length; i++)
System\Text\StructListBuilder.cs (4)
35if ((uint)pos < (uint)array.Length) 61Debug.Assert(array.Length == _count); 64int newSize = array.Length == 0 ? DefaultArraySize : array.Length * 2;
System.Text.RegularExpressions.Generator (64)
RegexGenerator.Emitter.cs (45)
1394literalChars.Length switch 4691Debug.Assert(args.Length is >= 1); 4694string key = $"{MethodName}{args.Length}"; 4700var lines = new string[24 + args.Length]; 4701lines[0] = $"/// <summary>Pushes {args.Length} value{(args.Length == 1 ? "" : "s")} onto the backtracking stack.</summary>"; 4703lines[2] = $"internal static void {MethodName}(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})"; 4705lines[4] = $" // If there's space available for {(args.Length > 1 ? $"all {args.Length} values, store them" : "the value, store it")}."; 4708lines[7] = $" if ((uint){(args.Length > 1 ? $"(p + {args.Length - 1})" : "p")} < (uint)s.Length)"; 4710for (int i = 0; i < args.Length; i++) 4714lines[9 + args.Length] = args.Length > 1 ? $" pos += {args.Length};" : " pos++;"; 4715lines[10 + args.Length] = $" return;"; 4716lines[11 + args.Length] = $" }}"; 4717lines[12 + args.Length] = $""; 4718lines[13 + args.Length] = $" // Otherwise, resize the stack to make room and try again."; 4719lines[14 + args.Length] = $" WithResize(ref stack, ref pos{FormatN(", arg{0}", args.Length)});"; 4720lines[15 + args.Length] = $""; 4721lines[16 + args.Length] = $" // <summary>Resize the backtracking stack array and push {args.Length} value{(args.Length == 1 ? "" : "s")} onto the stack.</summary>"; 4722lines[17 + args.Length] = $" [MethodImpl(MethodImplOptions.NoInlining)]"; 4723lines[18 + args.Length] = $" static void WithResize(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})"; 4724lines[19 + args.Length] = $" {{"; 4725lines[20 + args.Length] = $" Array.Resize(ref stack, (pos + {args.Length - 1}) * 2);"; 4726lines[21 + args.Length] = $" {MethodName}(ref stack, ref pos{FormatN(", arg{0}", args.Length)});"; 4727lines[22 + args.Length] = $" }}"; 4728lines[23 + args.Length] = $"}}"; 4743Debug.Assert(args.Length is >= 1); 4745if (args.Length == 1) 4752string key = $"{MethodName}{args.Length}"; 4756var lines = new string[5 + args.Length]; 4757lines[0] = $"/// <summary>Pops {args.Length} value{(args.Length == 1 ? "" : "s")} from the backtracking stack.</summary>"; 4759lines[2] = $"internal static void {MethodName}(int[] stack, ref int pos{FormatN(", out int arg{0}", args.Length)})"; 4761for (int i = 0; i < args.Length; i++) 4765lines[4 + args.Length] = $"}}"; 5433for (int i = 0; i < parts.Length; i++)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (5)
329int len = s_propTable.Length; 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1276if ((uint)index < (uint)cache.Length) 1567if (chars[0] < asciiStrings.Length) 1824int max = s_propTable.Length;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (4)
108chars is { Length: 1 }) 146if (RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: true) is { Length: > 1 } caseInsensitivePrefixes) 327bool invalidChars = chars is not { Length: 1 } || fixedDistanceSets[i].Negated; 354Debug.Assert(chars is { Length: 1 });
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (4)
116if (captureNumberList == null || captop == captureNumberList.Length) 126captureCount = captureNumberList.Length; 127for (int i = 0; i < captureNumberList.Length; i++) 2127(uint)i < (uint)capslist.Length)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (2)
795int s1CharsLength = s1Chars?.Length ?? 0; 796int s2CharsLength = s2Chars?.Length ?? 0;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTree.cs (2)
49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 55for (int i = 0; i < captureNames.Length; i++)
Stubs.cs (1)
28stringBuilder.CopyTo(0, chars, 0, chars.Length);
UpgradeToGeneratedRegexCodeFixer.cs (1)
321for (int i = 0; i < parts.Length; i++)
System.Threading.Channels (20)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (8)
85int tail2 = (last + 1) & (array.Length - 1); 111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize); 143segment._state._first = (first + 1) & (array.Length - 1); 209segment._state._first = (first + 1) & (segment._array.Length - 1); 233segment._state._first = (first + 1) & (array.Length - 1); 281segment._state._first = (first + 1) & (segment._array.Length - 1); 327pt = (pt + 1) & (segment._array.Length - 1)) 346int arraySize = segment._array.Length;
src\libraries\Common\src\System\Collections\Generic\Deque.cs (12)
24if (_size == _array.Length) 30if (++_tail == _array.Length) 57if (++_head == _array.Length) 78index = _array.Length - 1; 89_tail = _array.Length - 1; 106pos = (pos + 1) % _array.Length; 112Debug.Assert(_size == _array.Length); 117int capacity = (int)(_array.Length * 2L); 118if (capacity < _array.Length + MinimumGrow) 120capacity = _array.Length + MinimumGrow; 131Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 132Array.Copy(_array, 0, newArray, _array.Length - _head, _tail);
System.Threading.RateLimiting (19)
src\libraries\Common\src\System\Collections\Generic\Deque.cs (12)
24if (_size == _array.Length) 30if (++_tail == _array.Length) 57if (++_head == _array.Length) 78index = _array.Length - 1; 89_tail = _array.Length - 1; 106pos = (pos + 1) % _array.Length; 112Debug.Assert(_size == _array.Length); 117int capacity = (int)(_array.Length * 2L); 118if (capacity < _array.Length + MinimumGrow) 120capacity = _array.Length + MinimumGrow; 131Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 132Array.Copy(_array, 0, newArray, _array.Length - _head, _tail);
System\Threading\RateLimiting\ChainedPartitionedRateLimiter.cs (6)
59for (int i = 0; i < _limiters.Length; i++) 71RateLimitLease? notAcquiredLease = CommonAcquireLogic(exception, lease, ref leases, i, _limiters.Length); 85for (int i = 0; i < _limiters.Length; i++) 97RateLimitLease? notAcquiredLease = CommonAcquireLogic(exception, lease, ref leases, i, _limiters.Length); 129exceptions[exceptions.Length - 1] = ex; 238for (int i = _leases.Length - 1; i >= 0; i--)
System\Threading\RateLimiting\PartitionedRateLimiter.cs (1)
61if (limiters.Length == 0)
System.Threading.Tasks.Dataflow (25)
Base\DataflowBlock.cs (1)
2040Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID");
Blocks\BatchBlock.cs (5)
741for (int i = 0; i < newBatch.Length; i++) newBatch[i] = _messages.Dequeue(); 800Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long 914Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long 1144if (multipleOutputItems == null) return singleOutputItem.Length; 1148foreach (T[] item in multipleOutputItems) count += item.Length;
Blocks\JoinBlock.cs (1)
1397Debug.Assert(_targets.Length > 0, "A join must have targets.");
Internal\ImmutableArray.cs (8)
52var newArray = new T[_array.Length + 1]; 53Array.Copy(_array, newArray, _array.Length); 54newArray[newArray.Length - 1] = item; 68if (_array.Length == 1) return Empty; 71var newArray = new T[_array.Length - 1]; 73Array.Copy(_array, index + 1, newArray, index, _array.Length - index - 1); 78public int Count { get { return _array.Length; } } 90public T[] ToArray() { return _array.Length == 0 ? s_empty._array : (T[])_array.Clone(); }
Internal\QueuedMap.cs (1)
214Debug.Assert(arrayOffset + count <= items.Length, "Range must be within array size");
Internal\SourceCore.cs (1)
436for (int i = 0; i < itemsAsArray.Length; i++)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (8)
85int tail2 = (last + 1) & (array.Length - 1); 111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize); 143segment._state._first = (first + 1) & (array.Length - 1); 209segment._state._first = (first + 1) & (segment._array.Length - 1); 233segment._state._first = (first + 1) & (array.Length - 1); 281segment._state._first = (first + 1) & (segment._array.Length - 1); 327pt = (pt + 1) & (segment._array.Length - 1)) 346int arraySize = segment._array.Length;
System.Threading.Tasks.Parallel (13)
System\Threading\Tasks\Parallel.cs (9)
206Action[] actionsCopy = new Action[actions.Length]; 207for (int i = 0; i < actionsCopy.Length; i++) 223actionsCopy.Length); 231if (actionsCopy.Length < 1) return; 248(actionsCopy.Length > SMALL_ACTIONCOUNT_LIMIT) || 249(parallelOptions.MaxDegreeOfParallelism != -1 && parallelOptions.MaxDegreeOfParallelism < actionsCopy.Length) 271while (myIndex <= actionsCopy.Length) 332Task[] tasks = new Task[actionsCopy.Length]; 338for (int i = 1; i < tasks.Length; i++)
System\Threading\Tasks\ParallelRangeManager.cs (4)
97int numIndexRangesToVisit = _indexRanges.Length; 165_nCurrentIndexRange = (_nCurrentIndexRange + 1) % _indexRanges.Length; 291Debug.Assert(_indexRanges != null && _indexRanges.Length != 0); 293int nInitialRange = (Interlocked.Increment(ref _nCurrentIndexRangeToAssign) - 1) % _indexRanges.Length;
System.Transactions.Local (12)
System\Transactions\Transaction.cs (2)
465byte[] toReturn = new byte[internalPromotedToken.Length]; 466Array.Copy(internalPromotedToken, toReturn, toReturn.Length);
System\Transactions\TransactionInteropNonWindows.cs (9)
57var whereaboutsCopy = new byte[whereabouts.Length]; 58Buffer.BlockCopy(whereabouts, 0, whereaboutsCopy, 0, whereabouts.Length); 75if (cookie.Length < 32) 86var cookieCopy = new byte[cookie.Length]; 87Buffer.BlockCopy(cookie, 0, cookieCopy, 0, cookie.Length); 145if (propagationToken.Length < 24) 246if (propagationToken.Length < 24) 251byte[] propagationTokenCopy = new byte[propagationToken.Length]; 252Array.Copy(propagationToken, propagationTokenCopy, propagationToken.Length);
System\Transactions\TransactionManager.cs (1)
173resourceManagerRecoveryInformation = reader.ReadBytes(recoveryInformation.Length - checked((int)stream.Position));
System.Web.HttpUtility (4)
System\Web\HttpUtility.cs (2)
180public static byte[]? UrlEncodeToBytes(byte[]? bytes) => bytes == null ? null : UrlEncodeToBytes(bytes, 0, bytes.Length); 190public static string? UrlDecode(byte[]? bytes, Encoding e) => bytes == null ? null : UrlDecode(bytes, 0, bytes.Length, e);
System\Web\Util\HttpEncoder.cs (2)
606ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, bytes.Length); 609ArgumentOutOfRangeException.ThrowIfGreaterThan(count, bytes.Length - offset);
System.Web.Services.Description (74)
System\Web\Services\Configuration\WebServicesSection.cs (5)
25if (attrs.Length == 0) 59if (attrs.Length == 0) { 74string[] prefixes = new string[attrs.Length]; 76for (int i = 0; i < attrs.Length; i++) { 82for (int i = 0; i < prefixes.Length; i++) {
System\Web\Services\Description\ServiceDescription.cs (3)
839for (int i = 0; i < ParameterOrder.Length; i++) 1017MessagePart[] partArray = new MessagePart[partNames.Length]; 1018for (int i = 0; i < partNames.Length; i++)
System\Web\Services\Description\ServiceDescriptionSerializer.cs (65)
42for (int i = 0; i < a.Length; i++) { 139for (int i = 0; i < a.Length; i++) { 202for (int i = 0; i < a.Length; i++) { 368for (int i = 0; i < a.Length; i++) { 452for (int i = 0; i < a.Length; i++) { 537for (int i = 0; i < a.Length; i++) { 703for (int i = 0; i < a.Length; i++) { 1283for (int i = 0; i < a.Length; i++) { 1652for (int i = 0; i < a.Length; i++) { 1715for (int i = 0; i < a.Length; i++) { 1802for (int i = 0; i < a.Length; i++) { 1858for (int i = 0; i < a.Length; i++) { 1914for (int i = 0; i < a.Length; i++) { 1970for (int i = 0; i < a.Length; i++) { 2033for (int i = 0; i < a.Length; i++) { 2090for (int i = 0; i < a.Length; i++) { 2168for (int i = 0; i < a.Length; i++) { 2268for (int i = 0; i < a.Length; i++) { 2327for (int ia = 0; ia < a.Length; ia++) { 2382for (int ia = 0; ia < a.Length; ia++) { 2437for (int i = 0; i < a.Length; i++) { 2492for (int i = 0; i < a.Length; i++) { 2562for (int i = 0; i < a.Length; i++) { 2617for (int i = 0; i < a.Length; i++) { 2717for (int i = 0; i < a.Length; i++) { 2765for (int i = 0; i < a.Length; i++) { 2806for (int i = 0; i < a.Length; i++) { 2854for (int i = 0; i < a.Length; i++) { 2903for (int i = 0; i < a.Length; i++) { 2961for (int i = 0; i < a.Length; i++) { 3001for (int i = 0; i < a.Length; i++) { 3092for (int i = 0; i < a.Length; i++) { 3134for (int i = 0; i < a.Length; i++) { 3176for (int i = 0; i < a.Length; i++) { 3218for (int i = 0; i < a.Length; i++) { 3260for (int i = 0; i < a.Length; i++) { 3302for (int i = 0; i < a.Length; i++) { 3344for (int i = 0; i < a.Length; i++) { 3386for (int i = 0; i < a.Length; i++) { 3428for (int i = 0; i < a.Length; i++) { 3470for (int i = 0; i < a.Length; i++) { 3512for (int i = 0; i < a.Length; i++) { 3554for (int i = 0; i < a.Length; i++) { 3596for (int i = 0; i < a.Length; i++) { 3606for (int i = 0; i < a.Length; i++) { 3687for (int i = 0; i < a.Length; i++) { 3792for (int i = 0; i < a.Length; i++) { 3834for (int i = 0; i < a.Length; i++) { 3905for (int i = 0; i < a.Length; i++) { 3944for (int i = 0; i < a.Length; i++) { 3985for (int i = 0; i < a.Length; i++) { 4033for (int i = 0; i < a.Length; i++) { 4103for (int i = 0; i < a.Length; i++) { 4155for (int i = 0; i < a.Length; i++) { 4235for (int i = 0; i < a.Length; i++) { 4315for (int i = 0; i < a.Length; i++) { 4366for (int i = 0; i < a.Length; i++) { 4479for (int i = 0; i < a.Length; i++) { 4540for (int i = 0; i < a.Length; i++) { 4581for (int i = 0; i < a.Length; i++) { 4643for (int i = 0; i < a.Length; i++) { 4682for (int i = 0; i < a.Length; i++) { 4722for (int i = 0; i < a.Length; i++) { 4787for (int i = 0; i < a.Length; i++) { 9284for (int i = 0; i < vals.Length; i++) {
System\Web\Services\Description\SoapFormatExtensions.cs (1)
99for (int i = 0; i < Parts.Length; i++) {
System.Windows.Controls.Ribbon (9)
Microsoft\Windows\Controls\GenericValueConverters.cs (2)
31if (values.Length < 2) 36for (int i = 1; i < values.Length; i++)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (1)
464if (handleTypeCount == 0 || handleTypeCount == handleTypes.Length)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonScrollButtonVisibilityConverter.cs (1)
50values.Length != 4 ||
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (3)
195for (i = 1; i < _unitStrings.Length; ++i) 210if (i >= _unitStrings.Length) 212for (i = 0; i < _pixelUnitStrings.Length; ++i)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2241for (int i = 0; i < properties.Length; i++)
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (1)
392int wordCount = string.IsNullOrEmpty(Text) ? 0 : Text.Split().Length;
System.Windows.Forms (527)
misc\CollectionHelper.cs (2)
21ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)index, (uint)target.Length, nameof(index)); 24if (target.Length - index < source.Count)
misc\ImageListUtils.cs (2)
30for (int i = 0; i < pathInfo.Length; i++) 45if (i == pathInfo.Length - 1)
System\Resources\AssemblyNamesTypeResolutionService.cs (1)
109List<AssemblyName> assemblyList = new(_names.Length);
System\Resources\ResXDataNode.cs (4)
132if (fileRefDetails is not null && fileRefDetails.Length > 1) 139if (fileRefDetails.Length > 2) 424if (serializedData.Length <= 0) 676if (typeParts is not null && typeParts.Length >= 2)
System\Resources\ResxFileRef.Converter.cs (3)
86result = parts.Length > 1 88: parts.Length > 0 ? ([fileName, parts[0]]) : ([fileName]); 111Encoding textFileEncoding = parts.Length > 2 ? Encoding.GetEncoding(parts[2]) : Encoding.Default;
System\Windows\Forms\Accessibility\AccessibleObject.cs (2)
2989if (args?.Length == 0 && s_propertiesWithArguments.Contains(name)) 3271int length = runtimeId.Length;
System\Windows\Forms\Accessibility\AccessibleObject.EnumVariantObject.cs (1)
167for (i = 0; i < celt && _currentChild < newOrder.Length; ++i)
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (3)
152index = ctrls.Length - 1; 184if (ctrls is null || ctrls.Length == 0) 191if (index >= 0 && index < ctrls.Length)
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (1)
252last = controls.Length;
System\Windows\Forms\ActiveX\AxHost.AxPerPropertyBrowsingEnum.cs (5)
80if (_names.Length == 0) 85object[] values = new object[_cookies.Length]; 88Debug.Assert(_cookies.Length == _names.Length, "Got uneven names and cookies"); 93for (int i = 0; i < _names.Length; i++)
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (2)
310if (names.Length > 0 && cookies.Length > 0)
System\Windows\Forms\ActiveX\AxHost.cs (3)
2379if (index > 0 && index < s_categoryNames.Length && s_categoryNames[index] is not null) 2584else if (attributes is not null && _attribsStash is not null && attributes.Length == _attribsStash.Length)
System\Windows\Forms\ActiveX\AxHost.EnumUnknown.cs (1)
20_size = (array is null) ? 0 : array.Length;
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (3)
1199for (int i = 0; i < _ambientProperties.Length; i++) 1265for (int i = 0; i < _ambientProperties.Length; i++) 1275for (int i = 0; i < _ambientProperties.Length; i++)
System\Windows\Forms\ActiveX\Control.ActiveXVerbEnum.cs (3)
40while (celt > 0 && _current < _verbs.Length) 61if (_current + celt < _verbs.Length) 67_current = (uint)_verbs.Length;
System\Windows\Forms\ActiveX\DataStreamFromComStream.cs (2)
57if (count > 0 && index >= 0 && (count + index) <= buffer.Length) 117if (count > 0 && index >= 0 && (count + index) <= buffer.Length)
System\Windows\Forms\Application.cs (7)
176if (attrs is not null && attrs.Length > 0) 466if (attrs is not null && attrs.Length > 0) 516if (attrs is not null && attrs.Length > 0) 1274Debug.Assert(arguments is not null && arguments.Length > 0); 1281if (arguments.Length >= 2) 1283StringBuilder sb = new((arguments.Length - 1) * 16); 1284for (int argumentIndex = 1; argumentIndex < arguments.Length; argumentIndex++)
System\Windows\Forms\Application.ThreadContext.cs (1)
453for (int i = 0; i < contexts.Length; ++i)
System\Windows\Forms\ComponentModel\COM2Interop\COM2Enum.cs (5)
55for (int i = 0; i < _stringValues.Length; i++) 76_stringValues = new string[names.Length]; 78for (int i = 0; i < names.Length; i++) 95if (_values.Length > 0 && value.GetType() != _values[0].GetType()) 113for (int i = 0; i < _values.Length; i++)
System\Windows\Forms\ComponentModel\COM2Interop\COM2ICategorizePropertiesHandler.cs (1)
62for (int i = 0; i < properties.Length; i++)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (8)
24for (int i = 0; i < properties.Length; i++) 40for (int i = 0; i < attributes.Length; i++) 64Debug.Assert(typeNames.Length == values.Length, "Mismatched parameter and attribute name length"); 65if (typeNames.Length != values.Length) 71for (int i = 0; i < typeNames.Length; i++) 158if (parameters.Length == 1 && parameters[0].ParameterType.IsAssignableFrom(value.GetType()))
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (5)
76if (_names.Length == 0) 81object[] valueItems = new object[_names.Length]; 84Debug.Assert(_cookies.Length == _names.Length, "Got uneven names and cookies"); 96for (int i = _names.Length - 1; i >= 0; i--)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IPerPropertyBrowsingHandler.cs (3)
23for (int i = 0; i < properties.Length; i++) 127if (names.Length > 0 && cookies.Length > 0)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IProvidePropertyBuilderHandler.cs (1)
45for (int i = 0; i < properties.Length; i++)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IVsPerPropertyBrowsingHandler.cs (1)
39for (int i = 0; i < properties.Length; i++)
System\Windows\Forms\ComponentModel\COM2Interop\COM2Properties.cs (9)
45for (int i = 0; i < _properties.Length; i++) 91return _properties.Length > 0 ? _properties[0] : null; 94Debug.Assert(_defaultPropertyIndex < _properties.Length, "Whoops! default index is > props.Length"); 134for (int i = 0; i < _properties.Length; i++) 195var versions = new (ushort, ushort, ushort, ushort)[pTypeInfos.Length]; 196for (int i = 0; i < pTypeInfos.Length; i++) 235if (newTypeInfoVersions.Length != _typeInfoVersions.Length) 242for (int i = 0; i < newTypeInfoVersions.Length; i++)
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (2)
130for (int i = 0; i < attributes.Length; i++) 158int baseCount = _baseAttributes is null ? 0 : _baseAttributes.Length;
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (4)
67nint[] addresses = new nint[objects.Length]; 71for (int i = 0; i < addresses.Length; i++) 83(uint)addresses.Length, 92for (int i = 0; i < addresses.Length; i++)
System\Windows\Forms\ComponentModel\COM2Interop\Com2TypeInfoProcessor.CachedProperties.cs (2)
29Com2PropertyDescriptor[] clonedProperties = new Com2PropertyDescriptor[properties.Length]; 30for (int i = 0; i < properties.Length; i++)
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (4)
199if (typeInfos.Length == 0) 210for (int i = 0; i < typeInfos.Length; i++) 221Guid[] typeGuids = new Guid[typeInfos.Length]; 223for (int i = 0; i < typeInfos.Length; i++)
System\Windows\Forms\Control.ControlCollection.cs (2)
143if (controls.Length == 0) 149for (int i = 0; i < controls.Length; ++i)
System\Windows\Forms\Control.ControlVersionInfo.cs (3)
34if (attrs is not null && attrs.Length > 0) 81if (attrs is not null && attrs.Length > 0) 129if (attrs is not null && attrs.Length > 0)
System\Windows\Forms\Control.cs (10)
6023if (tme._args is null || tme._args.Length < 1) 6027else if (tme._args.Length < 2) 6046Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for WaitCallback"); 6051Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for SendOrPostCallback"); 6469Marshal.Copy(bytes, 0, m.LParamInternal, bytes.Length); 6470Marshal.Copy(nullBytes, 0, m.LParamInternal + (nint)bytes.Length, nullBytes.Length); 6472m.ResultInternal = (LRESULT)((bytes.Length + nullBytes.Length) / sizeof(char)); 9204for (int i = 0; i < controlSnapshot.Length; i++)
System\Windows\Forms\Controls\Buttons\FlatButtonAppearanceConverter.cs (2)
21Attribute[] attributes2 = new Attribute[attributes.Length + 1]; 23attributes2[attributes.Length] = new ApplicableToButtonAttribute();
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
1315if (value is null || value.Length == 0) 2987for (int i = 0; i < newItems.Length; i++)
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.cs (2)
271ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, destination.Length - count); 286ArgumentOutOfRangeException.ThrowIfGreaterThan(index, destination.Length - count);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (17)
1581if (clonedColumns.Length == clonedColumnsCount) 1635Debug.Assert(finalClonedColumns.Length == 0); 1643for (int k = 0; k < finalClonedColumns.Length; k++) 5274for (int arrayIndex = 0; arrayIndex < dataGridViewRows.Length; arrayIndex++) 5283if (arrayIndex == dataGridViewRows.Length - 1 && !currentRowFrozen && nextVisibleRowPresent && nextRowFrozen) 8160int bytecountEndOfFragment = 135 + destinationBytes.Length; 10921int columnCount = dataGridViewColumns.Length; 11061int rowCount = dataGridViewRows.Length; 11238if (previousModes.Length != Columns.Count) 15317Debug.Assert(dataGridViewRows.Length > 0); 15320DisplayedBandsInfo.CorrectRowIndexAfterInsertion(rowIndex, dataGridViewRows.Length); 15323CorrectRowIndexesAfterInsertion(rowIndex, dataGridViewRows.Length); 15332Debug.Assert(dataGridViewRows.Length > 0); 15603newCurrentCell = new Point(_ptCurrentCell.X, _ptCurrentCell.Y + dataGridViewRows.Length); 15630_selectedBandIndexes[rowEntry] = rowIndex + dataGridViewRows.Length; 15645_selectedBandSnapshotIndexes[rowEntry] = rowIndex + dataGridViewRows.Length; 26239for (int r = 0; r < rects.Length; r++)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (1)
211int cellCount = dataGridViewCells.Length;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (2)
194List<DataGridViewColumn> initialColumns = new(dataGridViewColumns.Length); 195List<DataGridViewColumn> sortedColumns = new(dataGridViewColumns.Length);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
1102for (int i = 0; i < newItems.Length; i++)
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (2)
1797if (columnIndex == values.Length) 1808return setResult && values.Length <= cellCount;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (3)
781OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, null), indexStart, dataGridViewRows.Length); 1753if (dataGridViewRows.Length == 1) 1831OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Refresh, null), rowIndex, dataGridViewRows.Length, false, true, false, newCurrentCell);
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (1)
521for (int i = 0; i < images.Length; ++i)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (3)
550Debug.Assert(regionIndex == (textRegions.Length - 1), "Failed to consume all link label visual regions"); 1054&& regionRectangles.Length > 0) 1319&& link.VisualRegion.GetRegionScans(g.Transform) is { } regionRectangles && regionRectangles.Length > 0)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
641for (int i = 1; i < tabStops.Length; i++)
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (2)
1178if (value is null || value.Length == 0) 1989for (int i = 0; i < newItems.Length; i++)
System\Windows\Forms\Controls\ListBoxes\ListBox.IntegerCollection.cs (3)
212else if (_count + elements >= _innerArray.Length) 214int newLength = Math.Max(_innerArray.Length * 2, _innerArray.Length + elements);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
47Debug.Assert(id.Length >= 3);
System\Windows\Forms\Controls\ListView\ColumnHeader.cs (1)
486PInvokeCore.SendMessage(ListView, PInvoke.LVM_SETCOLUMNORDERARRAY, (WPARAM)cols.Length, (LPARAM)pCols);
System\Windows\Forms\Controls\ListView\ListView.CheckedIndexCollection.cs (2)
55for (int i = 0; i < _owner.Items.Count && index < indices.Length; ++i) 170for (int index = 0; index < indices.Length; ++index)
System\Windows\Forms\Controls\ListView\ListView.CheckedListViewItemCollection.cs (2)
50for (int i = 0; i < _owner.Items.Count && index < items.Length; ++i) 214for (int index = 0; index < items.Length; ++index)
System\Windows\Forms\Controls\ListView\ListView.ColumnHeaderCollection.cs (8)
73return _owner._columnHeaders is null ? 0 : _owner._columnHeaders.Length; 264int[] indices = new int[values.Length]; 266for (int i = 0; i < values.Length; i++) 276if (!usedIndices.Contains(header.DisplayIndex) && header.DisplayIndex >= 0 && header.DisplayIndex < values.Length) 285if (usedIndices.Count == values.Length) 314for (int colIdx = _owner._columnHeaders.Length - 1; colIdx >= 0; colIdx--) 329for (int colIdx = _owner._columnHeaders.Length - 1; colIdx >= 0; colIdx--) 536int columnCount = _owner._columnHeaders.Length;
System\Windows\Forms\Controls\ListView\ListView.cs (30)
464for (int i = 0; i < items.Length; i++) 509for (int i = 0; i < items.Length; i++) 2506ColumnHeader? col = (_columnHeaders is not null && _columnHeaders.Length > 0) ? _columnHeaders[0] : null; 3058for (int colIdx = _columnHeaders.Length - 1; colIdx >= 0; colIdx--) 3453for (int i = 0; i < _columnHeaders.Length; i++) 3798for (int i = 0; i < _columnHeaders.Length; i++) 3828int columnCount = _columnHeaders is null ? 0 : _columnHeaders.Length; 3988if (items is null || items.Length == 0) 4005for (int i = 0; i < items.Length; i++) 4019for (int i = 0; i < items.Length; i++) 4030for (int i = 0; i < items.Length; i++) 4084if (items is null || items.Length == 0) 4110for (int i = 0; i < items.Length; i++) 4125cColumns = (uint)(_columnHeaders is not null ? Math.Min(MAXTILECOLUMNS, _columnHeaders.Length) : 0), 4598int columnCount = _columnHeaders is null ? 0 : _columnHeaders.Length; 4674_savedSelectedItems = new List<ListViewItem>(lviArr.Length); 4675for (int i = 0; i < lviArr.Length; i++) 5242ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _columnHeaders?.Length ?? 0); 5320int[] orderedColumns = new int[indices.Length]; 5321for (int i = 0; i < indices.Length; i++) 5334(WPARAM)orderedColumns.Length, 5601for (int i = 0; i < _columnHeaders.Length; i++) 5801cLines = _columnHeaders is not null ? _columnHeaders.Length : 0, 6043if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem) 6059if (_columnHeaders is not null && nmheader->iItem < _columnHeaders.Length && 6094if (_columnHeaders is not null && nmheader->iItem < _columnHeaders.Length) 6152if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem) 6274if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem) 6292Debug.Assert(_columnHeaders!.Length > 0, "there should be a column that we need to compensate for"); 6824Marshal.Copy(charBuf, 0, destPtr, Math.Min(charBuf.Length, infoTip->cchTextMax));
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (2)
174for (int i = 0; i < columnHeaders.Length; i++) 250for (int i = 0; i < selectedItemProviders.Length; i++)
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (3)
149checkedValues = new bool[values.Length]; 150for (int i = 0; i < values.Length; i++) 163for (int i = 0; i < values.Length; i++)
System\Windows\Forms\Controls\ListView\ListView.SelectedIndexCollection.cs (1)
193for (int index = 0; index < indices.Length; ++index)
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (2)
273for (int i = 0; i < items.Length; i++) 358for (int index = 0; index < items.Length; ++index)
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (1)
116Debug.Assert(id.Length >= 2);
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (1)
156for (int i = 0; i < groups.Length; i++)
System\Windows\Forms\Controls\ListView\ListViewGroupItemCollection.cs (2)
51for (int i = 0; i < items.Length; i++) 58for (int i = 0; i < items.Length; i++)
System\Windows\Forms\Controls\ListView\ListViewItem.cs (12)
94if (items is not null && items.Length > 0) 96_subItems.EnsureCapacity(items.Length); 97for (int i = 0; i < items.Length; i++) 102SubItemCount = items.Length; 120SubItemCount = subItems.Length; 123for (int i = 0; i < subItems.Length; i++) 185if (items is not null && items.Length > 0) 187_subItems = new List<ListViewSubItem>(items.Length); 188for (int i = 0; i < items.Length; i++) 193SubItemCount = items.Length; 211SubItemCount = subItems.Length; 214for (int i = 0; i < subItems.Length; i++)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
208Debug.Assert(id.Length >= 2);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemImageAccessibleObject.cs (1)
46Debug.Assert(id.Length >= 4);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (1)
109Debug.Assert(id.Length >= 4);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (3)
136EnsureAdditionalCapacity(items.Length); 154EnsureAdditionalCapacity(items.Length); 171EnsureAdditionalCapacity(items.Length);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (3)
180if (value is not null && value.Length > 0) 255if (value is not null && value.Length > 0) 538if (value is not null && value.Length > 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (20)
376if (_selectedObjects is not null && _selectedObjects.Length > 0 && _rootEntry is not null) 890get => _selectedObjects is null || _selectedObjects.Length == 0 ? null : _selectedObjects[0]; 917if (value is not null && value.Length > 0) 919for (int count = 0; count < value.Length; count++) 923throw new ArgumentException(string.Format(SR.PropertyGridSetNull, count, value.Length)); 936&& _selectedObjects.Length == value.Length) 941for (int i = 0; i < value.Length && (isSame || classesSame); i++) 1544int oldArraySize = tabComponents is null ? 0 : tabComponents.Length; 1784if (verbs is not null && verbs.Length > 0) 2152if (components is null || components.Length == 0) 2165for (int i = 0; i < tabAttribute.TabScopes.Length; i++) 2173for (int i = 1; i < components.Length && tabClasses.Count > 0; i++) 2436for (int i = 0; i < tabAttribute.TabClasses.Length; i++) 2483for (int i = 0; i < tabAttribute.TabClasses.Length; i++) 2499if (i < newObjects.Length) 2502Array.Copy(_selectedObjects, i + 1, newObjects, i, newObjects.Length - i); 3455for (int i = 0; i < tabAttribute.TabClasses.Length; i++) 3501object[] newComponents = new object[components!.Length - 1]; 3503Array.Copy(components, index + 1, newComponents, index, components.Length - index - 1); 3508killTab = components is not null && components.Length == 0;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\CommandsPane.cs (7)
99verbCount = _verbs.Length; 167for (int i = 0; i < _verbs.Length; i++) 176if (component is null || verbs is null || verbs.Length == 0) 187for (int i = 0; i < verbs.Length; i++) 207Point[] links = new Point[_verbs!.Length]; 211for (int i = 0; i < _verbs.Length; i++) 233for (int i = 0; i < _verbs.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (10)
894if (objects is null || objects.Length == 0) 899return objects.Length == 1 949bool expandable = childProperties is not null && childProperties.Length > 0; 954if (childProperties is not null && childProperties.Length == _children.Count) 956for (int i = 0; i < childProperties.Length; i++) 1342entries = new GridEntry[objArray.Length]; 1344for (int i = 0; i < entries.Length; i++) 2106for (int i = 0; i < props.Length; i++) 2110newProperties ??= new PropertyDescriptor[props.Length]; 2119for (int i = 0; i < props.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridToolTip.cs (4)
19for (int i = 0; i < controls.Length; i++) 61for (int i = 0; i < _controls.Length; i++) 112for (int i = 0; i < _controls.Length; i++) 155for (int i = 0; i < _controls.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (8)
91for (int i = 0; i < _descriptors.Length; i++) 221for (int i = 1; i < _descriptors.Length; i++) 254object?[] values = new object?[components.Length]; 256for (int i = 0; i < components.Length; i++) 268for (int i = 0; i < _descriptors.Length; i++) 288for (int i = 0; i < _descriptors.Length; i++) 321for (int i = 0; i < _descriptors.Length; i++) 333for (int i = 0; i < _descriptors.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.MergedAttributeCollection.cs (4)
28_attributeCollections = new AttributeCollection[_owner._descriptors.Length]; 29for (int i = 0; i < _owner._descriptors.Length; i++) 35if (_attributeCollections.Length == 0) 53for (int i = 1; i < _attributeCollections.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.MultiMergeCollection.cs (4)
22public int Count => _items?.Length ?? 0; 40Array.Copy(_items, 0, array, index, _items.Length); 61if (_items is null || _items.Length != collection.Count) 69for (int i = 0; i < newItems.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (9)
159var copy = new IComponent[_objects.Length]; 160Array.Copy(_objects, 0, copy, 0, _objects.Length); 231for (int i = 0; i < ownerArray.Length; i++) 269if (objects is null || objects.Length == 0) 343if (owner1 is Array a1 && owner2 is Array a2 && a1.Length == a2.Length) 345for (int i = 0; i < a1.Length; i++) 367int length = _objects.Length; 387int length = _objects.Length;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.PropertyMerger.cs (7)
34for (int i = 0; i < entries.Length; i++) 66for (int i = 0; i < entries.Length; i++) 137int[] positions = new int[objectProperties.Length]; 146for (int j = 1; match && j < objectProperties.Length; j++) 232for (int i = 0; i < entries.Length; i++) 236newEntries ??= new MultiPropertyDescriptorGridEntry[entries.Length]; 246for (int i = 0; i < entries.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (11)
318for (int i = 0; i < _propertyValueUIItems.Length; i++) 412for (int i = 0; i < _propertyValueUIItems.Length; i++) 424|| (_propertyValueUIItems is not null && _propertyValueUIItems.Length > 0); 487for (int i = 0; i < _propertyValueUIItems.Length; i++) 523if (_uiItemRects is null || _uiItemRects.Length != _propertyValueUIItems.Length) 525_uiItemRects = new Rectangle[_propertyValueUIItems.Length]; 534for (int i = 0; i < _propertyValueUIItems.Length; i++) 546ownerGridView.LabelPaintMargin = (s_imageSize + 1) * _propertyValueUIItems.Length; 635if (objArray.Length > 0) 805if (owner is Array array && array.Length > 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (15)
1278if (index >= (values.Length - 1)) 1519for (int i = 0; i < values.Length; i++) 1521object currentValue = values[(i + index + 1) % values.Length]; 1708if (values.Length == 0) 1716for (int i = 0; i < values.Length; i++) 1830if (current >= target + targetEntries.Length) 2435for (int i = 0; i < values.Length; i++) 2469if (i == values.Length - 1) 3147if (delta > 0 && index >= (values.Length - 1)) 3153index = values.Length - 1; 3518for (int i = 0; i < entries.Length; i++) 3535int newArraySize = entries.Length + (e.NewChildCount - e.OldChildCount); 3547entries.Length - (parentIndex + e.OldChildCount + 1)); 3705if (rgItems is not null && rgItems.Length > 0) 3707for (int i = 0; i < rgItems.Length; i++)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
80for (int i = 0; i < currentAttributes.Length; i++)
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (8)
1200if (value is not null && value.Length > PInvoke.MAX_TAB_STOPS) 1215pf.cTabCount = (short)((value is null) ? 0 : value.Length); 1963if (characterSet.Length == 0) 2236int charSetLen = charSet.Length; 2834_editStream = new MemoryStream(encodedBytes.Length); 2835_editStream.Write(encodedBytes, 0, encodedBytes.Length); 2952result = Encoding.Unicode.GetString(bytes, 0, bytes.Length); 2957result = (CodePagesEncodingProvider.Instance.GetEncoding(0) ?? Encoding.UTF8).GetString(bytes, 0, bytes.Length);
System\Windows\Forms\Controls\TabControl\TabControl.cs (4)
1537int index = ((tabPages.Length > 0) && (SelectedIndex == -1)) ? 0 : SelectedIndex; 1551for (int i = 0; i < tabPages.Length; i++) 1615for (int i = 0; i < pages.Length; i++) 1878for (int i = 0; i < tabPages.Length; i++)
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (5)
615if (value is not null && value.Length > 0) 1880if (start > bytes.Length) 1882start = bytes.Length; 1885if (end > bytes.Length) 1887end = bytes.Length;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1794for (int i = 0; i < displayedItems.Length; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripItemCollection.cs (1)
128for (int i = 0; i < toolStripItems.Length; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (2)
146if (textFields.Length >= 1) 151if (textFields.Length >= 2)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (2)
536for (int i = 0; i < controls.Length; i++) 622for (int i = 0; i < controlArray.Length; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.ToolStripPanelRowCollection.cs (1)
57for (int i = 0; i < value.Length; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.cs (3)
98for (int i = 0; i < value.Length; i++) 288if (index >= array.Length || InnerList.Count > array.Length - index)
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (1)
1373for (int i = 0; i < paintRects.Length; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (3)
977Rectangle[] whiteRectangles = new Rectangle[s_baseSizeGripRectangles.Length]; 978Rectangle[] greyRectangles = new Rectangle[s_baseSizeGripRectangles.Length]; 980for (int i = 0; i < s_baseSizeGripRectangles.Length; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (1)
192for (int i = 0; ((i < toolStrip.Items.Count) && (i < keys.Length)); i++)
System\Windows\Forms\Controls\TreeView\ArraySubsetEnumerator.cs (1)
17Debug.Assert(array is null || count <= array.Length, "Trying to enumerate more than the array contains");
System\Windows\Forms\Controls\TreeView\TreeNode.cs (2)
1606if (_children is null || _children.Length == 0) 1610else if (_childCount + num > _children.Length)
System\Windows\Forms\Controls\TreeView\TreeNodeCollection.cs (5)
212if (nodes.Length == 0) 218if (tv is not null && nodes.Length > TreeNode.MAX_TREENODES_OPS) 228_owner.EnsureCapacity(nodes.Length); 229for (int i = nodes.Length - 1; i >= 0; i--) 235if (tv is not null && nodes.Length > TreeNode.MAX_TREENODES_OPS)
System\Windows\Forms\Controls\WebBrowser\HtmlElement.HtmlElementShim.cs (1)
91for (int i = 0; i < s_dispInterfaceTypes.Length && _cookie is null; i++)
System\Windows\Forms\Controls\WebBrowser\HtmlElementCollection.cs (2)
86int count = _elementsArray.Length; 152return _elementsArray is not null ? _elementsArray.Length : 0;
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (2)
233if (ctls.Length > 0 && _components is null) 239for (int i = 0; i < ctls.Length; i++)
System\Windows\Forms\DataBinding\BindingSource.cs (2)
976ListSortDescription[] sorts = new ListSortDescription[split.Length]; 977for (int i = 0; i < split.Length; i++)
System\Windows\Forms\DataBinding\Command.cs (4)
37Debug.Assert(s_cmds.Length > 0, "why is cmds.Length zero?"); 40int icmdLim = s_cmds.Length; 75icmd = s_cmds.Length; 156if (i < 0 || i >= s_cmds.Length)
System\Windows\Forms\DataBinding\ListBindingConverter.cs (4)
124int lastItem = ConstructorParameterProperties.Length - 1; 150Array.Copy(ConstructorParamaterTypes, 0, ctorParams, 0, ctorParams.Length); 167object?[] values = new object[ctorParams.Length]; 169for (int i = 0; i < values.Length; i++)
System\Windows\Forms\DataBinding\ListBindingHelper.cs (10)
93if (listAccessors is null || listAccessors.Length == 0 || listAccessors[0] is null) 151if (listAccessors is null || listAccessors.Length == 0) 185int len = (listAccessors is null) ? 1 : (listAccessors.Length + 1); 366if (startIndex >= listAccessors.Length) 418if (startIndex == listAccessors.Length) 452if (listAccessors.Length > startIndex) 471if (listAccessors.Length > startIndex + 1) 473int accessorsCount = listAccessors.Length - (startIndex + 1); 549for (int idx = 0; idx < props.Length; idx++) 551if (props[idx].GetIndexParameters().Length > 0 && props[idx].PropertyType != typeof(object))
System\Windows\Forms\DataBinding\RelatedCurrencyManager.cs (2)
79if (listAccessors is not null && listAccessors.Length > 0) 81accessors = new PropertyDescriptor[listAccessors.Length + 1];
System\Windows\Forms\DataBinding\RelatedPropertyManager.cs (2)
60if (listAccessors is not null && listAccessors.Length > 0) 62accessors = new PropertyDescriptor[listAccessors.Length + 1];
System\Windows\Forms\Design\ComponentEditorForm.cs (10)
90for (int n = 0; n < _pageSites.Length; n++) 107for (int n = 0; n < _pageSites.Length; n++) 199if (_pageSites is not null && _pageSites.Length != 0) 204for (int n = 0; n < _pageSites.Length; n++) 244for (int n = 0; n < _pageSites.Length; n++) 341_maxSize = new Size(3 * (BUTTON_WIDTH + BUTTON_PAD), 24 * _pageTypes.Length); 343_pageSites = new ComponentEditorPageSite[_pageTypes.Length]; 346for (int n = 0; n < _pageTypes.Length; n++) 364for (int n = 0; n < _pageSites.Length; n++) 383Debug.Assert((newPage >= 0) && (newPage < _pageSites.Length),
System\Windows\Forms\Design\EventsTab.cs (3)
126specifiedAttributesPlusContent = new Attribute[attributes.Length + 1]; 127Array.Copy(attributes, 0, specifiedAttributesPlusContent, 0, attributes.Length); 128specifiedAttributesPlusContent[attributes.Length] = DesignerSerializationVisibilityAttribute.Content;
System\Windows\Forms\Design\WindowsFormsComponentEditor.cs (1)
36if (pageControlTypes is null || pageControlTypes.Length == 0)
System\Windows\Forms\Dialogs\CommonDialogs\ColorDialog.cs (3)
77int[] result = new int[_customColors.Length]; 86if (value is not null && value.Length > 0) 88MemoryMarshal.Cast<int, COLORREF>(value)[..Math.Min(customColors.Length, value.Length)].CopyTo(customColors);
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (5)
165get => _fileNames is { } names && names.Length > 0 ? names[0] : string.Empty; 240if ((FilterIndex * 2) - 1 >= tokens.Length) 621for (int i = 0; i < fileNames.Length; i++) 628for (int j = 0; j < extensions.Length; j++) 763nMaxFile = (uint)_charBuffer.Length,
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.Vista.cs (5)
187if (filterItems.Length > 0) 191dialog->SetFileTypes((uint)filterItems.Length, fi); 211if (tokens.Length % 2 != 0) 216var extensions = new COMDLG_FILTERSPEC[tokens.Length / 2]; 220for (int i = 1; i < tokens.Length; i += 2)
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (3)
169get => _selectedPaths.Length > 0 ? _selectedPaths[0] : string.Empty; 179public string[] SelectedPaths => _selectedPaths.Length > 0 ? (string[])_selectedPaths.Clone() : []; 365if (_selectedPaths.Length > 0)
System\Windows\Forms\Dialogs\CommonDialogs\OpenFileDialog.cs (3)
189if (fullPaths is null || fullPaths.Length == 0) 194string[] safePaths = new string[fullPaths.Length]; 195for (int i = 0; i < safePaths.Length; ++i)
System\Windows\Forms\Dialogs\MessageBox.cs (4)
30if (t_helpInfoTable is not null && t_helpInfoTable.Length > 0) 86if (t_helpInfoTable.Length == 1) 92int newCount = t_helpInfoTable.Length - 1; 117lastCount = t_helpInfoTable.Length;
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogPage.cs (1)
889for (int i = 0; i < _boundCustomButtons.Length; i++)
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (2)
302- ((buttons.Length - startIndex) * _scaledButtonAlignmentWidth - _scaledButtonAlignmentPadding); 304for (int i = startIndex; i < buttons.Length; i++)
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.ControlItemAccessibleObject.cs (1)
132Debug.Assert(id.Length >= 3);
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (2)
580for (int i = 0; i < array.Length; i++) 657for (int i = 0; i < w.Length; i++)
System\Windows\Forms\Input\CursorConverter.cs (2)
103for (int i = 0; i < props.Length; i++) 164for (int i = 0; i < props.Length; i++)
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (7)
83Debug.Assert(_cols.Length != value.Length, "PERF: should not allocate strips, we've already got an array"); 97Debug.Assert(_rows.Length != value.Length, "PERF: should not allocate strips, we've already got an array"); 269LayoutInfo[] trimmedChildInfo = new LayoutInfo[childInfo.Length - nonParticipatingElements]; 270Array.Copy(childInfo, trimmedChildInfo, trimmedChildInfo.Length); 300for (int i = 0; i < _childInfo.Length; i++)
System\Windows\Forms\Layout\TableLayout.cs (34)
27if (array.Length > 1) 30sorter.QuickSort(0, array.Length - 1); 119CommonProperties.SetLayoutBounds(containerInfo.Container, new Size(SumStrips(containerInfo.Columns, 0, containerInfo.Columns.Length), 120SumStrips(containerInfo.Rows, 0, containerInfo.Rows.Length))); 180if (tempInfo.Columns is not null && containerInfo.Columns is not null && (tempInfo.Columns.Length != containerInfo.Columns.Length)) 185if (tempInfo.Rows is not null && containerInfo.Rows is not null && (tempInfo.Rows.Length != containerInfo.Rows.Length)) 226if (cols.Length != 0 && totalSpace.Width > usedSpace.Width) 231if (rows.Length != 0 && totalSpace.Height > usedSpace.Height) 473if (containerInfo.Rows is null || containerInfo.Rows.Length != numRows) 478if (containerInfo.Columns is null || containerInfo.Columns.Length != numColumns) 493for (int i = ++index; i < layoutInfo.Length; i++) 502index = layoutInfo.Length; 655for (int i = 0; i < strips.Length; i++) 739int colStop = Math.Min(layoutInfo.ColumnStart + layoutInfo.ColumnSpan, containerInfo.Columns.Length); 760for (int i = 0; i < strips.Length; i++) 780for (int i = 0; i < strips.Length; i++) 856int rowStop = Math.Min(layoutInfo.RowStart + layoutInfo.RowSpan, containerInfo.Rows.Length); 872for (int i = start; i < Math.Min(start + span, strips.Length); i++) 949if (!(i == strips.Length - 1) // this is not the last strip 1023for (int i = 0; i < strips.Length; i++) 1088totalPercentAllocatedSpace = maxSize - totalAbsoluteAndAutoSizeAllocatedSpace - (strips.Length * cellBorderWidth); 1093for (int i = 0; i < strips.Length; i++) 1117for (int i = 0; i < strips.Length; i++) 1151for (int i = 0; i < strips.Length; i++) 1169Debug.Assert((dontHonorConstraint || (usedSpace == SumStrips(strips, 0, strips.Length))), "Error computing usedSpace."); 1195for (int i = 0; i < childrenInfo.Length; i++) 1232for (; currentCol < colStop && currentCol < containerInfo.Columns.Length; currentCol++) 1246for (int rowIndex = currentRow; rowIndex < rowStop && rowIndex < containerInfo.Rows.Length; rowIndex++) 1429Debug.Assert((containerInfo.Columns is null && cols is null) || containerInfo.Columns!.Length == cols.Length, 1431Debug.Assert((containerInfo.Rows is null && rows is null) || containerInfo.Rows!.Length == rows.Length,
System\Windows\Forms\MDI\MDIClient.cs (1)
348if (childForm is null && MdiChildren.Length > 0 && MdiChildren[0].IsMdiChildFocusable)
System\Windows\Forms\MDI\MDIWindowDialog.cs (1)
44for (int i = 0; i < all.Length; i++)
System\Windows\Forms\MDI\MdiWindowListStrip.cs (2)
79if (forms is not null && forms.Length != 0) 99for (int i = 0; i < forms.Length; i++)
System\Windows\Forms\OLE\DataFormats.cs (2)
249if (s_formatList is null || s_formatList.Length <= s_formatCount + size) 293s_formatCount = s_formatList.Length;
System\Windows\Forms\OLE\DataObject.Composition.NativeToWinFormsAdapter.cs (3)
139index = s_serializedObjectID.Length; 142return new MemoryStream(bytes, index, bytes.Length - index); 486for (int i = 0; i < mappedFormats.Length; i++)
System\Windows\Forms\OLE\DataObject.Composition.WinFormsToNativeAdapter.cs (1)
370if (files is null || files.Length == 0)
System\Windows\Forms\OLE\DataObject.DataStore.cs (4)
54for (int i = 0; i < mappedFormats.Length; i++) 149for (int i = 0; i < formats.Length; i++) 176int baseVarLength = baseVar.Length; 185for (int j = 0; j < cur.Length; j++)
System\Windows\Forms\OLE\DataObject.FormatEnumerator.cs (1)
41for (int i = 0; i < formats.Length; i++)
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (10)
271int[] cw = new int[containerInfo.Columns.Length]; 272for (int i = 0; i < containerInfo.Columns.Length; i++) 293int[] rh = new int[containerInfo.Rows.Length]; 294for (int i = 0; i < containerInfo.Rows.Length; i++) 347int cols = colStrips.Length; 348int rows = rowStrips.Length; 508int lastRow = containerInfo.Rows.Length - 1; 509if (containerInfo.Rows.Length > 0) 515int lastColumn = containerInfo.Columns.Length - 1; 516if (containerInfo.Columns.Length > 0)
System\Windows\Forms\Printing\PrintPreviewControl.cs (8)
211value = Math.Min(value, _pageInfo.Length - (_rows * _columns)); 351if (_pageInfo is null || _pageInfo.Length == 0) 471if (_pageInfo.Length == 0) 643if (imageIndex < pages.Length) 675for (int i = 0; i < pageRenderArea.Length; i++) 677if (i + StartPage < pages.Length) 969else if (_pageInfo is not null && StartPage < _pageInfo.Length) 985StartPage = _pageInfo.Length;
System\Windows\Forms\Rendering\ScreenDcCache.cs (3)
47for (int i = 0; i < _itemsCache.Length; i++) 70for (int i = 0; i < _itemsCache.Length; i++) 88for (int i = 0; i < _itemsCache.Length; i++)
System\Windows\Forms\Screen.cs (1)
161for (int i = 0; i < screens.Length; i++)
System\Windows\Forms\SendKeys\SendKeys.cs (1)
350for (int i = 0; i < s_keywords.Length; i++)
System\Windows\Forms\StringSource.cs (2)
27_size = strings.Length; 71_size = _strings.Length;
System\Windows\Forms\ToolTip\ToolTip.cs (6)
486for (int i = 0; i < controls.Length; i++) 1568for (int i = 0; i < possibleLocations.Length; i++) 1583for (int i = 0; i < possibleLocations.Length; i++) 1598for (int i = 0; i < possibleLocations.Length; i++) 1616for (int i = 1; i < possibleLocations.Length; i++) 1784for (int i = 0; i < controls.Length; i++)
System\Windows\Forms\ToolTip\ToolTipBuffer.cs (1)
25if (_buffer is null || _buffer.Length < text.Length + 1)
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.FontConverter.cs (1)
99for (int tokenCount = 0; tokenCount < styleTokens.Length; tokenCount++)
System.Windows.Forms.Analyzers.Tests (2)
System\Windows\Forms\Analyzers\ApplicationConfigTests.FontStyle.cs (1)
17Assert.Equal(5, values.Length); // The values of Graphics unit: Regular, Bold, Italic, Underline, Strikeout.
System\Windows\Forms\Analyzers\ApplicationConfigTests.GraphicsUnit.cs (1)
18Assert.Equal(7, values.Length); // The values of Graphics unit: World, Display, Pixel, Point, Inch, Document, Millimeter.
System.Windows.Forms.Design (322)
System\ComponentModel\Design\ArrayEditor.cs (3)
35Array.Copy(valueArray, items, items.Length); 57Array newArray = Array.CreateInstance(CollectionItemType, value.Length); 58Array.Copy(value, newArray, value.Length);
System\ComponentModel\Design\BinaryEditor.cs (1)
79stream.Write(bytes, 0, bytes.Length);
System\ComponentModel\Design\ByteViewer.cs (9)
260int length = offset + _columnCount > _dataBuf.Length ? _dataBuf.Length % _columnCount : _columnCount; 283if (_dataBuf.Length is >= 0 and < 8) 322if (_dataBuf.Length > 1024) 328size = _dataBuf.Length / 2; 402bufferSize = PInvoke.MultiByteToWideChar(PInvoke.CP_ACP, 0, (PCSTR)pDataBuff, _dataBuf.Length, null, 0); 423_edit.Text = string.Create(_dataBuf.Length / sizeof(char) + 1, _dataBuf, static (text, dataBuf) => 478_linesCount = (_dataBuf.Length + _columnCount - 1) / _columnCount; 680if (line < 0 || line >= _linesCount || line > _dataBuf.Length / _columnCount)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (8)
64if (newItemTypes.Length > 1) 70for (int i = 0; i < newItemTypes.Length; i++) 167for (int i = 0; i < items.Length; i++) 260for (int i = 0; i < items.Length; i++) 678for (int i = 0; i < items.Length; i++) 690for (int i = 0; i < deadItems.Length; i++) 755for (int i = 0; i < items.Length; i++) 1051for (int i = 0; i < items.Length; i++)
System\ComponentModel\Design\CollectionEditor.cs (1)
392for (int i = 0; i < value.Length; i++)
System\ComponentModel\Design\DesignerActionList.cs (2)
44if (info.GetParameters().Length == 0 && !info.IsSpecialName) 72return attributes.Length > 0 ? attributes[0] : null;
System\ComponentModel\Design\DesignerActionListCollection.cs (1)
31for (int i = 0; i < value.Length; i++)
System\ComponentModel\Design\DesignSurface.cs (1)
165if (designerViews is null || designerViews.Length == 0)
System\ComponentModel\Design\EventBindingService.cs (2)
155if (args is not null && args.Length > 0) 157for (int i = 0; i < args.Length; i++)
System\ComponentModel\Design\InheritanceService.cs (2)
117if (fieldAttrs is not null && fieldAttrs.Length > 0) 119Debug.Assert(fieldAttrs.Length == 1, "Non-inheritable attribute has more than one copy");
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (3)
268if (surrogates.Length == value.Length) 273for (int i = 0; i < surrogates.Length; i++) 314int selectionLength = (i == surrogates.Length - 1)
System\ComponentModel\Design\ReferenceService.cs (1)
271for (int i = 0; i < references.Length; i++)
System\ComponentModel\Design\SelectionService.cs (1)
262_contextKeyword = (short)Math.Min(count, s_selectionKeywords.Length - 1);
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (15)
623for (int i = 0; i < indexes.Length; i++) 710for (int i = 0; i < parameters.Length; i++) 730Type[] paramTypes = new Type[delegateParams.Length]; 731for (int idx = 0; idx < paramTypes.Length; idx++) 851for (int i = 0; i < parameters.Length; i++) 1032for (int i = 0; i < indexes.Length; i++) 1077for (int i = 0; i < parameters.Length; i++) 1110for (int i = 0; i < indexes.Length; i++) 1696Debug.Assert(nameParts.Length > 0, "How can we fail to split when IndexOf succeeded?"); 1706for (int idx = 1; idx < nameParts.Length; idx++) 1941object?[] argumentValues = new object[arguments.Length]; 1944if (arguments.Length > 0) 1953for (int i = 0; i < arguments.Length; i++) 2015Debug.Assert(arguments.Length == 0, "Property serialization does not support arguments"); 2021Debug.Assert(arguments.Length == 0, "Field serialization does not support arguments");
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (2)
114if (attributes.Length > 0) 345if (method.GetParameters().Length == 1 && MethodSupportsSerialization(method))
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (9)
259if (instance is null && addToContainer && typeof(IComponent).IsAssignableFrom(type) && (argArray is null || argArray.Length == 0 || (argArray.Length == 1 && argArray[0] == Container))) 295Type?[] types = new Type?[argArray.Length]; 297for (int index = 0; index < argArray.Length; index++) 302object?[] tempArgs = new object?[argArray.Length]; 307if (parameters.Length == types.Length) 313for (int t = 0; t < types.Length; t++) 674for (int i = 0; i < propArray.Length; i++)
System\ComponentModel\Design\Serialization\EnumCodeDomSerializer.cs (1)
39needCast = (values.Length > 1);
System\Drawing\BitmapSelector.cs (1)
72assembly.GetCustomAttributes(attributeType, inherit: false).Length > 0;
System\Drawing\Design\ColorEditor.ColorPalette.cs (1)
78for (int i = 0; i < s_staticCells.Length; i++)
System\Drawing\Design\ColorEditor.ColorUI.cs (4)
106for (int i = 0; i < colors.Length; i++) 127for (int i = 0; i < props.Length; i++) 368for (int i = 0; i < values.Length; i++) 381for (int i = 0; i < values.Length; i++)
System\Drawing\Design\IconEditor.cs (4)
24if (extensions is null || extensions.Length == 0) 30for (int i = 0; i < extensions.Length; i++) 38if (i < extensions.Length - 1) 68Debug.Assert(s_imageExtenders.Length <= 0, "Why does IconEditor have subclasses if Icon doesn't?");
System\Drawing\Design\ImageEditor.cs (3)
27if (extensions is null || extensions.Length == 0) 33for (int i = 0; i < extensions.Length; i++) 43if (i != extensions.Length - 1)
System\Drawing\Design\ToolboxItem.cs (4)
226if (comps is not null && comps.Length > 0) 243if (comps is not null && comps.Length > 0) 284for (int i = 0; i < components.Length; i++) 299for (int index = 0; index < components.Length; index++)
System\Windows\Forms\Design\AnchorEditor.AnchorUI.cs (3)
312for (int i = 0; i < _picker._tabOrder.Length; i++) 317i = i < 0 ? i + _picker._tabOrder.Length : i % _picker._tabOrder.Length;
System\Windows\Forms\Design\Behavior\AdornerCollection.cs (1)
98for (int i = 0; (i < value.Length); i++)
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.cs (1)
184for (int i = 0; i < allFormats.Length; i++)
System\Windows\Forms\Design\Behavior\BehaviorService.cs (5)
782Marshal.Copy(bytes, 0, m.LParamInternal, bytes.Length); 783Marshal.Copy(nullBytes, 0, m.LParamInternal + (nint)bytes.Length, nullBytes.Length); 784m.ResultInternal = (LRESULT)((bytes.Length + nullBytes.Length) / sizeof(char));
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (14)
336for (int i = 0; i < lines.Length; i++) 370for (int k = 0; k < diffs.Length; k++) 447for (int i = 0; i < distances.Length; i++) 460for (int i = 0; i < distances.Length; i++) 781if (distances.Length == 0) 787for (int i = 0; i < distances.Length; i++) 805if (smallestIndex < distances.Length) 820for (int i = 0; i < lines.Length; i++) 1048if (snapLines is null || snapLines.Length == 0) 1179_recentLines = new Line[_vertLines.Length + _horzLines.Length]; 1181_horzLines.CopyTo(_recentLines, _vertLines.Length); 1193string[] lines = new string[recent.Length]; 1194for (int i = 0; i < recent.Length; i++)
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (11)
358if (_dragComponents is not null && _dragComponents.Length > 0) 363if (_dragComponents.Length == 1) 375transDesc = string.Format(performCopy ? SR.BehaviorServiceCopyControls : SR.BehaviorServiceMoveControls, _dragComponents.Length); 406for (int i = 0; i < _dragComponents.Length; i++) 484for (int i = 0; i < _dragComponents.Length; i++) 986for (int i = 0; i < _dragComponents.Length; i++) 1031for (int i = 0; i < _dragComponents.Length; i++) 1056if ((_dragComponents is not null) && (_dragComponents.Length > 0)) 1059for (int i = 0; i < _dragComponents.Length; i++) 1114for (int i = 0; i < _dragComponents.Length; i++) 1174for (int i = 0; i < _dragComponents.Length; i++)
System\Windows\Forms\Design\Behavior\GlyphCollection.cs (1)
59for (int i = 0; i < value.Length; i += 1)
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (9)
208for (int i = 0; i < _resizeComponents.Length; i++) 237if (_resizeComponents.Length == 1) 249locString = string.Format(SR.BehaviorServiceResizeControls, _resizeComponents.Length); 261else if (_resizeComponents.Length > 0) 378for (int i = 0; !_captureLost && i < _resizeComponents.Length; i++) 503if (_resizeComponents is null || _resizeComponents.Length == 0) 633for (int i = 0; i < _resizeComponents.Length; i++) 919if (_resizeComponents is not null && _resizeComponents.Length > 0) 928for (int i = 0; i < _resizeComponents.Length; i++)
System\Windows\Forms\Design\Behavior\SelectionManager.cs (10)
319if (currentSelectionBounds.Length >= previousSelectionBounds.Length) 333bool[] intersected = new bool[smaller.Length]; 334for (int i = 0; i < smaller.Length; i++) 345for (int s = 0; s < smaller.Length; s++) 369for (int k = 0; k < intersected.Length; k++) 383for (int i = 0; i < currentSelectionBounds.Length; i++) 436if (_currentSelectionBounds.Length > 0) 439for (int i = 1; i < _currentSelectionBounds.Length; i++) 456_previousSelectionBounds = _currentSelectionBounds.Length > 0 ? [.. _currentSelectionBounds] : null;
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (3)
211for (int i = startIndex + 1; ((i < _styles.Count) && (i < widths.Length)); i++) 222if (startIndex < widths.Length) 365for (int i = 0; i < updatedWidths.Length; i++)
System\Windows\Forms\Design\ColumnHeaderCollectionEditor.cs (2)
37ColumnHeader[] colHeaders = new ColumnHeader[value.Length]; 38Array.Copy(value, 0, colHeaders, 0, value.Length);
System\Windows\Forms\Design\CommandSet.cs (14)
210for (int i = 0; i < _commandSet.Length; i++) 355for (int i = 0; i < _commandSet.Length; i++) 458List<IComponent> list = new(components.Length); 1944if (componentNames is not null && idx < componentNames.Length) 2318trans = host?.CreateTransaction(string.Format(SR.CommandSetSize, selectedObjects.Length)); 2397trans = host.CreateTransaction(string.Format(SR.CommandSetSizeToGrid, selectedObjects.Length)); 2534trans = host.CreateTransaction(string.Format(SR.CommandSetFormatSpacing, selectedObjects.Length)); 2594for (int n = 0; n < selectedObjects.Length; n++) 2661for (int n = selectedObjects.Length - 1; n >= 0; n--) 2700? (lastSize.Width + lastLoc.X - curLoc.X - total) / (selectedObjects.Length - 1) 2701: (lastSize.Height + lastLoc.Y - curLoc.Y - total) / (selectedObjects.Length - 1); 2721for (int n = 0; n < selectedObjects.Length; n++) 3141for (int i = 0; i < _commandSet.Length; i++) 3218for (int i = 0; itemCount < 3 && i < _commandSet.Length; i++)
System\Windows\Forms\Design\ComponentTray.cs (2)
1353if (comps.Length == 0) 1701if (techs.Length > 0)
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (2)
324Type[] types = new Type[runtimeTypes.Length]; 326for (int i = 0; i < runtimeTypes.Length; i++)
System\Windows\Forms\Design\ControlCommandSet.cs (7)
270for (int i = 0; i < _commandSet.Length; i++) 347for (int i = 0; i < _commandSet.Length; i++) 998batchString = string.Format(SR.CommandSetBringToFront, selectedComponents.Length); 1002batchString = string.Format(SR.CommandSetSendToBack, selectedComponents.Length); 1010if (selectedComponents.Length > 0) 1012int len = selectedComponents.Length; 1351for (int i = 0; i < _commandSet.Length; i++)
System\Windows\Forms\Design\ControlDesigner.cs (2)
1629for (int i = 0; i < shadowProps.Length; i++) 2177if (techs.Length > 0)
System\Windows\Forms\Design\CustomMenuItemCollection.cs (1)
33for (int i = 0; (i < value.Length); i++)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (1)
546for (int i = 0; i < cols.Length; i++)
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (4)
213for (int i = 0; i < oldColumns.Length; i++) 243for (int i = 0; i < newColumns.Length; i++) 261for (int i = 0; i < newColumns.Length; i++) 272for (int i = 0; i < userAddedColumnsInfo.Length; i++)
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
369for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\DesignerActionVerbList.cs (1)
21for (int i = 0; i < _verbs.Length; i++)
System\Windows\Forms\Design\DesignerExtenders.cs (2)
30for (int i = 0; i < _providers.Length; i++) 44for (int i = 0; i < _providers.Length; i++)
System\Windows\Forms\Design\DockEditor.DockUI.cs (5)
230int maxI = _leftRightOrder.Length - 1; 248for (int i = 0; i < _tabOrder.Length; i++) 253i = i < 0 ? i + _tabOrder.Length : i % _tabOrder.Length; 272int maxI = _upDownOrder.Length - 1;
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (2)
191int len = types.Length; 201Debug.Assert(attrs is not null && attrs.Length == 1, $"Invalid number of GuidAttributes found on: {t.FullName}");
System\Windows\Forms\Design\DocumentDesigner.cs (4)
263for (int i = 0; i < dragComps.Length; i++) 1227for (int i = 0; i < types.Length; i++) 1290for (int i = 0; i < shadowProps.Length; i++) 1311for (int i = 0; i < noBrowseProps.Length; i++)
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (4)
585while (_insertionIndex < _childInfo.Length - 1 && _childInfo[_insertionIndex].InSelectionCollection) 599if (_insertionIndex != _childInfo.Length) 794|| _childInfo.Length == 0 815for (i = 0; i < _childInfo.Length; i++)
System\Windows\Forms\Design\FormDocumentDesigner.cs (1)
463for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ImageCollectionEditor.cs (2)
112if (value is null || value.Length == 0) 117for (int i = 0; i < value.Length; i++)
System\Windows\Forms\Design\ImageIndexEditor.cs (2)
154for (int i = 0; i < pathInfo.Length; i++) 169if (i == pathInfo.Length - 1)
System\Windows\Forms\Design\ImageListDesigner.cs (1)
114for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ListViewSubItemCollectionEditor.cs (1)
109for (int i = 0; i < value.Length; i++)
System\Windows\Forms\Design\MaskedTextBoxDesigner.cs (1)
174for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (5)
44IComponent[] components = new IComponent[_components.Length]; 45for (int i = 0; i < _components.Length; i++) 223trans = host.CreateTransaction(string.Format(SR.DragDropMoveComponents, _components.Length)); 241List<object> topComponents = new(_components.Length); 242for (int i = 0; i < _components.Length; i++)
System\Windows\Forms\Design\OleDragDropHandler.cs (8)
81for (int i = 0; dropOk && i < dragObjects.Length; i++) 256if (TryGetService(out ISelectionService? selSvc) && comps.Length > 0) 262for (int i = 0; i < comps.Length; i++) 338for (int i = 0; i < comps.Length; i++) 474for (int i = 0; i < components.Length; i++) 524trans = host.CreateTransaction(string.Format(SR.DragDropDragComponents, components.Length)); 723if (components is not null && components.Length > 0) 740for (int i = 0; i < components.Length; i++)
System\Windows\Forms\Design\ParentControlDesigner.cs (3)
614for (int i = 0; i < children.Length; i++) 1410for (int i = 0; i < dragComps.Length; i++) 1513for (int i = 0; i < dragComps.Length; i++)
System\Windows\Forms\Design\RichTextBoxDesigner.cs (1)
75for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\SelectionUIHandler.cs (13)
43_dragControls = new Control[components.Length]; 44for (int i = 0; i < components.Length; i++) 58for (int i = 0; i < components.Length; i++) 90Debug.Assert(bounds is not null && controls is not null && bounds.Length == controls.Length, "bounds->controls mismatch"); 96for (int i = 0; i < controls.Length; i++) 115for (int i = 0; i < controls.Length; i++) 258_originalCoordinates = new BoundsInfo[controls.Length]; 259for (int i = 0; i < controls.Length; i++) 270for (int i = 0; i < controls.Length; i++) 519for (int i = 0; i < controls.Length; i++) 543if (components is not null && components.Length > 0) 578return components is not null && components.Length > 0;
System\Windows\Forms\Design\SelectionUIService.cs (13)
258if (objects.Length > 1) 260transactionName = string.Format(SR.DragDropMoveComponents, objects.Length); 265if (objects.Length > 0) 282if (objects.Length > 1) 284transactionName = string.Format(SR.DragDropSizeComponents, objects.Length); 289if (objects.Length > 0) 306transactionName = string.Format(SR.DragDropDragComponents, objects.Length); 976if (objects.Length == 0) 996for (int i = 0; i < objects.Length; i++) 1124if (components.Length > 1 || (components.Length == 1 && comp is not null && comp.Site is null)) 1126trans = _host.CreateTransaction(string.Format(SR.DragDropMoveComponents, components.Length)); 1128else if (components.Length == 1)
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (2)
426Array.Copy(s_activeCursorArrays, _cursors, _cursors.Length); 427Array.Copy(s_activeSizeArray, _sizes, _sizes.Length);
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (1)
56Debug.Assert(s_validKeys.Distinct().Count() == s_validKeys.Length);
System\Windows\Forms\Design\StandardMenuStripVerb.cs (4)
122for (int j = 0; j < menuItemNames.Length; j++) 126for (int i = 0; i < menuArray.Length; i++) 198if (i == menuArray.Length - 1) 211if (j == menuItemNames.Length - 1)
System\Windows\Forms\Design\StringArrayEditor.cs (3)
29Array.Copy(valueArray, items, items.Length); 42Array newArray = Array.CreateInstance(CollectionItemType, value.Length); 43Array.Copy(value, newArray, value.Length);
System\Windows\Forms\Design\StringCollectionEditor.StringCollectionForm.cs (5)
146for (int i = 0; i < lines.Length; i++) 152if (lines.Length != Items.Length) 158for (int i = 0; i < lines.Length; ++i) 174Array.Resize(ref newLines, newLines.Length - 1);
System\Windows\Forms\Design\StyleEditorForm.cs (4)
530if (_tableLayoutPanel.ColumnStyles.Count > columnWidths.Length) 532int diff = _tableLayoutPanel.ColumnStyles.Count - columnWidths.Length; 539if (_tableLayoutPanel.RowStyles.Count > rowHeights.Length) 541int diff = _tableLayoutPanel.RowStyles.Count - rowHeights.Length;
System\Windows\Forms\Design\TabControlDesigner.cs (1)
471for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (31)
469rowProp?.SetValue(Table, Table.GetRowHeights().Length); 477colProp?.SetValue(Table, Table.GetColumnWidths().Length); 738int numRows = Table.GetRowHeights().Length; 739int numColumns = Table.GetColumnWidths().Length; 857if (cw.Length > 1) 863for (int i = 0; i < cw.Length - 1; i++) 878if (rh.Length > 1) 881for (int i = 0; i < rh.Length - 1; i++) 918if (cw.Length > Table.ColumnStyles.Count) 920int colDifference = cw.Length - Table.ColumnStyles.Count; 931if (rh.Length > Table.RowStyles.Count) 933int rowDifference = rh.Length - Table.RowStyles.Count; 982position.X = columns.Length; 989for (int i = 0; i < columns.Length; i++) 1005position.X = columns.Length; 1010for (int i = 0; i < columns.Length; i++) 1028position.Y = rows.Length; 1033for (int i = 0; i < rows.Length; i++) 1091for (int i = 0; i < cw.Length - 1; i++) 1126for (int i = 0; i < rh.Length - 1; i++) 1202_rowCountBeforeAdd = Math.Max(0, Table.GetRowHeights().Length); // don't want negative 1203_colCountBeforeAdd = Math.Max(0, Table.GetColumnWidths().Length); 1223for (int row = 0; row < rows.Length; row++) 1225for (int column = 0; column < columns.Length; column++) 1270if (dropPoint.Y < 0 || dropPoint.Y >= rows.Length || dropPoint.X < 0 || dropPoint.X >= columns.Length) 1342_rowCountBeforeAdd = Math.Max(0, Table.GetRowHeights().Length); // don't want negative 1343_colCountBeforeAdd = Math.Max(0, Table.GetColumnWidths().Length); 1972if ((isRow && rh.Length < index - 1) || (!isRow && ch.Length < index - 1)) 2106for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\TabOrder.cs (3)
614for (int i = 0; i < _tabGlyphs.Length; i++) 680for (int i = 0; i < _commands.Length; i++) 699for (int i = 0; i < _commands.Length; i++)
System\Windows\Forms\Design\TextBoxBaseDesigner.cs (1)
110for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\TextBoxDesigner.cs (1)
55for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripContainerDesigner.cs (2)
133if (internalControlIndex >= _panels.Length || internalControlIndex < 0) 446for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripContentPanelDesigner.cs (1)
90for (int i = 0; i < noBrowseEvents.Length; i++)
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1524parentPanel.Join(ToolStrip, parentPanel.Rows.Length); 2231for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (4)
322ToolStripItem[] items = new ToolStripItem[standardTypes.Length]; 323for (int i = 0; i < standardTypes.Length; i++) 346ToolStripItem[] items = new ToolStripItem[customTypes.Length]; 347for (int i = 0; i < customTypes.Length; i++)
System\Windows\Forms\Design\ToolStripDropDownDesigner.cs (1)
561for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (1)
1044for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
2290for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (3)
517for (int i = 0; i < noBrowseEvents.Length; i++) 560for (int i = 0; i < noBrowseProps.Length; i++) 572for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (4)
193for (int i = 0; i < _addCommands.Length; i++) 215for (int i = 0; i < _addCommands.Length; i++) 1240for (int i = 0; i < _commands.Length; i++) 1260for (int i = 0; i < _commands.Length; i++)
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (4)
413TreeNode[] nodes = new TreeNode[items.Length]; 415for (int i = 0; i < items.Length; i++) 438if (items.Length > 0 && nodes[0] is not null) 609for (int i = 0; i < values.Length; i++)
System\Windows\Forms\Design\UserControlDocumentDesigner.cs (1)
49for (int i = 0; i < shadowProps.Length; i++)
System.Windows.Forms.IntegrationTests.Common (1)
TestHelpers.cs (1)
248if (Directory.GetDirectories(currentDirectory, seek, SearchOption.TopDirectoryOnly).Length == 1)
System.Windows.Forms.Interop.Tests (1)
AccessibleObjectTests.cs (1)
726if (member is PropertyInfo property && property.GetGetMethod() is MethodInfo getter && getter.GetParameters() is var parameters && parameters.Length > 0)
System.Windows.Forms.Primitives (11)
System\Windows\Forms\Internals\UnicodeCharBuffer.cs (7)
20IntPtr result = Marshal.AllocCoTaskMem(_buffer.Length * 2); 21Marshal.Copy(_buffer, 0, result, _buffer.Length); 28while (i < _buffer.Length && _buffer[i] != 0) 34if (i < _buffer.Length) 45Marshal.Copy(ptr, _buffer, 0, _buffer.Length); 51int count = Math.Min(s.Length, _buffer.Length - _offset); 54if (_offset < _buffer.Length)
System\Windows\Forms\ObjectCache.cs (3)
30for (int i = 0; i < _itemsCache.Length; i++) 49for (int i = 0; i < _itemsCache.Length; i++) 68for (int i = 0; i < _itemsCache.Length; i++)
Windows\Win32\System\Com\ComSafeArrayScopeExtensions.cs (1)
21uint length = (uint)interfaces.Length;
System.Windows.Forms.Primitives.Tests (99)
Interop\Ole32\CADWORDTests.cs (4)
37cElems = (uint)values.Length, 38pElems = (uint*)Marshal.AllocCoTaskMem(sizeof(uint) * values.Length) 43Span<uint> elements = new(ca.pElems, values.Length); 44for (int i = 0; i < values.Length; i++)
Interop\Ole32\CALPOLESTRTests.cs (4)
37cElems = (uint)values.Length, 38pElems = (PWSTR*)Marshal.AllocCoTaskMem(IntPtr.Size * values.Length) 43Span<IntPtr> elements = new(ca.pElems, values.Length); 44for (int i = 0; i < values.Length; i++)
Interop\Oleaut32\ITypeInfoTests.cs (2)
145int[] rgDispId = new int[rgszNames.Length]; 149typeInfo.Value->GetIDsOfNames(pRgszNames, (uint)rgszNames.Length, pRgDispId);
Interop\Oleaut32\VARIANTTests.cs (80)
1213HRESULT hr = InitPropVariantFromBuffer(pResult, (uint)result.Length, &variant); 1248HRESULT hr = InitPropVariantFromBuffer(pResult, (uint)result.Length, &variant); 1276HRESULT hr = InitPropVariantFromInt16Vector(pResult, (uint)result.Length, &variant); 1304HRESULT hr = InitPropVariantFromUInt16Vector(pResult, (uint)result.Length, &variant); 1333HRESULT hr = InitPropVariantFromBooleanVector(pResult, (uint)boolResult.Length, &variant); 1361HRESULT hr = InitPropVariantFromInt32Vector(pResult, (uint)result.Length, &variant); 1389HRESULT hr = InitPropVariantFromUInt32Vector(pResult, (uint)result.Length, &variant); 1419HRESULT hr = InitPropVariantFromInt32Vector(pResult, (uint)result.Length, &variant); 1456HRESULT hr = InitPropVariantFromUInt32Vector(pResult, (uint)result.Length, &variant); 1491HRESULT hr = InitPropVariantFromInt64Vector(pResult, (uint)result.Length, &variant); 1519HRESULT hr = InitPropVariantFromUInt64Vector(pResult, (uint)result.Length, &variant); 1549HRESULT hr = InitPropVariantFromInt32Vector(pResult, (uint)result.Length, &variant); 1584HRESULT hr = InitPropVariantFromDoubleVector(pResult, (uint)result.Length, &variant); 1614HRESULT hr = InitPropVariantFromUInt32Vector(pResult, (uint)result.Length, &variant); 1651HRESULT hr = InitPropVariantFromInt64Vector(pResult, (uint)result.Length, &variant); 1692HRESULT hr = InitPropVariantFromDoubleVector(pResult, (uint)result.Length, &variant); 1732HRESULT hr = InitPropVariantFromFileTimeVector(pResult, (uint)fileTimeResult.Length, &variant); 1762HRESULT hr = InitPropVariantFromBuffer(pResult, (uint)(result.Length * sizeof(Guid)), &variant); 1798HRESULT hr = InitPropVariantFromInt32Vector(pResult, (uint)result.Length, &variant); 1804HRESULT hr = InitPropVariantFromInt64Vector(pResult, (uint)result.Length, &variant); 1840HRESULT hr = InitPropVariantFromInt32Vector(pResult, (uint)result.Length, &variant); 1846HRESULT hr = InitPropVariantFromInt64Vector(pResult, (uint)result.Length, &variant); 1882HRESULT hr = InitPropVariantFromInt32Vector(pResult, (uint)result.Length, &variant); 1888HRESULT hr = InitPropVariantFromInt64Vector(pResult, (uint)result.Length, &variant); 1924HRESULT hr = InitPropVariantFromBuffer(pResult, (uint)(result.Length * sizeof(VARIANT)), &variant); 2011Assert.Equal(result.Length, array.GetLength(0)); 2030Assert.Equal(result.Length, array.GetLength(0)); 2100Assert.Equal(result.Length, array.GetLength(0)); 2117Assert.Equal(result.Length, array.GetLength(0)); 2207Assert.Equal(result.Length, array.GetLength(0)); 2232Assert.Equal(result.Length, array.GetLength(0)); 2322Assert.Equal(result.Length, array.GetLength(0)); 2347Assert.Equal(result.Length, array.GetLength(0)); 2437Assert.Equal(result.Length, array.GetLength(0)); 2462Assert.Equal(result.Length, array.GetLength(0)); 2552Assert.Equal(result.Length, array.GetLength(0)); 2577Assert.Equal(result.Length, array.GetLength(0)); 2654Assert.Equal(result.Length, array.GetLength(0)); 2679Assert.Equal(result.Length, array.GetLength(0)); 2769Assert.Equal(result.Length, array.GetLength(0)); 2794Assert.Equal(result.Length, array.GetLength(0)); 2871Assert.Equal(result.Length, array.GetLength(0)); 2896Assert.Equal(result.Length, array.GetLength(0)); 2986Assert.Equal(result.Length, array.GetLength(0)); 3011Assert.Equal(result.Length, array.GetLength(0)); 3088Assert.Equal(result.Length, array.GetLength(0)); 3113Assert.Equal(result.Length, array.GetLength(0)); 3203Assert.Equal(result.Length, array.GetLength(0)); 3228Assert.Equal(result.Length, array.GetLength(0)); 3305Assert.Equal(result.Length, array.GetLength(0)); 3330Assert.Equal(result.Length, array.GetLength(0)); 3419Assert.Equal(result.Length, array.GetLength(0)); 3444Assert.Equal(result.Length, array.GetLength(0)); 3534Assert.Equal(result.Length, array.GetLength(0)); 3559Assert.Equal(result.Length, array.GetLength(0)); 3649Assert.Equal(result.Length, array.GetLength(0)); 3674Assert.Equal(result.Length, array.GetLength(0)); 3764Assert.Equal(result.Length, array.GetLength(0)); 3789Assert.Equal(result.Length, array.GetLength(0)); 3886Assert.Equal(expected.Length, array.GetLength(0)); 3912Assert.Equal(expected.Length, array.GetLength(0)); 4019Assert.Equal(expected.Length, array.GetLength(0)); 4045Assert.Equal(expected.Length, array.GetLength(0)); 4148Assert.Equal(expected.Length, array.GetLength(0)); 4173Assert.Equal(expected.Length, array.GetLength(0)); 4268Assert.Equal(expected.Length, array.GetLength(0)); 4293Assert.Equal(expected.Length, array.GetLength(0)); 4398Assert.Equal(result.Length, array.GetLength(0)); 4425Assert.Equal(result.Length, array.GetLength(0)); 4530Assert.Equal(result.Length, array.GetLength(0)); 4567Assert.Equal(result.Length, array.GetLength(0)); 4712Assert.Equal(result.Length, array.GetLength(0)); 4749Assert.Equal(result.Length, array.GetLength(0)); 4895Assert.Equal(result.Length, array.GetLength(0)); 4933Assert.Equal(result.Length, array.GetLength(0)); 5101Assert.Equal(result.Length, array.GetLength(0)); 5153Assert.Equal(result.Length, array.GetLength(0)); 5419cElements = (uint)result.Length, 5431for (int i = 0; i < result.Length; i++) 5743cElements = (uint)result.Length,
System\Windows\Forms\Automation\UiaTextProviderTests.cs (1)
79for (int i = 0; i < expected.Length; i++)
System\Windows\Forms\Automation\UiaTextRangeTests.cs (4)
749Assert.True(expected.Length == actual.Length); 750for (int i = 0; i < expected.Length; i++) 831Assert.True(expected.Length == actual.Length); 832for (int i = 0; i < expected.Length; i++)
Windows\Win32\System\Com\IDispatchTests.cs (2)
25int[] rgDispId = new int[rgszNames.Length]; 29picture.Value->GetIDsOfNames(&riid, pRgszNames, (uint)rgszNames.Length, PInvokeCore.GetThreadLocale(), pRgDispId);
Windows\Win32\System\Com\SafeArrayScopeTests.cs (2)
13Assert.Equal(intArray.Length, scope.Length); 14for (int i = 0; i < intArray.Length; i++)
System.Windows.Forms.Primitives.TestUtilities (8)
Extensions\AssertExtensions.cs (1)
445int expectedCount = expectedArray.Length;
Metafiles\DataHelpers.cs (4)
16if (values.Length % 2 != 0) 19Point[] points = new Point[values.Length / 2]; 23Unsafe.CopyBlock(p, i, (uint)(sizeof(int) * values.Length)); 32for (int i = 0; i < points.Length; i++)
Metafiles\RecordTypes\EMREXTSELECTCLIPRGN.cs (1)
43for (int i = 0; i < clippingRects.Length; i++)
Metafiles\Validators\EmfValidator.cs (1)
35currentValidator = currentIndex < validationSteps.Length
Metafiles\Validators\Poly16Validator.cs (1)
36Assert.Equal(_points.Length, (int)poly->cpts);
System.Windows.Forms.Tests (63)
SerializableTypesTests.cs (2)
29writer.Write(bytes.Length); 64bufferStream.Read(buffer, 0, buffer.Length);
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (8)
1124Assert.Equal(3, columnHeaders.Length); 1143Assert.Equal(2, columnHeaders.Length); 1161Assert.Equal(2, columnHeaders.Length); 1179Assert.Equal(2, columnHeaders.Length); 1215Assert.Equal(3, rowHeaders.Length); 1235Assert.Equal(2, rowHeaders.Length); 1254Assert.Equal(2, rowHeaders.Length); 1273Assert.Equal(2, rowHeaders.Length);
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarBodyAccessibleObjectTests.cs (2)
89Assert.Equal(7, accessibleObject.GetColumnHeaders().Length); // Contains days of week 295rowHeaders.Length.Should().Be(expectedCount);
System\Windows\Forms\CheckedListBox.CheckedIndexCollectionTests.cs (6)
62for (int i = 0; i < items.Length; i++) 85for (int i = 0; i < items.Length; i++) 106for (int i = 0; i < items.Length; i++) 112int[] array = new int[items.Length]; 127for (int i = 0; i < items.Length; i++) 149for (int i = 0; i < items.Length; i++)
System\Windows\Forms\CheckedListBox.CheckedItemCollectionTests.cs (2)
60for (int i = 0; i < items.Length; i++) 96object[] array = new object[items.Length];
System\Windows\Forms\DomainUpDownTests.cs (1)
1392s.Should().Contain($"Items.Count: {items.Length}");
System\Windows\Forms\FileDialogTests.cs (2)
278if (expectedFileNames.Length > 0) 293if (expectedFileNames.Length > 0)
System\Windows\Forms\FolderBrowserDialogTests.cs (2)
166if (expectedSelectedPaths.Length > 0) 180if (expectedSelectedPaths.Length > 0)
System\Windows\Forms\KeysConverterTests.cs (1)
156Assert.Equal(expectedValues.Length, standardValuesCollection.Count);
System\Windows\Forms\ListBoxTests.cs (2)
3346Marshal.Copy(GetSelResult, 0, m.LParam, GetSelResult.Length); 3347m.Result = GetSelResult.Length;
System\Windows\Forms\ListViewItemTests.cs (4)
1055if (expected is null || expected.Length == 0) 1062Assert.Equal(expected.Length, actual.Length); 1063for (int i = 0; i < expected.Length; i++)
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (1)
94DateTime end = dates.Length > 1 ? DateTime.Parse(dates[1]) : start;
System\Windows\Forms\MonthCalendarTests.cs (13)
203if (value?.Length > 0) 218if (value?.Length > 0) 246if (value?.Length > 0) 264if (value?.Length > 0) 531if (value?.Length > 0) 546if (value?.Length > 0) 574if (value?.Length > 0) 592if (value?.Length > 0) 1557if (value?.Length > 0) 1572if (value?.Length > 0) 1600if (value?.Length > 0) 1618if (value?.Length > 0) 4480((DateTime[])typeof(MonthCalendar).GetProperty(propertyName).GetValue(calendar)).Length.Should().Be(expectedCount);
System\Windows\Forms\RichTextBoxTests.cs (14)
4741for (int i = 0; i < faceName.Length; i++) 4781for (int i = 0; i < faceName.Length; i++) 6229for (int i = 0; i < tabs.Length; i++) 6879string oldWayExpectedText = testCaseData.Length > 2 ? (string)testCaseData[2] : SAME; 6880string oldControlExpectedText = testCaseData.Length > 3 ? (string)testCaseData[3] : SAME; 8566stream.Write(buffer, 0, buffer.Length); 8609stream.Write(buffer, 0, buffer.Length); 8628stream.Write(buffer, 0, buffer.Length); 8653stream.Write(buffer, 0, buffer.Length); 8696stream.Write(buffer, 0, buffer.Length); 8715stream.Write(buffer, 0, buffer.Length); 8730stream.Write(buffer, 0, buffer.Length); 8747stream.Write(buffer, 0, buffer.Length); 8800stream.Write(buffer, 0, buffer.Length);
System\Windows\Forms\SystemInformationTests.cs (1)
513Assert.Equal(count, Screen.AllScreens.Length);
System\Windows\Forms\ToolStripDropDownItemTests.cs (1)
352Assert.Equal(expectedDropDownItems.Length > 0, item.HasDropDownItems);
System\Windows\Forms\ToolStripPanel.ToolStripPanelRowCollectionTests.cs (1)
28int length = rows.Length;
System.Windows.Forms.UI.IntegrationTests (18)
DragDropTests.cs (2)
1052&& fileNames.Length > 0 && fileNames[0].Contains(DragAcceptRtf)) 1067&& fileNames.Length > 0 && fileNames[0].Contains(DragAcceptRtf))
Infra\ScreenRecordService.cs (7)
169WriteActl(fileStream, buffer, crc, croppedFrames.Length, playCount: 1); 180for (int i = 1; i < croppedFrames.Length; i++) 242List<(TimeSpan elapsed, Bitmap image, Size offset)> resultFrames = new(frames.Length); 256for (int i = 1; i < frames.Length; i++) 540if (bytes.Length < buffer.Length) 547for (ReadOnlySpan<byte> remaining = bytes; !remaining.IsEmpty; remaining = remaining[Math.Min(buffer.Length, remaining.Length)..]) 549ReadOnlySpan<byte> current = remaining[..Math.Min(buffer.Length, remaining.Length)];
Input\KeyboardSimulator.cs (8)
93if (modifierArray.Length == 0 && keyArray.Length == 0) 98Span<INPUT> inputs = stackalloc INPUT[modifierArray.Length * 2 + keyArray.Length * 2]; 99for (int i = 0; i < modifierArray.Length; i++) 105for (int i = 0; i < keyArray.Length; i++) 107inputs[modifierArray.Length + i] = InputBuilder.KeyDown(keyArray[i]); 108inputs[modifierArray.Length + i + 1] = InputBuilder.KeyUp(keyArray[i]);
TabControlTests.cs (1)
116for (int i = 0; i < originalPages.Length; i++)
System.Xaml (97)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (4)
143for (int i = assemblies.Length - 1; i >= 0; i--) 266if (reqKeyToken.Length == curKeyToken.Length) 270for (int i = 0; i < reqKeyToken.Length; i++)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (8)
1293public override int Capacity => _entries.Length; 1299if (_count < _entries.Length) 1306int size = _entries.Length; 1322Array.Copy(_entries, 0, destEntries, 0, _entries.Length); 1344if (_count < _entries.Length) 1467if (_entries.Length >= oldCount) 1497ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _entries.Length); 1528if (newCapacity + (newCapacity >> 2) >= _sourceArray.Length)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
92if (nameFrags.Length == 1)
System\Xaml\Context\XamlContext.cs (1)
275for (int i = 0; i < typeArgs.Length; i++)
System\Xaml\Context\XamlParserContext.cs (2)
175if (parInfo.Length >= parameterCount) 177parameterCount = parInfo.Length;
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1126for (int i = 0; i < args.Length; i++)
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
258for (int i = 0; i < attributes.Length; i++)
System\Xaml\Parser\GenericTypeNameScanner.cs (1)
359Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\MeScanner.cs (3)
552Debug.Assert(KnownStrings.WhitespaceChars.Length == 5); 612IsConstructorParsingMode = context.CurrentLongestConstructorOfMarkupExtension.Length > 0; 613MaxConstructorParams = context.CurrentLongestConstructorOfMarkupExtension.Length;
System\Xaml\Parser\NodeStreamSorter.cs (6)
472_sortingInfoArray = new ReorderInfo[_originalNodesInOrder.Length]; 476for (int i = 0; i < _originalNodesInOrder.Length; i++) 507for (int idx = 0; idx < _sortingInfoArray.Length; idx++) 564while (idx < _sortingInfoArray.Length 674for (int idx = start + 1; idx < _sortingInfoArray.Length; idx++) 692end =_sortingInfoArray.Length;
System\Xaml\Parser\XamlText.cs (1)
362for (int i = 0; i < EastAsianCodePointRanges.Length; i++)
System\Xaml\RefOnly\LooseTypeExtensions.cs (2)
94for (int i = 0; i < genericParameterConstraints.Length; i++) 110for (int i = 0; i < interfaces.Length; i++)
System\Xaml\Replacements\TypeListConverter.cs (2)
28Type[] types = new Type[tl.Length]; 29for (int i = 0; i < tl.Length; i++)
System\Xaml\Runtime\ClrObjectRuntime.cs (3)
114if (args == null || args.Length == 0) 125methods = new MethodBase[members.Length]; 126Array.Copy(members, methods, members.Length);
System\Xaml\Runtime\DynamicMethodRuntime.cs (8)
198if (args == null || args.Length == 0) 349if (args.Length == 0) 357Type[] paramTypes = new Type[parameters.Length]; 358LocalBuilder[] locals = new LocalBuilder[paramTypes.Length]; 359for (int i = 0; i < parameters.Length; i++) 392for (int i = 0; i < locals.Length; i++) 566Emit_ConstInt(ilGenerator, paramArgNums.Length); 570for (int i = 0; i < paramArgNums.Length; i++)
System\Xaml\Schema\CollectionReflector.cs (2)
308if (paramInfos == null || paramInfos.Length != paramCount) 353if (method.GetParameters().Length == argCount)
System\Xaml\Schema\Reflector.cs (6)
72if (attributes.Length == 0) 135if (attributes.Length == 0) 169if (attributes.Length == 0) 207if (attributes.Length == 0) 248if (attributes.Length == 0) 280if (attributes.Length == 0)
System\Xaml\Schema\TypeReflector.cs (13)
457knownMembers = new List<XamlMember>(propList.Length + eventList.Length); 473Dictionary<string, PropertyInfo> result = new Dictionary<string, PropertyInfo>(propList.Length); 474for (int i = 0; i < propList.Length; i++) 477if (currentProp.GetIndexParameters().Length > 0) 534Dictionary<string, EventInfo> result = new Dictionary<string, EventInfo>(eventList.Length); 535for (int i = 0; i < eventList.Length; i++) 589if (pi.GetIndexParameters().Length == 0) 900return (pmi.Length == 1) && (mi.ReturnType != typeof(void)); 922return (pmi.Length == 2); 945return (pmi.Length == 2) && typeof(Delegate).IsAssignableFrom(pmi[1].ParameterType); 1052if (objs.Length == 0) 1056if (objs.Length > 1)
System\Xaml\Schema\XamlNamespace.cs (5)
62if (typeArgs == null || typeArgs.Length == 0) 99Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types."); 105typeName = MangleGenericTypeName(typeName, typeArgs.Length); 156var clrTypeArgs = new Type[typeArgs.Length]; 157for (int n = 0; n < typeArgs.Length; n++)
System\Xaml\Schema\XamlTypeInvoker.cs (1)
132if (!_xamlType.UnderlyingType.IsValueType && (arguments == null || arguments.Length == 0))
System\Xaml\XamlBackgroundReader.cs (1)
113get { return _inIdx >= _incoming.Length; }
System\Xaml\XamlMember.cs (5)
654if (parameters.Length > 0) 805if ((method.GetParameters().Length != 1) || (method.ReturnType == typeof(void))) 813if ((method != null) && (method.GetParameters().Length != 2)) 876if (attribs.Length > 0) 975if (parameters.Length == 2)
System\Xaml\XamlObjectReader.cs (4)
1275if (arguments.Count != methodParams.Length) 1644if (constructorParameters.Length != ctorArgProps.Count) { continue; } 1646IList constructorArguments = new List<object>(constructorParameters.Length); 1647for (int i = 0; i < constructorParameters.Length; i++)
System\Xaml\XamlSchemaContext.cs (2)
316if (typeArguments == null || typeArguments.Length == 0) 1035_unexaminedAssemblies = new WeakReferenceList<Assembly>(currentAssemblies.Length);
System\Xaml\XamlType.cs (12)
921if (addParams.Length == 2) 940if (addParams.Length == 2) 944else if (addParams.Length == 1) 1185Debug.Assert(typeArgs.Length == 1); 1225Debug.Assert(typeArgs.Length == 1); 1498XamlType[] result = new XamlType[types.Length]; 1499for (int i = 0; i < types.Length; i++) 1584XamlType[] typeVector = new XamlType[parameterInfos.Length]; 1585for (int i = 0; i < parameterInfos.Length; i++) 1592if (ctorDict.ContainsKey(typeVector.Length)) 1596throw new XamlSchemaException(SR.Format(SR.MarkupExtensionWithDuplicateArity, UnderlyingType, typeVector.Length)); 1602ctorDict.Add(typeVector.Length, GetReadOnly(typeVector));
System\Xaml\XamlXmlWriter.cs (2)
1903if (constructorParameters.Length != ctorArgProps.Count) 1908for (int i = 0; i < constructorParameters.Length; i++)
TaskUsageLogger (3)
TaskUsageLogger.cs (3)
93if (parameters.Length != 1) 387if (parts.Length > 1 && String.Equals(name1, parts[parts.Length - 1], StringComparison.OrdinalIgnoreCase))
Templates.Blazor.Tests (17)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
95if (builtPackages.Length == 0) 100Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Blazor.WebAssembly.Auth.Tests (17)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
95if (builtPackages.Length == 0) 100Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Blazor.WebAssembly.Tests (17)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
95if (builtPackages.Length == 0) 100Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Mvc.Tests (17)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
95if (builtPackages.Length == 0) 100Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Tests (17)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
95if (builtPackages.Length == 0) 100Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
157if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 555Array.Clear(keyBytes, 0, keyBytes.Length); 556Array.Clear(pem, 0, pem.Length); 562Array.Clear(keyBytes, 0, keyBytes.Length); 563Array.Clear(pem, 0, pem.Length); 613Array.Clear(bytes, 0, bytes.Length); 641Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
157Array.Clear(export, 0, export.Length); 539if (availableCommands.Count == commands.Length)
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
TestDiscoveryWorker (1)
Program.cs (1)
22if (args.Length != 1)
TestingAppHost1.MyWebApp (1)
Program.cs (1)
30summaries[Random.Shared.Next(summaries.Length)]
TestProject.AppHost (2)
TestProgram.cs (2)
25for (int i = 0; i < args.Length; i++) 29if (args.Length > i + 1)
TestTasks (1)
InjectRequestHandler.cs (1)
21if (args.Length > 1)
UIAutomationClient (67)
MS\Internal\Automation\ClientEventManager.cs (2)
145int[] propertiesAsInts = new int[properties.Length]; 146for (int i = 0; i < properties.Length; i++)
MS\Internal\Automation\MenuTracker.cs (2)
76Debug.Assert(handlers.Length <= 1, "handlers.Length"); 77if( handlers.Length > 0 )
MS\Internal\Automation\Misc.cs (8)
51int l = a1.Length; 53if (l != a2.Length) 85totalLength += a.Length; 93int l = a.Length; 106if (a.Length == 0) 114for (int src = 1; src < a.Length; src++) 126if (newLength == a.Length) 695for (int source = 0; source < ach.Length; source++)
MS\Internal\Automation\ProxyManager.cs (4)
106for( int i = 0 ; i < _pseudoProxies.Length ; i++ ) 724for( int i = proxyInfo.Length - 1; i >= 0; i-- ) 731for( int j = 0 ; j < _pseudoProxyClassNames.Length ; j++ ) 801if ( index >= QUERYCLASSNAME_BASE && index - QUERYCLASSNAME_BASE < _classNames.Length )
MS\Internal\Automation\Schema.cs (2)
197AutomationElement[] els = new AutomationElement[objArr.Length]; 198for (int i = 0; i < objArr.Length; i++)
MS\Internal\Automation\UiaCoreApi.cs (22)
144IntPtr dataStart = Marshal.AllocCoTaskMem((properties.Length + patterns.Length) * sizeof(int)); 149_propertyCount = properties.Length; 150for (int i = 0; i < properties.Length; i++) 156_patternCount = patterns.Length; 157for (int i = 0; i < patterns.Length; i++) 226for (int propertyIndex = 0; propertyIndex < request.Properties.Length; propertyIndex++) 250int patternBaseIndex = 1 + request.Properties.Length; 251for (int patternIndex = 0; patternIndex < request.Patterns.Length; patternIndex++) 460Debug.Assert(offsets.Length == treeStructures.Length); 463UiaCacheResponse[] responses = new UiaCacheResponse[treeStructures.Length]; 466for (int i = 0; i < treeStructures.Length; i++) 469int endRow = i < treeStructures.Length - 1 ? offsets[i + 1] : requestedData.GetLength(0); 591CheckError(RawUiaAddEvent(hnode, eventId, callback, scope, properties, properties == null ? 0 : properties.Length, miniCR, out hevent)); 878SafeTextRangeHandle[] result = new SafeTextRangeHandle[arr.Length]; 879for (int i = 0; i < arr.Length; i++) 894SafeTextRangeHandle[] result = new SafeTextRangeHandle[arr.Length]; 895for (int i = 0; i < arr.Length; i++) 1021int count = doubles.Length / 4; 1022int leftover = doubles.Length % 4; 1121if (arr == null || arr.Length != 2)
MS\Internal\Automation\WindowHideOrCloseTracker.cs (2)
90Debug.Assert(handlers.Length <= 1, "handlers.Length"); 91if ( handlers.Length > 0 )
MS\Internal\Automation\WindowShowOrOpenTracker.cs (2)
88Debug.Assert(handlers.Length <= 1, "handlers.Length"); 89if (handlers.Length > 0)
MS\Internal\Automation\WinEventWrap.cs (3)
37Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid"); 39_hHooks = new IntPtr[_eventIds.Length]; 134for (int i=0;i<_hHooks.Length;i++)
System\Windows\Automation\AndCondition.cs (2)
40Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) ); 52SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.And, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\Automation.cs (1)
236if (properties.Length == 0)
System\Windows\Automation\AutomationElement.cs (8)
339for (int i = 0; i < id.Length; i++) 763if (responses.Length < 1) 768Debug.Assert(responses.Length == 1); 788AutomationElement[] els = new AutomationElement[responses.Length]; 790for( int i = 0 ; i < responses.Length ; i ++ ) 815if (patterns != null && patterns.Length > 0) 1241int dataOffset = isProperty ? 1 : 1 + _request.Properties.Length; 1242for (int i = 0; i < refTable.Length; i++)
System\Windows\Automation\AutomationElementCollection.cs (1)
93return _elements.Length;
System\Windows\Automation\Condition.cs (2)
68IntPtr mem = Marshal.AllocCoTaskMem(conditions.Length * IntPtr.Size); 77for (int i = 0; i < conditions.Length; i++)
System\Windows\Automation\OrCondition.cs (2)
39Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) ); 51SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.Or, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\Text\TextRange.cs (4)
85TextPatternRange[] ranges = new TextPatternRange[hTextRanges.Length]; 86for (int i = 0; i < hTextRanges.Length; i++) 410AutomationElement[] wrappedChildren = new AutomationElement[rawChildren.Length]; 411for (int i = 0; i < rawChildren.Length; i++)
UIAutomationClientSideProviders (68)
MS\Internal\AutomationProxies\Accessible.cs (6)
572if (accChildren != null && 0 <= index && index < accChildren.Length) 649children = new Accessible[objs.Length]; 650for (int i=0;i<objs.Length;i++) 994if (index >= children.Length) 995index = children.Length - 1; 1021for (int i=0;i<children.Length;i++)
MS\Internal\AutomationProxies\EventManager.cs (1)
484if (currentRanges != null && currentRanges.Length > 0)
MS\Internal\AutomationProxies\Misc.cs (7)
66int len = baseID.Length; 78double[] doubles = new double[rectArray.Length * 4]; 80for (int i = 0; i < rectArray.Length; i++) 141int l = a1.Length; 143if (l != a2.Length) 1074if (index >= QUERYCLASSNAME_BASE && index - QUERYCLASSNAME_BASE < _asClassNames.Length) 1659for (int source = 0; source < ach.Length; source++)
MS\Internal\AutomationProxies\MSAANativeProvider.cs (8)
277properties = new AutomationProperty[propertiesAsInts.Length]; 278for (int i = 0; i < propertiesAsInts.Length; i++) 295properties = new AutomationProperty[propertiesAsInts.Length]; 296for (int i = 0; i < propertiesAsInts.Length; i++) 395rval = new int[parentId.Length + 1]; 406rval[rval.Length - 1] = _acc.AccessibleChildrenIndex(Parent._acc); 580IRawElementProviderSimple [] rawEPS= new IRawElementProviderSimple[accessibles.Length]; 581for (int i=0;i<accessibles.Length;i++)
MS\Internal\AutomationProxies\MSAAWinEventWrap.cs (1)
96for (int i=0;i<_hHooks.Length;i++)
MS\Internal\AutomationProxies\ProxyHwnd.cs (5)
307properties = new AutomationProperty[propertiesAsInts.Length]; 308for (int i = 0; i < propertiesAsInts.Length; i++) 325properties = new AutomationProperty[propertiesAsInts.Length]; 326for (int i = 0; i < propertiesAsInts.Length; i++) 533for (int i = 0; evtId != null && i < evtId.Length; i++)
MS\Internal\AutomationProxies\WindowsHyperlink.cs (3)
301for (int source = 0; source < ach.Length; source++) 305if (source + 1 < ach.Length && ach[source] == '<' && (ach[source + 1] == 'A' || ach[source + 1] == 'a')) 309else if (source + 2 < ach.Length && ach[source] == '<' && ach[source + 1] == '/' && (ach[source + 2] == 'A' || ach[source + 2] == 'a'))
MS\Internal\AutomationProxies\WindowsIPAddress.cs (2)
130if (abOctet.Length == 4) 227if (strIPAddresses.Length != 4)
MS\Internal\AutomationProxies\WindowsListBox.cs (1)
463WinEventTracker.RemoveToNotificationList(hwnd, aEvtIdProperties, null, aEvtIdProperties.Length);
MS\Internal\AutomationProxies\WindowsListView.cs (12)
241int groupsCount = groupIds.Length; 244if (groupIds.Length == 0) 279int groupsCount = groupIds.Length; 282if (groupIds.Length == 0) 353if (groupIds.Length == 0) 380int groupsCount = groupIds.Length; 383if (groupIds.Length == 0) 496for (int i = 0, c = aidProps.Length; i < c; i++) 525for (int i = 0, c = aidProps.Length; i < c; i++) 830if ( viewID < 0 || viewID > ListViewViews.Length ) 839if ( viewID < 0 || viewID > ListViewViews.Length ) 1602if (groupIds.Length == 0)
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (4)
257if (groupInfo._count <= 0 || groupInfo._count > items.Length) 271if (groupInfo._count <= 0 || groupInfo._count > items.Length) 316if (groupInfo._count <= 0 || groupInfo._count > items.Length) 518if (groupManagerInfo._count <= 0 || groupManagerInfo._count >= items.Length)
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (4)
802System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length"); 803if (min == _items.Length) 807_items = new int[temp.Length * 2]; 808Array.Copy(temp, _items, temp.Length);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
124for (index = 0; index < groupIds.Length && windowsListViewGroup.ID != groupIds[index]; index++); 126if (index >= groupIds.Length)
MS\Internal\AutomationProxies\WindowsMenu.cs (5)
465WinEventTracker.AddToNotificationList(IntPtr.Zero, new WinEventTracker.ProxyRaiseEvents(MenuEvents), _menuEvents, _menuEvents.Length); 486WinEventTracker.RemoveToNotificationList (IntPtr.Zero, _menuEvents, new WinEventTracker.ProxyRaiseEvents (MenuEvents), _menuEvents.Length); 1068int count = aidProps.Length; 1367for (int i = 0; i < keywordsAccelerators.Length; i++) 2781for (int i = 0; i < keywordsAccelerators.Length; i++)
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (2)
413if (a1.Length != a2.Length || a1.Rank != a2.Rank)
MS\Internal\AutomationProxies\WindowsTab.cs (2)
315&& aidProps.Length > 0 337&& aidProps.Length > 0
MS\Internal\AutomationProxies\WindowsTooltip.cs (3)
97WinEventTracker.AddToNotificationList( IntPtr.Zero, new WinEventTracker.ProxyRaiseEvents( OnToolTipEvents ), _toolTipEventIds, _toolTipEventIds.Length ); 114WinEventTracker.RemoveToNotificationList( IntPtr.Zero, _toolTipEventIds, new WinEventTracker.ProxyRaiseEvents( OnToolTipEvents ), _toolTipEventIds.Length ); 259for (scan = rects.Length - 1; scan >= 0; scan--)
UIAutomationProvider (1)
MS\Internal\Automation\UiaCoreProviderApi.cs (1)
63CheckError(RawUiaRaiseStructureChangedEvent(provider, structureChangeType, runtimeId, runtimeId == null ? 0 : runtimeId.Length));
UIAutomationTypes (20)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (1)
43if (handleTypeCount == 0 || handleTypeCount == handleTypes.Length)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (17)
5905get { return buffer.Length; } 5910IntPtr result = Marshal.AllocCoTaskMem(buffer.Length); 5911Marshal.Copy(buffer, 0, result, buffer.Length); 5919while (i < buffer.Length && buffer[i] != 0) 5924if (i < buffer.Length) 5934Marshal.Copy(ptr, buffer, 0, buffer.Length); 5941int count = Math.Min(bytes.Length, buffer.Length - offset); 5946if (offset < buffer.Length) 5963get { return buffer.Length; } 5968IntPtr result = Marshal.AllocCoTaskMem(buffer.Length * 2); 5969Marshal.Copy(buffer, 0, result, buffer.Length); 5977while (i < buffer.Length && buffer[i] != 0) 5982if (i < buffer.Length) 5991Marshal.Copy(ptr, buffer, 0, buffer.Length); 5997int count = Math.Min(s.Length, buffer.Length - offset); 6002if (offset < buffer.Length)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (1)
2899int len = args.Length;
System\Windows\Automation\ControlType.cs (1)
97int totalRows = this._requiredPatternsSets.Length;
UnitTests.Common (12)
TestHelpers.cs (6)
133if (ops.Count != expectedOperations.Length) 135errorBuilder.AppendLine(String.Format("{0} operations.Count: expected={1}, actual = {2}", prefix, expectedOperations.Length, ops.Count)); 224if (desc.Length != data.Length) 227action, section, data.Length, desc.Length));
TestTypes.cs (6)
585if (_byteArrayValue.Length != other._byteArrayValue.Length) { return false; } 586for (int i = 0; i < _byteArrayValue.Length; i++) 591for (int i = 0; i < _charArrayValue.Length; i++) 622sb.AppendLine("ByteArrayValue: " + (_byteArrayValue != null ? "Length: " + _byteArrayValue.Length : "null")); 623sb.AppendLine("CharArrayValue: " + (_charArrayValue != null ? "Length: " + _charArrayValue.Length : "null"));
vbc (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
329responseBuffer.Length,
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
160_loggingStream.Write(bytes, 0, bytes.Length);
VBCSCompiler (2)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
329responseBuffer.Length,
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (1)
160_loggingStream.Write(bytes, 0, bytes.Length);
VBCSCompiler.UnitTests (4)
CompilerServerTests.cs (3)
1504Assert.Equal(first.Length, second.Length); 1505for (int i = 0; i < first.Length; i++)
NamedPipeClientConnectionHostTests.cs (1)
138var readCount = await stream.ReadAsync(buffer, 0, buffer.Length);
VersioningWebSite (1)
VersionRouteAttribute.cs (1)
64if (rangeValues.Length == 1)
VisualBasicErrorFactsGenerator (1)
Program.vb (1)
10If args.Length <> 2 Then
VisualBasicRuntimeTest (1)
Program.cs (1)
21if (args.Length != 1)
VisualBasicSyntaxGenerator (2)
Util\WriteUtils.vb (1)
892Dim last = parts.Length - 1
Util\XmlRenamer.vb (1)
45If fields.Length >= 4 AndAlso fields(0).Trim <> "" AndAlso Cleanup(fields(3)) <> "" Then
Wasm.Performance.ConsoleHost (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Wasm.Performance.Driver (1)
Program.cs (1)
29if (args.Length > 0)
WebSocketSample (1)
Program.cs (1)
13if (args.Length < 1)
WinFormsControlsTest (19)
DataGridViewTest.cs (6)
57if (_cellFontIndex >= s_fonts.Length) 59_cellFontIndex -= s_fonts.Length; 63if (_columnHeaderFontIndex >= s_fonts.Length) 65_columnHeaderFontIndex -= s_fonts.Length; 69if (_rowHeaderFontIndex >= s_fonts.Length) 71_rowHeaderFontIndex -= s_fonts.Length;
DragDrop.cs (12)
114&& files.Length > 0 && files.Length <= 5) 123e.MessageReplacementToken = $"{(files.Length > 1 ? "Cats" : "Cat")}"; 128else if (files.Length == 1 && files.Any(file => file.Contains("DragAccept.rtf"))) 161&& files.Length > 0 && files.Length <= 5 254&& files.Length > 0 && files[0].Contains("DragAccept.rtf")) 296&& files.Length > 0 && files[0].Contains("DragAccept.rtf")) 320&& fileNames.Length > 0 && fileNames[0].Contains("DragAccept.rtf")) 349&& fileNames.Length > 0 && fileNames[0].Contains("DragAccept.rtf")) 364if (bitmapFiles.Length == 1) 370for (int i = 0; i < bitmapFiles.Length; i++)
FormOwnerTestForm.cs (1)
62Array.Clear(_array, 0, _array.Length);
WinShimmer (2)
Program.cs (2)
23if (args.Length != 3) 25throw new ArgumentOutOfRangeException("args", $"WinShimmer was provided {args.Length} arguments instead of 3");
XmlFileLogger (3)
ItemGroupParser.cs (2)
27if (lines.Length == 1) 44for (int i = 1; i < lines.Length; i++)
XmlFileLogger.cs (1)
165if (parameters.Length != 1)
xunit.assert (10)
CollectionAsserts.cs (6)
171 if (index < elementInspectors.Length) 184 if (tracker.IterationCount != elementInspectors.Length) 185 throw CollectionException.ForMismatchedItemCount(elementInspectors.Length, tracker.IterationCount, tracker.FormatStart()); 212 if (index < elementInspectors.Length) 225 if (tracker.IterationCount != elementInspectors.Length) 226 throw CollectionException.ForMismatchedItemCount(elementInspectors.Length, tracker.IterationCount, tracker.FormatStart());
MultipleAsserts.cs (1)
30 if (checks == null || checks.Length == 0)
Sdk\ArgumentFormatter.cs (2)
265 typeParameters.Length == 0 526 result = string.Format(CultureInfo.CurrentCulture, "{0}<{1}>", result, new string(',', typeInfo.GenericTypeParameters.Length - 1));
Sdk\AssertHelper.cs (1)
156 && p.GetIndexParameters().Length == 0
xunit.console (8)
CommandLine.cs (4)
21for (var i = args.Length - 1; i >= 0; i--) 119var args = new List<string>(capacity: rspLines.Length); 408if (pieces.Length != 2 || string.IsNullOrEmpty(pieces[0]) || string.IsNullOrEmpty(pieces[1])) 421if (pieces.Length != 2 || string.IsNullOrEmpty(pieces[0]) || string.IsNullOrEmpty(pieces[1]))
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextPaths.cs (1)
48var application = files != null && files.Length > 0 ? files[0] : null;
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\PackageCompilationAssemblyResolver.cs (1)
80if (_nugetPackageDirectories == null || _nugetPackageDirectories.Length == 0 ||
common\Json.cs (1)
29get { return _array.Length; }
ConsoleRunner.cs (1)
40if (args.Length == 0 || args[0] == "-?" || args[0] == "/?" || args[0] == "-h" || args[0] == "--help")