27630 references to Length
aspire (116)
Agents\CopilotCli\CopilotCliRunner.cs (1)
84if (lines.Length > 0)
Agents\Playwright\PlaywrightCliInstaller.cs (1)
325if (Directory.Exists(dir) && Directory.GetFileSystemEntries(dir).Length == 0)
Agents\VsCode\VsCodeCliRunner.cs (1)
66if (lines.Length == 0)
Backchannel\ExtensionBackchannel.cs (1)
171if (addressParts.Length != 2 || !int.TryParse(addressParts[1], out var port) || port <= 0 ||
Caching\DiskCache.cs (2)
194if (parts.Length >= 2 && long.TryParse(parts[1], out var ts)) 243if (parts.Length >= 2 && long.TryParse(parts[1], out var ts))
Certificates\CertificateGeneration\CertificateManager.cs (8)
234if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 699Array.Clear(keyBytes, 0, keyBytes.Length); 700Array.Clear(pem, 0, pem.Length); 706Array.Clear(keyBytes, 0, keyBytes.Length); 707Array.Clear(pem, 0, pem.Length); 757Array.Clear(bytes, 0, bytes.Length); 785Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
Certificates\CertificateGeneration\UnixCertificateManager.cs (2)
176Array.Clear(export, 0, export.Length); 623if (availableCommands.Count == commands.Length)
Certificates\CertificateGeneration\WindowsCertificateManager.cs (1)
62Array.Clear(export, 0, export.Length);
CliExecutionContext.cs (1)
90return HivesDirectory.GetDirectories().Length;
Commands\AddCommand.cs (2)
375if (choices.Length == 1) 406if (explicitGroups.Length == 0 && implicitGroup is not null)
Commands\AgentInitCommand.cs (1)
147if (applicators.Length == 0)
Commands\AppHostLauncher.cs (2)
155if (existingSockets.Length > 0) 157logger.LogDebug("Found {Count} running instance(s) for this AppHost, stopping them first.", existingSockets.Length);
Commands\DescribeCommand.cs (2)
283var endpoints = snapshot.Urls.Length > 0 301var endpoints = snapshot.Urls.Length > 0
Commands\InitCommand.cs (2)
414if (appHostProjects.Length == 0 || serviceDefaultsProjects.Length == 0)
Commands\NewCommand.cs (2)
158if (templatesForPrompt.Length == 0) 327if (explicitGroups.Length == 0 && implicitGroup is not null)
Commands\PipelineCommandBase.cs (1)
149await extensionInteractionService.StartDebugSessionAsync(ExecutionContext.WorkingDirectory.FullName, passedAppHostProjectFile?.FullName, debug: true, new DebugSessionOptions { Command = Name, Args = commandArgs.Length > 0 ? commandArgs : null });
Commands\StopCommand.cs (4)
101if (allConnections.Length == 0) 112if (inScopeConnections.Length == 1) 153if (allConnections.Length == 0) 159_logger.LogDebug("Found {Count} running AppHost(s) to stop", allConnections.Length);
Commands\TelemetryCommandHelpers.cs (2)
324var result = new IOtlpResource[resources.Length]; 325for (var i = 0; i < resources.Length; i++)
Configuration\ConfigurationService.cs (5)
199for (int i = 0; i < keyParts.Length - 1; i++) 213var finalKey = keyParts[keyParts.Length - 1]; 231for (int i = 1; i < keyParts.Length; i++) 261for (int i = 0; i < keyParts.Length - 1; i++) 274var finalKey = keyParts[keyParts.Length - 1];
DotNet\DotNetCliRunner.cs (7)
323if (properties.Length > 0) 334if (items.Length > 0) 597{ Length: > 2 } chunks => chunks[1].Split("@") switch { // Break up the template+version string (@ separator for .NET 10.0+) 598{ Length: 2 } versionChunks => versionChunks[1], // The version in the second chunk 600{ Length: 2 } versionChunks => versionChunks[1], 787if (configPaths.Length == 0) 945var delayIndex = Math.Min(attempt - 1, s_searchRetryDelays.Length - 1);
Interaction\BannerService.cs (2)
84for (var letterIdx = 0; letterIdx <= s_letterPositions.Length; letterIdx++) 86var visibleCols = letterIdx < s_letterPositions.Length ? s_letterPositions[letterIdx] : s_aspireLines[0].Length;
Mcp\Docs\DocsCache.cs (2)
138_logger.LogDebug("DocsCache index disk hit, loaded {Count} documents", diskDocuments.Length); 156_logger.LogDebug("DocsCache set index with {Count} documents", documents.Length);
Mcp\Docs\DocsIndexService.cs (8)
220if (queryTokens.Length is 0) 356if (slugLower.Length is 0 || queryTokens.Length is 0) 374var isMultiWordQuery = queryTokens.Length > 1; 397var maxStartIndex = slugSegments.Length - tokenParts.Length; 403for (var partIndex = 0; partIndex < tokenParts.Length; partIndex++) 440if (matchingSegments == queryTokens.Length) 449return PartialSlugMatchBonus * matchingSegments / (float)queryTokens.Length;
Npm\SigstoreNpmProvenanceChecker.cs (1)
409if (segments.Length < 2)
NuGet\BundleNuGetService.cs (1)
83if (Directory.Exists(libsDir) && Directory.GetFiles(libsDir, "*.dll").Length > 0)
NuGet\NuGetPackageCache.cs (2)
105if (result.Packages?.Length > 0) 110if (result.Packages?.Length < SearchPageSize)
Packaging\NuGetConfigMerger.cs (7)
40if (channel.Type is not PackageChannelType.Explicit || mappings is null || mappings.Length == 0) 63if (mappings is null || mappings.Length == 0) 98if (mappings is null || mappings.Length == 0) 819if (channel.Type is not PackageChannelType.Explicit || mappings is null || mappings.Length == 0) 868if (missingSources.Length > 0) 932if (matches.Length > 1) 938return matches.Length == 1;
Packaging\NuGetConfigPrompter.cs (2)
40if (mappings is null || mappings.Length == 0) 97if (mappings is null || mappings.Length == 0)
Packaging\TemporaryNuGetConfig.cs (1)
78if (mappings.Length > 0)
Processes\DetachedProcessLauncher.Windows.cs (1)
69(nint)(nint.Size * handles.Length),
Program.cs (8)
98if (args is not null && args.Length > 0) 104for (var i = 0; i < args.Length; i++) 106if ((args[i] == "--log-level" || args[i] == "-l") && i + 1 < args.Length) 140for (var i = 0; i < args.Length; i++) 147if (args[i] == "--log-file" && i + 1 < args.Length) 194var isMcpStartCommand = args?.Length >= 2 && 250var isMcpStartCommand = args?.Length >= 2 && 716var commandLine = args.Length > 0 ? $"aspire {string.Join(" ", args)}" : "aspire";
Projects\DotNetAppHostProject.cs (1)
507if (matchingSockets.Length == 0)
Projects\DotNetBasedAppHostServerProject.cs (1)
486if (additionalArgs is { Length: > 0 })
Projects\GuestAppHostProject.cs (2)
1175if (matchingSockets.Length == 0) 1315if (lines.Length > 0)
Projects\GuestRuntime.cs (2)
179if (additionalArgs is { Length: > 0 }) 195if (additionalArgs is { Length: > 0 } && !args.Any(a => a.Contains("{args}")))
Projects\PrebuiltAppHostServer.cs (1)
427if (additionalArgs is { Length: > 0 })
Projects\ProjectLocator.cs (1)
85logger.LogDebug("Found {CandidateCount} files matching pattern '{Pattern}'", candidateFiles.Length, pattern);
Projects\ProjectUpdater.cs (3)
82if (configPathsExitCode != 0 || configPaths is null || configPaths.Length == 0) 99{ Length: 0 or 1 } => fallbackNuGetConfigDirectory, 100var p when p.Length > 1 => IsGlobalNuGetConfig(p[0]!) ? fallbackNuGetConfigDirectory : p[0],
Scaffolding\ScaffoldingService.cs (1)
186if (lines.Length > 0)
src\Shared\CircularBuffer.cs (1)
227if (array.Length - arrayIndex < Count)
src\Shared\ConsoleLogs\AnsiParser.cs (2)
202for (var i = 0; i < parameters.Length; i++) 207if (parameter is XtermForegroundSequenceCode or XtermBackgroundSequenceCode && i + 2 < parameters.Length)
src\Shared\ConsoleLogs\PromptContext.cs (1)
35if (lines.Length == 1)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (1)
229if (span.Links is { Length: > 0 })
src\Shared\Json\JsonFlattener.cs (1)
35for (var i = 0; i < keys.Length - 1; i++)
src\Shared\PathLookupHelper.cs (1)
54if (pathExtensions is not null && pathExtensions.Length > 0)
src\Shared\UserSecrets\IsolatedUserSecretsHelper.cs (1)
73if (remainingFiles.Length == 0)
src\Shared\X509Certificate2Extensions.cs (2)
52if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
Templating\CliTemplateFactory.cs (2)
178if (resourceNames.Length == 0) 184_logger.LogDebug("Found {ResourceCount} embedded resources for template root '{TemplateRoot}': {TemplateResources}", resourceNames.Length, templateRoot, string.Join(", ", resourceNames));
Templating\TemplateNuGetConfigService.cs (1)
33if (mappings is null || mappings.Length == 0)
Utils\ConfigurationHelper.cs (2)
183for (int i = 0; i < parts.Length - 1; i++) 212var finalKey = parts[parts.Length - 1];
Utils\ConsoleActivityLogger.cs (2)
119var spinChar = _spinnerChars[_spinnerIndex % _spinnerChars.Length]; 419color = _availableColors[_colorIndex % _availableColors.Length];
Utils\EnvironmentChecker\DeprecatedWorkloadCheck.cs (1)
126if (columns.Length > 0 &&
Utils\FileSystemHelper.cs (1)
65if (!Directory.Exists(root) || patterns.Length == 0)
Utils\MarkdownToSpectreConverter.cs (2)
131if (lines.Length > 1) 171for (int i = 0; i < lines.Length; i++)
Aspire.Azure.Messaging.EventHubs (2)
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
Aspire.Azure.Messaging.EventHubs.Tests (1)
tests\Aspire.Azure.Security.KeyVault.Tests\MockTransport.cs (1)
158ContentStream = new MemoryStream(content, 0, content.Length, false, true);
Aspire.Azure.Messaging.ServiceBus (2)
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
Aspire.Azure.Messaging.WebPubSub (2)
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
Aspire.Azure.Npgsql (1)
src\Components\Common\ManagedIdentityTokenCredentialHelpers.cs (1)
75if (tokenParts.Length != 3)
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (1)
src\Components\Common\ManagedIdentityTokenCredentialHelpers.cs (1)
75if (tokenParts.Length != 3)
Aspire.Azure.Security.KeyVault.Tests (2)
AspireKeyVaultExtensionsTests.cs (1)
159response.AddHeader(new HttpHeader("Content-Length", buffer.Length.ToString(CultureInfo.InvariantCulture)));
MockTransport.cs (1)
158ContentStream = new MemoryStream(content, 0, content.Length, false, true);
Aspire.Azure.Storage.Queues (2)
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
Aspire.Cli.EndToEnd.Tests (1)
Helpers\CliE2ETestHelpers.cs (1)
164return matches.Length > 0 ? Path.GetDirectoryName(matches[0]) : null;
Aspire.Cli.Tests (30)
Agents\AgentEnvironmentDetectorTests.cs (1)
97Assert.Equal(2, applicators.Length);
Caching\DiskCacheTests.cs (2)
87Assert.True(files.Length >= 1); 125Assert.Equal(2, parts.Length);
Commands\DescribeCommandTests.cs (1)
252Assert.Equal(2, deserialized.Resources.Length);
Commands\DoCommandTests.cs (1)
222Assert.True(outputPathIndex >= 0 && outputPathIndex < args.Length - 1);
Commands\ExportCommandTests.cs (6)
767if (entries.Length == 0) 801TotalCount = entries.Length, 802ReturnedCount = entries.Length 810if (entries.Length == 0) 846TotalCount = entries.Length, 847ReturnedCount = entries.Length
Commands\LogsCommandTests.cs (4)
336Assert.Equal(3, deserialized.Logs.Length); 389Assert.Equal(3, logsOutput.Logs.Length); 468Assert.Equal(3, logsOutput.Logs.Length); 506Assert.Equal(3, logsOutput.Logs.Length);
Commands\McpIconHelperTests.cs (1)
39Assert.True(bytes.Length > 0, "Icon data should not be empty");
Commands\PublishCommandPromptingIntegrationTests.cs (1)
412Assert.Equal(4, completedPrompt.Answers.Length);
Commands\SdkDumpCommandTests.cs (1)
226Console.WriteLine($"Warnings: {warningLines.Length}");
Commands\TelemetryLogsCommandTests.cs (2)
142TotalCount = entries.Length, 143ReturnedCount = entries.Length
Commands\TelemetrySpansCommandTests.cs (2)
144TotalCount = entries.Length, 145ReturnedCount = entries.Length
Commands\TelemetryTracesCommandTests.cs (5)
79Assert.Equal(2, dataRows.Length); 130Assert.Equal(2, dataRows.Length); 161.Where(cells => cells.Length >= 5) 192TotalCount = entries.Length, 193ReturnedCount = entries.Length
Utils\AppHostHelperTests.cs (2)
230Assert.Equal(2, sockets.Length); 260Assert.Equal(2, sockets.Length);
Utils\ResourceColorMapTests.cs (1)
13Assert.Equal(ColorGenerator.s_variableNames.Length, ResourceColorMap.s_hexColors.Count);
Aspire.Components.Common.TestUtilities (1)
ConformanceTests.cs (1)
342if (NotAcceptableLogCategories.Length > 0)
Aspire.Confluent.Kafka.Tests (1)
OtelMetricsTests.cs (1)
117Assert.Equal(4, groups.Length);
Aspire.Dashboard (53)
Api\TelemetryApiService.cs (3)
289var hasResourceFilter = resourceNames is { Length: > 0 }; 340var hasResourceFilter = resourceNames is { Length: > 0 }; 418if (resourceNames is null || resourceNames.Length == 0)
Components\Controls\Chart\ChartBase.cs (7)
251currentBucketCounts = new ulong[histogramValue.Values.Length]; 253else if (currentBucketCounts.Length != histogramValue.Values.Length) 258for (var valuesIndex = 0; valuesIndex < histogramValue.Values.Length; valuesIndex++) 340for (var i = 0; i < histogramValue.Values.Length; i++) 363for (var i = 0; i < explicitBounds.Length; i++) 374return explicitBounds[explicitBounds.Length - 1];
Components\Pages\ConsoleLogs.razor.cs (1)
586if (tasks.Length > 0)
Configuration\DashboardOptions.cs (1)
315var addresses = new List<BindingAddress>(parts.Length);
Extensions\CollectionExtensions.cs (2)
10if (array.Length != other.Length)
Extensions\TelemetryFilterFormatter.cs (2)
45if (parts.Length != 3 && parts.Length != 4)
Model\BrowserLinkOutgoingPeerResolver.cs (1)
45if (parts.Length == 2)
Model\ConnectionStringParser.cs (1)
184token.Contains(',') && token.Split(',').Length > 1)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (2)
545if (assistantEvent?.ToolCalls?.Length > 0) 547for (var i = 0; i < assistantEvent.ToolCalls.Length; i++)
Model\Markdown\HighlightedCodeBlockRenderer.cs (1)
134for (var i = 0; i < slices.Length; i++)
Model\TelemetryExportService.cs (8)
387var destinationName = outgoingPeerResolvers.Length > 0 649Attributes = scope.Attributes.Length > 0 ? ConvertAttributes(scope.Attributes) : null 656var additionalCount = additionalAttributes?.Length ?? 0; 658if (attributes.Length == 0 && additionalCount == 0) 663var result = new OtlpKeyValueJson[attributes.Length + additionalCount]; 665for (var i = 0; i < attributes.Length; i++) 676for (var i = 0; i < additionalAttributes.Length; i++) 678result[attributes.Length + i] = new OtlpKeyValueJson
Model\TelemetryImportService.cs (3)
135if (telemetryData.ResourceLogs is { Length: > 0 }) 142if (telemetryData.ResourceSpans is { Length: > 0 }) 149if (telemetryData.ResourceMetrics is { Length: > 0 })
Otlp\Model\MetricValues\DimensionScope.cs (2)
108if (bucketCounts.Length > 0 && explicitBounds.Length == 0)
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; 351for (var i = 0; i < values.Length; i++) 394for (var i = 0; i < values.Length; i++)
Otlp\Model\OtlpResource.cs (4)
329if (x.Length != y.Length) 334for (var i = 0; i < x.Length; i++) 352for (var i = 0; i < obj.Length; i++)
Otlp\Model\Serialization\OtlpJsonProtobufConverter.cs (1)
876for (var i = 0; i < bytes.Length; i++)
src\Shared\CircularBuffer.cs (1)
227if (array.Length - arrayIndex < Count)
src\Shared\ConsoleLogs\AnsiParser.cs (2)
202for (var i = 0; i < parameters.Length; i++) 207if (parameter is XtermForegroundSequenceCode or XtermBackgroundSequenceCode && i + 2 < parameters.Length)
src\Shared\ConsoleLogs\PromptContext.cs (1)
35if (lines.Length == 1)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (1)
229if (span.Links is { Length: > 0 })
src\Shared\StringUtils.cs (1)
14&& input.Split(delimiter) is { Length: > 0 } splitInput
Aspire.Dashboard.Tests (17)
CircularBufferTests.cs (2)
17for (var i = 0; i < values.Length; i++) 19var index = (521 + i) % values.Length;
Integration\StartupTests.cs (1)
562Assert.Equal(16, Convert.FromHexString(app.DashboardOptionsMonitor.CurrentValue.Frontend.BrowserToken!).Length);
Integration\TelemetryApiTests.cs (2)
61Assert.Equal(apiKey.Length, options.Mcp.GetPrimaryApiKeyBytesOrNull()!.Length); 82Assert.Equal(apiKey.Length, options.Api.GetPrimaryApiKeyBytesOrNull()!.Length);
Mcp\McpIconHelperTests.cs (1)
40Assert.True(bytes.Length > 0, "Icon data should not be empty");
Model\TelemetryExportServiceTests.cs (8)
177Assert.Equal(2, resourceLogs.ScopeLogs.Length); 182Assert.Equal(2, logger1Scope.LogRecords.Length); 365Assert.Equal(2, spans.Length); 604Assert.Equal(2, resourceMetrics.ScopeMetrics.Length); 609Assert.Equal(2, meter1Scope.Metrics.Length); 1012Assert.Equal(2, data.ResourceSpans[0].ScopeSpans![0].Spans!.Length); 1014Assert.Equal(2, data.ResourceLogs[0].ScopeLogs![0].LogRecords!.Length); 1054Assert.Equal(2, data.ResourceSpans[0].ScopeSpans![0].Spans!.Length);
TelemetryRepositoryTests\MetricsTests.cs (1)
394var dimension = instrumentData.Dimensions.Single(d => d.Attributes.Length == 0);
TelemetryRepositoryTests\TraceTests.cs (2)
854Assert.Equal(5, trace.FirstSpan.Events[0].Attributes.Length); 1486var views = resource.GetViews().OrderBy(v => v.Properties.Length).ToList();
Aspire.Deployment.EndToEnd.Tests (2)
AuthenticationTests.cs (2)
104Assert.True(parts.Length >= 4, $"Expected at least 4 parts in name, got {parts.Length}: {rgName}");
Aspire.Hosting (53)
ApplicationModel\Docker\DockerfileStage.cs (2)
198if (command.Length == 0) 215if (command.Length == 0)
ApplicationModel\ResourceCommandService.cs (2)
76if (names.Length == 1) 92for (var i = 0; i < results.Length; i++)
ApplicationModel\ResourceExtensions.cs (5)
999if (annotations.Length > 1) 1077if (names.Length == 0) 1081if (names.Length > 1) 1190if (registryTargetAnnotations.Length == 1) 1195if (registryTargetAnnotations.Length > 1)
ApplicationModel\ResourceLoggerService.cs (4)
54if (resourceNames.Length > 1) 162if (resourceNames.Length > 1) 182if (resourceNames.Length > 1) 464if (backlogSnapshot.Length > 0)
ApplicationModel\ResourceNotificationService.cs (6)
269var tasks = new Task[names.Length]; 285for (var i = 0; i < names.Length; i++) 287var displayName = names.Length > 1 ? names[i] : dependency.Name; 352var tasks = new Task[names.Length]; 354for (var i = 0; i < names.Length; i++) 356var displayName = names.Length > 1 ? names[i] : dependency.Name;
Ats\AspireUnionAttribute.cs (1)
51if (types.Length < 2)
Dashboard\DashboardEventHandlers.cs (1)
653if (sessionPort.Split(':') is { Length: 2 } parts &&
Dcp\DcpExecutor.cs (10)
1198var serviceName = _nameGenerator.GetServiceName(sp.ModelResource, endpoint, endpoints.Length > 1, serviceNames); 1847Array.Clear(keyPem, 0, keyPem.Length); 1848Array.Clear(keyBytes, 0, keyBytes.Length); 1854Array.Clear(pfxBytes, 0, pfxBytes.Length); 2304Array.Clear(keyPem, 0, keyPem.Length); 2316Array.Clear(pfxBytes, 0, pfxBytes.Length); 2887Array.Clear(keyBytes, 0, keyBytes.Length); 2888Array.Clear(pemKey, 0, pemKey.Length); 2893Array.Clear(keyBytes, 0, keyBytes.Length); 2926if (pfxCandidate.Length > 0)
Dcp\DcpLogParser.cs (2)
180for (int i = 0; i < lines.Length; i++) 185if (i < lines.Length - 1)
Exec\ExecResourceManager.cs (3)
204if (args is not null && args.Length > 0) 227_logger.LogDebug("Exec resource '{ResourceName}' will run command '{Command}' with {ArgsCount} args '{Args}'.", execResourceName, exe, args?.Length ?? 0, string.Join(' ', args ?? [])); 258_logger.LogDebug("Exec container resource '{ResourceName}' will run command '{Command}' with {ArgsCount} args '{Args}'.", execResourceName, exe, args?.Length ?? 0, string.Join(' ', args ?? []));
IProjectMetadata.cs (1)
60if (projectFiles.Length != 1)
Orchestrator\RelationshipEvaluator.cs (1)
56if (relationships.Length == 0)
Pipelines\DistributedApplicationPipeline.cs (3)
218if (registryTargetAnnotations.Length > 1) 227if (registryTargetAnnotations.Length == 0) 721for (var i = 0; i < allStepTasks.Length; i++)
Pipelines\Internal\DeploymentStateManagerBase.cs (1)
285for (var i = 0; i < segments.Length - 1; i++)
Pipelines\Internal\JsonFlattener.cs (1)
41for (var i = 0; i < keys.Length - 1; i++)
Pipelines\PipelineActivityReporter.cs (2)
404for (var i = 0; i < responses.Length; i++) 444if (responses is not null && responses.Length > 0)
Publishing\ManifestPublishingContext.cs (1)
711for (var i = 0; i < arguments.Length; i++)
Publishing\ResourceContainerImageManager.cs (2)
355if (ridArray.Length == 1) 460var imageTag = imageNameParts.Length > 1 ? imageNameParts[1] : null;
src\Shared\CircularBuffer.cs (1)
227if (array.Length - arrayIndex < Count)
src\Shared\PathLookupHelper.cs (1)
54if (pathExtensions is not null && pathExtensions.Length > 0)
src\Shared\StringUtils.cs (1)
14&& input.Split(delimiter) is { Length: > 0 } splitInput
src\Shared\X509Certificate2Extensions.cs (2)
52if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
Aspire.Hosting.Analyzers (5)
AppHostAnalyzer.cs (2)
93&& parameterData.ModelTypes.Length > 0) 96if (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 (1)
src\Shared\PathLookupHelper.cs (1)
54if (pathExtensions is not null && pathExtensions.Length > 0)
Aspire.Hosting.Azure.AppConfiguration (3)
AzureAppConfigurationExtensions.cs (3)
218if (roles is null || roles.Length == 0) 223var builtInRoles = new AppConfigurationBuiltInRole[roles.Length]; 224for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.AppContainers (7)
AzureContainerAppsInfrastructure.cs (1)
25if (caes.Length == 0)
ContainerAppContext.cs (4)
152if (unsupportedEndpoints.Length > 0) 200var httpIngress = httpOnlyEndpoints.Length == 1 ? httpOnlyEndpoints[0] : null; 207if (externalHttp.Length == 1) 211else if (httpOnlyEndpoints.Length > 0)
ContainerAppEnvironmentContext.cs (2)
35if (endpointNames.Length > 0) 54x.EndpointNames.Length == 1
Aspire.Hosting.Azure.AppService (3)
AzureAppServiceEnvironmentResource.cs (1)
235if (problematicKeys.Length == 0)
AzureAppServiceInfrastructure.cs (1)
27if (appServiceEnvironments.Length == 0)
AzureAppServiceWebsiteContext.cs (1)
105if (unsupportedEndpoints.Length > 0)
Aspire.Hosting.Azure.CognitiveServices (3)
AzureOpenAIExtensions.cs (3)
254if (roles is null || roles.Length == 0) 259var builtInRoles = new CognitiveServicesBuiltInRole[roles.Length]; 260for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.ContainerRegistry (3)
AzureContainerRegistryExtensions.cs (3)
295if (roles is null || roles.Length == 0) 300var builtInRoles = new ContainerRegistryBuiltInRole[roles.Length]; 301for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.CosmosDB (4)
AzureCosmosDBContainerResource.cs (1)
33if (partitionKeyPathsArray.Length == 0)
AzureCosmosDBExtensions.cs (1)
371if (partitionKeyPathsArray.Length == 0)
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
Aspire.Hosting.Azure.EventHubs (3)
AzureEventHubsExtensions.cs (3)
539if (roles is null || roles.Length == 0) 544var builtInRoles = new EventHubsBuiltInRole[roles.Length]; 545for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.Functions (1)
AzureFunctionsProjectResourceExtensions.cs (1)
425if (projectFiles.Length != 1)
Aspire.Hosting.Azure.KeyVault (3)
AzureKeyVaultResourceExtensions.cs (3)
196if (roles is null || roles.Length == 0) 201var builtInRoles = new KeyVaultBuiltInRole[roles.Length]; 202for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.Search (3)
AzureSearchExtensions.cs (3)
156if (roles is null || roles.Length == 0) 161var builtInRoles = new SearchBuiltInRole[roles.Length]; 162for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.ServiceBus (3)
AzureServiceBusExtensions.cs (3)
692if (roles is null || roles.Length == 0) 697var builtInRoles = new ServiceBusBuiltInRole[roles.Length]; 698for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.SignalR (3)
AzureSignalRExtensions.cs (3)
221if (roles is null || roles.Length == 0) 226var builtInRoles = new SignalRBuiltInRole[roles.Length]; 227for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.Sql (1)
SubnetAddressAllocator.cs (1)
100if (parts.Length != 2 || !int.TryParse(parts[1], out var prefix) || prefix < 0 || prefix > 32)
Aspire.Hosting.Azure.Storage (4)
AzureStorageExtensions.cs (4)
696if (roles is null || roles.Length == 0) 720if (roles is null || roles.Length == 0) 725var builtInRoles = new StorageBuiltInRole[roles.Length]; 726for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Azure.Tests (5)
AzureContainerAppsTests.cs (1)
1888Assert.Equal(2, containers.Length);
AzureFunctionsTests.cs (1)
24&& m.GetParameters() is { Length: 5 } parameters
AzureServiceBusExtensionsTests.cs (2)
843m.GetParameters().Length == 3 && 870m.GetParameters().Length == 3 &&
AzureStorageExtensionsTests.cs (1)
971m.GetParameters().Length == 3 &&
Aspire.Hosting.Azure.WebPubSub (3)
AzureWebPubSubExtensions.cs (3)
337if (roles is null || roles.Length == 0) 342var builtInRoles = new WebPubSubBuiltInRole[roles.Length]; 343for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.CodeGeneration.Java (2)
AtsJavaCodeGenerator.cs (2)
134for (var i = 0; i < members.Length; i++) 138var suffix = i < members.Length - 1 ? "," : ";";
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
AtsTypeScriptCodeGeneratorTests.cs (1)
1013Assert.Equal(2, types.Length);
Aspire.Hosting.Docker (3)
DockerComposeInfrastructure.cs (2)
31if (dockerComposeEnvironments.Length == 0) 91if (registries.Length == 1)
EnvVarEscaper.cs (1)
218if (strippedLength >= stripped.Length)
Aspire.Hosting.Foundry (3)
FoundryExtensions.cs (3)
220if (roles is null || roles.Length == 0) 225var builtInRoles = new CognitiveServicesBuiltInRole[roles.Length]; 226for (var i = 0; i < roles.Length; i++)
Aspire.Hosting.Foundry.Tests (1)
ProjectResourceTests.cs (1)
97Assert.Equal(3, properties.Length);
Aspire.Hosting.Integration.Analyzers (3)
AspireExportAnalyzer.cs (1)
767if (methods.Length > 1)
src\Aspire.Hosting.Analyzers\Infrastructure\WellKnownTypes.cs (2)
28for (var i = 0; i < WellKnownTypeData.WellKnownTypeNames.Length; i++) 49_lazyWellKnownTypes = new INamedTypeSymbol?[WellKnownTypeData.WellKnownTypeNames.Length];
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
1252if (parts.Length > 1 && TryParseNodeVersion(parts[1], out var version))
Aspire.Hosting.JavaScript.Tests (1)
AddNodeAppTests.cs (1)
21&& m.GetParameters() is { Length: 5 } parameters
Aspire.Hosting.Kubernetes (1)
KubernetesInfrastructure.cs (1)
29if (kubernetesEnvironments.Length == 0)
Aspire.Hosting.Maui (1)
Utilities\MauiEnvironmentHelper.cs (1)
190for (var i = 0; i < chars.Length; i++)
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
709return parts.Length > 0 && int.TryParse(parts[0], out majorVersion) && majorVersion > 0;
Aspire.Hosting.PostgreSQL.Tests (1)
AddPostgresTests.cs (1)
738&& m.GetParameters() is { Length: 5 } parameters
Aspire.Hosting.Qdrant.Tests (1)
AddQdrantTests.cs (1)
21&& m.GetParameters() is { Length: 5 } parameters
Aspire.Hosting.RemoteHost (42)
Ats\AtsCallbackProxyFactory.cs (6)
89var argsExpr = parameters.Length == 0 141for (int i = 0; i < parameters.Length; i++) 355for (int i = 0; i < parameters.Length; i++) 374Debug.Assert(originalArgs.Length == argTypes.Length, "originalArgs and argTypes must have the same length"); 381for (int i = 0; i < originalArgs.Length; i++)
Ats\AtsMarshaller.cs (2)
270if (genericArgs.Length == 1) 285if (genericArgs.Length == 2)
Ats\CapabilityDispatcher.cs (4)
270var methodArgs = new object?[parameters.Length]; 271for (int i = 0; i < parameters.Length; i++) 336var methodArgs = new object?[parameters.Length]; 338for (int i = 0; i < parameters.Length; i++)
Ats\GenericMethodResolver.cs (5)
27var resolvedTypes = new Type[genericArgs.Length]; 31for (var i = 0; i < genericArgs.Length; i++) 41for (var j = 0; j < parameters.Length && j < arguments.Length; j++) 61for (var k = 0; k < typeArgs.Length; k++)
Ats\ReferenceExpressionRef.cs (4)
207if (ValueProviders == null || ValueProviders.Length == 0) 215var valueProviders = new object?[ValueProviders.Length]; 216for (int i = 0; i < ValueProviders.Length; i++) 248index >= 0 && index < valueProviders.Length)
AtsCapabilityScanner.cs (21)
1770if (genericArgs.Length > 0) 1780if (genericArgs.Length > 0) 1819if (genericArgs.Length == 2) 1836if (genericArgs.Length == 1) 1846if (genericArgs.Length == 1) 1856if (genericArgs.Length > 0) 1864if (constraints.Length > 0) 2027if (genericArgs.Length > 0) 2038if (genericArgs.Length > 0) 2088if (genericArgs.Length == 2) 2111if (genericArgs.Length == 2) 2134if (genericArgs.Length == 1) 2154if (genericArgs.Length == 1) 2175if (genericArgs.Length > 0) 2183if (constraints.Length > 0) 2304if (genericArgs.Length == 0) 2322return constraints.Length == 0; 2442if (genericArgs.Length > 0) 2452if (genericArgs.Length > 0) 2610if (unionAttr.Types.Length < 2) 2613$"[AspireUnion] on {context} has {unionAttr.Types.Length} type(s). Union must have at least 2 types.");
Aspire.Hosting.RemoteHost.Tests (4)
AtsCapabilityScannerTests.cs (1)
370Assert.Equal(2, parameters.Length);
AttributeDataReaderTests.cs (1)
96Assert.Equal(2, result.Types.Length);
ReferenceExpressionRefTests.cs (2)
58Assert.Equal(2, exprRef.ValueProviders.Length); 244if (valueProviders != null && valueProviders.Length > 0)
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
90if (parameters.Length == 0)
Aspire.Hosting.Testing.Tests (5)
TestingBuilderTests.cs (3)
42if (unexpectedAppHostFiles.Length > 0) 194Assert.True(result1.Length > 0); 439Assert.True(result.Length > 0);
TestingFactoryTests.cs (2)
58Assert.True(result1.Length > 0); 85Assert.True(result.Length > 0);
Aspire.Hosting.Tests (33)
ApplicationModel\Docker\DockerfileBuilderEdgeCasesTests.cs (1)
234Assert.Equal(101, lines.Length); // FROM + 100 RUN statements
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (6)
148Assert.Equal(2, snapshot.Urls.Length); 165Assert.Equal(2, snapshot.Relationships.Length); 170Assert.Equal(2, snapshot.HealthReports.Length); 175Assert.Equal(2, snapshot.Volumes.Length); 180Assert.Equal(2, snapshot.EnvironmentVariables.Length); 185Assert.Equal(3, snapshot.Commands.Length);
Backchannel\AuxiliaryBackchannelTests.cs (1)
222Assert.Equal(5, results.Length);
Backchannel\Exec\ExecTestsBase.cs (1)
48if (expectedLogMessages.Length == 0)
Backchannel\JsonElementConversionTests.cs (3)
86Assert.Equal(3, array.Length); 121Assert.Equal(4, array.Length); 153Assert.Equal(2, filters.Length);
Dcp\DcpExecutorTests.cs (3)
162var callArgs = executionType == ExecutionType.IDE ? exe.Spec.Args : exe.Spec.Args![^(expectedArgs?.Length ?? 0)..]; 687() => loggerState.GetBacklogSnapshot().Length == 0, 2160Assert.Equal(2 + (aliases?.Length ?? 0), network.Aliases.Count);
DistributedApplicationTests.cs (3)
1249Assert.Equal(16, keyBytes.Length); 1911Assert.True(parts.Length >= 3, """A line should have line number, timestamp, and "the rest" """); 1918Assert.True(parts.Length >= 2, """A line should start with a timestamp""");
ManifestGenerationTests.cs (3)
146if (withArgsArgs.Length > 0) 160Assert.Equal(addExecutableArgs.Length + withArgsArgs.Length, args.GetArrayLength());
Pipelines\DistributedApplicationPipelineTests.cs (1)
1376Assert.Equal(expectedFilteredLevels.Length, capturedLogs.Count);
ResourceCommandServiceTests.cs (1)
181Assert.Equal(2, resourceNames.Length);
ResourceWithProbeTests.cs (1)
55Assert.Equal(2, annotations.Length);
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
WithUrlsTests.cs (7)
510var initialized = urlSnapshots.FirstOrDefault(s => s.Length == 1); 513var endpointsAllocated = urlSnapshots.FirstOrDefault(s => s.Length == 2 && s.Any(u => u.IsInactive)); 516var running = urlSnapshots.FirstOrDefault(s => s.Length == 2 && s.All(u => !u.IsInactive)); 628var initialized = urlSnapshots.FirstOrDefault(s => s.Length == 1); 631var endpointsAllocated = urlSnapshots.FirstOrDefault(s => s.Length == 2 && s.Any(u => u.IsInactive)); 634var running = urlSnapshots.FirstOrDefault(s => s.Length == 2 && s.All(u => !u.IsInactive)); 981&& e.Snapshot.Urls.Length == resourceB.Resource.GetEndpoints().ToArray().Length + 1
Aspire.Hosting.Yarp (2)
ConfigurationBuilder\YarpConfigurationBuilder.cs (1)
59if (destinations.Length == 0)
YarpEnvConfigGenerator.cs (1)
28for (var i =0; i < cluster.Targets.Length; i++)
Aspire.Hosting.Yarp.Tests (2)
YarpClusterTests.cs (2)
132Assert.Equal(2, cluster.Targets.Length); 199Assert.Equal(3, cluster.Targets.Length);
Aspire.Microsoft.Azure.Cosmos (2)
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (2)
src\Shared\StableConnectionStringBuilder.cs (2)
180for (var i = 0; i < parts.Length; i++) 190if (keyAndValue.Length > 1)
Aspire.Milvus.Client.Tests (1)
ConformanceTests.cs (1)
66if (keyValue.Length == 2 && keyValue[0].Equals(configKey, StringComparison.OrdinalIgnoreCase))
Aspire.Playground.Tests (4)
src\Shared\PathLookupHelper.cs (1)
54if (pathExtensions is not null && pathExtensions.Length > 0)
src\Shared\X509Certificate2Extensions.cs (2)
52if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
tests\Aspire.TestUtilities\RequiresToolsAttribute.cs (1)
15if (executablesOnPath.Length == 0)
Aspire.Qdrant.Client.Tests (1)
ConformanceTests.cs (1)
70if (keyValue.Length == 2 && keyValue[0].Equals(configKey, StringComparison.OrdinalIgnoreCase))
Aspire.RabbitMQ.Client.Tests (2)
AspireRabbitMQLoggingTests.cs (2)
72Assert.True(logs.Length >= 2, "Should be at least 2 logs written."); 102Assert.Equal(2, logs.Length);
Aspire.RabbitMQ.Client.v6.Tests (2)
tests\Aspire.RabbitMQ.Client.Tests\AspireRabbitMQLoggingTests.cs (2)
72Assert.True(logs.Length >= 2, "Should be at least 2 logs written."); 102Assert.Equal(2, logs.Length);
Aspire.Templates.Tests (1)
StarterTemplateRunTestsBase.cs (1)
87Assert.Equal(5, response.Length);
Aspire.TestUtilities (4)
RequiresToolsAttribute.cs (1)
15if (executablesOnPath.Length == 0)
src\Shared\PathLookupHelper.cs (1)
54if (pathExtensions is not null && pathExtensions.Length > 0)
src\Shared\X509Certificate2Extensions.cs (2)
52if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0)
AspireJavaScript.MinimalApi (1)
AppHost.cs (1)
32summaries[Random.Shared.Next(summaries.Length)]
aspire-managed (3)
NuGet\Commands\RestoreCommand.cs (3)
104if (!string.IsNullOrEmpty(nugetConfigPath) && sources.Length > 0) 119if (parts.Length < 2) 159Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "Restoring {0} packages for {1}", packages.Length, framework));
AspireWithMaui.WeatherApi (1)
Controllers\WeatherForecastController.cs (1)
21Summary = s_summaries[Random.Shared.Next(s_summaries.Length)]
AspireWithNode.AspNetCoreApi (1)
Program.cs (1)
27summaries[Random.Shared.Next(summaries.Length)]
AzureFunctionsEndToEnd.Functions (1)
MyEventHubTrigger.cs (1)
11logger.LogInformation("C# EventHub trigger function processed: {Count} messages", input.Length);
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
32while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) > 0)
cdac-build-tool (2)
ComposeCommand.cs (1)
31if (inputs == null || inputs.Length == 0)
ObjectFileScraper.cs (1)
375while (j < fields.Length && !string.IsNullOrEmpty(fields[j].Name))
CodeStyleConfigFileGenerator (2)
Program.cs (2)
31if (args.Length != ExpectedArguments) 33Console.Error.WriteLine($"Excepted {ExpectedArguments} arguments, found {args.Length}: {string.Join(';', args)}");
ConfigurationSchemaGenerator (3)
ConfigSchemaEmitter.cs (1)
680if (_exclusionPaths.Length > 0)
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++)
crossgen2 (6)
Program.cs (5)
376if (crossModuleInlining.Length > 0) 736if (singleMethodName == null && singleMethodTypeName == null && singleMethodGenericArgs.Length == 0) 792if (method.Instantiation.Length != singleMethodGenericArgs.Length) 919if (blob.Length < s_publicKeyHeaderSize + 1) 942if (blob.Length != s_publicKeyHeaderSize + publicKeySize)
src\runtime\src\coreclr\tools\Common\InstructionSetHelpers.cs (1)
172for (int i = 0; i < instructionSetParamsInput.Length; i++)
csc (2)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
331responseBuffer.Length,
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
161_loggingStream.Write(bytes, 0, bytes.Length);
CSharpSyntaxGenerator (6)
Grammar\GrammarGenerator.cs (3)
277var indices = new int[array.Length]; 287for (var i = 0; i < indices.Length; i++) 289if (++indices[i] < array[i].Length)
Program.cs (3)
24if (args.Length is < 2 or > 3) 37if (args.Length == 3) 55else if (args.Length == 2)
CustomResources.AppHost (2)
TestResource.cs (2)
63var randomState = states[Random.Shared.Next(0, states.Length)]; 64var randomStyle = stateStyles[Random.Shared.Next(0, stateStyles.Length)];
Deployers.ApiService (1)
Program.cs (1)
19summaries[Random.Shared.Next(summaries.Length)]
DnnAnalyzer (2)
DnnAnalyzer.cs (2)
16if (args == null || args.Length != 1) 24var inputsString = inputs.Length == 0 ? "" : $", input nodes: {string.Join(", ", inputs)}";
dotnet (112)
_generated\114\WorkloadHistoryJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\13\CliSchemaJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\130\NugetSearchApiJsonSerializerContext.NugetSearchApiPackageSerializableArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\132\NugetSearchApiJsonSerializerContext.NugetSearchApiVersionSerializableArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\135\NugetSearchApiJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\158\TelemetryDiskLoggerJsonSerializerContext.EventModelArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\171\LocalToolsCacheJsonSerializerContext.CacheRowArray.g.cs (1)
59for (int i = 0; i < value.Length; i++)
_generated\58\ToolListJsonSerializerContext.LocalToolListJsonContractArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\60\ToolListJsonSerializerContext.ToolListJsonContractArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\65\ToolListJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\80\WorkloadManifestUpdaterJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\94\WorkloadListJsonSerializerContext.UpdateAvailableEntryArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\96\WorkloadListJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
Commands\NuGet\NuGetCommand.cs (1)
50for (int i = 0; i < args.Length; i++)
Commands\Run\RunCommand.cs (2)
773if (projectFiles.Length == 0) 778if (projectFiles.Length > 1)
Commands\Run\RunCommandSelector.cs (3)
256if (frameworks.Length == 1) 274for (int i = 0; i < frameworks.Length; i++) 376devices = new(targetResult.Items.Length);
Commands\Run\RunProperties.cs (1)
54if (applicationArgs.Length != 0)
Commands\Run\VirtualProjectBuildingCommand.cs (2)
330var effectiveTargets = Builder.RequestedTargets is { Length: > 0 } requestedTargets 462if (coreCompileResult.Items.Length == 0)
Commands\Solution\List\SolutionListCommand.cs (1)
52if (paths.Length == 0)
Commands\Test\MTP\IPC\Serializers\BaseSerializer.cs (1)
262public static bool IsNullOrEmpty<T>(T[]? list) => list is null || list.Length == 0;
Commands\Test\MTP\IPC\Serializers\CommandLineOptionMessagesSerializer.cs (2)
137if (commandLineOptionMessageList is null || commandLineOptionMessageList.Length == 0) 149WriteInt(stream, commandLineOptionMessageList.Length);
Commands\Test\MTP\IPC\Serializers\DiscoveredTestMessagesSerializer.cs (6)
264if (discoveredTestMessageList is null || discoveredTestMessageList.Length == 0) 276WriteInt(stream, discoveredTestMessageList.Length); 299if (parameterTypeFullNames is null || parameterTypeFullNames.Length == 0) 311WriteInt(stream, parameterTypeFullNames.Length); 324if (traits is null || traits.Length == 0) 336WriteInt(stream, traits.Length);
Commands\Test\MTP\IPC\Serializers\FileArtifactMessagesSerializer.cs (2)
162if (fileArtifactMessageList is null || fileArtifactMessageList.Length == 0) 174WriteInt(stream, fileArtifactMessageList.Length);
Commands\Test\MTP\IPC\Serializers\TestInProgressMessagesSerializer.cs (2)
130if (inProgressMessageList is null || inProgressMessageList.Length == 0) 142WriteInt(stream, inProgressMessageList.Length);
Commands\Test\MTP\IPC\Serializers\TestResultMessagesSerializer.cs (6)
346if (successfulTestResultMessages is null || successfulTestResultMessages.Length == 0) 358WriteInt(stream, successfulTestResultMessages.Length); 380if (failedTestResultMessages is null || failedTestResultMessages.Length == 0) 392WriteInt(stream, failedTestResultMessages.Length); 415if (exceptionMessages is null || exceptionMessages.Length == 0) 427WriteInt(stream, exceptionMessages.Length);
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.Help.cs (6)
254if (modules.Length == 0) 261for (int i = 0; i < missingOptions.Length; i++) 263if (i == missingOptions.Length - 1) 269string format = modules.Length == 1 270? (missingOptions.Length == 1 ? CliCommandStrings.HelpModuleIsMissingTheOptionBelow : CliCommandStrings.HelpModuleIsMissingTheOptionsBelow) 271: (missingOptions.Length == 1 ? CliCommandStrings.HelpModulesAreMissingTheOptionBelow : CliCommandStrings.HelpModulesAreMissingTheOptionsBelow);
Commands\Test\MTP\SolutionAndProjectUtility.cs (18)
51if (actualProjectFiles.Length == 1 && actualSolutionFiles.Length == 1) 67else if (actualSolutionFiles.Length > 1) 72else if (actualProjectFiles.Length > 1) 78if (actualProjectFiles.Length == 2) 109else if (actualProjectFiles.Length == 0 && 110actualSolutionFiles.Length == 0 && 111solutionFilterFiles.Length == 0) 119projectOrSolutionFilePath = actualSolutionFiles.Length == 1 ? actualSolutionFiles[0] : actualProjectFiles.Length == 1 ? actualProjectFiles[0] : solutionFilterFiles[0]; 120isSolution = actualSolutionFiles.Length == 1 || (actualProjectFiles.Length != 1 && solutionFilterFiles.Length == 1); 121if (actualSolutionFiles.Length != 1 && 122actualProjectFiles.Length != 1 && 123solutionFilterFiles.Length != 1) 143if (actualSolutionFiles.Length == 0) 148if (actualSolutionFiles.Length > 1)
Commands\Test\MTP\Terminal\AnsiTerminalTestProgressFrame.cs (8)
221if (progress.Length > 0 && progress.Any(i => i != null)) 227RenderedLines = new List<RenderedProgressItem>(progress.Length * 2); 337var linesToRender = new List<object>(progress.Length); 343int linesToDistribute = (int)(Height * 0.7) - 1 - progressItems.Length; 344var detailItems = new IEnumerable<TestDetailState>[progressItems.Length]; 345IEnumerable<int> sortedItemsIndices = Enumerable.Range(0, progressItems.Length).OrderBy(i => progressItems[i].TestNodeResultsState?.Count ?? 0); 349detailItems[sortedItemIndex] = progressItems[sortedItemIndex].TestNodeResultsState?.GetRunningTasks(linesToDistribute / progressItems.Length) ?? []; 352for (int progressI = 0; progressI < progressItems.Length; progressI++)
Commands\Test\MTP\Terminal\TerminalTestReporter.cs (3)
592if (exceptions is null || exceptions.Length == 0) 597for (int i = 1; i < exceptions.Length; i++) 637exceptions != null && exceptions.Length >= index + 1 ? property(exceptions[index]) : null;
Commands\Test\MTP\Terminal\TestProgressStateAwareTerminal.cs (1)
70for (int i = 0; i < _progressItems.Length; i++)
Commands\Test\VSTest\TestCommand.cs (6)
37if (args.Length > 0) 70if (settings.Length == 0) 76return settings.Length - 1; 204var unMatchedNonSettingsArgs = settings.Length > 1 229if (verbosity.Length == 2) 458if (parameterAndValue[0].Equals("default", StringComparison.InvariantCultureIgnoreCase) && parameterAndValue.Length > 1)
LoggerUtility.cs (1)
15for (int i = restoreArgs.Length - 1; i >= 0; i--)
NugetPackageDownloader\NuGetPackageDownloader.cs (2)
478if (extraFeeds == null || extraFeeds.Length == 0) 747if (foundPackagesBySource.Length == 0)
NugetPackageDownloader\PackageSourceLocation.cs (2)
43string[] localFeedsThatIsRooted = new string[sourceFeedOverrides.Length]; 44for (int index = 0; index < sourceFeedOverrides.Length; index++)
PrintableTable.cs (6)
94if (_columns.Count != widths.Length) 104if (_columns.Count != widths.Length) 114if (widths.Length != contents.Length) 119if (contents.Length == 0) 131for (int i = 0; i < contents.Length; ++i)
ShellShim\ShellShimRepository.cs (2)
208if (candidatepackagedShim.Length > 1) 216if (candidatepackagedShim.Length == 1)
SlnFileFactory.cs (2)
34if (files.Length == 0) 40if (files.Length > 1)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\BuildProtocol.cs (1)
331responseBuffer.Length,
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\CompilerServerLogger.cs (1)
161_loggingStream.Write(bytes, 0, bytes.Length);
src\sdk\src\Common\WorkloadSetVersion.cs (2)
11if (sections.Length < 1) 21int coreComponentsLength = SeparateCoreComponents(workloadSetVersion, out _).Length;
Telemetry\LLMEnvironmentDetectorForTelemetry.cs (1)
58return results.Length > 0 ? string.Join(", ", results) : null;
Telemetry\MacAddressGetter.cs (1)
154if (nics == null || nics.Length < 1)
ToolManifest\ToolManifestEditor.cs (1)
273|| tools.Commands != null && tools.Commands.Length == 0)
ToolPackage\LocalToolsResolverCache.cs (2)
167if (matchingRow.Length >= 2) 173if (matchingRow.Length == 1)
ToolPackage\LockFileMatchChecker.cs (3)
25return entryPointPathInArray.Length >= 1 59if (pathInLockFilePathInArray.Length - targetInArray.Length != 3)
ToolPackage\ToolConfigurationDeserializer.cs (1)
76if (dotNetCliTool.Commands.Length != 1)
dotnet-dev-certs (16)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (8)
236if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 702Array.Clear(keyBytes, 0, keyBytes.Length); 703Array.Clear(pem, 0, pem.Length); 709Array.Clear(keyBytes, 0, keyBytes.Length); 710Array.Clear(pem, 0, pem.Length); 760Array.Clear(bytes, 0, bytes.Length); 788Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
177Array.Clear(export, 0, export.Length); 624if (availableCommands.Count == commands.Length)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
66Array.Clear(export, 0, export.Length);
src\aspnetcore\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\aspnetcore\src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-format (17)
Commands\FormatAnalyzersCommand.cs (2)
45parseResult.GetValue(DiagnosticsOption) is string[] { Length: > 0 } diagnostics) 51parseResult.GetValue(ExcludeDiagnosticsOption) is string[] { Length: > 0 } excludeDiagnostics)
Commands\FormatCommandCommon.cs (4)
233if (include.Length == 1 && standardInputKeywords.Contains(include[0])) 241if (exclude.Length == 1 && standardInputKeywords.Contains(exclude[0])) 260Array.Clear(subject, 0, subject.Length); 275Array.Resize(ref subject, subject.Length + 1);
Commands\FormatStyleCommand.cs (2)
45parseResult.GetValue(DiagnosticsOption) is string[] { Length: > 0 } diagnostics) 51parseResult.GetValue(ExcludeDiagnosticsOption) is string[] { Length: > 0 } excludeDiagnostics)
Commands\RootFormatCommand.cs (2)
49parseResult.GetValue(DiagnosticsOption) is string[] { Length: > 0 } diagnostics) 55parseResult.GetValue(ExcludeDiagnosticsOption) is string[] { Length: > 0 } excludeDiagnostics)
Formatters\CharsetFormatter.cs (2)
55return originalBytes.Length == encodedBytes.Length
Utilities\EditorConfigFinder.cs (2)
29for (var index = 0; index < files.Length; index++) 40if (files.Length == 1)
Utilities\SourceFileMatcher.cs (3)
24_shouldMatchAll = include.Length == 0 && exclude.Length == 0; 26Include = include.Length > 0
dotnet-Microsoft.XmlSerializer.Generator (10)
Sgen.cs (10)
50for (int i = 0; i < args.Length; i++) 71if (i >= args.Length || codePath != null) 83if (i >= args.Length) 99if (i >= args.Length || assembly != null) 111if (i >= args.Length || defaultNamespace != null) 143if (i >= args.Length) 184if (args.Length == 0 || assembly == null) 268for (int i = 0; i < types.Length; i++) 278Console.WriteLine(SR.Format(SR.ImportInfo, type.Name, i + 1, types.Length)); 607if (string.IsNullOrEmpty(e.Name) || e.Name.Split(',').Length == 0)
dotnet-sourcelink (1)
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 (1538)
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)
101for (int i = 0; i < propsToRemove.Length; i++) 111for (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)
103for (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 (6)
340if (csProjects.Length == 1 && vbProjects.Length == 0) 344else if (csProjects.Length == 0 && vbProjects.Length == 1) 349else if (csProjects.Length == 0 && vbProjects.Length == 0)
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\Microsoft\VBCodeProvider.cs (4)
2858Debug.Assert(names.Length > 0); 2860for (int i = 1; i < names.Length; i++) 3524for (int i = 0; i < names.Length; i++) 3553for (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 (13)
_generated\1\JwtSerializerContext.JwtArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\3\JwtSerializerContext.SigningKeyArray.g.cs (1)
57for (int i = 0; i < value.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)
302if (parts.Length != 2)
src\aspnetcore\artifacts\obj\dotnet-user-jwts\Release\net11.0\Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\artifacts\obj\dotnet-user-jwts\Release\net11.0\Microsoft.AspNetCore.Tools.SecretsHelpersResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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\aspnetcore\src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-user-secrets (7)
src\aspnetcore\artifacts\obj\dotnet-user-secrets\Release\net11.0\Microsoft.AspNetCore.Tools.SecretsHelpersResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\artifacts\obj\dotnet-user-secrets\Release\net11.0\Microsoft.Extensions.SecretManager.Tools.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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\aspnetcore\src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-watch (1)
Watch\BuildEvaluator.cs (1)
208for (var i = 0; i < s_msBuildFileExtensionHashes.Length; i++)
EventSourceGenerator (1)
EventSourceGenerator.Parser.cs (1)
177byte[] combinedBytes = new byte[namespaceBytes.Length + bytes.Length];
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)
60readResult = stream.Read(buffer, 0, buffer.Length); 301readResult = stream.Read(buffer, 0, buffer.Length); 464readResult = stream.Read(buffer, 0, buffer.Length);
GenerateAnalyzerNuspec (8)
Program.cs (8)
11if (args.Length != 22) 13for (var i = 0; i < args.Length; i++) 84if (dependencyList.Length > 0) 101if (fileList.Length > 0 || assemblyList.Length > 0 || libraryList.Length > 0 || folderList.Length > 0 || readmePackageLocation.Length > 0) 217var targetPath = tfms.Length > 1 ? Path.Combine(folder, tfm) : folder;
GenerateDocumentationAndConfigFiles (154)
CodeFixerExtensions.cs (1)
82int? ilInstructionCount = body?.GetILAsByteArray()?.Length;
Program.cs (1)
696if (rule.Value.languages?.Length > 0)
src\roslyn\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\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
119int read = stream.Read(buffer, 0, buffer.Length);
src\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
244return source.Length == 0;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (4)
267if (parts.Length is < 3 or > 6) 274ReleaseTrackingRuleEntryKind.New => parts.Length > 4, 275ReleaseTrackingRuleEntryKind.Removed => parts.Length > 4, 276ReleaseTrackingRuleEntryKind.Changed => parts.Length <= 4,
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
348if (split.Length != 2) 397if (split.Length != 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
693if (trivia.Length == 0) 727if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
106if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
183Contract.ThrowIfFalse(lines.Length > 0); 187if (0 < lines.Length - 1) 193for (var i = 1; i < lines.Length; i++) 204if (i < lines.Length - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
99where nameSplit.Length == 3
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
292WriteArrayLength(array.Length); 372for (var offset = 0; offset < spanLength; offset += buffer.Length) 374var segmentLength = Math.Min(buffer.Length, spanLength - offset); 507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
110if (method.TypeParameters.Length != typeArgumentArray.Length)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
202var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
74if (_sourceLowerCaseCharacters.Length == PooledArraySize)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
57if (taskArray.Length == 0) 61for (var i = 0; i < taskArray.Length; i++) 72var result = new T[taskArray.Length]; 73for (var i = 0; i < taskArray.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
55if (typeArguments.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (4)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
13=> array == null || array.Length == 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
442if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
ilasm (2)
Program.cs (2)
42if (inputFiles is null || inputFiles.Length == 0) 105if (parts.Length == 2 && ushort.TryParse(parts[0], out ushort ssvMajor) && ushort.TryParse(parts[1], out ushort ssvMinor))
ILAssembler (43)
EntityRegistry.cs (1)
994var reader = new BlobReader(ptr, signature.Length);
GrammarVisitor.cs (42)
758if (dottedNames.Length > 1) 798return (indicies.Length, hasEllipsis) switch 1512blob.WriteInt16((short)fieldOrProps.Length); 1514for (int i = 0; i < fieldOrProps.Length; i++) 1811_manifestResources.WriteInt32(resourceData.Length); 2161for (int i = 0; i < declarations.Length; i++) 2307if (int32s.Length >= 1) 2312if (int32s.Length >= 2) 2328if (int32s.Length >= 3) 2333if (int32s.Length >= 4) 2446var marshalBlob = marshalBlobs.Length > 0 ? VisitMarshalBlob(marshalBlobs[marshalBlobs.Length - 1]).Value : null; 2784if (ids.Length == 2) 2791if (offsets.Length == 2) 2810var builder = ImmutableArray.CreateBuilder<byte>(bytes.Length); 2821var builder = ImmutableArray.CreateBuilder<short>(values.Length); 2832var builder = ImmutableArray.CreateBuilder<int>(values.Length); 2844var builder = ImmutableArray.CreateBuilder<byte>(values.Length); 2856var builder = ImmutableArray.CreateBuilder<long>(values.Length); 3051if (bytes.Length >= 8) 3055else if (bytes.Length >= 4) 3437if (strings.Length >= 1 && Guid.TryParse(StringHelpers.ParseQuotedString(strings[0].GetText()), out var languageGuid)) 3441if (strings.Length >= 2 && Guid.TryParse(StringHelpers.ParseQuotedString(strings[1].GetText()), out var vendorGuid)) 3445if (strings.Length >= 3 && Guid.TryParse(StringHelpers.ParseQuotedString(strings[2].GetText()), out var docTypeGuid)) 3507string alias = dottedNames.Length == 2 ? VisitDottedName(dottedNames[1]).Value : name; 4034numGenericParameters = types.Length; 4035if (types.Length != 0) 4118var prefix = new BlobBuilder(arrayPointerInfo.Length); 4122for (int i = arrayPointerInfo.Length - 1; i >= 0; i--) 4145for (int i = 0; i < arrayPointerInfo.Length; i++) 4195if (strings.Length == 4) 4207Debug.Assert(strings.Length == 2); 4352if (context.compQstring() is { Length: 1 } safeArrayCustomType) 4508string? moduleName = names.Length > 0 ? VisitCompQstring(names[0]).Value : null; 4509string? entryPointName = names.Length > 1 ? VisitCompQstring(names[1]).Value : null; 4642blob.WriteCompressedInteger(secAttributes.Length); 4982if (ids.Length == 2) 4989if (offsets.Length == 2) 5057ImmutableArray<EntityRegistry.GenericParameterEntity>.Builder builder = ImmutableArray.CreateBuilder<EntityRegistry.GenericParameterEntity>(typeParameters.Length); 5084for (int i = typeModifiers.Length - 1; i >= 0; i--) 5166blob.WriteCompressedInteger(types.Length); 5297ImmutableArray<EntityRegistry.TypeEntity>.Builder builder = ImmutableArray.CreateBuilder<EntityRegistry.TypeEntity>(bounds.Length);
ilc (6)
Program.cs (5)
244if (aggregateExeModules.Length > 0) 372if (mibcFilePaths.Length > 0) 386if (switchAndValue.Length != 2 794if (singleMethodName == null && singleMethodTypeName == null && singleMethodGenericArgs.Length == 0) 807if (method.Instantiation.Length != singleMethodGenericArgs.Length)
src\runtime\src\coreclr\tools\Common\InstructionSetHelpers.cs (1)
172for (int i = 0; i < instructionSetParamsInput.Length; i++)
ILCompiler.Compiler (290)
Compiler\CompilerTypeSystemContext.Aot.cs (2)
151TypeDesc[] interfaceDefinitions = new TypeDesc[implementedInterfaces.Length]; 152for (int i = 0; i < interfaceDefinitions.Length; i++)
Compiler\CompilerTypeSystemContext.BoxedTypes.cs (1)
527for (int i = 0; i < inst.Length; i++)
Compiler\Dataflow\FlowAnnotations.cs (11)
565paramAnnotations[paramAnnotations.Length - 1] = annotation; 746if (methodAnnotations.ParameterAnnotations.Length != baseMethodAnnotations.ParameterAnnotations.Length) 749for (int parameterIndex = 0; parameterIndex < methodAnnotations.ParameterAnnotations.Length; parameterIndex++) 768if (methodAnnotations.GenericParameterAnnotations.Length != baseMethodAnnotations.GenericParameterAnnotations.Length) 771for (int genericParameterIndex = 0; genericParameterIndex < methodAnnotations.GenericParameterAnnotations.Length; genericParameterIndex++) 787for (int parameterIndex = 0; parameterIndex < parameterAnnotations.Length; parameterIndex++) 800for (int genericParameterIndex = 0; genericParameterIndex < genericParameterAnnotations.Length; genericParameterIndex++) 909for (int genericParameterIndex = 0; genericParameterIndex < _genericParameterAnnotations.Length; genericParameterIndex++) 946for (int genericParameterIndex = 0; genericParameterIndex < GenericParameterAnnotations.Length; genericParameterIndex++)
Compiler\Dataflow\MethodBodyScanner.cs (2)
203for (int localVariableIndex = 0; localVariableIndex < locals.Length; localVariableIndex++) 348ValueBasicBlockPair?[] locals = new ValueBasicBlockPair?[methodIL.GetLocals().Length];
Compiler\Dataflow\ReflectionMethodBodyScanner.cs (1)
495for (int metadataIndex = 0; metadataIndex < paramMetadata.Length; metadataIndex++)
Compiler\DependencyAnalysis\DehydratedDataNode.cs (8)
88for (int i = 0; i < relocSort.Length; i++) 129while (sourcePosition < o.Data.Length) 136if (currentReloc < o.Relocs.Length) 147bytesToCopy = o.Data.Length - sourcePosition; 254if (currentReloc < o.Relocs.Length) 307Debug.Assert(sourcePosition == o.Data.Length); 308dehydratedSegmentPosition += o.Data.Length; 314for (int i = 0; i < relocSort.Length; i++)
Compiler\DependencyAnalysis\DictionaryLayoutNode.cs (3)
197public override bool IsEmpty => _layout.Length == 0; 222for (int i = 0; i < _layout.Length; i++) 337return _layout.Length == 0;
Compiler\DependencyAnalysis\EETypeNode.cs (4)
276if (_type.RuntimeInterfaces.Length > 0) 439Debug.Assert(defTypeDefinitionRuntimeInterfaces.Length == defTypeRuntimeInterfaces.Length); 440for (int interfaceIndex = 0; interfaceIndex < defTypeRuntimeInterfaces.Length; interfaceIndex++)
Compiler\DependencyAnalysis\GenericVarianceNode.cs (7)
30for (int i = 0; i < _details.Variance.Length; i++) 100if (Variance.Length != other.Variance.Length) 103for (int i = 0; i < Variance.Length; i++) 114var compare = Variance.Length.CompareTo(other.Variance.Length); 118for (int i = 0; i < Variance.Length; i++)
Compiler\DependencyAnalysis\InterfaceDispatchMapNode.cs (4)
92for (int interfaceIndex = declType.RuntimeInterfaces.Length - 1; interfaceIndex >= 0; interfaceIndex--) 148Debug.Assert(declTypeRuntimeInterfaces.Length == declTypeDefinitionRuntimeInterfaces.Length); 161for (int interfaceIndex = 0; interfaceIndex < declTypeRuntimeInterfaces.Length; interfaceIndex++)
Compiler\DependencyAnalysis\InterfaceGenericVirtualMethodTableNode.cs (3)
69for (int index = 0; index < openImplementationType.RuntimeInterfaces.Length; index++) 107for (int index = 0; index < openImplementationType.RuntimeInterfaces.Length; index++) 207Debug.Assert(((uint)ifaceId) < implementationType.RuntimeInterfaces.Length);
Compiler\DependencyAnalysis\ManagedDataDescriptorNode.cs (1)
68builder.EmitUInt((uint)jsonBytes.Length);
Compiler\DependencyAnalysis\MethodExceptionHandlingInfoNode.cs (1)
21Debug.Assert(data.DefinedSymbols == null || data.DefinedSymbols.Length == 0);
Compiler\DependencyAnalysis\NativeLayoutVertexNode.cs (11)
124for (int i = 0; i < _instantiationArgsSig.Length; i++) 171Debug.Assert(_instantiationArgsSig == null || (_instantiationArgsSig != null && _method.Instantiation.Length == _instantiationArgsSig.Length)); 176for (int i = 0; i < args.Length; i++) 267for (int i = 0; i < _parametersSig.Length; i++) 295Debug.Assert(_signature.Length == _parametersSig.Length); 298Vertex[] parameters = new Vertex[_parametersSig.Length]; 299for (int i = 0; i < _parametersSig.Length; i++) 449for (int i = 0; i < _instantiationArgs.Length; i++) 468Vertex[] args = new Vertex[_instantiationArgs.Length]; 469for (int i = 0; i < args.Length; i++) 1015if (_type.RuntimeInterfaces.Length > 0)
Compiler\DependencyAnalysis\NodeFactory.cs (1)
1330_helperEntrypointSymbols ??= new ISymbolNode[s_helperEntrypointNames.Length];
Compiler\DependencyAnalysis\ResourceDataNode.cs (2)
131Buffer.BlockCopy(resourceData, 0, resourceBlob, currentPos, resourceData.Length); 132currentPos += resourceData.Length;
Compiler\DependencyAnalysis\SealedVTableNode.cs (3)
153Debug.Assert(declTypeRuntimeInterfaces.Length == declTypeDefinitionRuntimeInterfaces.Length); 155for (int interfaceIndex = 0; interfaceIndex < declTypeRuntimeInterfaces.Length; interfaceIndex++)
Compiler\DependencyAnalysis\StructMarshallingStubMapNode.cs (2)
87for (int i = 0; i < nativeType.Fields.Length; i++) 98(uint)(nativeType.Fields.Length << InteropDataConstants.FieldCountShift);
Compiler\DescriptorMarker.cs (2)
327if (accessors.Length > 0) 329for (int i = 0; i < accessors.Length; ++i)
Compiler\Disassembler.cs (3)
26SortedList<int, Relocation> sortedRelocs = new SortedList<int, Relocation>(relocs.Length); 35while (offset < bytes.Length) 107size = DumpInstruction(_handle, (ulong)offset, (IntPtr)pByte, bytes.Length - offset);
Compiler\ExportsFileWriter.cs (1)
61if (_exportSymbols.Length != 0 || _methods.Count != 0)
Compiler\ILAssemblyGeneratingMethodDebugInfoProvider.cs (2)
103if (locals != null && locals.Length > 0) 111for (int i = 0; i < locals.Length; i++)
Compiler\MetadataManager.cs (3)
118return new ObjectNode.ObjectData(new byte[hydratedData.Data.Length], 815if (metadataBlob.Length > MaxAllowedMetadataOffset) 818throw new InvalidOperationException($"Metadata blob exceeded the addressing range (allowed: {MaxAllowedMetadataOffset}, actual: {metadataBlob.Length})");
Compiler\MethodBodyDeduplicator.cs (6)
111if (AreSame(o1.Data, o2.Data) && o1.Relocs.Length == o2.Relocs.Length) 113for (int i = 0; i < o1.Relocs.Length; i++) 172if (o1frames.Length != o2frames.Length) 175for (int i = 0; i < o1frames.Length; i++)
Compiler\MstatObjectDumper.cs (6)
65_types.LoadConstantI4(objectData.Data.Length); 73objectData.Data.Length, 74codeInfo.GCInfo.Length)); 77_methodEhInfo.Add(ehInfoNode.Method, objectData.Data.Length); 82_fieldRvas.LoadConstantI4(rvaDataNode.Field.GetFieldRvaData().Length); 105_blobs[nodeName] = size + objectData.Data.Length;
Compiler\ObjectWriter\CodeView\CodeViewTypesBuilder.cs (5)
243Debug.Assert(typeRecords.Length <= ushort.MaxValue); 244record.Write((ushort)typeRecords.Length); // Number of elements in class 348fieldListRecord.Write((uint)argumentTypes.Length); 534overflow.CopyTo(_bufferWriter.GetSpan(overflow.Length)); 535_bufferWriter.Advance(overflow.Length);
Compiler\ObjectWriter\CoffObjectWriter.Aot.cs (1)
83for (int i = 0; i < frameInfos.Length; i++)
Compiler\ObjectWriter\Dwarf\DwarfAbbrev.cs (1)
28for (int i = 2; i < _definition.Length; i++)
Compiler\ObjectWriter\Dwarf\DwarfEhFrame.cs (2)
89(uint)cie.Instructions.Length; 138(uint)fde.Instructions.Length;
Compiler\ObjectWriter\Dwarf\DwarfFde.cs (1)
53while (offset < blobData.Length)
Compiler\ObjectWriter\Dwarf\DwarfInfo.cs (6)
107writer.WriteStartDIE(_typeRecords.Length > 0 ? DwarfAbbrev.EnumerationType : DwarfAbbrev.EnumerationTypeNoChildren); 112if (_typeRecords.Length > 0) 245_statics = new(statics.Length); 261_fields.Length > 0 || 324method.ArgumentTypes.Length > 0 ? DwarfAbbrev.SubprogramStaticSpec : DwarfAbbrev.SubprogramStaticNoChildrenSpec); 448bool usesDebugLoc = metadataInfo.DebugVarInfo.Ranges.Length != 1;
Compiler\ObjectWriter\Eabi\EabiUnwindConverter.cs (4)
30if (blobData == null || blobData.Length == 0) 35Debug.Assert(blobData.Length % 8 == 0); 69int lastCodeOffset = blobData[blobData.Length - 8]; 72for (int offset = blobData.Length - 8; offset >= 0; offset -= 8)
Compiler\ObjectWriter\ElfObjectWriter.Aot.cs (1)
95for (int i = 0; i < frameInfos.Length; i++)
Compiler\ObjectWriter\MachObjectWriter.Aot.cs (3)
120if (blobData == null || blobData.Length == 0) 125Debug.Assert(blobData.Length % 8 == 0); 152while (offset < blobData.Length)
Compiler\ObjectWriter\UnixObjectWriter.Aot.cs (2)
192newLsdaSymbols = new Utf8String[frameInfos.Length]; 198for (int i = 0; i < frameInfos.Length; i++)
Compiler\ReachabilityInstrumentationFilter.cs (1)
65if (!_reachabilityInfo.TryGetValue(mvid, out bool[] tokenStates) || rowNumber >= tokenStates.Length)
Compiler\ReachabilityInstrumentationProvider.cs (5)
90if (regions.Length > 0) 93for (int i = 0; i < regions.Length; i++) 110byte[] newBytes = new byte[originalBytes.Length + InstrumentationPrefixByteCount]; 115Array.Copy(originalBytes, 0, newBytes, InstrumentationPrefixByteCount, originalBytes.Length); 186builder.EmitInt(item.Value.Length);
Compiler\SubstitutedILProvider.cs (17)
140OpcodeFlags[] flags = new OpcodeFlags[methodBytes.Length]; 154if ((uint)ehRegion.TryLength >= (uint)methodBytes.Length 155|| (uint)ehRegion.HandlerLength >= (uint)methodBytes.Length 156|| ((uint)methodBytes.Length - (uint)ehRegion.TryLength) < (uint)ehRegion.TryOffset 157|| ((uint)methodBytes.Length - (uint)ehRegion.HandlerLength) < (uint)ehRegion.HandlerOffset) 166if ((uint)offset >= (uint)flags.Length) 308if (handlerEnd < flags.Length) 452var offsetMap = new int[methodBytes.Length + 1]; 460while (srcPos < flags.Length) 480} while (srcPos < flags.Length && (flags[srcPos] & OpcodeFlags.VisibleBasicBlockStart) == 0); 506offsetMap[methodBytes.Length] = dstPos; 512while (srcPos < flags.Length) 529while (srcPos < flags.Length && (flags[srcPos] & OpcodeFlags.VisibleBasicBlockStart) == 0); 542while (srcPos < flags.Length && (flags[srcPos] & OpcodeFlags.VisibleBasicBlockStart) == 0); 621if (sequencePoint.Offset < flags.Length && (flags[sequencePoint.Offset] & OpcodeFlags.Mark) != 0) 642for (int srcOffset = 0; srcOffset < flags.Length; srcOffset++) 687|| methodIL.GetExceptionRegions().Length > 0)
Compiler\TypePreinit.cs (52)
176if (ehRegions != null && ehRegions.Length > 0) 195Value[] locals = new Value[localTypes.Length]; 196for (int i = 0; i < localTypes.Length; i++) 572if (finalizerMethodILBytes.Length != 1 || finalizerMethodILBytes[0] != (byte)ILOpcode.ret) 1040if (index >= locals.Length) 1063if (index >= locals.Length) 1095if (index >= storage.Length) 1534if (addition > previousByRef.PointedToBytes.Length - previousByRef.PointedToOffset 1818if (sizeBytes > addressValue.PointedToBytes.Length - addressValue.PointedToOffset 1911if (rvaData.Length % elementSize != 0) 1913retVal = new SpanValue(elementType, rvaData, 0, rvaData.Length); 2315public override int Size => InstanceBytes.Length; 2352Array.Copy(vtvalue.InstanceBytes, InstanceBytes, InstanceBytes.Length); 2359|| vtvalue.InstanceBytes.Length != InstanceBytes.Length) 2365for (int i = 0; i < InstanceBytes.Length; i++) 2391if (InstanceBytes.Length != size) 2418public override int Size => _entryType.InstanceFieldSize.AsInt * _targetFields.Length; 2478for (int i = 0; i < _targetFields.Length; i++) 2483Debug.Assert(_entryType.GetField("Vtable"u8).Offset.AsInt == _guidBytes[i].Length); 2541&& guidValue.Size == _parent._guidBytes[_index].Length) 2543Array.Copy(guidValue.InstanceBytes, _parent._guidBytes[_index], _parent._guidBytes[_index].Length); 2575&& field.Offset.AsInt < _parent._entryType.InstanceFieldSize.AsInt * _parent._targetFields.Length) 2609public override int Size => _methods.Length * _type.Context.Target.PointerSize; 2680Array.Copy(other._methods, _methods, other._methods.Length); 2719&& _parent._methods.Length - _index >= otherStruct._methods.Length) 2721Array.Copy(otherStruct._methods, 0, _parent._methods, _index, otherStruct._methods.Length); 2732|| mdType.InstanceFieldSize.AsInt > (_parent._methods.Length - _index) * _parent._type.Context.Target.PointerSize) 2739Array.Copy(_parent._methods, _index, slots, 0, slots.Length); 2755if (index >= _parent._methods.Length) 2791if (_index + numSlots > _parent._methods.Length) 2911Debug.Assert(index <= bytes.Length); 2912Debug.Assert(length <= bytes.Length - index); 3107if ((uint)size > (uint)(PointedToBytes.Length - PointedToOffset)) 3126if (PointedToOffset + src.Length > PointedToBytes.Length) 3129Array.Copy(src, 0, PointedToBytes, PointedToOffset, src.Length); 3137|| ((MetadataType)type).InstanceFieldSize.AsInt > PointedToBytes.Length - PointedToOffset) 3144Array.Copy(PointedToBytes, PointedToOffset, result.InstanceBytes, 0, result.InstanceBytes.Length); 3334if (bytes.Length != _data.Length) 3337Array.Copy(bytes, _data, bytes.Length); 3357Debug.Assert(valueToStore.InstanceBytes.Length == _elementSize); 3358Array.Copy(valueToStore.InstanceBytes, 0, _data, index * _elementSize, valueToStore.InstanceBytes.Length); 3448int length = _value.Length - startOffset - sizeof(char) /* terminating null */; 3533Array.Copy(valuetype.InstanceBytes, 0, result._data, type.Context.Target.PointerSize, valuetype.InstanceBytes.Length); 3548Array.Copy(_data, type.Context.Target.PointerSize, result.InstanceBytes, 0, result.InstanceBytes.Length); 3572builder.EmitBytes(_data, pointerSize, _data.Length - pointerSize); 3597if (fieldOffset + fieldSize > _instanceBytes.Length - _offset) 3619if (fieldOffset + fieldSize > _instanceBytes.Length - _offset) 3649if (fieldOffset + fieldSize > _instanceBytes.Length - _offset)
Compiler\UserDefinedTypeDescriptor.cs (1)
213for (int i = 0; i < args.Length; i++)
Compiler\XmlObjectDumper.cs (2)
56_writer.WriteAttributeString("Length", objectData.Data.Length.ToStringInvariant()); 65_writer.WriteAttributeString("Length", nodeWithCodeInfo.GCInfo.Length.ToStringInvariant());
IL\ILImporter.Scanner.cs (5)
120_exceptionRegions = new ExceptionRegion[ilExceptionRegions.Length]; 121for (int i = 0; i < ilExceptionRegions.Length; i++) 345while (nextBBOffset < _basicBlocks.Length && _basicBlocks[nextBBOffset] == null) 930&& _currentOffset + 5 < _ilBytes.Length 1045for (int i = 0; i < jmpDelta.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\GVMDependenciesNode.cs (1)
134for (int interfaceIndex = 0; interfaceIndex < potentialInterfaces.Length; interfaceIndex++)
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (11)
86if (_types.Length == 0) 90for (int i = 1; i < _types.Length; i++) 100uint sizeLength = DwarfHelper.SizeOfULEB128((ulong)_types.Length); 101return (int)(sizeLength + (uint)_types.Length); 106int sizeLength = DwarfHelper.WriteULEB128(buffer, (ulong)_types.Length); 108for (int i = 0; i < _types.Length; i++) 112return (int)(sizeLength + (uint)_types.Length); 119if (isReturn && _types.Length == 0) 203if (types.Length == 0) 218if (types.Length > 1) 220WasmValueType[] paramTypes = new WasmValueType[types.Length - 1];
src\runtime\src\coreclr\tools\Common\Compiler\DevirtualizationManager.cs (1)
79for (int i = 0; i < implTypeRuntimeInterfaces.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (1)
146if (buffer == null || buffer.Length != neededLength)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (3)
436n.Offset == 0 ? nodeContents.Data.Length : 0); 447n.Offset == 0 ? nodeContents.Data.Length : 0, 502var outputNode = new OutputNode(sectionWriter.SectionIndex, checked((ulong)sectionWriter.Position), nodeContents.Data.Length, GetNodeTypeName(node.GetType()));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (2)
318if ((uint)index >= (uint)_entries.Length) 329int max = Math.Min(count, _entries.Length);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
56if (_appendBuffer.WrittenCount > 0 || paddingLength > _padding.Length)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (1)
53for (int i = 0; i < reservedStrings.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
806for (int i = 1; i < names.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (1)
269IMAGE_RESOURCE_DATA_ENTRY.Write(ref dataBuilder, nodeAssociatedWithDataBuilder, dataEntryTable[language.Item1], language.Item1.DataEntry.Length);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.ResourcesDataModel.cs (1)
25public uint DataSize => (uint)DataEntry.Length;
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
27if (_buffer.Length == _size) 28Array.Resize(ref _buffer, 2 * _buffer.Length);
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8String.cs (2)
32public int Length => _value.Length; 48int length = _value.Length;
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (2)
118if ((uint)(_length + extraSpace) > (uint)_buffer.Length) 124int newSize = Math.Max(2 * _buffer.Length, _length + extraSpace);
src\runtime\src\coreclr\tools\Common\Pgo\PgoFormat.cs (1)
141if (offset >= _bytes.Length)
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILImporter.cs (16)
25if (_currentOffset + 1 > _ilBytes.Length) 77if (_currentOffset + (bytes - 1) >= _ilBytes.Length) 89_basicBlocks = new BasicBlock[_ilBytes.Length]; 114while (_currentOffset < _ilBytes.Length) 190if ((uint)target < (uint)_basicBlocks.Length) 211if ((uint)target < (uint)_basicBlocks.Length) 223if ((uint)target < (uint)_basicBlocks.Length) 244if ((uint)target < (uint)_basicBlocks.Length) 259if ((uint)target < (uint)_basicBlocks.Length) 275for (int i = 0; i < _exceptionRegions.Length; i++) 280(uint)r.ILRegion.TryOffset >= (uint)_basicBlocks.Length || 281(uint)r.ILRegion.TryLength > (uint)_basicBlocks.Length - (uint)r.ILRegion.TryOffset; 286(uint)r.ILRegion.FilterOffset >= (uint)_basicBlocks.Length || 291(uint)r.ILRegion.HandlerOffset >= (uint)_basicBlocks.Length || 292(uint)r.ILRegion.HandlerLength > (uint)_basicBlocks.Length - (uint)r.ILRegion.HandlerOffset; 935if (_currentOffset == _basicBlocks.Length)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\AsyncThunks.cs (3)
86for (int i = 0; i < inst.Length; i++) 264for (int i = 0; i < inst.Length; i++) 420for (int i = 0; i < inst.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\CalliMarshallingMethodThunk.cs (1)
65parameterTypes[parameterTypes.Length - 1] = Context.GetWellKnownType(WellKnownType.IntPtr);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\DelegateMarshallingMethodThunk.cs (3)
154if (parameterMetadataArray != null && parameterMetadataArray.Length > 0 && parameterMetadataArray[0].Index == 0) 168Debug.Assert(parameterIndex == parameterMetadataArray.Length || sequence <= parameterMetadataArray[parameterIndex].Index); 169if (parameterIndex == parameterMetadataArray.Length || sequence < parameterMetadataArray[parameterIndex].Index)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\DelegateMethodILEmitter.cs (3)
77TypeDesc[] replacementTypes = new TypeDesc[typesToReplace.Length]; 78for (int i = 0; i < typesToReplace.Length; i++) 84for (int i = 0; i < parameters.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\PInvokeILEmitter.cs (15)
82for (int i = 0; i < marshallers.Length; i++) 84Debug.Assert(parameterIndex == parameterMetadataArray.Length || i <= parameterMetadataArray[parameterIndex].Index); 85if (parameterIndex == parameterMetadataArray.Length || i < parameterMetadataArray[parameterIndex].Index) 166TypeDesc[] parameters = new TypeDesc[_marshallers.Length - 1]; 167for (int i = 1; i < _marshallers.Length; i++) 230TypeDesc[] nativeParameterTypes = new TypeDesc[_marshallers.Length - 1]; 232for (int i = 1; i < _marshallers.Length; i++) 270TypeDesc[] nativeParameterTypes = new TypeDesc[isHRSwappedRetVal ? _marshallers.Length : _marshallers.Length - 1]; 286for (int i = 1; i < _marshallers.Length; i++) 298nativeParameterTypes[_marshallers.Length - 1] = _marshallers[0].NativeParameterType; 363TypeDesc[] nativeParameterTypes = new TypeDesc[_marshallers.Length - 1]; 365for (int i = 1; i < _marshallers.Length; i++) 397for (int i = isHRSwappedRetVal ? 1 : 0; i < _marshallers.Length; i++) 486for (int i = 0; i < _marshallers.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\Marshaller.cs (1)
1047if (index < 0 || index >= Marshallers.Length - 1)
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\PInvokeDelegateWrapper.cs (1)
263Debug.Assert((int)kind < _methods.Length);
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (11)
517if (_embeddedDataIndex < _embeddedData.Length) 542if (_embeddedDataIndex < _embeddedData.Length) 553int[] bounds = new int[boundsStr.Length]; 554int[] loBounds = new int[loBoundsStr.Length]; 556for (int i = 0; i < boundsStr.Length; i++) 560for (int i = 0; i < loBoundsStr.Length; i++) 583if (rank < ImmutableArraysFilledWithZeroes.Length) 591for (int i = 0; i < result.Length; i++) 602if (_embeddedDataIndex < _embeddedData.Length) 605while ((_embeddedDataIndex < _embeddedData.Length) && _embeddedData[_embeddedDataIndex].index == indexData) 645return _embeddedDataIndex >= _embeddedData.Length;
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueExtensions.cs (1)
26for (int i = 0; i < args.Length; i++)
ILCompiler.DependencyAnalysisFramework (1)
src\runtime\src\coreclr\tools\Common\Sorting\ArrayAccessor.cs (1)
22return dataStructure.Length;
ILCompiler.Diagnostics (9)
PdbWriter.cs (9)
65if (Checksum.Length != other.Checksum.Length) 67for (int i = 0; i < Checksum.Length; i++) 208while (length < pdbFilePathBuilder.Length && pdbFilePathBuilder[length] != '\0') 341_ngenWriter.ModAddSymbols(_pdbMod, stringTableArray, stringTableArray.Length); 364if (document.Checksum.Length > 255) 372writer.Write((byte)checksum.Length); 391_ngenWriter.ModAddSymbols(_pdbMod, checksumTableArray, checksumTableArray.Length); 497_ngenWriter.ModAddSymbols(_pdbMod, symbolTableArray, symbolTableArray.Length);
ILCompiler.MetadataTransform (64)
ILCompiler\Metadata\Transform.Type.cs (1)
287record.Interfaces.Capacity = entity.ExplicitlyImplementedInterfaces.Length;
Internal\Metadata\NativeFormat\Writer\MdBinaryWriterGen.cs (12)
27writer.WriteUnsigned((uint)values.Length); 41writer.WriteUnsigned((uint)values.Length); 55writer.WriteUnsigned((uint)values.Length); 69writer.WriteUnsigned((uint)values.Length); 83writer.WriteUnsigned((uint)values.Length); 97writer.WriteUnsigned((uint)values.Length); 111writer.WriteUnsigned((uint)values.Length); 125writer.WriteUnsigned((uint)values.Length); 139writer.WriteUnsigned((uint)values.Length); 153writer.WriteUnsigned((uint)values.Length); 167writer.WriteUnsigned((uint)values.Length); 181writer.WriteUnsigned((uint)values.Length);
Internal\Metadata\NativeFormat\Writer\NativeFormatWriterGen.cs (17)
56for (int i = 0; i < Sizes.Length; i++) 60for (int i = 0; i < LowerBounds.Length; i++) 206for (int i = 0; i < Value.Length; i++) 335for (int i = 0; i < Value.Length; i++) 464for (int i = 0; i < Value.Length; i++) 593for (int i = 0; i < Value.Length; i++) 923for (int i = 0; i < Value.Length; i++) 1052for (int i = 0; i < Value.Length; i++) 1181for (int i = 0; i < Value.Length; i++) 1369for (int i = 0; i < Value.Length; i++) 1498for (int i = 0; i < Value.Length; i++) 1762for (int i = 0; i < Value.Length; i++) 1891for (int i = 0; i < Value.Length; i++) 2020for (int i = 0; i < Value.Length; i++) 4195for (int i = 0; i < PublicKey.Length; i++) 4201for (int i = 0; i < Mvid.Length; i++) 4312for (int i = 0; i < PublicKeyOrToken.Length; i++)
Internal\Metadata\NativeFormat\Writer\NativeMetadataWriter.cs (2)
490if (_size == _array.Length) 491Array.Resize(ref _array, 2 * _array.Length);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (30)
208_encoder.WriteUnsigned((uint)bytes.Length); 209for (int i = 0; i < bytes.Length; i++) 922Debug.Assert(args != null && args.Length > 0); 936writer.WriteUnsigned((uint)_args.Length); 937for (uint iArg = 0; _args != null && iArg < _args.Length; iArg++) 944int hash = _args != null ? _args.Length : 0; 948for (uint iArg = 0; _args != null && iArg < _args.Length; iArg++) 972if (other._args.Length != _args.Length) return false; 973for (uint iArg = 0; _args != null && iArg < _args.Length; iArg++) 1141writer.WriteUnsigned((uint)_parameters.Length); 1166_parameters.Length == other._parameters.Length && 1172for (int i = 0; i < _parameters.Length; i++) 1269writer.WriteUnsigned((uint)TypeSignatureKind.Instantiation | ((uint)_args.Length << 4)); 1271for (int iArg = 0; iArg < _args.Length; iArg++) 1277int hash = _args.Length; 1280for (int iArg = 0; iArg < _args.Length; iArg++) 1291if (_args.Length != other._args.Length || !Equals(_typeDef, other._typeDef)) 1294for (uint iArg = 0; iArg < _args.Length; iArg++) 1329writer.WriteUnsigned((uint)_bounds.Length); 1333writer.WriteUnsigned((uint)_lowerBounds.Length); 1359_bounds.Length != other._bounds.Length || 1360_lowerBounds.Length != other._lowerBounds.Length) 1364for (int i = 0; i < _bounds.Length; i++) 1369for (int i = 0; i < _lowerBounds.Length; i++) 1426return _data.Length;
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
27if (_buffer.Length == _size) 28Array.Resize(ref _buffer, 2 * _buffer.Length);
ILCompiler.ReadyToRun (233)
Compiler\CallChainProfile.cs (1)
138if (splitMethodName.Length != 2)
Compiler\DependencyAnalysis\ReadyToRun\ArgIterator.cs (7)
382if (other._parameterTypes == null || _parameterTypes.Length != other._parameterTypes.Length) 385for (int i = 0; i < _parameterTypes.Length; i++) 401public int NumFixedArgs() { return _parameterTypes != null ? _parameterTypes.Length : 0; } 413return (argNum < _parameterTypes.Length && _parameterTypes[argNum].GetCorElementType() == CorElementType.ELEMENT_TYPE_BYREF) ? 476if (_forcedByRefParams != null && (argNum + 1) < _forcedByRefParams.Length) 490if (_forcedByRefParams != null && _forcedByRefParams.Length > 0)
Compiler\DependencyAnalysis\ReadyToRun\AttributePresenceFilterNode.cs (2)
452result = new byte[pTable.Length * 2]; 453for (int i = 0; i < pTable.Length; i++)
Compiler\DependencyAnalysis\ReadyToRun\ByteArrayComparer.cs (5)
18if (a.Length != b.Length) 22for (int index = 0; index < a.Length; index++) 34int hash = unchecked(5381 + (a.Length << 7)); 35for (int index = 0; index < a.Length; index++)
Compiler\DependencyAnalysis\ReadyToRun\DebugDirectoryEntryNode.cs (1)
208Debug.Assert(hash.Length >= 16);
Compiler\DependencyAnalysis\ReadyToRun\DebugInfoTableNode.cs (14)
93uint boundsLength = (uint)(bounds?.Length ?? 0); 100nibbleWriter.WriteUInt((uint)(vars?.Length ?? 0)); 109nibbleWriter.WriteUInt((uint)(vars?.Length ?? 0)); 113methodDebugBlob.Write(header, 0, header.Length); 115if (bounds?.Length > 0) 117methodDebugBlob.Write(bounds, 0, bounds.Length); 120if (vars?.Length > 0) 122methodDebugBlob.Write(vars, 0, vars.Length); 148if (offsetMapping == null || offsetMapping.Length == 0) 167writer2.WriteUInt((uint)offsetMapping.Length); // We need the total count 174int totalBits = bitWidth * offsetMapping.Length; 182for (uint i = 0; i < offsetMapping.Length; i++) 247if (varInfos == null || varInfos.Length == 0) 253writer.WriteUInt((uint)varInfos.Length);
Compiler\DependencyAnalysis\ReadyToRun\DevirtualizationManager.cs (2)
124for (int i = 0; i < implTypeRuntimeInterfaces.Length; i++) 126for (int j = i + 1; j < implTypeRuntimeInterfaces.Length; j++)
Compiler\DependencyAnalysis\ReadyToRun\ExceptionInfoLookupTableNode.cs (1)
98if (ehInfo != null && ehInfo.Data.Length != 0)
Compiler\DependencyAnalysis\ReadyToRun\GCRefMapBuilder.cs (2)
83for (int parameterIndex = 0; parameterIndex < parameterTypes.Length; parameterIndex++) 102bool[] forcedByRefParams = new bool[parameterTypes.Length];
Compiler\DependencyAnalysis\ReadyToRun\GCRefMapNode.cs (1)
108Debug.Assert(nextOffsetIndex == offsets.Length);
Compiler\DependencyAnalysis\ReadyToRun\ILBodyFixupSignature.cs (2)
93dataBuilder.EmitUInt(checked((uint)metadata.ConstantData.Length)); 95dataBuilder.EmitUInt(checked((uint)metadata.TypeRefs.Length));
Compiler\DependencyAnalysis\ReadyToRun\InliningInfoNode.cs (2)
70if (inlinees.Length == 0) 337for (; inlinerIndex < sortedInliners.Length; inlinerIndex++)
Compiler\DependencyAnalysis\ReadyToRun\InstrumentationDataTableNode.cs (1)
227for (int i = 0; i < symbols.Length; i++)
Compiler\DependencyAnalysis\ReadyToRun\MethodColdCodeNode.cs (1)
63return _methodColdCode.Data.Length;
Compiler\DependencyAnalysis\ReadyToRun\MethodGCInfoNode.cs (11)
56coldCodeUnwindInfoCount = _methodNode.ColdFrameInfos.Length; 59int[] offsets = new int[_methodNode.FrameInfos.Length + coldCodeUnwindInfoCount]; 68for (int frameInfoIndex = 0; frameInfoIndex < deduplicatedResult._methodNode.FrameInfos.Length; frameInfoIndex++) 71offset += deduplicatedResult._methodNode.FrameInfos[frameInfoIndex].BlobData.Length; 82offset += deduplicatedResult._methodNode.GCInfo.Length; 93for (int frameInfoIndex = 0; frameInfoIndex < _methodNode.ColdFrameInfos.Length; frameInfoIndex++) 95offsets[frameInfoIndex + _methodNode.FrameInfos.Length] = offset; 99offset += blobData.Length; 183int numHotFrameInfos = _methodNode.FrameInfos.Length; 187numFrameInfos += _methodNode.ColdFrameInfos.Length; 296int align4Pad = -item.Bytes.Length & 3;
Compiler\DependencyAnalysis\ReadyToRun\MethodWithGCInfo.cs (4)
98public int Size => _methodCode.Data.Length; 100public bool IsEmpty => _methodCode.Data.Length == 0; 391if (_ehInfo?.Data is not { Length: > 0 } data) 394int clauseCount = data.Length / ClauseSize;
Compiler\DependencyAnalysis\ReadyToRun\ReadyToRunInstructionSetSupportSignature.cs (2)
88builder.EmitUInt((uint)(instructionSetsSupported.Length + instructionSetsExplicitlyUnsupported.Length));
Compiler\DependencyAnalysis\ReadyToRun\RuntimeFunctionsTableNode.cs (11)
62runtimeFunctionIndex += method.FrameInfos.Length; 93for (int frameIndex = 0; frameIndex < method.FrameInfos.Length; frameIndex++) 148endIndex = method.FrameInfos.Length; 156Debug.Assert((method.FrameInfos.Length + method.ColdFrameInfos.Length) == funcletOffsets.Length); 157startIndex = method.FrameInfos.Length; 158endIndex = funcletOffsets.Length; 166if (frameIndex >= method.FrameInfos.Length) 168frameInfo = method.ColdFrameInfos[frameIndex - method.FrameInfos.Length]; 171if (frameIndex == method.FrameInfos.Length)
Compiler\DependencyAnalysis\ReadyToRun\WasmR2RToInterpreterThunkNode.cs (1)
124for (int i = 0; i < offsets.Length; i++)
Compiler\PettisHansenSort\DisjointSetForest.cs (3)
18for (int i = 0; i < _nodes.Length; i++) 34if (NumNodes >= _nodes.Length) 47if (node < 0 || node >= _nodes.Length)
Compiler\PettisHansenSort\PettisHansen.cs (5)
23for (int i = 0; i < phNodes.Length; i++) 42for (int i = 0; i < phNodes.Length; i++) 52for (int i = 0; i < phNodes.Length; i++) 60for (int i = 0; i < phEdges.Length; i++) 148for (int i = 0; i < phEdges.Length; i++)
Compiler\ReadyToRunCodegenCompilation.cs (2)
762Logger.Writer.WriteLine($"Processing {methodsToRecompile.Length} recompiles"); 804for (int i = 0; i < exceptionRegions.Length; i++)
Compiler\ReadyToRunCompilationModuleGroupBase.cs (1)
579if (methodIL.GetExceptionRegions().Length > 0)
Compiler\ReadyToRunStandaloneMethodMetadata.cs (3)
73_nonCodeAlternateBlob.WriteCompressedInteger(_exceptionRegions.Length); 75for (int i = 0; i < _exceptionRegions.Length; i++) 111int expectedFinalSize = _nonCodeAlternateBlob.Count + _alternateILStream.Length + _alternateNonTypeRefStream.Count;
Compiler\SystemObjectFieldLayoutAlgorithm.cs (1)
30Debug.Assert(0 == layoutFromMetadata.Offsets.Length, "Incompatible system library. The CoreCLR System.Private.CoreLib must be used when compiling in ready-to-run mode.");
IBC\IBCDataReader.cs (1)
686using (var m = new MemoryStream(buffer, pos, buffer.Length - pos))
IBC\IBCProfileParser.cs (6)
132BlobReader br = new BlobReader(pb, paramSignatureEntry.Signature.Length); 244if (signature.Length >= 2) 309ReadOnlySpan<byte> typeName = new ReadOnlySpan<byte>(typeEntry.Name).Slice(0, typeEntry.Name.Length - 1 /* these strings are null terminated */); 332typeNamespace = new ReadOnlySpan<byte>(namespaceEntry.Name).Slice(0, namespaceEntry.Name.Length - 1 /* these strings are null terminated */); 423if (signatureReader.RemainingBytes != signatureEntry.Signature.Length) 425for (int i = 0; i < signatureEntry.Signature.Length; i++)
IBC\ReaderExtensions.cs (1)
33for (int i = 0; i < characters.Length - 1; ++i)
IL\ReadyToRunILProvider.cs (1)
313for (int i = 0; i < _exceptionRegions.Length; i++)
IL\Stubs\PInvokeILEmitter.cs (3)
44TypeDesc[] nativeParameterTypes = new TypeDesc[_marshallers.Length - 1]; 46for (int i = 1; i < _marshallers.Length; i++) 100for (int i = 0; i < _marshallers.Length; i++)
Interop\IL\Marshaller.ReadyToRun.cs (6)
37for (int i = 0, parameterIndex = 0; i < marshallers.Length; i++) 39Debug.Assert(parameterIndex == parameterMetadataArray.Length || i <= parameterMetadataArray[parameterIndex].Index); 42if (parameterIndex == parameterMetadataArray.Length || i < parameterMetadataArray[parameterIndex].Index) 124for (int i = 0; i < marshallers.Length; i++) 136for (int i = 0; i < marshallers.Length; i++) 148for (int i = 0; i < marshallers.Length; i++)
JitInterface\CorInfoImpl.ReadyToRun.cs (3)
683if (ilBody.GetExceptionRegions().Length != 0) 1595int totalClauses = _ehClauses.Length; 3164if (pBBCountData <= (byte*)location && (byte*)location < (pBBCountData + _bbCounts.Length))
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\GVMDependenciesNode.cs (1)
134for (int interfaceIndex = 0; interfaceIndex < potentialInterfaces.Length; interfaceIndex++)
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (11)
86if (_types.Length == 0) 90for (int i = 1; i < _types.Length; i++) 100uint sizeLength = DwarfHelper.SizeOfULEB128((ulong)_types.Length); 101return (int)(sizeLength + (uint)_types.Length); 106int sizeLength = DwarfHelper.WriteULEB128(buffer, (ulong)_types.Length); 108for (int i = 0; i < _types.Length; i++) 112return (int)(sizeLength + (uint)_types.Length); 119if (isReturn && _types.Length == 0) 203if (types.Length == 0) 218if (types.Length > 1) 220WasmValueType[] paramTypes = new WasmValueType[types.Length - 1];
src\runtime\src\coreclr\tools\Common\Compiler\DevirtualizationManager.cs (1)
79for (int i = 0; i < implTypeRuntimeInterfaces.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (1)
146if (buffer == null || buffer.Length != neededLength)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (3)
436n.Offset == 0 ? nodeContents.Data.Length : 0); 447n.Offset == 0 ? nodeContents.Data.Length : 0, 502var outputNode = new OutputNode(sectionWriter.SectionIndex, checked((ulong)sectionWriter.Position), nodeContents.Data.Length, GetNodeTypeName(node.GetType()));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (2)
318if ((uint)index >= (uint)_entries.Length) 329int max = Math.Min(count, _entries.Length);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
56if (_appendBuffer.WrittenCount > 0 || paddingLength > _padding.Length)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\StringTableBuilder.cs (1)
53for (int i = 0; i < reservedStrings.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (5)
34if (locals.Length == 0) 45for (int i = 1; i < locals.Length; i++) 83return _locals.Length + _body.EncodeSize(); 98pos += _locals.Length; 114WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), bodySizePrefixLength + _locals.Length);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (14)
36ArgumentOutOfRangeException.ThrowIfGreaterThan(n, _padding.Length); 133if (funcletKinds.Length < 1) 141for (int i = 0; i < funcletKinds.Length; i++) 315size += Sections.Length * WebcilEncoder.SectionHeaderEncodeSize(); // include size of all section headers 404for (int i = 0; i < sections.Length; i++) 426uint sizeOfHeaders = (uint)WebcilEncoder.HeaderEncodeSize(WebcilVersion.Version1) + (uint)(webcilSections.Length * WebcilEncoder.SectionHeaderEncodeSize()); 430for (int i = 0; i < webcilSections.Length; i++) 480Debug.Assert(webcilSections.Length > 0); 481Debug.Assert(webcilSections[webcilSections.Length - 1].Name.ToString() == "reloc"); 483ushort relocSectionIdx = _baseRelocMap.Count > 0 ? checked((ushort)webcilSections.Length) : (ushort)0; 490CoffSections = (ushort)webcilSections.Length, 759if (_webcilSegment.Sections.Length > 0) 762WebcilSection lastSection = _webcilSegment.Sections[_webcilSegment.Sections.Length - 1]; 880if (size > relocScratchBuffer.Length)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
806for (int i = 1; i < names.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (1)
269IMAGE_RESOURCE_DATA_ENTRY.Write(ref dataBuilder, nodeAssociatedWithDataBuilder, dataEntryTable[language.Item1], language.Item1.DataEntry.Length);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.ResourcesDataModel.cs (1)
25public uint DataSize => (uint)DataEntry.Length;
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (30)
208_encoder.WriteUnsigned((uint)bytes.Length); 209for (int i = 0; i < bytes.Length; i++) 922Debug.Assert(args != null && args.Length > 0); 936writer.WriteUnsigned((uint)_args.Length); 937for (uint iArg = 0; _args != null && iArg < _args.Length; iArg++) 944int hash = _args != null ? _args.Length : 0; 948for (uint iArg = 0; _args != null && iArg < _args.Length; iArg++) 972if (other._args.Length != _args.Length) return false; 973for (uint iArg = 0; _args != null && iArg < _args.Length; iArg++) 1141writer.WriteUnsigned((uint)_parameters.Length); 1166_parameters.Length == other._parameters.Length && 1172for (int i = 0; i < _parameters.Length; i++) 1269writer.WriteUnsigned((uint)TypeSignatureKind.Instantiation | ((uint)_args.Length << 4)); 1271for (int iArg = 0; iArg < _args.Length; iArg++) 1277int hash = _args.Length; 1280for (int iArg = 0; iArg < _args.Length; iArg++) 1291if (_args.Length != other._args.Length || !Equals(_typeDef, other._typeDef)) 1294for (uint iArg = 0; iArg < _args.Length; iArg++) 1329writer.WriteUnsigned((uint)_bounds.Length); 1333writer.WriteUnsigned((uint)_lowerBounds.Length); 1359_bounds.Length != other._bounds.Length || 1360_lowerBounds.Length != other._lowerBounds.Length) 1364for (int i = 0; i < _bounds.Length; i++) 1369for (int i = 0; i < _lowerBounds.Length; i++) 1426return _data.Length;
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
27if (_buffer.Length == _size) 28Array.Resize(ref _buffer, 2 * _buffer.Length);
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8String.cs (2)
32public int Length => _value.Length; 48int length = _value.Length;
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (2)
118if ((uint)(_length + extraSpace) > (uint)_buffer.Length) 124int newSize = Math.Max(2 * _buffer.Length, _length + extraSpace);
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (22)
223for (int i = 0; i < pgoData.Length; i++) 225if ((i + 1 < pgoData.Length) && 259if (index > (nativeSchema.Length - 2)) 408if (codeSize < _code.Length) 462debugEHClauseInfos = new DebugEHClauseInfo[_ehClauses.Length]; 463for (int i = 0; i < _ehClauses.Length; i++) 809methodInfo->ILCodeSize = (uint)ilCode.Length; 812methodInfo->EHcount = (uint)exceptionRegions.Length; 945sig->numArgs = (ushort)locals.Length; 1298if (calleeIL.GetExceptionRegions().Length != 0) 3568for (int i = 0; i < enclosingClassName.Length; i++) 4157if (pCode <= (byte*)location && (byte*)location < pCode + _code.Length) 4168if (pColdCode <= (byte*)location && (byte*)location < pColdCode + _coldCode.Length) 4180if (pROData <= (byte*)location && (byte*)location < pROData + _roData.Length) 4192if (pRWData <= (byte*)location && (byte*)location < pRWData + _rwData.Length) 4219length = _code.Length; 4222length = _roData.Length; 4225length = _rwData.Length; 4229length = _coldCode.Length; 4538nativeSchemas = new PgoInstrumentationSchema[pgoResultsSchemas.Length]; 4541for (int i = 0; i < nativeSchemas.Length; i++) 4640pgoResults.countSchemaItems = (uint)nativeSchemas.Length;
src\runtime\src\coreclr\tools\Common\Pgo\PgoFormat.cs (1)
141if (offset >= _bytes.Length)
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\VersionResilientHashCode.TypeSystem.cs (1)
31for (int i = 0; i < instantiation.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\AsyncThunks.cs (3)
86for (int i = 0; i < inst.Length; i++) 264for (int i = 0; i < inst.Length; i++) 420for (int i = 0; i < inst.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\Marshaller.cs (1)
1047if (index < 0 || index >= Marshallers.Length - 1)
src\runtime\src\coreclr\tools\Common\TypeSystem\MetadataEmitter\TypeSystemMetadataEmitter.cs (11)
517if (_embeddedDataIndex < _embeddedData.Length) 542if (_embeddedDataIndex < _embeddedData.Length) 553int[] bounds = new int[boundsStr.Length]; 554int[] loBounds = new int[loBoundsStr.Length]; 556for (int i = 0; i < boundsStr.Length; i++) 560for (int i = 0; i < loBoundsStr.Length; i++) 583if (rank < ImmutableArraysFilledWithZeroes.Length) 591for (int i = 0; i < result.Length; i++) 602if (_embeddedDataIndex < _embeddedData.Length) 605while ((_embeddedDataIndex < _embeddedData.Length) && _embeddedData[_embeddedDataIndex].index == indexData) 645return _embeddedDataIndex >= _embeddedData.Length;
TypeSystem\Mutable\MutableModule.cs (3)
214byte[] metadataArray = GC.AllocateArray<byte>(metadataArrayTemp.Length, pinned: true); 216Array.Copy(metadataArrayTemp, metadataArray, metadataArray.Length); 222_reader = new MetadataReader(pb, metadataArray.Length);
ILCompiler.RyuJit (67)
Compiler\DependencyAnalysis\MethodCodeNode.cs (9)
201if (_localTypes.Length > 0) 203localNames = new string[_localTypes.Length]; 209if (!local.CompilerGenerated && local.Slot < localNames.Length) 221if (varInfo.VarNumber < parameterNames.Length) 266var sequencePoints = new (string Document, int LineNumber)[_debugLocInfos.Length * 4 /* chosen empirically */]; 272if (offset >= sequencePoints.Length) 274int newLength = Math.Max(2 * sequencePoints.Length, sequencePoint.Offset + 1); 281for (int i = 1; i < sequencePoints.Length; i++) 306var sequencePoint = sequencePoints[Math.Min(nativeMapping.ILOffset, sequencePoints.Length - 1)];
JitInterface\CorInfoImpl.RyuJit.cs (17)
113if (blobData == null || blobData.Length == 0) 118Debug.Assert(blobData.Length % 8 == 0); 129for (int i = 0; i < registerOffset.Length; i++) 135while (offset < blobData.Length) 151for (int i = 0; i < registerOffset.Length; i++) 179for (int i = 0; i < registerOffset.Length; i++) 224for (int i = registerOffset.Length - 1; i >= 0; i--) 825mdType.VirtualMethodImplsForType.Length > 0) 894int totalClauses = _ehClauses.Length; 897for (int i = 1; i < _ehClauses.Length; i++) 912for (int i = 0; i < _ehClauses.Length; i++) 993int numLocals = methodIL.GetLocals().Length; 1000if (varNumber < debugVarInfoBuilders.Length) 1005for (uint i = 0; i < debugVarInfoBuilders.Length; i++) 2310if (implClasses == null || implClasses.Length > maxExactClasses) 2371if (bytes.Length >= bufferSize && valueOffset <= bytes.Length - bufferSize)
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\DisjointSetForest.cs (3)
18for (int i = 0; i < _nodes.Length; i++) 34if (NumNodes >= _nodes.Length) 47if (node < 0 || node >= _nodes.Length)
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\PettisHansen.cs (5)
23for (int i = 0; i < phNodes.Length; i++) 42for (int i = 0; i < phNodes.Length; i++) 52for (int i = 0; i < phNodes.Length; i++) 60for (int i = 0; i < phEdges.Length; i++) 148for (int i = 0; i < phEdges.Length; i++)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (5)
34if (locals.Length == 0) 45for (int i = 1; i < locals.Length; i++) 83return _locals.Length + _body.EncodeSize(); 98pos += _locals.Length; 114WasmExpr.OffsetRelocationsByOffset(buffer.Slice(0, relocsEncoded), bodySizePrefixLength + _locals.Length);
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (23)
223for (int i = 0; i < pgoData.Length; i++) 225if ((i + 1 < pgoData.Length) && 259if (index > (nativeSchema.Length - 2)) 408if (codeSize < _code.Length) 462debugEHClauseInfos = new DebugEHClauseInfo[_ehClauses.Length]; 463for (int i = 0; i < _ehClauses.Length; i++) 582TypeDesc[] localTypes = new TypeDesc[locals.Length]; 583for (int i = 0; i < localTypes.Length; i++) 809methodInfo->ILCodeSize = (uint)ilCode.Length; 812methodInfo->EHcount = (uint)exceptionRegions.Length; 945sig->numArgs = (ushort)locals.Length; 1298if (calleeIL.GetExceptionRegions().Length != 0) 3568for (int i = 0; i < enclosingClassName.Length; i++) 4157if (pCode <= (byte*)location && (byte*)location < pCode + _code.Length) 4168if (pColdCode <= (byte*)location && (byte*)location < pColdCode + _coldCode.Length) 4180if (pROData <= (byte*)location && (byte*)location < pROData + _roData.Length) 4192if (pRWData <= (byte*)location && (byte*)location < pRWData + _rwData.Length) 4219length = _code.Length; 4222length = _roData.Length; 4225length = _rwData.Length; 4538nativeSchemas = new PgoInstrumentationSchema[pgoResultsSchemas.Length]; 4541for (int i = 0; i < nativeSchemas.Length; i++) 4640pgoResults.countSchemaItems = (uint)nativeSchemas.Length;
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
ILCompiler.TypeSystem (137)
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ArrayType.cs (2)
108for (int i = 0; i < methods.Length; i++) 291for (int i = 0; i < argTypes.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\InstantiatedType.cs (4)
254for (int j = 0; j < clone.Length; j++) 273for (int i = 0; i < uninstantiatedTypes.Length; i++) 281clone = new T[uninstantiatedTypes.Length]; 282for (int j = 0; j < clone.Length; j++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\InstantiatedType.MethodImpls.cs (3)
18if (uninstMethodImpls == null || uninstMethodImpls.Length == 0) 21MethodImplRecord[] instMethodImpls = new MethodImplRecord[uninstMethodImpls.Length]; 23for (int i = 0; i < uninstMethodImpls.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Instantiation.cs (6)
41return _genericParameters.Length; 66for (int i = 0; i < _genericParameters.Length; i++) 100if (_currentIndex >= _collection.Length) 110if (_genericParameters.Length != other._genericParameters.Length) 113for (int i = 0; i < _genericParameters.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataFieldLayoutAlgorithm.cs (11)
871Array.Clear(instanceNonGCPointerFieldsCount, 0, instanceNonGCPointerFieldsCount.Length); 898if (instanceNonGCPointerFieldsCount[j] < instanceNonGCPointerFieldsArr[j].Length 899|| (j == log2PointerSize && instanceGCPointerFieldsArr.Length > 0)) 912if (instanceNonGCPointerFieldsCount[j] < instanceNonGCPointerFieldsArr[j].Length 913|| (j == log2PointerSize && instanceGCPointerFieldsArr.Length > 0)) 925Debug.Assert(instanceNonGCPointerFieldsCount[i] < instanceNonGCPointerFieldsArr[i].Length 926|| (i == log2PointerSize && instanceGCPointerFieldsArr.Length > 0)); 932if (instanceNonGCPointerFieldsCount[i] >= instanceNonGCPointerFieldsArr[i].Length) 954for (int j = 0; j < instanceGCPointerFieldsArr.Length; j++) 961for (int j = instanceNonGCPointerFieldsCount[i]; j < instanceNonGCPointerFieldsArr[i].Length; j++) 968for (int i = 0; i < instanceValueClassFieldsArr.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataRuntimeInterfacesAlgorithm.cs (1)
55if (explicitInterfaces.Length == 0)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataTypeSystemContext.cs (2)
68_wellKnownTypes = new MetadataType[s_wellKnownTypeNames.Length]; 71for (int typeIndex = 0; typeIndex < _wellKnownTypes.Length; typeIndex++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataVirtualMethodAlgorithm.cs (20)
68for (; _index < _arrayToEnumerate.Length; _index++) 124if (_methodsRequiringSlotUnificationCount >= _methodsRequiringSlotUnification.Length) 126Array.Resize(ref _methodsRequiringSlotUnification, Math.Max(_methodsRequiringSlotUnification.Length * 2, 2)); 165if (_memberCount >= _members.Length) 167Array.Resize(ref _members, Math.Max(_members.Length * 2, 2)); 169for (int i = 0; i < _members.Length; i++) 185for (int i = 0; i < _members.Length; i++) 206for (int i = 0; i < _members.Length; i++) 317for (int i = 0; i < foundMethodImpls.Length; i++) 337Debug.Assert(foundMethodImplsOnDefinition.Length == foundMethodImpls.Length); 940consideredInterfaces = new DefType[currentType.RuntimeInterfaces.Length + 1]; 941Array.Copy(currentType.RuntimeInterfaces, consideredInterfaces, currentType.RuntimeInterfaces.Length); 942consideredInterfaces[consideredInterfaces.Length - 1] = currentType.IsGenericDefinition ? (DefType)currentType.InstantiateAsOpen() : currentType; 945MetadataType[] candidateInterfaces = new MetadataType[consideredInterfaces.Length]; 946MethodDesc[] candidateMethods = new MethodDesc[consideredInterfaces.Length]; 956int dwParentInterfaces = pParentMT != null ? pParentMT.RuntimeInterfaces.Length : 0; 960? consideredInterfaces.Length 961: pMT.RuntimeInterfaces.Length; 1025Debug.Assert(candidatesCount < candidateInterfaces.Length);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MethodDesc.cs (13)
93for (int i = 0; i < newParameters.Length; i++) 176return _parameters.Length; 184return _embeddedSignatureData != null && _embeddedSignatureData.Length != 0; 203if ((_embeddedSignatureData == null) || (_embeddedSignatureData.Length == 0)) 261if (this._parameters.Length != otherSignature._parameters.Length) 264for (int i = 0; i < this._parameters.Length; i++) 284if (this._embeddedSignatureData.Length != otherSignature._embeddedSignatureData.Length) 289for (int i = 0; i < this._embeddedSignatureData.Length; i++) 413TypeDesc[] parameters = new TypeDesc[_parameters.Length]; 414for (int i = 0; i < parameters.Length; i++) 748for (int j = 0; j < clone.Length; j++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\PropertySignature.cs (1)
29return _parameters.Length;
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\SimpleArrayOfTRuntimeInterfacesAlgorithm.cs (7)
32_genericRuntimeInterfaces = new MetadataType[s_genericRuntimeInterfacesNames.Length]; 34for (int i = 0; i < s_genericRuntimeInterfacesNames.Length; ++i) 50var result = new DefType[_arrayRuntimeInterfaces.Length + _genericRuntimeInterfaces.Length]; 51Array.Copy(_arrayRuntimeInterfaces, result, _arrayRuntimeInterfaces.Length); 54int offset = _arrayRuntimeInterfaces.Length; 55for (int i = 0; i < _genericRuntimeInterfaces.Length; ++i)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeHashingAlgorithms.cs (1)
80for (int i = 0; i < parameters.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemHelpers.cs (1)
238for (int i = 0; i < inst.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\GCPointerMap.cs (5)
90Debug.Assert(numCells <= gcFlags.Length << 5); 110for (int i = 0; i < _gcFlags.Length; i++) 120for (int i = 0; i < _gcFlags.Length; i++) 138for (int i = 0; i < _gcFlags.Length; i++) 250Debug.Assert(startBit + numBits <= buffer.Length << 5);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtable.cs (11)
185Debug.Assert(hashTableLocal.Length > 0); 187int mask = hashTableLocal.Length - 1; 273int newSize = checked(oldHashtable.Length * 2); 290int mask = newHashTable.Length - 1; 293for (int iEntry = 0; iEntry < oldHashtable.Length; iEntry++) 440int mask = hashTableLocal.Length - 1; 472if (Interlocked.Increment(ref _reserve) >= hashTableLocal.Length - 1) 607Debug.Assert(hashTableLocal.Length > 0); 609int mask = hashTableLocal.Length - 1; 694for (; _index < _hashtableContentsToEnumerate.Length; _index++) 704if (_index == _hashtableContentsToEnumerate.Length)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\VersionResilientHashCode.TypeSystem.cs (1)
31for (int i = 0; i < instantiation.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\CachingMetadataStringDecoder.cs (3)
47int mask = _table.Length - 1; 77int mask = _table.Length - 1; 132int mask = _table.Length - 1;
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaGenericParameter.cs (1)
136for (int i = 0; i < constraintTypes.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaModule.cs (6)
294TypeDefinitionHandle[] bucketHeads = new TypeDefinitionHandle[(buckets.Length / 8) + 1]; 305ref TypeDefinitionHandle head = ref bucketHeads[(uint)hashCode % bucketHeads.Length]; 323TypeDefinitionHandle entry = bucketHeads[(uint)hashCode % bucketHeads.Length]; 345ExportedTypeHandle[] bucketHeads = new ExportedTypeHandle[(buckets.Length / 8) + 1]; 356ref ExportedTypeHandle head = ref bucketHeads[(uint)hashCode % bucketHeads.Length]; 374ExportedTypeHandle entry = bucketHeads[(uint)hashCode % bucketHeads.Length];
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaSignatureParser.cs (1)
231for (int i = 0; i < instance.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILDisassembler.cs (2)
249return _currentOffset < _ilBytes.Length; 265return _ilBytes.Length;
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILOpcodeHelper.cs (2)
20Debug.Assert((uint)opcode < (uint)s_opcodeSizes.Length); 32return (uint)opcode < (uint)s_opcodeSizes.Length
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\InstantiatedMethodIL.cs (3)
68for (int i = 0; i < locals.Length; i++) 76clone = new LocalVariableDefinition[locals.Length]; 77for (int j = 0; j < clone.Length; j++)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\MethodILDebugView.cs (2)
68if (locals != null && locals.Length > 0) 76for (int i = 0; i < locals.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\ILEmitter.cs (6)
53if (_length == _instructions.Length) 60if (_length + sizeof(ushort) > _instructions.Length) 69if (_length + sizeof(int) > _instructions.Length) 79Array.Resize(ref _instructions, 2 * _instructions.Length + 10); 216EmitUInt32(labels.Length); 218int remainingBytes = labels.Length * 4;
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\UnsafeAccessors.cs (7)
274if (declData.Length != maybeData.Length) 280for (int i = 0; i < declData.Length; ++i) 303Debug.Assert(tmp.Length == 2); 311int toUpdate = lvls.Length < 2 ? 0 : lvls.Length - 2; 481for (int i = 0; i < methodInstantiation.Length; ++i)
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\DefType.RuntimeDetermined.cs (1)
69for (int j = 0; j < clone.Length; j++)
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\MethodDesc.RuntimeDetermined.cs (1)
115for (int j = 0; j < clone.Length; j++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Sorting\MethodSignature.Sorting.cs (8)
11int result = _parameters.Length.CompareTo(other._parameters.Length); 29for (int i = 0; i < _parameters.Length; i++) 37return (_embeddedSignatureData?.Length ?? 0).CompareTo(other._embeddedSignatureData?.Length ?? 0); 39result = _embeddedSignatureData.Length.CompareTo(other._embeddedSignatureData.Length); 43for (int i = 0; i < _embeddedSignatureData.Length; i++)
illink (39)
ILLink.RoslynAnalyzer (9)
src\runtime\src\libraries\Common\src\System\Buffers\SearchValuesPolyfills.cs (1)
75if (offset < (uint)lookup.Length)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (3)
71if (pkt.Length > PUBLIC_KEY_TOKEN_LEN) 81if (keyOrToken.Length == 0) 87HexConverter.EncodeToUtf16(keyOrToken, vsb.AppendSpan(keyOrToken.Length * 2), HexConverter.Casing.Lower);
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (2)
256if (parts.Length is < 2 or > 4) 262for (int i = 0; i < parts.Length; i++)
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\AssemblyNameInfo.cs (1)
61PublicKeyOrToken = parts._publicKeyOrToken is null ? default : parts._publicKeyOrToken.Length == 0
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueExtensions.cs (1)
26for (int i = 0; i < args.Length; i++)
TrimAnalysis\TrimAnalysisVisitor.cs (1)
118for (int i = 0; i < elements.Length; i++)
ILLink.Tasks (2)
CreateRuntimeRootDescriptorFile.cs (2)
168if (namespaceDefElements.Length == 3) 208if (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);
Infrastructure.Tests (24)
ExtractTestPartitions\ExtractTestPartitionsTests.cs (3)
46Assert.Equal(2, partitions.Length); 133Assert.Equal(3, partitions.Length); 302if (args.Length > 0)
ExtractTestPartitions\MockAssemblyBuilder.cs (1)
138var names = classNames.Length > 0 ? classNames : new[] { "TestClass1", "TestClass2" };
PowerShellScripts\BuildTestMatrixTests.cs (5)
84Assert.Equal(2, matrix.Tests.Length); 117Assert.Equal(3, matrix.Tests.Length); 157Assert.Equal(2, matrix.Tests.Length); 252Assert.Equal(2, matrix.Tests.Length); 438Assert.Equal(2, entry.SupportedOSes.Length);
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (10)
125Assert.Equal(3, expanded.Include.Length); 312Assert.Equal(3, expanded.Include.Length); 364Assert.Equal(3, expanded.Include.Length); 397Assert.Equal(2, expanded.Include.Length); 426Assert.Equal(3, expanded.Include.Length); 465Assert.Equal(3, expanded.Include.Length); 499Assert.Equal(3, expanded.Include.Length); 589Assert.Equal(3, regularEntries.Length); 593Assert.Equal(6, splitEntries.Length); 611Assert.Equal(9, allNoNugets.Length);
PowerShellScripts\SplitTestMatrixByDepsTests.cs (4)
43Assert.Equal(2, outputs["tests_matrix_no_nugets"].Include.Length); 137Assert.Equal(5, outputs["tests_matrix_no_nugets"].Include.Length); 138Assert.Equal(3, outputs["tests_matrix_no_nugets_overflow"].Include.Length); 155Assert.Equal(5, outputs["tests_matrix_no_nugets"].Include.Length);
WorkflowScripts\AutoRerunTransientCiFailuresTests.cs (1)
527Assert.Equal(2, result.Requests.Length);
installer.tasks (19)
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))
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
Keycloak.ApiService (1)
Program.cs (1)
35summaries[Random.Shared.Next(summaries.Length)]
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)
295if (args is { Length: > 0 })
WebHost.cs (1)
267options.AllowedHosts = (hosts?.Length > 0 ? hosts : new[] { "*" });
Microsoft.AspNetCore.Antiforgery (27)
Internal\BinaryBlob.cs (9)
30if (data == null || data.Length != bitLength / 8) 38internal int Length => _data.Length; 44return checked(_data.Length * 8); 62Debug.Assert(_data.Length == other._data.Length); 75Debug.Assert(_data != null && _data.Length >= (32 / 8)); 91if (a == null || b == null || a.Length != b.Length) 97for (var i = 0; i < a.Length; i++)
Internal\DefaultAntiforgeryTokenSerializer.cs (6)
196+ securityTokenBytes.Length + // SecurityToken 204totalSize += claimUidBytes!.Length; 227securityTokenBytes.CopyTo(tokenBytes.Slice(offset, securityTokenBytes.Length)); 228offset += securityTokenBytes.Length; 236claimUidBytes!.CopyTo(tokenBytes.Slice(offset, claimUidBytes!.Length)); 237offset += claimUidBytes.Length;
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Antiforgery\Release\net11.0\Microsoft.AspNetCore.Antiforgery.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (6)
137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 270return Base64UrlEncode(input, offset: 0, count: input.Length); 284ValidateParameters(input.Length, nameof(input), offset, count); 325ValidateParameters(input.Length, nameof(input), offset, count); 329if (output.Length - outputOffset < arraySizeRequired)
Microsoft.AspNetCore.App.Analyzers (4)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.App.Analyzers\Release\netstandard2.0\Microsoft.AspNetCore.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\RoslynUtils\WellKnownTypes.cs (2)
32for (var i = 0; i < WellKnownTypeData.WellKnownTypeNames.Length; i++) 53_lazyWellKnownTypes = new INamedTypeSymbol?[WellKnownTypeData.WellKnownTypeNames.Length];
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
348var length = disallowedMethodTypes.Length;
Microsoft.AspNetCore.Authentication (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Authentication\Release\net11.0\Microsoft.AspNetCore.Authentication.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.Abstractions (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Authentication.Abstractions\Release\net11.0\Microsoft.AspNetCore.Authentication.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.Cookies (1)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
Microsoft.AspNetCore.Authentication.OAuth (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Authentication.OAuth\Release\net11.0\Microsoft.AspNetCore.Authentication.OAuth.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authorization (3)
AuthorizationPolicy.cs (2)
153if (rolesSplit?.Length > 0) 161if (authTypesSplit?.Length > 0)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Authorization\Release\net11.0\Microsoft.AspNetCore.Authorization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authorization.Policy (2)
AuthorizationEndpointConventionBuilderExtensions.cs (1)
67if (authorizeData.Length == 0)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Authorization.Policy\Release\net11.0\Microsoft.AspNetCore.Authorization.Policy.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Components (87)
BindConverter.cs (4)
1820if (value.Length == 0) 1829for (var i = 1; i < value.Length; i++) 2041var convertedArray = new T[initialArray.Length]; 2043for (var i = 0; i < initialArray.Length; i++)
CascadingParameterState.cs (3)
39if (infos.Length == 0) 48var numInfos = infos.Length; 56resultStates ??= new List<CascadingParameterState>(infos.Length - infoIndex);
PersistentState\PersistentServicesRegistry.cs (2)
59_registrations.Length + 1); 60for (var i = 0; i < _registrations.Length; i++)
PersistentState\PersistentStateValueProviderKeyResolver.cs (5)
75currentBuffer = keyBuffer[preKey.Length..]; 95currentBuffer = keyBuffer[preKey.Length..]; 103GrowBuffer(ref pool, ref keyBuffer, keySpan.Length * 4 + preKey.Length); 112keyBuffer = keyBuffer[..(preKey.Length + currentBuffer.Length)]; 144var newPool = pool == null ? ArrayPool<byte>.Shared.Rent(size ?? 2048) : ArrayPool<byte>.Shared.Rent(pool.Length * 2);
RenderTree\EventArgsTypeCache.cs (2)
27if (parameterInfos.Length == 0) 31else if (parameterInfos.Length > 1)
RenderTree\Renderer.cs (2)
916for (int i = 0; i < updatedComponentsId.Length; i++) 961for (var i = 0; i < updatedComponents.Length; i++)
RenderTree\RenderTreeDiffBuilder.cs (2)
764return $"Encountered an unsupported frame type during diffing {unsupportedFrameType} for Component Path: '{componentPath}' on tree with length '{newTree.Length}' and contents '{frameTypesDescriptor}'."; 770for (var i = 0; i <= frameIndex && i < renderTree.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\Router.cs (1)
153if (routeAttributes.Length == 0)
Routing\RouteTableFactory.cs (5)
105var templates = new string[routeAttributes.Length]; 106for (var i = 0; i < routeAttributes.Length; i++) 149for (var i = 0; i < templates.Length; i++) 167public (RoutePattern, HashSet<string>)[] ParsedTemplates { get; set; } = new (RoutePattern, HashSet<string>)[templates.Length]; 177for (var i = 0; i < result.ParsedTemplates.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Components\Release\net11.0\Microsoft.AspNetCore.Components.Routing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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\aspnetcore\src\Components\Shared\src\RootTypeCache.cs (1)
55for (var i = 0; i < assemblies.Length; i++)
src\aspnetcore\src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (10)
326for (var i = 0; i < keys.Length; i++) 346for (var i = 0; i < values.Length; i++) 447if (arrayIndex < 0 || arrayIndex > array.Length || array.Length - arrayIndex < Count) 659if (_arrayStorage.Length < capacity) 692if (_arrayStorage.Length < capacity) 694capacity = _arrayStorage.Length == 0 ? DefaultCapacity : _arrayStorage.Length * 2; 731if ((uint)count <= (uint)array.Length) 754if ((uint)count <= (uint)array.Length)
src\aspnetcore\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\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternFactory.cs (1)
471for (var i = 0; i < updatedSegments.Length; i++)
src\aspnetcore\src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (11)
70return _rentedBuffer.Length; 80return _rentedBuffer.Length - _index; 146if (_index > _rentedBuffer.Length - count) 148ThrowInvalidOperationException(_rentedBuffer.Length); 184var availableSpace = _rentedBuffer.Length - _index; 188var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 190var newSize = checked(_rentedBuffer.Length + growBy); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
42for (var i = 0; i < NamespaceParts.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Components.Analyzers\Release\netstandard2.0\Microsoft.AspNetCore.Components.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Components.Authorization (2)
AttributeAuthorizeDataCache.cs (1)
40for (var i = 0; i < allAttributes.Length; i++)
AuthorizeViewCore.cs (1)
121for (var i = 0; i < authorizeData.Length; i++)
Microsoft.AspNetCore.Components.Endpoints (31)
Builder\ResourceCollectionUrlEndpoint.cs (3)
179if (rented == null || rented.Length < length) 275context.Response.ContentLength = contents.Length; 285var 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)
RazorComponentEndpointInvoker.cs (1)
150else if (endpoint.Metadata.GetMetadata<ConfiguredRenderModesMetadata>()?.ConfiguredRenderModes.Length == 0)
Rendering\Buffering\TextChunkPage.cs (1)
28if (_count < _buffer.Length)
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (2)
33if (renderModesMetadata.ConfiguredRenderModes.Length == 0) 40if (renderModesMetadata.ConfiguredRenderModes.Length == 1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Components.Endpoints\Release\net11.0\Microsoft.AspNetCore.Components.Endpoints.FormMapping.FormDataResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Components.Endpoints\Release\net11.0\Microsoft.AspNetCore.Components.Endpoints.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
31for (var i = 0; i < assemblies.Length; i++)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
28SerializeChildren(ref position, frames, frames.Length, result, capture, logger, ownerComponentType);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (6)
137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
src\aspnetcore\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.Forms (6)
ClientValidation\DefaultClientValidationService.cs (1)
42if (metadata.ValidationAttributes.Length == 0)
EditContext.cs (4)
264for (var i = 0; i < delegates.Length; i++) 345var tasks = new Task[delegates.Length]; 347for (var i = 0; i < delegates.Length; i++) 396for (var i = 0; i < tasks.Length; i++)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
63var newEndIndex = newBuffer.Length - _currentBuffer.Length + _nextEndIndex;
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
42for (var i = 0; i < NamespaceParts.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Components.SdkAnalyzers\Release\netstandard2.0\Microsoft.AspNetCore.Components.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Components.Server (53)
Circuits\CircuitHost.cs (7)
261for (var i = 0; i < _circuitHandlers.Length; i++) 293for (var i = 0; i < _circuitHandlers.Length; i++) 329for (var i = 0; i < _circuitHandlers.Length; i++) 357for (var i = 0; i < _circuitHandlers.Length; i++) 830for (var i = 0; i < operations.Length; i++) 888? new Task[operations.Length] 895for (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\CircuitPersistenceManager.cs (3)
126if (batch.Operations.Length != rootComponentDescriptors.Count) 132for (var i = 0; i < batch.Operations.Length; i++) 183if (rootComponents == null || rootComponents.Length == 0)
Circuits\PersistedCircuitState.cs (1)
17return $"ApplicationStateCount={ApplicationState?.Count ?? 0}, RootComponentsLength={RootComponents?.Length ?? 0} bytes";
Circuits\RemoteJSDataStream.cs (3)
104if (chunk.Length == 0) 109if (chunk.Length > _chunkSize) 114_bytesRead += chunk.Length;
Circuits\RemoteJSRuntime.cs (2)
161if (_maximumIncomingBytes - data.Length < _byteArraysToBeRevivedTotalBytes) 170_byteArraysToBeRevivedTotalBytes += Math.Max(4, data.Length);
Circuits\ServerComponentDeserializer.cs (5)
307Span<int> seenSsrComponentIds = operations.Length <= 128 308? stackalloc int[operations.Length] 309: (seenComponentIdsStorage = ArrayPool<int>.Shared.Rent(operations.Length)).AsSpan(0, operations.Length); 311for (var i = 0; i < operations.Length; i++)
src\aspnetcore\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\aspnetcore\src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
31for (var i = 0; i < assemblies.Length; i++)
src\aspnetcore\src\Components\Shared\src\RenderFragmentSerializer.cs (1)
28SerializeChildren(ref position, frames, frames.Length, result, capture, logger, ownerComponentType);
src\aspnetcore\src\Components\Shared\src\RootComponentOperationBatch.cs (1)
17return $"{nameof(RootComponentOperationBatch)}: {BatchId}, Operations Count: {Operations.Length}";
src\aspnetcore\src\Components\Shared\src\RootTypeCache.cs (1)
55for (var i = 0; i < assemblies.Length; i++)
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (11)
70return _rentedBuffer.Length; 80return _rentedBuffer.Length - _index; 146if (_index > _rentedBuffer.Length - count) 148ThrowInvalidOperationException(_rentedBuffer.Length); 184var availableSpace = _rentedBuffer.Length - _index; 188var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 190var newSize = checked(_rentedBuffer.Length + growBy); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\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\aspnetcore\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.Web (4)
_generated\2\WebRendererSerializerContext.JSComponentParameterArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
Forms\HtmlFieldPrefix.cs (2)
20var restLength = _rest?.Length ?? 0; 36var restLength = _rest?.Length ?? 0;
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
63var newEndIndex = newBuffer.Length - _currentBuffer.Length + _nextEndIndex;
Microsoft.AspNetCore.Connections.Abstractions (6)
src\aspnetcore\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\aspnetcore\src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
Microsoft.AspNetCore.Cors (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Cors\Release\net11.0\Microsoft.AspNetCore.Cors.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Cryptography.Internal (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Cryptography.Internal\Release\net11.0\Microsoft.AspNetCore.Cryptography.Internal.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
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.DataProtection (73)
ArraySegmentExtensions.cs (2)
13if (arraySegment.Offset == 0 && arraySegment.Count == arraySegment.Array!.Length) 19Buffer.BlockCopy(arraySegment.Array!, arraySegment.Offset, retVal, 0, retVal.Length);
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)
400CryptoUtil.Assert(resultSpan.Length == outputSize, "writtenSpan length should equal calculated outputSize"); 517cbDerivedKey: (uint)tempKeys.Length); 551CryptoUtil.Assert(ptr - pbRetVal == retVal.Length, "ptr - pbRetVal == retVal.Length");
Cng\CngGcmAuthenticatedEncryptor.cs (3)
319CryptoUtil.Assert(resultSpan.Length == outputSize, "writtenSpan length should equal calculated outputSize"); 389cbDerivedKey: (uint)tempKeys.Length); 406CryptoUtil.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 (10)
52if (originalPurposes != null && originalPurposes.Length > 0) 54var newPurposes = new string[originalPurposes.Length + 1]; 55Array.Copy(originalPurposes, 0, newPurposes, 0, originalPurposes.Length); 56newPurposes[originalPurposes.Length] = newPurpose; 124CryptoUtil.Assert(retVal != null && retVal.Length >= sizeof(uint) + sizeof(Guid), "retVal != null && retVal.Length >= sizeof(uint) + sizeof(Guid)"); 205if (protectedData.Length < _magicHeaderKeyIdSize) 287ArraySegment<byte> ciphertext = new ArraySegment<byte>(protectedData, sizeof(uint) + sizeof(Guid), protectedData.Length - (sizeof(uint) + sizeof(Guid))); // chop off magic header + encryptor id 340Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */); 377var targetLength = purposes.Length; 416Debug.Assert(index == targetArr.Length);
KeyManagement\KeyRingBasedSpanDataProtector.cs (4)
51var span = destination.GetSpan(result.Length); 53destination.Advance(result.Length); 179var span = destination.GetSpan(result.Length); 181destination.Advance(result.Length);
KeyManagement\XmlKeyManager.cs (2)
440for (var i = 0; i < deletableElementsArray.Length; i++) 466for (var i = 0; i < deletableElementsArray.Length; i++)
Managed\ManagedAuthenticatedEncryptor.cs (5)
637CryptoUtil.Assert(ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes, "ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes"); 638Buffer.BlockCopy(ciphertext, 0, retVal, idx, ciphertext.Length); 648CryptoUtil.Assert(digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes, "digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes"); 649Buffer.BlockCopy(digest, 0, retVal, idx, digest.Length); 653CryptoUtil.Assert(idx == retVal.Length, "idx == retVal.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\SP800_108_CTR_HMACSHA512Extensions.cs (3)
13var cbCombinedContext = checked((uint)contextHeader.Length + cbContext); 28Unsafe.CopyBlock(pbCombinedContext, pbContextHeader, (uint)contextHeader.Length); 30Unsafe.CopyBlock(&pbCombinedContext[contextHeader.Length], pbContext, cbContext);
SP800_108\Win7SP800_108_CTR_HMACSHA512Provider.cs (1)
63hashHandle.HashData(pbTempInputBuffer, (uint)tempInputBuffer.Length, pbHashDigest, SHA512_DIGEST_SIZE_IN_BYTES);
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.DataProtection\Release\net11.0\Microsoft.AspNetCore.DataProtection.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (6)
137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (11)
70return _rentedBuffer.Length; 80return _rentedBuffer.Length - _index; 146if (_index > _rentedBuffer.Length - count) 148ThrowInvalidOperationException(_rentedBuffer.Length); 184var availableSpace = _rentedBuffer.Length - _index; 188var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 190var newSize = checked(_rentedBuffer.Length + growBy); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
XmlEncryption\XmlEncryptionExtensions.cs (2)
176Array.Clear(underlyingBuffer, 0, underlyingBuffer.Length); 197Array.Clear(plaintextSecret, 0, plaintextSecret.Length);
Microsoft.AspNetCore.DataProtection.Abstractions (7)
DataProtectionCommonExtensions.cs (1)
80if (subPurposes != null && subPurposes.Length > 0)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.DataProtection.Abstractions\Release\net11.0\Microsoft.AspNetCore.DataProtection.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 270return Base64UrlEncode(input, offset: 0, count: input.Length); 284ValidateParameters(input.Length, nameof(input), offset, count); 325ValidateParameters(input.Length, nameof(input), offset, count); 329if (output.Length - outputOffset < arraySizeRequired)
Microsoft.AspNetCore.DataProtection.Extensions (6)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.DataProtection.Extensions\Release\net11.0\Microsoft.AspNetCore.DataProtection.Extensions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
TimeLimitedDataProtector.cs (5)
54byte[] plaintextWithHeader = new byte[checked(ExpirationTimeHeaderSize + plaintext.Length)]; 56Buffer.BlockCopy(plaintext, 0, plaintextWithHeader, ExpirationTimeHeaderSize, plaintext.Length); 75if (plaintextWithHeader.Length < ExpirationTimeHeaderSize) 92byte[] retVal = new byte[plaintextWithHeader.Length - ExpirationTimeHeaderSize]; 93Buffer.BlockCopy(plaintextWithHeader, ExpirationTimeHeaderSize, retVal, 0, retVal.Length);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (11)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (8)
236if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 702Array.Clear(keyBytes, 0, keyBytes.Length); 703Array.Clear(pem, 0, pem.Length); 709Array.Clear(keyBytes, 0, keyBytes.Length); 710Array.Clear(pem, 0, pem.Length); 760Array.Clear(bytes, 0, bytes.Length); 788Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
177Array.Clear(export, 0, export.Length); 624if (availableCommands.Count == commands.Length)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
66Array.Clear(export, 0, export.Length);
Microsoft.AspNetCore.Diagnostics (7)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
459if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Diagnostics\Release\net11.0\Microsoft.AspNetCore.Diagnostics.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Diagnostics.HealthChecks\Release\net11.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)
70if (_excludePathStartsWith.Length != 0 && ShouldExcludePath(context.Request.Path.Value!)) 151if (_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)
24Assert.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.HeaderParsing (1)
HeaderParsingFeature.cs (1)
60if (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 (28)
_generated\10\SourceGenerationContext.StringArray.g.cs (1)
59for (int i = 0; i < value.Length; i++)
_generated\5\SourceGenerationContext.StaticWebAssetPatternArray.g.cs (1)
59for (int i = 0; i < value.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\HostingTelemetryHelpers.cs (1)
76return (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\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Hosting\Release\net11.0\Microsoft.AspNetCore.Hosting.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
397if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\aspnetcore\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\aspnetcore\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\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Http (12)
Internal\ResponseCookies.cs (1)
151for (var i = 0; i < values.Length; i++)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\aspnetcore\src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\aspnetcore\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)
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)
31if (contentTypes is null || contentTypes.Length == 0) 37for (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; 326for (var i = 0; i < keys.Length; i++) 346for (var i = 0; i < values.Length; i++) 447if (arrayIndex < 0 || arrayIndex > array.Length || array.Length - arrayIndex < Count) 629for (var i = 0; i < storage.Properties.Length; i++) 654if (_propertyStorage != null || _arrayStorage.Length < capacity) 678capacity = Math.Max(DefaultCapacity, Math.Max(storage.Properties.Length, capacity)); 681for (var i = 0; i < storage.Properties.Length; i++) 692if (_arrayStorage.Length < capacity) 694capacity = _arrayStorage.Length == 0 ? DefaultCapacity : _arrayStorage.Length * 2; 731if ((uint)count <= (uint)array.Length) 754if ((uint)count <= (uint)array.Length) 775for (var i = 0; i < properties.Length; i++) 901for (var i = 0; i < properties.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Http.Abstractions\Release\net11.0\Microsoft.AspNetCore.Http.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\aspnetcore\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.Connections (10)
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 270return Base64UrlEncode(input, offset: 0, count: input.Length); 284ValidateParameters(input.Length, nameof(input), offset, count); 325ValidateParameters(input.Length, nameof(input), offset, count); 329if (output.Length - outputOffset < arraySizeRequired)
src\aspnetcore\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.Extensions (64)
_generated\10\ProblemDetailsJsonContext.StringArray.g.cs (1)
57for (int i = 0; i < value.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 (20)
446var contextArgAccess = new Expression[argTypes.Length]; 448for (var i = 0; i < argTypes.Length; i++) 598Expression paramArray = factoryContext.BoxedArgs.Length > 0 612var expandedArguments = new Expression[arguments.Length + 1]; 616var constructorType = factoryContext.ArgumentTypes?.Length switch 650if (parameters is null || parameters.Length == 0) 655var args = new Expression[parameters.Length]; 657factoryContext.ArgumentTypes = new Type[parameters.Length]; 658factoryContext.BoxedArgs = new Expression[parameters.Length]; 661for (var i = 0; i < parameters.Length; i++) 1275var count = binders.Length; 1323var count = binders.Length; 1480var count = binders.Length; 1609if (constructor is not null && parameters is { Length: > 0 }) 1613var constructorArguments = new Expression[parameters.Length]; 1615for (var i = 0; i < parameters.Length; i++) 1636var bindings = new List<MemberBinding>(properties.Length); 1638for (var i = 0; i < properties.Length; i++) 2161if (factoryContext.ArgumentExpressions == null || factoryContext.ArgumentExpressions.Length == 0) 2166for (var i = 0; i < factoryContext.ArgumentExpressions.Length; i++)
SessionExtensions.cs (1)
39if (data == null || data.Length < 4)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Http.Extensions\Release\net11.0\Microsoft.AspNetCore.Components.Endpoints.FormMapping.FormDataResources.cs (1)
25for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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\aspnetcore\src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (2)
125if (constructors.Length == 1) 135else if (constructors.Length > 1)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\aspnetcore\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\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\aspnetcore\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\aspnetcore\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\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Http.Results (2)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (1)
379for (var i = 0; i < states.Length; i++)
Microsoft.AspNetCore.HttpLogging (20)
FileLoggerProcessor.cs (1)
310return files.Length == 0
HttpLoggingMiddleware.cs (5)
65if (_interceptors.Length == 0 && loggingFields == HttpLoggingFields.None) 99for (var i = 0; i < _interceptors.Length; i++) 206if (loggingFields.HasFlag(HttpLoggingFields.ResponseBody) || _interceptors.Length > 0) 316for (var i = 0; i < interceptors.Length; i++) 326for (var i = 0; i < interceptors.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.HttpLogging\Release\net11.0\Microsoft.AspNetCore.HttpLogging.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (6)
137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
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.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)
69for (int i = 0; i < PrefixBytes.Length && Mask[i] != 0; i++) 82var mask = new byte[PrefixBytes.Length];
Microsoft.AspNetCore.Identity (7)
_generated\16\IdentityEndpointsJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\47\IdentityJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.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;
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Identity\Release\net11.0\Microsoft.AspNetCore.Identity.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Localization (4)
ApplicationBuilderExtensions.cs (1)
84if (cultures.Length == 0)
RequestLocalizationOptions.cs (2)
125var supportedCultures = new List<CultureInfo>(cultures.Length); 144var supportedUICultures = new List<CultureInfo>(uiCultures.Length);
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Localization\Release\net11.0\Microsoft.AspNetCore.Localization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Abstractions (15)
ModelBinding\BindingInfo.cs (2)
150if (propertyFilterProviders.Length == 1) 155else if (propertyFilterProviders.Length > 1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.Abstractions\Release\net11.0\Microsoft.AspNetCore.Mvc.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\aspnetcore\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\aspnetcore\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 (17)
ApiDescriptionGroupCollectionProvider.cs (1)
72for (var i = _apiDescriptionProviders.Length - 1; i >= 0; i--)
src\aspnetcore\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);
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)
129if (routeAttributes.Length > 0) 319if (routeAttributes.Length > 0) 337var applicableAttributes = new List<object>(routeAttributes.Length); 671if (httpMethods.Length > 0)
ApplicationParts\RelatedAssemblyAttribute.cs (2)
63if (attributes.Length == 0) 80for (var i = 0; i < attributes.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)
534var count = declaredParameterInfos.Length; 630var convertedArguments = new string?[arguments.Length]; 631for (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\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.Core\Release\net11.0\Microsoft.AspNetCore.Mvc.Core.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
src\aspnetcore\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\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\aspnetcore\src\Shared\PropertyActivator\PropertyActivator.cs (1)
90property.GetIndexParameters().Length == 0 &&
src\aspnetcore\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\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (1)
379for (var i = 0; i < states.Length; i++)
Microsoft.AspNetCore.Mvc.Cors (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.Cors\Release\net11.0\Microsoft.AspNetCore.Mvc.Cors.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.DataAnnotations\Release\net11.0\Microsoft.AspNetCore.Mvc.DataAnnotations.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.Formatters.Xml\Release\net11.0\Microsoft.AspNetCore.Mvc.Formatters.Xml.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Localization (1)
Properties\Resources.Designer.cs (1)
53for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Razor (9)
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++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.Razor\Release\net11.0\Microsoft.AspNetCore.Mvc.Razor.Resources.cs (1)
22for (var i = 0; i < formatterNames.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.RazorPages (21)
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 (2)
128for (var i = 0; i < properties.Length; i++) 144for (var i = 0; i < methods.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)
230for (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++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.RazorPages\Release\net11.0\Microsoft.AspNetCore.Mvc.RazorPages.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.TagHelpers (14)
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);
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.TagHelpers\Release\net11.0\Microsoft.AspNetCore.Mvc.TagHelpers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.ViewFeatures (43)
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))
Filters\SaveTempDataPropertyFilterBase.cs (1)
90for (var i = 0; i < propertyHelpers.Length; i++)
Filters\ViewDataAttributePropertyProvider.cs (1)
17for (var i = 0; i < propertyHelpers.Length; i++)
HtmlAttributePropertyHelper.cs (2)
40result = new HtmlAttributePropertyHelper[propertyHelpers.Length]; 41for (var i = 0; i < propertyHelpers.Length; i++)
Infrastructure\DefaultTempDataSerializer.cs (1)
15if (value.Length == 0)
MemberExpressionCacheKey.cs (1)
68if (_index >= _members.Length)
ModelExplorer.cs (2)
190for (var j = 0; j < propertyHelpers.Length; j++) 238for (var i = 0; i < PropertiesInternal.Length; i++)
ModelExplorerExtensions.cs (1)
75if (modelExplorer.PropertiesInternal.Length == 0)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Mvc.ViewFeatures\Release\net11.0\Microsoft.AspNetCore.Mvc.ViewFeatures.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (11)
70return _rentedBuffer.Length; 80return _rentedBuffer.Length - _index; 146if (_index > _rentedBuffer.Length - count) 148ThrowInvalidOperationException(_rentedBuffer.Length); 184var availableSpace = _rentedBuffer.Length - _index; 188var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 190var newSize = checked(_rentedBuffer.Length + growBy); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.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 (4)
203var count = declaredParameterInfos.Length; 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.OutputCaching (21)
Memory\MemoryOutputCacheStore.cs (3)
123Size = value.Length 126if (tags is { Length: > 0 }) 142Debug.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 (5)
177for (var j = 0; j < headerValuesArray.Length; j++) 204for (var i = 0; i < queryArray.Length; i++) 219for (var j = 0; j < queryValueArray.Length; j++) 253for (var j = 0; j < queryValueArray.Length; j++) 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)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.OutputCaching\Release\net11.0\Microsoft.AspNetCore.OutputCaching.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.RateLimiting (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.RateLimiting\Release\net11.0\Microsoft.AspNetCore.RateLimiting.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Razor (1)
TagHelpers\RestrictChildrenAttribute.cs (1)
26var concatenatedNames = new string[1 + childTags.Length];
Microsoft.AspNetCore.Razor.Runtime (3)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Razor.Runtime\Release\net11.0\Microsoft.AspNetCore.Razor.Runtime.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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.Utilities.Shared (27)
PooledArrayBufferWriter`1.cs (11)
64return _rentedBuffer.Length; 74return _rentedBuffer.Length - _index; 128if (_index > _rentedBuffer.Length - count) 130ThrowCannotAdvance(_rentedBuffer.Length); 170var availableSpace = _rentedBuffer!.Length - _index; 174var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 176var newSize = checked(_rentedBuffer.Length + growBy); 182Debug.Assert(oldBuffer.Length >= _index); 183Debug.Assert(_rentedBuffer.Length >= _index); 191Debug.Assert(_rentedBuffer.Length - _index > 0); 192Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\roslyn\artifacts\obj\Microsoft.AspNetCore.Razor.Utilities.Shared\Release\net11.0\Microsoft.AspNetCore.Razor.SharedUtilities.Resources.CollectionUtilitiesSR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.AspNetCore.Razor.Utilities.Shared\Release\net11.0\Microsoft.AspNetCore.Razor.Utilities.Shared.Resources.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\EnumerableExtensions.cs (4)
60Debug.Assert(result.Length == count); 131Debug.Assert(result.Length == count); 572if (newArray.Length <= 1) 577var length = newArray.Length;
Utilities\Hashing\NonCryptographicHashAlgorithm.cs (1)
118int read = stream.Read(buffer, 0, buffer.Length);
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)
122for (var j = 0; j < headerValuesArray.Length; j++) 144for (var i = 0; i < queryArray.Length; i++) 155for (var j = 0; j < queryValueArray.Length; j++) 180for (var j = 0; j < queryValueArray.Length; j++)
ResponseCachingMiddleware.cs (2)
529var newArray = new string[originalArray.Length]; 531for (var i = 0; i < originalArray.Length; i++)
Microsoft.AspNetCore.ResponseCompression (5)
ResponseCompressionBody.cs (1)
214for (var i = 0; i < varyValues.Length; i++)
ResponseCompressionProvider.cs (4)
38if (_providers.Length == 0) 48for (var i = 0; i < _providers.Length; i++) 107for (int i = 0; i < _providers.Length; i++) 120for (int i = 0; i < _providers.Length; i++)
Microsoft.AspNetCore.Rewrite (5)
RedirectToNonWwwRule.cs (1)
25if (domains.Length < 1)
RedirectToWwwRule.cs (1)
25if (domains.Length < 1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Rewrite\Release\net11.0\Microsoft.AspNetCore.Rewrite.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
UrlActions\CustomResponseAction.cs (2)
37response.ContentLength = content.Length; 39response.Body.Write(content, 0, content.Length);
Microsoft.AspNetCore.Routing (92)
ArrayBuilder.cs (2)
43public int Capacity => _array?.Length ?? 0; 114if (_count < result.Length)
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)
208if (hosts is null || hosts.Length == 0) 213for (var j = 0; j < hosts.Length; j++) 230if (endpointKeys is null || endpointKeys.Length == 0) 247for (var j = 0; j < endpointKeys.Length; j++) 388for (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)
373for (var i = 0; i < destinations.Length; i++) 390if (endpointsQuality.Length == 0) 396for (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\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Routing\Release\net11.0\Microsoft.AspNetCore.Routing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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++)
ValidationEndpointFilterFactory.cs (1)
36for (var i = 0; i < parameters.Length; i++)
Microsoft.AspNetCore.Routing.Abstractions (6)
src\aspnetcore\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.Server.HttpSys (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Server.HttpSys\Release\net11.0\Microsoft.AspNetCore.Server.HttpSys.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Server.IIS (1)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Server.IIS\Release\net11.0\Microsoft.AspNetCore.Server.IIS.CoreStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Server.Kestrel.Core (163)
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)
688if (_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)
678if (_fakeMemory.Length < minSize)
Internal\Http3\Http3OutputProducer.cs (1)
245if (_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\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net11.0\Microsoft.AspNetCore.Server.Kestrel.Core.CoreStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net11.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net11.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\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\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
20Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\aspnetcore\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\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (6)
137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (8)
236if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 702Array.Clear(keyBytes, 0, keyBytes.Length); 703Array.Clear(pem, 0, pem.Length); 709Array.Clear(keyBytes, 0, keyBytes.Length); 710Array.Clear(pem, 0, pem.Length); 760Array.Clear(bytes, 0, bytes.Length); 788Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
177Array.Clear(export, 0, export.Length); 624if (availableCommands.Count == commands.Length)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
66Array.Clear(export, 0, export.Length);
src\aspnetcore\src\Shared\Hpack\DynamicHPackEncoder.cs (1)
36_hashMask = (byte)(_headerBuckets.Length - 1);
src\aspnetcore\src\Shared\runtime\Http2\Hpack\DynamicTable.cs (6)
46index += _buffer.Length; 73if (_count == _buffer.Length) 79int newBufferSize = Math.Min(Math.Max(16, _buffer.Length * 2), maxCapacity); 84int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 98if (++_insertIndex == _buffer.Length) 128if (++_removeIndex == _buffer.Length)
src\aspnetcore\src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
571_headerNameLength = _headerName.Length; 578if (length > _stringOctets.Length) 585_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 638if (dst.Length < stringLength) 640dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\aspnetcore\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\aspnetcore\src\Shared\runtime\Http3\QPack\H3StaticTable.Http3.cs (1)
34public static int Count => s_staticTable.Length;
src\aspnetcore\src\Shared\runtime\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackDecoder.cs (1)
680else if (buffer.Length < requiredLength)
src\aspnetcore\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\aspnetcore\src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
233for (int i = 0; i < settings.Length; i++)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (5)
src\aspnetcore\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\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
20Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Session (13)
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;
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.Session\Release\net11.0\Microsoft.AspNetCore.Session.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.SignalR.Common (5)
src\aspnetcore\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.Core (22)
Internal\DefaultHubDispatcher.cs (3)
348var clientStreamLength = hubMethodInvocationMessage.StreamIds?.Length ?? 0; 727for (var parameterPointer = 0; parameterPointer < arguments.Length; parameterPointer++) 748else if (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\aspnetcore\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\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
237if (parameters.Length == 3
src\aspnetcore\src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.StaticFiles (4)
HtmlDirectoryFormatter.cs (2)
205context.Response.ContentLength = bytes.Length; 206return context.Response.Body.WriteAsync(bytes, 0, bytes.Length);
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.StaticFiles\Release\net11.0\Microsoft.AspNetCore.StaticFiles.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
StaticFileContext.cs (1)
287for (int i = 0; i < states.Length; i++)
Microsoft.AspNetCore.WebSockets (3)
WebSocketMiddleware.cs (3)
247if (values.Length == 1) 267if (values.Length == 1) 308if (values.Length == 1)
Microsoft.AspNetCore.WebUtilities (24)
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)
PagedByteBuffer.cs (5)
32if (_currentPage == null || _currentPageIndex == _currentPage.Length) 53var copyLength = Math.Min(memory.Length, currentPage.Length - _currentPageIndex); 73page.Length; 90page.Length; 107page.Length;
ReasonPhrases.cs (1)
189if (j < (uint)phrases.Length)
src\aspnetcore\artifacts\obj\Microsoft.AspNetCore.WebUtilities\Release\net11.0\Microsoft.AspNetCore.WebUtilities.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (5)
157if (buffer.Length - bufferOffset < arraySizeRequired) 270return Base64UrlEncode(input, offset: 0, count: input.Length); 284ValidateParameters(input.Length, nameof(input), offset, count); 325ValidateParameters(input.Length, nameof(input), offset, count); 329if (output.Length - outputOffset < arraySizeRequired)
Microsoft.Build (329)
_generated\0\RegexGenerator.g.cs (3)
9372if ((uint)p < (uint)s.Length) 9398if ((uint)(p + 1) < (uint)s.Length) 9425if ((uint)(p + 2) < (uint)s.Length)
BackEnd\BuildManager\BuildManager.cs (2)
1752for (int i = 1; i < instances.Length; i++) 3476if (inputCacheFiles.Length == 0)
BackEnd\BuildManager\CacheAggregator.cs (4)
60Assumed.Equal(configs.Length, results.Length, "Assuming 1-to-1 mapping between configs and results. Otherwise it means the caches are either not minimal or incomplete"); 62if (configs.Length == 0 && results.Length == 0)
BackEnd\Client\MSBuildClientPacketPump.cs (2)
248if ((headerBytesRead != headerByte.Length) && !localPacketPumpShutdownEvent.WaitOne(0)) 263InternalError.Throw($"Incomplete header read. {headerBytesRead} of {headerByte.Length} bytes read");
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 (6)
140if (i < (waitForExitTasks?.Length ?? 0)) 148if (i < waitForExitTasks.Length) 466Assumed.Positive(processNamesToSearch.Length, "Expected at least one process name to search for."); 467string expectedProcessName = processNamesToSearch.Length == 1 1340if (bytesRead != _headerByte.Length) 1342CommunicationsUtilities.Trace(_nodeId, $"COMMUNICATIONS ERROR (HRC) Node: {_nodeId} Process: {_process.Id} Bytes Read: {bytesRead} Expected: {_headerByte.Length}");
BackEnd\Components\Logging\BuildErrorTelemetryTracker.cs (1)
42private readonly int[] _errorCounts = new int[Enum.GetValues(typeof(ErrorCategory)).Length];
BackEnd\Components\Logging\ProjectLoggingContext.cs (1)
229propertiesToSerialize?.Length > 0 &&
BackEnd\Components\RequestBuilder\IntrinsicTasks\CallTarget.cs (1)
90if ((Targets == null) || (Targets.Length == 0))
BackEnd\Components\RequestBuilder\IntrinsicTasks\IntrinsicTaskFactory.cs (2)
60var propertyInfos = new TaskPropertyInfo[infos.Length]; 61for (int i = 0; i < infos.Length; i++)
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (16)
226if ((Projects == null) || (Projects.Length == 0)) 232if (TargetAndPropertyListSeparators?.Length > 0) 288skipProjects = new bool[Projects.Length]; 300for (int i = 0; i < Projects.Length; i++) 406for (int i = 0; i < Projects.Length; i++) 416if (projectToBuildInParallel.Length <= 0) 495if (runEachTargetSeparately && targets?.Length > 0) 532var projectDirectory = new string[projects.Length]; 533var projectNames = new string[projects.Length]; 534var toolsVersions = new string[projects.Length]; 535var projectProperties = new Dictionary<string, string>[projects.Length]; 536var undefinePropertiesPerProject = new List<string>[projects.Length]; 538for (int i = 0; i < projectNames.Length; i++) 581undefinePropertiesPerProject[i] = new List<string>(propertiesToUndefine.Length); 584if (log != null && propertiesToUndefine.Length > 0) 663for (int i = 0; i < projects.Length; i++)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (14)
343Assumed.Equal(projectFiles.Length, properties.Length, "Properties and project counts not the same"); 344Assumed.Equal(projectFiles.Length, toolsVersions.Length, "Tools versions and project counts not the same"); 346FullyQualifiedBuildRequest[] requests = new FullyQualifiedBuildRequest[projectFiles.Length]; 348for (int i = 0; i < projectFiles.Length; ++i) 388Assumed.Equal(requests.Length, results.Length, "# results != # requests"); 587WaitHandle[] allHandles = new WaitHandle[handles.Length + 1]; 589Array.Copy(handles, 0, allHandles, 1, handles.Length); 1004Assumed.Equal(requests.Length, results.Length, "# results != # requests"); 1024for (int i = 0; i < requests.Length; i++) 1225ProjectErrorUtilities.VerifyThrowInvalidProject(allTargets.Length > 0,
BackEnd\Components\RequestBuilder\TargetBuilder.cs (4)
115Assumed.Positive(targetNames.Length, "List of targets must be non-empty"); 149List<TargetSpecification> targets = new List<TargetSpecification>(targetNames.Length); 253ITargetResult[] results = new TargetResult[targets.Length]; 273for (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)
293ErrorUtilities.VerifyThrowArgument((targetOutputsPerProject == null) || (projectFileNames.Length == targetOutputsPerProject.Length), "General.TwoVectorsMustHaveSameLength", projectFileNames.Length, targetOutputsPerProject?.Length ?? 0, "projectFileNames", "targetOutputsPerProject"); 295BuildEngineResult result = BuildProjectFilesInParallel(projectFileNames, targetNames, globalProperties, new List<String>[projectFileNames.Length], toolsVersion, includeTargetOutputs); 301Assumed.Equal(targetOutputsPerProject.Length, result.TargetOutputsPerProject.Count, $"{targetOutputsPerProject.Length} != {result.TargetOutputsPerProject.Count}"); 303for (int i = 0; i < targetOutputsPerProject.Length; i++) 977if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null) 991for (int i = 0; i < targetNames.Length; i++) 1157if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null) 1170for (int i = 0; i < targetNames.Length; i++) 1182PropertyDictionary<ProjectPropertyInstance>[] propertyDictionaries = new PropertyDictionary<ProjectPropertyInstance>[projectFileNames.Length]; 1184for (int i = 0; i < projectFileNames.Length; i++) 1218Assumed.Equal(results.Length, projectFileNames.Length, $"{results.Length}!={projectFileNames.Length}."); 1222targetOutputsPerProject = new List<IDictionary<string, ITaskItem[]>>(results.Length); 1226for (int i = 0; i < results.Length; i++) 1237ITaskItem[] clonedTaskItem = new ITaskItem[resultEntry.Value.Items.Length]; 1238for (int j = 0; j < resultEntry.Value.Items.Length; j++) 1263Assumed.True(results.Length == projectFileNames.Length || !overallSuccess, $"The number of results returned {results.Length} cannot be less than the number of project files {projectFileNames.Length} unless one of the results indicated failure.");
BackEnd\Components\Scheduler\Scheduler.cs (8)
1760Stack<BuildRequest> requestsToAdd = new Stack<BuildRequest>(blocker.BuildRequests.Length); 2380while (numRead < buffer.Length && requestsToRead.MoveNext()) 2408int[] previousWork = new int[currentWork.Length]; 2409HashSet<int>[] runningRequests = new HashSet<int>[currentWork.Length]; 2432for (int i = 0; i < currentWork.Length; i++) 2454for (int i = 0; i < currentWork.Length; i++) 2524for (int i = 0; i < nodeActiveTimes.Length; i++) 2549for (int i = 0; i < currentWork.Length; i++)
BackEnd\Components\Scheduler\SchedulingPlan.cs (3)
374if (values.Length < 1) 382for (int i = 1; i < values.Length; i++) 404if (values.Length < 3)
BackEnd\Node\OutOfProcNode.cs (1)
815if (configuration.LoggerDescriptions?.Length > 0)
BackEnd\Shared\BuildResult.cs (1)
796ConcurrentDictionary<string, TargetResult> resultsByTarget = CreateTargetResultDictionary(targetNames.Length);
BackEnd\Shared\TargetResult.cs (6)
309if (_items.Length == 0) 351var itemsCount = _items?.Length ?? 0; 359var defaultBufferCapacity = _items.Length * 128; 369var interner = new LookasideStringInterner(StringComparer.Ordinal, _items.Length); 388using MemoryStream itemsStream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true); 391for (int i = 0; i < _items.Length; i++)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (6)
889var stringOutputs = new string[convertibleOutputs.Length]; 890for (int i = 0; i < convertibleOutputs.Length; i++) 1116for (int i = 0; i < loadedType.Properties.Length; i++) 1579StringBuilder joinedOutputs = (outputs.Length == 0) ? new StringBuilder() : null; 1655if (LogTaskInputs && !_taskLoggingContext.LoggingService.OnlyLogCriticalEvents && outputs.Length > 0 && parameter.Log) 1673StringBuilder joinedOutputs = (outputs.Length == 0) ? new StringBuilder() : null;
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (3)
52if (availableTypes.Length != checkTypes.Length) 58catch (ReflectionTypeLoadException ex) when (ex.LoaderExceptions.Length != 0)
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (1)
284check.SupportedRules.Count != checkFactoryContext.RuleIds.Length
BuildCheck\Infrastructure\BuildEventsProcessor.cs (1)
258CheckConfigurationEffective config = configPerRule.Length == 1
BuildCheck\Infrastructure\ConfigurationProvider.cs (2)
129var configurations = new CheckConfigurationEffective[userConfigs.Length]; 131for (int idx = 0; idx < userConfigs.Length; idx++)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
33Debug.Assert(regex.GetGroupNumbers().Length - 1 == numberRangePairs.Length);
Collections\ArrayDictionary.cs (2)
96if (count < keys.Length) 104throw new InvalidOperationException($"ArrayDictionary is at capacity {keys.Length}");
Collections\ItemDictionary.cs (1)
396if (Count > array.Length - arrayIndex)
Collections\ReadOnlyConvertingDictionary.cs (1)
150Assumed.GreaterThanOrEqual(array.Length - arrayIndex, _backing.Count, "Specified array size insufficient to hold the contents of the collection.");
Collections\RetrievableEntryHashSet\HashHelpers.cs (1)
61for (int i = 0; i < primes.Length; i++)
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (16)
181if ((_count == 0 && _slots.Length > HashHelpers.GetMinPrime()) || 182(_count > 0 && _slots.Length / _count > ShrinkThreshold)) 268Array.Clear(_buckets, 0, _buckets.Length); 366for (int i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next) 417int bucket = hashCode % _buckets.Length; 523info.AddValue(CapacityName, _buckets == null ? 0 : _buckets.Length); 565for (int i = 0; i < array.Length; i++) 635if (index < 0 || Count > array.Length - index) 674if (arrayIndex > array.Length || count > array.Length - arrayIndex) 740Debug.Assert(newSlots.Length <= _slots.Length, "capacity increased after TrimExcess"); 823int bucket = hashCode % _buckets.Length; 824for (int i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next) 843if (_lastIndex == _slots.Length) 847bucket = hashCode % _buckets.Length;
Construction\Solution\SolutionFile.cs (6)
980if (words.Length >= 2) 1652ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationNames.Length == 2, "SubCategoryForSolutionParsingErrors", 1678configurationPlatformParts.Length == 2, 1729ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(nameValue.Length == 2, "SubCategoryForSolutionParsingErrors", 1775ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationPlatformParts.Length <= 2, "SubCategoryForSolutionParsingErrors", 1781(configurationPlatformParts.Length > 1) ? configurationPlatformParts[1] : string.Empty,
Construction\Solution\SolutionProjectGenerator.cs (1)
2133var properties = new Dictionary<string, string>(_metaprojectGlobalProperties.Length, StringComparer.OrdinalIgnoreCase);
Definition\Project.cs (1)
2632for (int i = 0; i < includeGlobStrings.Length; ++i)
Definition\Toolset.cs (1)
596if (defaultTasksFiles.Length == 0)
Evaluation\Evaluator.cs (2)
419if (includeSplitFilesEscaped.Length > 0) 2086if (importFilesEscaped.Length == 0)
Evaluation\Expander.cs (43)
2540ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2590ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2639ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2663ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2741ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2810ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2882ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2901ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2914ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 3147ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 3164ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 3198ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 3231ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 3264ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 4028args = new object[_arguments.Length]; 4031for (int n = 0; n < _arguments.Length; n++) 4085if (objectInstance != null && args.Length == 1 && (String.Equals("Equals", _methodMethodName, StringComparison.OrdinalIgnoreCase) || String.Equals("CompareTo", _methodMethodName, StringComparison.OrdinalIgnoreCase))) 4104if (_methodMethodName.Equals("GetPathOfFileAbove") && args.Length == 1) 4162IEnumerable<MethodInfo> methods = _receiverType.GetMethods(_bindingFlags).Where(m => m.Name.Equals(_methodMethodName) && m.GetParameters().Length == args.Length); 4246for (int i = index; i < args.Length; i++) 4265ErrorUtilities.ThrowArgument("CouldNotDifferentiateBetweenCompatibleMethods", _methodMethodName, args.Length); 4616object[] coercedArguments = new object[args.Length]; 4621for (int n = 0; n < parameters.Length; n++) 4786Type[] types = new Type[_arguments.Length]; 4787for (int n = 0; n < _arguments.Length; n++) 4832if (parameters.Length == _arguments.Length) 4909return parameters.Length > 0
Evaluation\Expander\ArgumentParser.cs (15)
20if (enforceLength && args.Length != 2) 43if (args.Length != 3) 69if (args.Length != 4) 95if (args.Length != 2) 118if (args.Length != 3) 140if (args.Length != 1) 151if (args.Length != 1) 268if (args.Length != 1) 280if (args.Length != 2) 310if (args.Length != 1) 323if (args.Length != 2) 337if (args.Length != 2) 351if (args.Length != 2) 376if (args.Length != 2) 402if (args.Length != 2)
Evaluation\Expander\WellKnownFunctions.cs (21)
24for (var i = 0; i < args.Length; i++) 55switch (args.Length) 98if (args.Length == 0) 124if (args.Length == 0) 194if (args.Length == 0) 202if (args.Length == 0) 223if (args.Length == 0) 273if (args.Length == 0) 398if (args.Length >= 4 && 401returnVal = IntrinsicFunctions.GetRegistryValueFromView(arg0, arg1, args[2], new ArraySegment<object>(args, 3, args.Length - 3)); 407if (args.Length == 0) 474if (args.Length == 0) 482if (args.Length == 0) 490if (args.Length == 0) 498if (args.Length == 0) 506if (args.Length == 0) 514if (args.Length == 0) 522if (args.Length == 0) 878if (args.Length == 0) 910if (string.Equals(methodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3) 981if (args.Length == 0)
Evaluation\IntrinsicFunctions.cs (1)
241if (views == null || views.Length == 0)
Evaluation\LazyItemEvaluator.IncludeOperation.cs (1)
161for (int i = 0; i < matchers.Length; ++i)
Graph\ProjectInterpretation.cs (1)
144if (configurationPlatformParts.Length > 1)
Instance\TaskFactories\TaskHostTask.cs (4)
770globalProperties = new System.Collections.IDictionary[request.GlobalProperties.Length]; 771for (int i = 0; i < request.GlobalProperties.Length; i++) 781removeGlobalProperties = new IList<string>[request.RemoveGlobalProperties.Length]; 782for (int i = 0; i < request.RemoveGlobalProperties.Length; i++)
Instance\TaskFactoryWrapper.cs (1)
262for (int i = 0; i < propertyInfos.Length; i++)
Instance\TaskRegistry.cs (1)
717string unqualifiedTaskName = nameComponents[nameComponents.Length - 1];
Logging\BinaryLogger\BinaryLogger.cs (3)
889if (binaryLoggerParameters == null || binaryLoggerParameters.Length == 0) 894if (binaryLoggerParameters.Length == 1) 907for (int i = 0; i < binaryLoggerParameters.Length; i++)
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
493var dictionary = ArrayDictionary<string, string>.Create(list.Length); 494for (int i = 0; i < list.Length; i++)
Logging\BinaryLogger\BuildEventArgsWriter.cs (3)
775if (arguments == null || arguments.Length == 0) 780int count = arguments.Length; 881if (e is LazyFormattedBuildEventArgs { RawArguments: { Length: > 0 } } and
Logging\BinaryLogger\Postprocessing\StreamExtensions.cs (2)
46int read = stream.Read(buffer, 0, (int)Math.Min(bytesCount - totalRead, buffer.Length)); 63return buffer.Length == ms.Length ? buffer : ms.ToArray();
Logging\DistributedLoggers\ConfigurableForwardingLogger.cs (1)
77for (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)
188parameterAndValue.Length > 1 ? parameterAndValue[1] : null);
Logging\ParallelLogger\ParallelLoggerHelpers.cs (2)
154for (int i = 0; i < stackTrace.Length; i++) 158stackTrace[stackTrace.Length - i - 1] = !string.IsNullOrEmpty(projectStartedEvent.TargetNames) ?
Logging\TerminalLogger\TerminalLogger.cs (3)
1102if (_isReplayMode && nodeIndex >= _nodes.Length) 1107if (nodeIndex >= _nodes.Length) 1109int newSize = Math.Max(nodeIndex + 1, _nodes.Length * 2);
Logging\TerminalLogger\TerminalNodesFrame.cs (1)
32_nodes = new (TerminalNodeStatus, int)[nodes.Length];
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Extensions\IEnumerableExtensions.cs (1)
329return source.Length == 0;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Extensions\ImmutableArrayExtensions.cs (1)
847int last = copy.Length - 1;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ArrayBuilder.cs (2)
44for (var i = 0; i < result.Length; i++) 645Debug.Assert(start + length <= items.Length);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ObjectPool`1.cs (3)
173for (var i = 0; i < items.Length; i++) 220for (var i = 0; i < items.Length; i++) 282for (var i = 0; i < items.Length; i++)
src\msbuild\src\Shared\CanonicalError.cs (1)
374if (explodedText.Length > 0)
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (2)
667if (bytesRead != headerByte.Length) 687CommunicationsUtilities.Trace($"Incomplete header read from server. {bytesRead} of {headerByte.Length} bytes read");
src\msbuild\src\Shared\OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
src\msbuild\src\Shared\PlatformNegotiation.cs (1)
113if (keyVal.Length != 2 || string.IsNullOrEmpty(keyVal[0]) || string.IsNullOrEmpty(keyVal[1]))
src\msbuild\src\Shared\ResourceUtilities.cs (1)
362if (args?.Length > 0)
src\msbuild\src\Shared\TaskHostBuildRequest.cs (5)
82var result = new Dictionary<string, string>?[globalProperties.Length]; 83for (int i = 0; i < globalProperties.Length; i++) 138int length = array?.Length ?? 0; 165int length = _globalProperties?.Length ?? 0; 192int length = _removeGlobalProperties?.Length ?? 0;
src\msbuild\src\Shared\TaskLoggingHelper.cs (3)
275Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 296if (messageArgs?.Length > 0) 470Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
src\msbuild\src\Shared\TaskParameter.cs (6)
132ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 134for (int i = 0; i < inputAsITaskItemArray.Length; i++) 291int length = wrappedItems?.Length ?? 0; 295for (int i = 0; i < wrappedItems.Length; i++) 422int length = array.Length; 505int length = array.Length;
src\msbuild\src\Shared\TypeLoader.cs (2)
266Dictionary<string, string> assembliesDictionary = new(localAssemblies.Length + runtimeAssemblies.Length);
Utilities\AwaitExtensions.cs (2)
113RegisteredWaitHandle[] callbackHandles = new RegisteredWaitHandle[handles.Length]; 114for (int i = 0; i < handles.Length; i++)
Utilities\EngineFileUtilities.cs (1)
384for (int i = 0; i < fileList.Length; i++)
Utilities\ProjectWriter.cs (2)
142Assumed.Equal(itemVectorTransforms.Count, (surroundingTextPieces.Length - 1), "We must have two pieces of surrounding text for every item vector transform found."); 165base.WriteString(surroundingTextPieces[surroundingTextPieces.Length - 1]);
Microsoft.Build.Framework (54)
BackEnd\CommunicationsUtilities.cs (5)
360Assumed.Equal(bytes.Length, 4, "Int should be 4 bytes"); 362stream.Write(bytes, 0, bytes.Length); 476var readTask = stream.ReadAsync(bytes, 0, bytes.Length); 493int bytesRead = stream.Read(bytes, 0, bytes.Length); 504if (bytesRead != bytes.Length)
BinaryTranslator.cs (8)
301length = byteArray.Length; 983int count = array.Length; 1042int count = array.Length; 1118int count = array.Length; 1369var length = byteArray?.Length ?? 0; 1405int count = array.Length; 1422int count = array.Length; 1737int count = array.Length;
ChangeWaves.cs (1)
71return AllWaves[AllWaves.Length - 1];
EncodingUtilities.cs (4)
150var buffer = new byte[preamble.Length]; 160bytesRead = stream.Read(buffer, 0, preamble.Length); 168return bytesRead == preamble.Length && !buffer.Where((t, i) => preamble[i] != t).Any(); 240if (defaultEncoding is UTF8Encoding e && e.GetPreamble().Length > 0)
FileClassifier.cs (1)
283if (nugetLocations is { Length: > 0 })
FileUtilities.cs (9)
608var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 958Debug.Assert(allowedExtensions?.Length > 0); 1388Assumed.Positive(splitPath.Length, "Cannot call MakeRelative on a path of only slashes."); 1403while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1408if (index == splitBase.Length && index == splitPath.Length) 1421for (int i = index; i < splitBase.Length; i++) 1425for (int i = index; i < splitPath.Length; i++)
LazyFormattedBuildEventArgs.cs (4)
92if (argsOrMessage is object[] arguments && arguments.Length > 0 && base.Message is not null) 110if (argsOrMessage is object[] arguments && arguments.Length > 0) 113writer.Write(arguments.Length); 184if ((args?.Length > 0))
Loader\LoadedType.cs (3)
93Properties = new ReflectableTaskPropertyInfo[props.Length]; 96PropertyAssemblyQualifiedNames = new string[props.Length]; 99for (int i = 0; i < props.Length; i++)
Logging\LoggerParametersHelper.cs (1)
61yield return new Tuple<string, string?>(parameterAndValue[0], parameterAndValue.Length > 1 ? parameterAndValue[1] : null);
Sdk\SdkReference.cs (4)
89if (parts.Length < 1 || parts.Length > 2) 99if (parts.Length == 1 || string.IsNullOrWhiteSpace(parts[1])) 103else if (parts.Length == 2)
src\msbuild\artifacts\obj\Microsoft.Build.Framework\Release\net11.0\Microsoft.Build.Framework.Resources.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Telemetry\BuildTelemetry.cs (1)
254for (int i = 0; i < targets.Length; i++)
Telemetry\CrashTelemetry.cs (1)
1001for (int i = 0; i < lines.Length; i++)
Utilities\EventArgsFormatting.cs (2)
351for (int i = 0; i < lines.Length; i++) 360if (i < (lines.Length - 1))
Utilities\FileMatcher.cs (5)
491string[] longParts = new string[parts.Length - startingElement]; 494for (int i = startingElement; i < parts.Length; ++i) 518for (int j = i; j < parts.Length; ++j) 903for (int i = 0; i < excludeNextSteps.Length; i++) 951for (int i = 0; i < excludeNextSteps.Length; i++)
Utilities\FrameworkLocationHelper.cs (2)
896if (directories.Length == 0) 912for (int i = 1; i < directories.Length; ++i)
Utilities\ProcessExtensions.cs (1)
487if (cmdlineBytes.Length == 0)
Utilities\TaskFactoryUtilities.cs (1)
196if (directories?.Length > 0)
Microsoft.Build.Tasks.CodeAnalysis (19)
src\roslyn\src\Compilers\Core\MSBuildTask\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)
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (4)
847(Sources.Length > 0) && 1116if (sources is null || sources.Length == 0) 1125for (int i = 0; i < sources.Length; i++) 1137transformedSources = new string[sources.Length];
src\roslyn\src\Compilers\Core\MSBuildTask\MvidReader.cs (1)
100if (name!.Length == 8 && name[0] == '.' &&
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (3)
572if ((this.References == null) || (this.References.Length == 0)) 577var references = new List<ITaskItem>(this.References.Length); 578var links = new List<ITaskItem>(this.References.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
331responseBuffer.Length,
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
161_loggingStream.Write(bytes, 0, bytes.Length);
Microsoft.Build.Tasks.Core (230)
_generated\0\RegexGenerator.g.cs (3)
4207if ((uint)p < (uint)s.Length) 4233if ((uint)(p + 1) < (uint)s.Length) 4260if ((uint)(p + 2) < (uint)s.Length)
AssemblyDependency\AssemblyInformation.cs (1)
621if (publicKeyOrToken.Length <= 8)
AssemblyDependency\AssemblyResolution.cs (2)
164var resolvers = new Resolver[searchPaths.Length]; 166for (int p = 0; p < searchPaths.Length; ++p)
AssemblyDependency\GenerateBindingRedirects.cs (5)
61if (SuggestedRedirects == null || SuggestedRedirects.Length == 0) 262if (oldVersionRange.Length == 0 || oldVersionRange.Length > 2) 268var oldVerStrHigh = oldVersionRange[oldVersionRange.Length == 1 ? 0 : 1]; 374Assumed.Positive(SuggestedRedirects?.Length ?? 0, "This should not be called if there is no suggested redirect.");
AssemblyDependency\Node\OutOfProcRarNode.cs (4)
133for (int i = 0; i < endpoints.Length; i++) 138Task[] endpointTasks = new Task[endpoints.Length]; 140for (int i = 0; i < endpoints.Length; i++) 147CommunicationsUtilities.Trace($"{endpoints.Length} RAR endpoints started.");
AssemblyDependency\Node\RarNodeExecuteResponse.cs (1)
25_numCopyLocalFiles = rar.CopyLocalFiles.Length;
AssemblyDependency\Node\RarTaskParameters.cs (4)
59Dictionary<string, TaskParameter> taskParameters = new(properties.Length, StringComparer.Ordinal); 79&& stringArray.Length == defaultStringArray.Length) 81for (int i = 0; i < stringArray.Length; i++)
AssemblyDependency\Reference.cs (1)
259if (scatterFilesToAttach == null || scatterFilesToAttach.Length == 0)
AssemblyDependency\ReferenceTable.cs (8)
996string satelliteFilename = subDirectories.Length > 0 1067var dependencies = new List<AssemblyNameExtension>(dependentAssemblies?.Length ?? 0); 1069if (dependentAssemblies?.Length > 0) 1072for (int i = 0; i < dependentAssemblies.Length; i++) 1923if (pkt?.Length > 0) 2063if (_latestTargetFrameworkDirectories?.Length > 0) 2330return refPkt != null && refPkt.Length != 0; 2751if (relatedFileExtensions.Count > 0 || satellites.Count > 0 || serializationAssemblyFiles.Count > 0 || scatterFiles.Length > 0 || hasValidWinMDImplementationFile)
AssemblyDependency\ResolveAssemblyReference.cs (31)
1176AbsolutePath[] result = new AbsolutePath[paths.Length]; 1177for (int i = 0; i < paths.Length; i++) 1212AbsolutePath[] result = new AbsolutePath[paths.Length]; 1213for (int i = 0; i < paths.Length; i++) 2236if (_cache == null && AssemblyInformationCachePaths != null && AssemblyInformationCachePaths.Length > 0) 2375for (int i = 0; i < _targetFrameworkDirectories.Length; i++) 2388if (installedAssemblyTableInfo?.Length > 0) 2399bool targetingProfile = !String.IsNullOrEmpty(ProfileName) && ((_fullFrameworkFolders.Length > 0) || (FullFrameworkAssemblyTables.Length > 0)); 2413if (inclusionListSubsetTableInfo.Length > 0 && (redistList?.Count > 0)) 2467for (int i = 0; i < redistList.Errors.Length; ++i) 2848MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies); 2865MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies); 2971if (fullRedistAssemblyTableInfo.Length > 0) 3002for (int i = 0; i < fullFrameworkRedistList.Errors.Length; ++i) 3055bool targetFrameworkSubsetIsSet = TargetFrameworkSubsets.Length != 0 || InstalledAssemblySubsetTables.Length != 0; 3059bool fullFrameworkFoldersIsSet = _fullFrameworkFolders.Length > 0; 3060bool fullFrameworkTableLocationsIsSet = FullFrameworkAssemblyTables.Length > 0; 3158if (IgnoreDefaultInstalledAssemblySubsetTables && _installedAssemblySubsetTables.Length == 0) 3165if (_targetFrameworkSubsets.Length == 0 && _installedAssemblySubsetTables.Length == 0) 3248if (TargetFrameworkDirectories?.Length == 1)
AssignCulture.cs (3)
136AssignedFiles = new ITaskItem[Files.Length]; 137CultureNeutralAssignedFiles = new ITaskItem[Files.Length]; 143for (int i = 0; i < Files.Length; ++i)
AssignProjectConfiguration.cs (2)
312if (configurationPlatformParts.Length > 1) 399if (platforms.Length != 2)
AssignTargetPath.cs (3)
55AssignedFiles = new ITaskItem[Files.Length]; 57if (Files.Length > 0) 98for (int i = 0; i < Files.Length; ++i)
CallTarget.cs (1)
69if ((Targets == null) || (Targets.Length == 0))
CommandLineBuilderExtension.cs (5)
188string[] splitAndTrimmed = new string[splits.Length]; 189for (int i = 0; i < splits.Length; ++i) 237(metadataNames != null && metadataNames.Length == treatAsFlags.Length), "metadataNames and treatAsFlags should have the same length."); 247for (int i = 0; i < metadataNames.Length; ++i)
Copy.cs (19)
62for (int i = 0; i < copyThreads.Length; ++i) 477success = !copyInParallel || DestinationFiles.Length == 1 501destinationFilesSuccessfullyCopied = new List<ITaskItem>(DestinationFiles.Length); 509DestinationFiles.Length, // Set length to common case of 1:1 source->dest. 513for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 620DestinationFiles.Length, // Set length to common case of 1:1 source->dest. 623for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 637var successFlags = new IntPtr[DestinationFiles.Length]; 657destinationFilesSuccessfullyCopied = new List<ITaskItem>(DestinationFiles.Length); 658for (int i = 0; i < successFlags.Length; i++) 753return (SourceFiles == null || SourceFiles.Length == 0) && (SourceFolders == null || SourceFolders.Length == 0); 796if (DestinationFiles != null && DestinationFiles.Length != SourceFiles.Length) 798Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", DestinationFiles.Length, SourceFiles.Length, "DestinationFiles", "SourceFiles"); 826DestinationFiles = new ITaskItem[SourceFiles.Length]; 828for (int i = 0; i < SourceFiles.Length; ++i) 851if (isSuccess && SourceFolders != null && SourceFolders.Length > 0)
CreateManifestResourceName.cs (4)
139ManifestResourceNames = new ITaskItem[ResourceFiles.Length]; 140ResourceFilesWithManifestResourceNames = new ITaskItem[ResourceFiles.Length]; 365for (int i = 1; i < subNames.Length; i++) 395for (int i = 1; i < subNames.Length; i++)
Exec.cs (1)
642for (int i = 0; i < _charactersToEscape.Length; i++)
FileIO\GetFileHash.cs (2)
88Parallel.For(0, Files.Length, parallelOptions, index => 118if (Files.Length == 1)
FileIO\WriteLinesToFile.cs (4)
96if (Lines != null && Lines.Length > 0) 98StringBuilder buffer = new StringBuilder(capacity: Lines.Length * 64); 353if (fileStream.Length != newContentBytes.Length) 363while ((bytesRead = fileStream.Read(fileBuffer, 0, fileBuffer.Length)) > 0)
FindAppConfigFile.cs (2)
98for (int i = PrimaryList.Length - 1; i >= 0; i--) 106for (int i = SecondaryList.Length - 1; i >= 0; i--)
FindInList.cs (1)
86for (int i = List.Length - 1; i >= 0; i--)
GenerateApplicationManifest.cs (1)
427if (values.Length != 5)
GenerateResource.cs (16)
686if ((Sources == null) || (Sources.Length == 0)) 867OutputResources = new ITaskItem[outputResources.Length + cachedOutputFiles.Count]; 869cachedOutputFiles.CopyTo(OutputResources, outputResources.Length); 1325if ((OutputResources != null) && (OutputResources.Length != Sources.Length)) 1327Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", Sources.Length, OutputResources.Length, "Sources", "OutputResources"); 1337if (Sources.Length != 1) 1382for (int i = 0; i < Sources.Length; ++i) 2057OutputResources = new ITaskItem[Sources.Length]; 2061for (i = 0; i < Sources.Length; ++i) 2102Assumed.True(OutputResources != null && OutputResources.Length != 0, "Should be at least one output resource"); 2105ITaskItem[] temp = new ITaskItem[OutputResources.Length - _unsuccessfullyCreatedOutFiles.Count]; 2108for (int i = 0; i < Sources.Length; i++) 2518_assemblyNames = new AssemblyNameExtension[_assemblyFiles.Length]; 2519for (int i = 0; i < _assemblyFiles.Length; i++)
GetCompatiblePlatform.cs (2)
55AssignedProjectsWithPlatform = new ITaskItem[AnnotatedProjects.Length]; 56for (int i = 0; i < AnnotatedProjects.Length; i++)
GetReferenceAssemblyPaths.cs (2)
299var result = new AbsolutePath[parts.Length]; 300for (int i = 0; i < parts.Length; i++)
GetSDKReferenceFiles.cs (2)
373if (manifestReferencePaths?.Length > 0) 1006if (sdkManifestReferences?.Length > 0)
Hash.cs (3)
63if (ItemsToHash?.Length > 0) 80for (int i = 0; i < ItemsToHash.Length; i++) 93shaBufferPosition = AddBytesToShaBuffer(sha, shaBuffer, shaBufferPosition, ShaBufferSize, s_itemSeparatorCharacterBytes, s_itemSeparatorCharacterBytes.Length);
ListOperators\RemoveDuplicates.cs (4)
42if (Inputs == null || Inputs.Length == 0) 50var filteredList = new List<ITaskItem>(Inputs.Length); 61HadAnyDuplicates = Inputs.Length != Filtered.Length;
ManifestUtil\ApplicationManifest.cs (1)
981bool[] results = new bool[s_attributeNames.Length];
ManifestUtil\EmbeddedManifestReader.cs (1)
55Marshal.Copy(hResource, buffer, 0, buffer.Length);
ManifestUtil\mansign2.cs (7)
516if (cspPublicKeyBlob == null || cspPublicKeyBlob.Length == 0) 535publicKeyBlob.cbData = (uint)cspPublicKeyBlob.Length; 655manifestInformationNode.SetAttribute("Hash", hash.Length == 0 ? "" : BytesToHexString(hash, 0, hash.Length)); 810sigValueBytes.Length, 881licenseBlob.cbData = (uint)licenseXml.Length; 893Marshal.Copy(timestampBlob.pbData, timestampSignature, 0, timestampSignature.Length);
ManifestUtil\MetadataReader.cs (2)
71for (int i = 0; i < names.Length; i++) 185if (pk.Length != 0)
ManifestUtil\Util.cs (2)
389for (int i = 0; i < s_platforms.Length; ++i) 407if (items.Length <= 1)
ManifestUtil\XmlUtil.cs (2)
107if (entries.Length > 0) 150string filename = uri.Segments[uri.Segments.Length - 1];
Move.cs (8)
97if (SourceFiles == null || SourceFiles.Length == 0) 119if (DestinationFiles != null && DestinationFiles.Length != SourceFiles.Length) 121Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", DestinationFiles.Length, SourceFiles.Length, "DestinationFiles", "SourceFiles"); 128DestinationFiles = new ITaskItem[SourceFiles.Length]; 130for (int i = 0; i < SourceFiles.Length; ++i) 156for (int i = 0; i < SourceFiles.Length && !_canceling; ++i)
MSBuild.cs (10)
186if ((Projects == null) || (Projects.Length == 0)) 192if (TargetAndPropertyListSeparators?.Length > 0) 247skipProjects = new bool[Projects.Length]; 259for (int i = 0; i < Projects.Length; i++) 363for (int i = 0; i < Projects.Length; i++) 444var targetLists = new List<string[]>(runEachTargetSeparately ? targets.Length : 1); 445if (runEachTargetSeparately && targets.Length > 0) 488for (int i = 0; i < projectNames.Length; i++) 527undefinePropertiesPerProject[i] = new List<string>(propertiesToUndefine.Length); 530if (log != null && propertiesToUndefine.Length > 0)
RedistList.cs (11)
225var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 226for (int i = 0; i < redistListPaths.Length; ++i) 261var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 262for (int i = 0; i < redistListPaths.Length; ++i) 278var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 279for (int i = 0; i < redistListPaths.Length; ++i) 347var keyBuilder = assemblyTables.Length > 0 ? new StringBuilder(assemblyTables[0].Descriptor) : new StringBuilder(); 348for (int i = 1; i < assemblyTables.Length; ++i) 575var keyBuilder = allowListAssemblyTableInfo.Length > 0 ? new StringBuilder(allowListAssemblyTableInfo[0].Descriptor) : new StringBuilder(); 578for (int i = 1; i < allowListAssemblyTableInfo.Length; ++i) 1082if (_subsetToSearchFor.Length > 0)
ResGenDependencies.cs (3)
397if (OutputFiles.Length != otherLibrary.OutputFiles.Length) 402for (int i = 0; i < OutputFiles.Length; i++)
ResolveManifestFiles.cs (3)
187if (RuntimePackAssets != null && RuntimePackAssets.Length > 0) 366itemCulture = pathSegments.Length > 1 ? pathSegments[pathSegments.Length - 2] : null;
ResolveSDKReference.cs (6)
280if (InstalledSDKs.Length == 0) 300var sdkItems = new Dictionary<string, ITaskItem>(InstalledSDKs.Length, StringComparer.OrdinalIgnoreCase); 1237for (int i = 0; i < supportedArchitectures.Length; i++) 1242if (supportedArchitectures.Length > 1 && i != supportedArchitectures.Length - 1) 1364switch (appxComponents.Length)
ResourceHandling\MSBuildResXReader.cs (3)
246if (fileRefInfo.Length == 3) 373if (parts.Length > 1) 377else if (parts.Length > 0)
SetRidAgnosticValueForProjects.cs (2)
48if (isRidAgnosticArray.Length != targetFrameworksArray.Length)
src\msbuild\src\Shared\CanonicalError.cs (1)
374if (explodedText.Length > 0)
src\msbuild\src\Shared\PlatformNegotiation.cs (1)
113if (keyVal.Length != 2 || string.IsNullOrEmpty(keyVal[0]) || string.IsNullOrEmpty(keyVal[1]))
src\msbuild\src\Shared\ResourceUtilities.cs (1)
362if (args?.Length > 0)
src\msbuild\src\Shared\TaskParameter.cs (6)
132ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 134for (int i = 0; i < inputAsITaskItemArray.Length; i++) 291int length = wrappedItems?.Length ?? 0; 295for (int i = 0; i < wrappedItems.Length; i++) 422int length = array.Length; 505int length = array.Length;
StateFileBase.cs (1)
137if (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)
586retVal.isDirty = stateFiles.Length > 0;
TaskEnvironmentExtensions.cs (6)
49var result = new AbsolutePath[paths.Length]; 50for (int i = 0; i < paths.Length; i++) 79var result = new string[paths.Length]; 80for (int i = 0; i < paths.Length; i++) 100var result = new string[paths.Length]; 101for (int i = 0; i < paths.Length; i++)
Telemetry.cs (1)
43if (item.Length != 2)
Unzip.cs (2)
305if (_includePatterns.Length > 0) 310if (_excludePatterns.Length > 0)
WriteCodeFragment.cs (1)
503.Where(t => t.Length == positionalParameters.Count)
XmlPeek.cs (1)
164if (Result.Length == 0)
XslTransformation.cs (8)
127if (XmlInputPaths != null && XmlInputPaths.Length != _outputPaths.Length) 129Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", _outputPaths.Length, XmlInputPaths.Length, "OutputPaths", "XmlInputPaths"); 134if (XmlContent != null && _outputPaths.Length != 1) 136Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", _outputPaths.Length, 1, "OutputPaths", "XmlContent"); 201for (int i = 0; i < XmlInputPaths.Length; i++) 329public int Count => XmlMode == XmlModes.XmlFile ? _filePaths.Length : 1;
Microsoft.Build.Tasks.Git (16)
GitDataReader\GitRefTableReader.cs (3)
248length: restartOffsets.Length - 1, 265if (firstGreater < restartOffsets.Length - 1) 333length: restartOffsets.Length - 1,
GitDataReader\GitRefTableReader.Primitives.cs (1)
131=> ReadExactly(buffer, buffer.Length);
GitOperations.cs (4)
411for (var i = 0; i < segments.Length; i++) 425if (i == segments.Length - 1) 436Debug.Assert(segments.Length > 0); 442for (var i = 0; i < segments.Length - 1; i++)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.Build.Utilities.Core (35)
_generated\0\RegexGenerator.g.cs (3)
2665if ((uint)p < (uint)s.Length) 2691if ((uint)(p + 1) < (uint)s.Length) 2718if ((uint)(p + 2) < (uint)s.Length)
CommandLineBuilder.cs (10)
409if (fileNames?.Length > 0) 413for (int i = 0; i < fileNames.Length; ++i) 419for (int i = 0; i < fileNames.Length; ++i) 444if (fileItems?.Length > 0) 448for (int i = 0; i < fileItems.Length; ++i) 457for (int i = 0; i < fileItems.Length; ++i) 576if (parameters?.Length > 0) 608if (parameters?.Length > 0) 687if (parameters?.Length > 0) 718if (parameters?.Length > 0)
ExtensionSDK.cs (1)
161if (words.Length > 1 && Version.TryParse(words[1], out Version ver))
src\msbuild\src\Shared\CanonicalError.cs (1)
374if (explodedText.Length > 0)
src\msbuild\src\Shared\ResourceUtilities.cs (1)
362if (args?.Length > 0)
src\msbuild\src\Shared\TaskLoggingHelper.cs (3)
275Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 296if (messageArgs?.Length > 0) 470Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
ToolLocationHelper.cs (10)
1056if (winmdPaths.Length > 0) 1058ErrorUtilities.DebugTraceMessage("GetLegacyTargetPlatformReferences", $"Found {winmdPaths.Length} contract winmds in '{winmdLocation}'"); 1143if (winmdPaths.Length > 0) 1145ErrorUtilities.DebugTraceMessage("GetApiContractReferences", $"Found {winmdPaths.Length} contract winmds in '{contractPath}'"); 2530ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", $"Found '{sdkNameDirectories.Length}' sdkName directories under '{extensionSdksDirectory.FullName}'"); 2536ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", $"Found '{sdkVersionDirectories.Length}' sdkVersion directories under '{sdkNameFolders.FullName}'"); 2952if (diskRoots?.Length > 0) 2977if (sdkDiskRoots.Count == 0 && diskRoots?.Length > 0) 3034ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", $"Found '{platformIdentifiers.Length}' platform identifier directories under '{platformsRoot}'"); 3040ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", $"Found '{platformVersions.Length}' platform version directories under '{platformIdentifier.FullName}'");
ToolTask.cs (4)
719if (nameValuePair.Length == 2 && nameValuePair[0].Length > 0) 1467_environmentVariablePairs = new List<KeyValuePair<string, string>>(EnvironmentVariables.Length); 1473if (nameValuePair.Length == 1 || (nameValuePair.Length == 2 && nameValuePair[0].Length == 0))
TrackedDependencies\TrackedDependencies.cs (2)
33var expanded = new List<ITaskItem>(expand.Length); 80if (files?.Length > 0)
Microsoft.CodeAnalysis (354)
_generated\0\RegexGenerator.g.cs (3)
966if ((uint)p < (uint)s.Length) 992if ((uint)(p + 1) < (uint)s.Length) 1019if ((uint)(p + 2) < (uint)s.Length)
Binding\AbstractLookupSymbolsInfo.cs (1)
77if (index < _arities.Length)
CodeGen\BasicBlock.cs (1)
731return (uint)BranchLabels.Length;
CodeGen\ILBuilderEmit.cs (2)
231Debug.Assert(caseLabels.Length > 0); 263Debug.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)
69Debug.Assert(caseLabels.Length > 0);
CodeGen\SwitchStringJumpTableEmitter.cs (3)
81Debug.Assert(caseLabels.Length > 0); 96Debug.Assert(_keyHash == null || ShouldGenerateHashTableSwitch(_caseLabels.Length)); 196var 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())
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
32Debug.Assert(regex.GetGroupNumbers().Length - 1 == numberRangePairs.Length);
CommandLine\CommandLineParser.cs (1)
366if (kv.Length != 2)
CommandLine\CommonCompiler.cs (1)
1813stream.Write(bytes, 0, bytes.Length);
Compilation\Compilation.cs (2)
1068for (int i = 0; i < parts.Length - 1; i++) 1080foreach (INamedTypeSymbol candidate in container.GetTypeMembers(parts[parts.Length - 1]))
Compilation\SyntaxTreeOptionsProvider.cs (1)
61for (int i = 0; i < trees.Length; i++)
CryptographicHashProvider.cs (1)
276Debug.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)
93if (_messageArgs.Length == 0)
Diagnostic\DiagnosticInfo.cs (9)
50AssertExpectedMessageArgumentsLength(messageProvider, errorCode, arguments.Length); 323if (_arguments.Length == 0) 334for (int i = 0; i < _arguments.Length; i++) 362var newArguments = new object[_arguments.Length]; 363Array.Copy(_arguments, newArguments, newArguments.Length); 399for (int i = 0; i < _arguments.Length; i++) 417if (_arguments.Length == other._arguments.Length) 420for (int i = 0; i < _arguments.Length; i++)
Diagnostic\LocalizableResourceString.cs (1)
75(_formatArguments.Length > 0 ? string.Format(resourceString, _formatArguments) : resourceString) :
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1556if (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)
202for (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)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (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\FileLockCheck.cs (1)
164res = RmRegisterResources(handle, (uint)paths.Length, paths, 0, null, 0, null);
InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
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\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)
1497Debug.Assert(AttributeDescription.InterpolatedStringHandlerArgumentAttribute.Signatures.Length == 2); 2962for (int i = 0; i < description.Signatures.Length; i++) 2965Debug.Assert(targetSignature.Length >= 3); 2975for (; j < targetSignature.Length; j++) 3049if (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)
95if (!emitAllDebugInfo && blob.Length == 0) 148if (blob.Length > 0)
PEWriter\MetadataWriter.cs (1)
492_pseudoStringTokenToTokenMap = new UserStringHandle[_pseudoStringTokenToStringMap.Length];
PEWriter\NativeResourceWriter.cs (2)
283dataWriter.WriteUInt32((uint)data.Length); 356var sectionWriter = new BlobWriter(builder.ReserveBytes(resourceSections.SectionBytes.Length));
PEWriter\PeWriter.cs (1)
329.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)
413for (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)
99for (i = 1; i < s_emittedNames.Length; i++) 109for (i = 0; i < s_typeIdToTypeCodeMap.Length; i++) 133for (i = 0; i < s_typeCodeToTypeIdMap.Length; i++)
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (2)
152Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 156builder.WriteBytes(0, sizeof(byte) * (DynamicAttributeSize - info.Flags.Length));
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (4)
75if (customDebugInfo.Length < CustomDebugInfoConstants.GlobalHeaderSize) 88while (offset <= customDebugInfo.Length - CustomDebugInfoConstants.RecordHeaderSize) 109if (offset > customDebugInfo.Length - bodySize || alignmentSize > 3 || alignmentSize > bodySize) 868return Encoding.UTF8.GetString(block, 0, block.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
244return source.Length == 0;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (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)
73if (diagnostics?.Length > 0) 83if (diagnostics?.Length > 0) 93if (annotations?.Length > 0) 108if (annotations?.Length > 0) 588Debug.Assert(annotations.Length != 0, "annotations should be non-empty"); 944for (int i = 0; i < array.Length; i++) 966for (int i = 0; i < array.Length; i++) 1003var 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 (5)
14public int Capacity => _nodes.Length; 28Array.Clear(_nodes, 0, _nodes.Length); 71this.AddRange(items, 0, items.Length); 137int currentSize = _nodes.Length; 167for (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)
1407if (annotations?.Length > 0)
Syntax\SyntaxNode.Iterators.cs (6)
145if (++_stackPtr >= _stack.Length) 158if (_stack?.Length < 256) 160Array.Clear(_stack, 0, _stack.Length); 206if (++_stackPtr >= _stack.Length) 216if (_stack?.Length < 256) 218Array.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)
389if (annotations?.Length > 0) 670return 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 (2)
385if (annotations == null || annotations.Length == 0) 436return diagnostics.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) 169int charsToCopy = Math.Min(chunk.Length - chunkStartOffset, count); 204int charsToWrite = Math.Min(chunk.Length - chunkStartOffset, count); 206if (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)
264if (length < 0 || length > buffer.Length) 564int count = Math.Min(buffer.Length, end - offset); 635Debug.Assert(charBuffer.Length == CharBufferSize); 739int copyLength = Math.Min(tempBuffer.Length, length); 1104var contentLength = Math.Min(length - position, buffer.Length); 1246Debug.Assert(buffer1.Length == buffer2.Length); 1247Debug.Assert(buffer1.Length == CharBufferSize); 1280Debug.Assert(length <= source.Length);
Text\SourceTextStream.cs (2)
144int length = Math.Min(count, preambleBytes.Length); 151int 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)
767for (int i = 0; i < s_metadataNames.Length; i++) 778for (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.Analyzers (175)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (3)
706if (parts.Length != 3 || 991for (var i = 0; i < parts.Length; i++) 1000i < parts.Length - 1)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (5)
253for (int i = 0; i < parts.Length; i++) 260if (parts.Length > 2 || // We allow only 0 or 1 ':' separator in the line. 268if (parts.Length == 1) 279var infoList = ImmutableArray.CreateBuilder<(string? prefix, int start, int end)>(ranges.Length); 280for (int i = 0; i < ranges.Length; i++)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (1)
226switch (entry.Split(s_entryFieldSeparators, StringSplitOptions.None).Length)
MetaAnalyzers\Fixers\ApplyDiagnosticAnalyzerAttributeFix.cs (2)
65var arguments = new SyntaxNode[languages.Length]; 67for (var i = 0; i < languages.Length; i++)
MetaAnalyzers\ReleaseTrackingHelper.cs (4)
267if (parts.Length is < 3 or > 6) 274ReleaseTrackingRuleEntryKind.New => parts.Length > 4, 275ReleaseTrackingRuleEntryKind.Removed => parts.Length > 4, 276ReleaseTrackingRuleEntryKind.Changed => parts.Length <= 4,
src\roslyn\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\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (12)
244return source.Length == 0; 1025return array.Length != 0 ? 1036while (index < source.Length) 1038TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 1039index += chunk.Length; 1064if (size != array.Length) 1069if (i >= array.Length) 1071arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 1083Debug.Assert(local.Length == size); 1084for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 1090if (i != array.Length) 1114return source is TSource[] { Length: 0 } ? [] : IndexIterator(source);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
348if (split.Length != 2) 397if (split.Length != 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
693if (trivia.Length == 0) 727if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
106if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
183Contract.ThrowIfFalse(lines.Length > 0); 187if (0 < lines.Length - 1) 193for (var i = 1; i < lines.Length; i++) 204if (i < lines.Length - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
99where nameSplit.Length == 3
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
292WriteArrayLength(array.Length); 372for (var offset = 0; offset < spanLength; offset += buffer.Length) 374var segmentLength = Math.Min(buffer.Length, spanLength - offset); 507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
110if (method.TypeParameters.Length != typeArgumentArray.Length)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
202var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
74if (_sourceLowerCaseCharacters.Length == PooledArraySize)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
57if (taskArray.Length == 0) 61for (var i = 0; i < taskArray.Length; i++) 72var result = new T[taskArray.Length]; 73for (var i = 0; i < taskArray.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
55if (typeArguments.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (4)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
13=> array == null || array.Length == 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
442if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Microsoft.CodeAnalysis.AnalyzerUtilities (157)
src\roslyn\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\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (12)
244return source.Length == 0; 1025return array.Length != 0 ? 1036while (index < source.Length) 1038TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 1039index += chunk.Length; 1064if (size != array.Length) 1069if (i >= array.Length) 1071arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 1083Debug.Assert(local.Length == size); 1084for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 1090if (i != array.Length) 1114return source is TSource[] { Length: 0 } ? [] : IndexIterator(source);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
348if (split.Length != 2) 397if (split.Length != 2)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.ValuePool.cs (4)
31for (int i = 0; i < values.Length; i++) 36this.OneDimensionalPool = new PropertySetAbstractValue[values.Length]; 50this.TwoDimensionalPool = new PropertySetAbstractValue[values.Length, values.Length];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
693if (trivia.Length == 0) 727if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
106if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
183Contract.ThrowIfFalse(lines.Length > 0); 187if (0 < lines.Length - 1) 193for (var i = 1; i < lines.Length; i++) 204if (i < lines.Length - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
99where nameSplit.Length == 3
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
292WriteArrayLength(array.Length); 372for (var offset = 0; offset < spanLength; offset += buffer.Length) 374var segmentLength = Math.Min(buffer.Length, spanLength - offset); 507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
110if (method.TypeParameters.Length != typeArgumentArray.Length)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
202var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
74if (_sourceLowerCaseCharacters.Length == PooledArraySize)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
57if (taskArray.Length == 0) 61for (var i = 0; i < taskArray.Length; i++) 72var result = new T[taskArray.Length]; 73for (var i = 0; i < taskArray.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
Microsoft.CodeAnalysis.CodeStyle (159)
src\roslyn\src\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (1)
64Debug.Assert(customTags.Length == tags.Length);
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (3)
89if (reformattedCopyrightTextParts.Length != fileHeaderCopyrightTextParts.Length) 95for (var i = 0; i < reformattedCopyrightTextParts.Length; i++)
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (2)
55if (messageArgs == null || messageArgs.Length == 0) 373? (_formatArguments.Length > 0 ? string.Format(formatProvider, messageFormat, _formatArguments) : messageFormat)
src\roslyn\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\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
777if (symbolParameters.Length != expectedParameters.Length) 782for (int i = 0; i < expectedParameters.Length; ++i)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (12)
244return source.Length == 0; 1025return array.Length != 0 ? 1036while (index < source.Length) 1038TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 1039index += chunk.Length; 1064if (size != array.Length) 1069if (i >= array.Length) 1071arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 1083Debug.Assert(local.Length == size); 1084for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 1090if (i != array.Length) 1114return source is TSource[] { Length: 0 } ? [] : IndexIterator(source);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
693if (trivia.Length == 0) 727if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
106if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
183Contract.ThrowIfFalse(lines.Length > 0); 187if (0 < lines.Length - 1) 193for (var i = 1; i < lines.Length; i++) 204if (i < lines.Length - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
99where nameSplit.Length == 3
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
292WriteArrayLength(array.Length); 372for (var offset = 0; offset < spanLength; offset += buffer.Length) 374var segmentLength = Math.Min(buffer.Length, spanLength - offset); 507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
110if (method.TypeParameters.Length != typeArgumentArray.Length)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
202var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
74if (_sourceLowerCaseCharacters.Length == PooledArraySize)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
57if (taskArray.Length == 0) 61for (var i = 0; i < taskArray.Length; i++) 72var result = new T[taskArray.Length]; 73for (var i = 0; i < taskArray.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
55if (typeArguments.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (4)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
13=> array == null || array.Length == 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
442if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Microsoft.CodeAnalysis.CSharp (860)
_generated\1\Syntax.xml.Internal.Generated.cs (498)
92if (diags?.Length > 0) 95if (annotations?.Length > 0) 181if (diags?.Length > 0) 184if (annotations?.Length > 0) 260if (diags?.Length > 0) 263if (annotations?.Length > 0) 358if (diags?.Length > 0) 361if (annotations?.Length > 0) 447if (diags?.Length > 0) 450if (annotations?.Length > 0) 526if (diags?.Length > 0) 529if (annotations?.Length > 0) 614if (diags?.Length > 0) 617if (annotations?.Length > 0) 708if (diags?.Length > 0) 711if (annotations?.Length > 0) 787if (diags?.Length > 0) 790if (annotations?.Length > 0) 894if (diags?.Length > 0) 897if (annotations?.Length > 0) 992if (diags?.Length > 0) 995if (annotations?.Length > 0) 1080if (diags?.Length > 0) 1083if (annotations?.Length > 0) 1178if (diags?.Length > 0) 1181if (annotations?.Length > 0) 1243if (diags?.Length > 0) 1246if (annotations?.Length > 0) 1322if (diags?.Length > 0) 1325if (annotations?.Length > 0) 1419if (diags?.Length > 0) 1422if (annotations?.Length > 0) 1507if (diags?.Length > 0) 1510if (annotations?.Length > 0) 1572if (diags?.Length > 0) 1575if (annotations?.Length > 0) 1668if (diags?.Length > 0) 1671if (annotations?.Length > 0) 1745if (diags?.Length > 0) 1748if (annotations?.Length > 0) 1861if (diags?.Length > 0) 1864if (annotations?.Length > 0) 1959if (diags?.Length > 0) 1962if (annotations?.Length > 0) 2038if (diags?.Length > 0) 2041if (annotations?.Length > 0) 2117if (diags?.Length > 0) 2120if (annotations?.Length > 0) 2196if (diags?.Length > 0) 2199if (annotations?.Length > 0) 2285if (diags?.Length > 0) 2288if (annotations?.Length > 0) 2374if (diags?.Length > 0) 2377if (annotations?.Length > 0) 2453if (diags?.Length > 0) 2456if (annotations?.Length > 0) 2518if (diags?.Length > 0) 2521if (annotations?.Length > 0) 2625if (diags?.Length > 0) 2628if (annotations?.Length > 0) 2690if (diags?.Length > 0) 2693if (annotations?.Length > 0) 2779if (diags?.Length > 0) 2782if (annotations?.Length > 0) 2868if (diags?.Length > 0) 2871if (annotations?.Length > 0) 2977if (diags?.Length > 0) 2980if (annotations?.Length > 0) 3056if (diags?.Length > 0) 3059if (annotations?.Length > 0) 3121if (diags?.Length > 0) 3124if (annotations?.Length > 0) 3186if (diags?.Length > 0) 3189if (annotations?.Length > 0) 3251if (diags?.Length > 0) 3254if (annotations?.Length > 0) 3350if (diags?.Length > 0) 3353if (annotations?.Length > 0) 3449if (diags?.Length > 0) 3452if (annotations?.Length > 0) 3568if (diags?.Length > 0) 3571if (annotations?.Length > 0) 3667if (diags?.Length > 0) 3670if (annotations?.Length > 0) 3766if (diags?.Length > 0) 3769if (annotations?.Length > 0) 3865if (diags?.Length > 0) 3868if (annotations?.Length > 0) 3964if (diags?.Length > 0) 3967if (annotations?.Length > 0) 4043if (diags?.Length > 0) 4046if (annotations?.Length > 0) 4122if (diags?.Length > 0) 4125if (annotations?.Length > 0) 4237if (diags?.Length > 0) 4240if (annotations?.Length > 0) 4335if (diags?.Length > 0) 4338if (annotations?.Length > 0) 4442if (diags?.Length > 0) 4445if (annotations?.Length > 0) 4535if (diags?.Length > 0) 4538if (annotations?.Length > 0) 4614if (diags?.Length > 0) 4617if (annotations?.Length > 0) 4692if (diags?.Length > 0) 4695if (annotations?.Length > 0) 4791if (diags?.Length > 0) 4794if (annotations?.Length > 0) 4960if (diags?.Length > 0) 4963if (annotations?.Length > 0) 5138if (diags?.Length > 0) 5141if (annotations?.Length > 0) 5214if (diags?.Length > 0) 5217if (annotations?.Length > 0) 5391if (diags?.Length > 0) 5394if (annotations?.Length > 0) 5489if (diags?.Length > 0) 5492if (annotations?.Length > 0) 5609if (diags?.Length > 0) 5612if (annotations?.Length > 0) 5726if (diags?.Length > 0) 5729if (annotations?.Length > 0) 5812if (diags?.Length > 0) 5815if (annotations?.Length > 0) 5899if (diags?.Length > 0) 5902if (annotations?.Length > 0) 6007if (diags?.Length > 0) 6010if (annotations?.Length > 0) 6105if (diags?.Length > 0) 6108if (annotations?.Length > 0) 6223if (diags?.Length > 0) 6226if (annotations?.Length > 0) 6321if (diags?.Length > 0) 6324if (annotations?.Length > 0) 6420if (diags?.Length > 0) 6423if (annotations?.Length > 0) 6515if (diags?.Length > 0) 6518if (annotations?.Length > 0) 6591if (diags?.Length > 0) 6594if (annotations?.Length > 0) 6667if (diags?.Length > 0) 6670if (annotations?.Length > 0) 6743if (diags?.Length > 0) 6746if (annotations?.Length > 0) 6845if (diags?.Length > 0) 6848if (annotations?.Length > 0) 6948if (diags?.Length > 0) 6951if (annotations?.Length > 0) 7061if (diags?.Length > 0) 7064if (annotations?.Length > 0) 7156if (diags?.Length > 0) 7159if (annotations?.Length > 0) 7323if (diags?.Length > 0) 7326if (annotations?.Length > 0) 7400if (diags?.Length > 0) 7403if (annotations?.Length > 0) 7476if (diags?.Length > 0) 7479if (annotations?.Length > 0) 7561if (diags?.Length > 0) 7564if (annotations?.Length > 0) 7646if (diags?.Length > 0) 7649if (annotations?.Length > 0) 7722if (diags?.Length > 0) 7725if (annotations?.Length > 0) 7816if (diags?.Length > 0) 7819if (annotations?.Length > 0) 7902if (diags?.Length > 0) 7905if (annotations?.Length > 0) 7967if (diags?.Length > 0) 7970if (annotations?.Length > 0) 8064if (diags?.Length > 0) 8067if (annotations?.Length > 0) 8152if (diags?.Length > 0) 8155if (annotations?.Length > 0) 8228if (diags?.Length > 0) 8231if (annotations?.Length > 0) 8304if (diags?.Length > 0) 8307if (annotations?.Length > 0) 8380if (diags?.Length > 0) 8383if (annotations?.Length > 0) 8456if (diags?.Length > 0) 8459if (annotations?.Length > 0) 8532if (diags?.Length > 0) 8535if (annotations?.Length > 0) 8662if (diags?.Length > 0) 8665if (annotations?.Length > 0) 8756if (diags?.Length > 0) 8759if (annotations?.Length > 0) 8850if (diags?.Length > 0) 8853if (annotations?.Length > 0) 8935if (diags?.Length > 0) 8938if (annotations?.Length > 0) 8999if (diags?.Length > 0) 9002if (annotations?.Length > 0) 9084if (diags?.Length > 0) 9087if (annotations?.Length > 0) 9161if (diags?.Length > 0) 9164if (annotations?.Length > 0) 9225if (diags?.Length > 0) 9228if (annotations?.Length > 0) 9310if (diags?.Length > 0) 9313if (annotations?.Length > 0) 9386if (diags?.Length > 0) 9389if (annotations?.Length > 0) 9498if (diags?.Length > 0) 9501if (annotations?.Length > 0) 9583if (diags?.Length > 0) 9586if (annotations?.Length > 0) 9660if (diags?.Length > 0) 9663if (annotations?.Length > 0) 9785if (diags?.Length > 0) 9788if (annotations?.Length > 0) 9861if (diags?.Length > 0) 9864if (annotations?.Length > 0) 9938if (diags?.Length > 0) 9941if (annotations?.Length > 0) 10042if (diags?.Length > 0) 10045if (annotations?.Length > 0) 10170if (diags?.Length > 0) 10173if (annotations?.Length > 0) 10383if (diags?.Length > 0) 10386if (annotations?.Length > 0) 10532if (diags?.Length > 0) 10535if (annotations?.Length > 0) 10617if (diags?.Length > 0) 10620if (annotations?.Length > 0) 10721if (diags?.Length > 0) 10724if (annotations?.Length > 0) 10797if (diags?.Length > 0) 10800if (annotations?.Length > 0) 10873if (diags?.Length > 0) 10876if (annotations?.Length > 0) 10936if (diags?.Length > 0) 10939if (annotations?.Length > 0) 11030if (diags?.Length > 0) 11033if (annotations?.Length > 0) 11124if (diags?.Length > 0) 11127if (annotations?.Length > 0) 11209if (diags?.Length > 0) 11212if (annotations?.Length > 0) 11315if (diags?.Length > 0) 11318if (annotations?.Length > 0) 11460if (diags?.Length > 0) 11463if (annotations?.Length > 0) 11554if (diags?.Length > 0) 11557if (annotations?.Length > 0) 11648if (diags?.Length > 0) 11651if (annotations?.Length > 0) 11760if (diags?.Length > 0) 11763if (annotations?.Length > 0) 11872if (diags?.Length > 0) 11875if (annotations?.Length > 0) 11993if (diags?.Length > 0) 11996if (annotations?.Length > 0) 12114if (diags?.Length > 0) 12117if (annotations?.Length > 0) 12253if (diags?.Length > 0) 12256if (annotations?.Length > 0) 12455if (diags?.Length > 0) 12458if (annotations?.Length > 0) 12649if (diags?.Length > 0) 12652if (annotations?.Length > 0) 12812if (diags?.Length > 0) 12815if (annotations?.Length > 0) 12978if (diags?.Length > 0) 12981if (annotations?.Length > 0) 13099if (diags?.Length > 0) 13102if (annotations?.Length > 0) 13193if (diags?.Length > 0) 13196if (annotations?.Length > 0) 13287if (diags?.Length > 0) 13290if (annotations?.Length > 0) 13408if (diags?.Length > 0) 13411if (annotations?.Length > 0) 13568if (diags?.Length > 0) 13571if (annotations?.Length > 0) 13648if (diags?.Length > 0) 13651if (annotations?.Length > 0) 13836if (diags?.Length > 0) 13839if (annotations?.Length > 0) 13937if (diags?.Length > 0) 13940if (annotations?.Length > 0) 14069if (diags?.Length > 0) 14072if (annotations?.Length > 0) 14159if (diags?.Length > 0) 14162if (annotations?.Length > 0) 14237if (diags?.Length > 0) 14240if (annotations?.Length > 0) 14349if (diags?.Length > 0) 14352if (annotations?.Length > 0) 14452if (diags?.Length > 0) 14455if (annotations?.Length > 0) 14582if (diags?.Length > 0) 14585if (annotations?.Length > 0) 14694if (diags?.Length > 0) 14697if (annotations?.Length > 0) 14797if (diags?.Length > 0) 14800if (annotations?.Length > 0) 14891if (diags?.Length > 0) 14894if (annotations?.Length > 0) 14967if (diags?.Length > 0) 14970if (annotations?.Length > 0) 15107if (diags?.Length > 0) 15110if (annotations?.Length > 0) 15208if (diags?.Length > 0) 15211if (annotations?.Length > 0) 15365if (diags?.Length > 0) 15368if (annotations?.Length > 0) 15611if (diags?.Length > 0) 15614if (annotations?.Length > 0) 15786if (diags?.Length > 0) 15789if (annotations?.Length > 0) 15903if (diags?.Length > 0) 15906if (annotations?.Length > 0) 15982if (diags?.Length > 0) 15985if (annotations?.Length > 0) 16072if (diags?.Length > 0) 16075if (annotations?.Length > 0) 16170if (diags?.Length > 0) 16173if (annotations?.Length > 0) 16275if (diags?.Length > 0) 16278if (annotations?.Length > 0) 16353if (diags?.Length > 0) 16356if (annotations?.Length > 0) 16451if (diags?.Length > 0) 16454if (annotations?.Length > 0) 16557if (diags?.Length > 0) 16560if (annotations?.Length > 0) 16871if (diags?.Length > 0) 16874if (annotations?.Length > 0) 17129if (diags?.Length > 0) 17132if (annotations?.Length > 0) 17387if (diags?.Length > 0) 17390if (annotations?.Length > 0) 17645if (diags?.Length > 0) 17648if (annotations?.Length > 0) 17919if (diags?.Length > 0) 17922if (annotations?.Length > 0) 18125if (diags?.Length > 0) 18128if (annotations?.Length > 0) 18307if (diags?.Length > 0) 18310if (annotations?.Length > 0) 18429if (diags?.Length > 0) 18432if (annotations?.Length > 0) 18659if (diags?.Length > 0) 18662if (annotations?.Length > 0) 18747if (diags?.Length > 0) 18750if (annotations?.Length > 0) 18826if (diags?.Length > 0) 18829if (annotations?.Length > 0) 18902if (diags?.Length > 0) 18905if (annotations?.Length > 0) 19009if (diags?.Length > 0) 19012if (annotations?.Length > 0) 19112if (diags?.Length > 0) 19115if (annotations?.Length > 0) 19200if (diags?.Length > 0) 19203if (annotations?.Length > 0) 19265if (diags?.Length > 0) 19268if (annotations?.Length > 0) 19330if (diags?.Length > 0) 19333if (annotations?.Length > 0) 19417if (diags?.Length > 0) 19420if (annotations?.Length > 0) 19510if (diags?.Length > 0) 19513if (annotations?.Length > 0) 19639if (diags?.Length > 0) 19642if (annotations?.Length > 0) 19760if (diags?.Length > 0) 19763if (annotations?.Length > 0) 19836if (diags?.Length > 0) 19839if (annotations?.Length > 0) 20094if (diags?.Length > 0) 20097if (annotations?.Length > 0) 20320if (diags?.Length > 0) 20323if (annotations?.Length > 0) 20546if (diags?.Length > 0) 20549if (annotations?.Length > 0) 20733if (diags?.Length > 0) 20736if (annotations?.Length > 0) 20821if (diags?.Length > 0) 20824if (annotations?.Length > 0) 21000if (diags?.Length > 0) 21003if (annotations?.Length > 0) 21225if (diags?.Length > 0) 21228if (annotations?.Length > 0) 21302if (diags?.Length > 0) 21305if (annotations?.Length > 0) 21478if (diags?.Length > 0) 21481if (annotations?.Length > 0) 21672if (diags?.Length > 0) 21675if (annotations?.Length > 0) 21766if (diags?.Length > 0) 21769if (annotations?.Length > 0) 21929if (diags?.Length > 0) 21932if (annotations?.Length > 0) 22043if (diags?.Length > 0) 22046if (annotations?.Length > 0) 22140if (diags?.Length > 0) 22143if (annotations?.Length > 0) 22314if (diags?.Length > 0) 22317if (annotations?.Length > 0) 22420if (diags?.Length > 0) 22423if (annotations?.Length > 0) 22532if (diags?.Length > 0) 22535if (annotations?.Length > 0) 22604if (diags?.Length > 0) 22607if (annotations?.Length > 0) 22689if (diags?.Length > 0) 22692if (annotations?.Length > 0) 22776if (diags?.Length > 0) 22779if (annotations?.Length > 0) 22868if (diags?.Length > 0) 22871if (annotations?.Length > 0) 22979if (diags?.Length > 0) 22982if (annotations?.Length > 0) 23091if (diags?.Length > 0) 23094if (annotations?.Length > 0) 23180if (diags?.Length > 0) 23183if (annotations?.Length > 0) 23298if (diags?.Length > 0) 23301if (annotations?.Length > 0) 23423if (diags?.Length > 0) 23426if (annotations?.Length > 0) 23542if (diags?.Length > 0) 23545if (annotations?.Length > 0) 23641if (diags?.Length > 0) 23644if (annotations?.Length > 0) 23750if (diags?.Length > 0) 23753if (annotations?.Length > 0) 23857if (diags?.Length > 0) 23860if (annotations?.Length > 0) 23960if (diags?.Length > 0) 23963if (annotations?.Length > 0) 24045if (diags?.Length > 0) 24048if (annotations?.Length > 0) 24148if (diags?.Length > 0) 24151if (annotations?.Length > 0) 24233if (diags?.Length > 0) 24236if (annotations?.Length > 0) 24309if (diags?.Length > 0) 24312if (annotations?.Length > 0) 24442if (diags?.Length > 0) 24445if (annotations?.Length > 0) 24545if (diags?.Length > 0) 24548if (annotations?.Length > 0) 24648if (diags?.Length > 0) 24651if (annotations?.Length > 0) 24720if (diags?.Length > 0) 24723if (annotations?.Length > 0) 24814if (diags?.Length > 0) 24817if (annotations?.Length > 0) 24917if (diags?.Length > 0) 24920if (annotations?.Length > 0) 25011if (diags?.Length > 0) 25014if (annotations?.Length > 0) 25173if (diags?.Length > 0) 25176if (annotations?.Length > 0) 25282if (diags?.Length > 0) 25285if (annotations?.Length > 0) 25377if (diags?.Length > 0) 25380if (annotations?.Length > 0) 25467if (diags?.Length > 0) 25470if (annotations?.Length > 0) 25557if (diags?.Length > 0) 25560if (annotations?.Length > 0) 25647if (diags?.Length > 0) 25650if (annotations?.Length > 0) 25737if (diags?.Length > 0) 25740if (annotations?.Length > 0) 25827if (diags?.Length > 0) 25830if (annotations?.Length > 0) 25917if (diags?.Length > 0) 25920if (annotations?.Length > 0) 26016if (diags?.Length > 0) 26019if (annotations?.Length > 0) 26115if (diags?.Length > 0) 26118if (annotations?.Length > 0) 26249if (diags?.Length > 0) 26252if (annotations?.Length > 0) 26352if (diags?.Length > 0) 26355if (annotations?.Length > 0) 26496if (diags?.Length > 0) 26499if (annotations?.Length > 0) 26622if (diags?.Length > 0) 26625if (annotations?.Length > 0) 26748if (diags?.Length > 0) 26751if (annotations?.Length > 0) 26847if (diags?.Length > 0) 26850if (annotations?.Length > 0) 26946if (diags?.Length > 0) 26949if (annotations?.Length > 0) 27036if (diags?.Length > 0) 27039if (annotations?.Length > 0) 27144if (diags?.Length > 0) 27147if (annotations?.Length > 0) 27261if (diags?.Length > 0) 27264if (annotations?.Length > 0)
_generated\2\Syntax.xml.Syntax.Generated.cs (249)
68return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 129return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 175return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 233return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 297return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 348return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 405return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 458return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 506return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 569return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 628return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 676return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 737return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 781return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 825return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 879return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 934return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 975return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1027return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1071return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1136return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1192return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1248return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1293return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1340return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1402return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1464return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1510return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1552return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1614return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1657return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1740return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1814return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1885return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1938return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 1978return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2026return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2066return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2116return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2169return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2241return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2297return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2350return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2403return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2456return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2516return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2576return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2650return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2710return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2783return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2842return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2889return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 2947return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3011return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3133return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3269return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3339return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3431return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3518return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3608return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3682return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3752return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3812return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3870return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3935return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 3999return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4066return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4118return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4174return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4225return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4266return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4310return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4383return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4445return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4510return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4560return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4643return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4693return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4735return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4784return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4836return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4878return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4937return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 4984return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5028return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5074return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5137return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5180return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5222return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5269return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5323return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5365return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5430return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5494return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5548return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5606return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5647return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5690return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5734return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5775return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5832return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5875return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5941return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 5987return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6035return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6102return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6147return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6189return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6254return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6337return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6446return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6561return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6633return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6693return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6742return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6789return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6827return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6877return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6937return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 6984return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7050return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7141return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7192return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7241return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7305return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7370return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7438return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7511return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7589return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7698return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7838return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 7945return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8043return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8119return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8186return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8250return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8323return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8423return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8478return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8584return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8657return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8747return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8800return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8846return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8916return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 8983return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9052return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9124return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9182return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9230return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9274return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9345return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9405return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9493return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9662return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9771return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9866return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9914return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 9971return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10032return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10097return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10142return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10197return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10254return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10470return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10636return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10804return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 10970return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11144return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11305return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11423return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11511return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11629return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11720return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11775return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11830return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11903return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 11963return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12016return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12058return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12098return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12148return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12203return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12295return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12376return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12432return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12585return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12737return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 12883return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13010return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13089return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13183return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13343return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13409return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13497return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13615return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13683return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13777return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13865return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 13924return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14043return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14121return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14194return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14248return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14292return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14353return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14416return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14493return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14563return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14619return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14684return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14764return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14849return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14910return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 14979return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15048return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15111return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15159return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15219return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15265return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15306return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15385return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15455return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15523return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15576return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15627return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15683return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15737return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15837return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15897return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 15952return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16002return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16051return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16100return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16149return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16198return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16247return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16298return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16350return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16430return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16485return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16564return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16634return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16696return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16751return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16803return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16853return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16911return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode; 16972return annotations?.Length > 0 ? newNode.WithAnnotations(annotations) : newNode;
Binder\Binder.cs (2)
990if (lines.Length == 1) 997var last = lines[lines.Length - 1].Trim();
Binder\Binder_Expressions.cs (1)
10019Debug.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)
3339var builder = ArrayBuilder<TypeWithAnnotations>.GetInstance(_fixedResults.Length);
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (1)
34Debug.Assert(parameters == null || parameters.Length == length);
CodeGen\EmitStatement.cs (2)
1284Debug.Assert(switchCaseLabels.Length > 0); 1526if (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)
917int 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)
348for (int i = fullName.Length - 2; i >= 0; i--)
Emitter\EditAndContinue\CSharpDefinitionMap.cs (1)
181for (int i = 0; i < result.Length; i++)
Emitter\Model\PEAssemblyBuilder.cs (1)
693Debug.Assert(symbol.Constructors.Length == description.Signatures.Length);
Emitter\Model\PEModuleBuilder.cs (2)
1377for (int i = 0; i < @params.Length; i++) 2260ArrayBuilder<NamedTypeSymbol> builder = ArrayBuilder<NamedTypeSymbol>.GetInstance(_inlineArrayTypes.Count + _readOnlyListTypes.Length);
Emitter\NoPia\EmbeddedTypesManager.cs (2)
49for (int i = 0; i < _lazyWellKnownTypeMethods.Length; i++) 56for (int i = 0; i < _lazySpecialTypeMethods.Length; i++)
Errors\XmlSyntaxDiagnosticInfo.cs (1)
45if (this.Arguments == null || this.Arguments.Length == 0)
FlowAnalysis\NullableWalker.cs (3)
8881Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length); 8883var elementsBuilder = ArrayBuilder<BoundNode>.GetInstance(collectionExpressionVisitResults.Length); 8884for (int i = 0; i < collectionExpressionVisitResults.Length; i++)
Lowering\LocalRewriter\LocalRewriter_Call.cs (7)
1173if (expanded && TryOptimizeParamsArray(actualArguments[actualArguments.Length - 1], out optimized)) 1175actualArguments[actualArguments.Length - 1] = optimized; 1413Debug.Assert(refKinds.Count == arguments.Length); 1594for (int a = 0; a < arguments.Length; ++a) 1657for (int s = 0; s < sideeffects.Length; s++) 1694Debug.Assert(actualArguments.Length == parameters.Length); 1699var argsCount = actualArguments.Length;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (3)
498if (expanded && actualArguments[actualArguments.Length - 1] is { IsParamsArrayOrCollection: true } array) 510actualArguments[actualArguments.Length - 1] = boundTemp; 920for (int i = 0; i < boundTempIndices.Length; i++)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (4)
742WellKnownTypes.GetWellKnownActionDelegate(invokeArgumentCount: delegateSignature.Length) : 743WellKnownTypes.GetWellKnownFunctionDelegate(invokeArgumentCount: delegateSignature.Length - 1); 785int parameterCount = delegateSignature.Length - (returnsVoid ? 0 : 1); 925if (j < result.Length)
Lowering\SyntheticBoundNodeFactory.cs (3)
767var ctor = type.InstanceConstructors.Single(c => c.ParameterCount == args.Length); 1037for (int i = 0; i < parts.Length - 1; i++) 1045var lastExpression = parts[parts.Length - 1];
Parser\LanguageParser.cs (1)
10249Debug.Assert(parenExpression.GetDiagnostics().Length == 0);
Parser\LanguageParser_InterpolatedString.cs (2)
76if (diagnostics.Length == 0) 608var builder = ArrayBuilder<DiagnosticInfo>.GetInstance(infos.Length);
Parser\Lexer.cs (3)
1276if (_identLen >= _identBuffer.Length) 1286var tmp = new char[_identBuffer.Length * 2]; 1287Array.Copy(_identBuffer, tmp, _identBuffer.Length);
Parser\SyntaxParser.cs (14)
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) 735int existingLength = existingDiags.Length; 742DiagnosticInfo[] result = new DiagnosticInfo[existingDiags.Length + diagnostics.Length]; 1112if (d != null && d.Length > 0)
Symbols\AssemblySymbol.cs (8)
725Debug.Assert(parts.Length > 0); 737for (int i = 1; i < parts.Length; i++) 835int forcedArity = nestedTypes[i].GenericTypeParameters.Length - nestedTypes[i + 1].GenericTypeParameters.Length; 855Debug.Assert(symbol is null || typeArgumentIndex == genericArguments.Length); 865forcedArity: typeInfo.GenericTypeArguments.Length); 879Debug.Assert(typeArgumentIndex == genericArguments.Length); 886int remainingTypeArguments = typeArguments.Length - currentTypeArgument;
Symbols\Attributes\SourceAttributeData.cs (2)
244for (int signatureIndex = 0; signatureIndex < description.Signatures.Length; signatureIndex++) 275for (int signatureByteIndex = 3; signatureByteIndex < targetSignature.Length; signatureByteIndex++)
Symbols\Compilation_WellKnownMembers.cs (1)
94for (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)
877int count = paramInfo.Length - 1;
Symbols\Metadata\PE\PEPropertySymbol.cs (6)
224Debug.Assert(propertyParams.Length > 0); 951var lastPropertyParamIndex = propertyParams.Length - 1; 987if (propertyParams.Length < 2) 992var numAccessorParams = accessorParams.Length; 994var parameters = new ParameterSymbol[propertyParams.Length - 1]; 995for (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)
398Debug.Assert(bindingResult.Length == allAssemblyData.Length); 423for (int i = 1; i < bindingResult.Length; i++) 686Debug.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\SourceComplexParameterSymbol.cs (1)
767Debug.Assert(AttributeDescription.InterpolatedStringHandlerArgumentAttribute.Signatures.Length == 2);
Symbols\Source\SourceNamespaceSymbol.cs (2)
303Array.Clear(memberOfArity, 0, memberOfArity.Length); 311if (arity >= memberOfArity.Length)
Symbols\Synthesized\SynthesizedEmbeddedExtensionMarkerNameAttributeSymbol.cs (1)
37Debug.Assert(_constructors.Length == AttributeDescription.ExtensionMarkerAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (1)
57Debug.Assert(_constructors.Length == AttributeDescription.NativeIntegerAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (1)
61Debug.Assert(_constructors.Length == AttributeDescription.NullableAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedNullableContextAttributeSymbol.cs (1)
45Debug.Assert(_constructors.Length == AttributeDescription.NullableContextAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol.cs (1)
45Debug.Assert(_constructors.Length == AttributeDescription.NullablePublicOnlyAttribute.Signatures.Length);
Symbols\TypeSymbolExtensions.cs (1)
599for (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 (3)
164if (_count >= _stack.Length) 166var tmp = ArrayPool<NodeIteration>.Shared.Rent(_stack.Length * 2); 167Array.Copy(_stack, tmp, _stack.Length);
Utilities\InterceptableLocation.cs (2)
144if (bytes.Length < minLength) 155displayFileName = 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\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
84var arrayLengthProperty = TryGetNoArgInt32Property(arrayType, nameof(Array.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
473for (var i = 0; i < originalSwitchLabels.Length; i++)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
272var triviaAfterSplit = tokenAfterNamespace.LeadingTrivia.Skip(triviaBeforeSplit.Length).ToArray(); 274if (triviaBeforeSplit.Length > 0)
Microsoft.CodeAnalysis.CSharp.Features (19)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (3)
61if (array.Length > 0) 71for (var i = 0; i < array.Length - 1; i++) 315statementsOnBlockWithForEach[statementsOnBlockWithForEach.Length - 2] == forEachInfo.ForEachStatement)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
3077if (oldVariables.Length != newVariables.Length) 3082for (var i = 0; i < oldVariables.Length; i++)
GenerateType\CSharpGenerateTypeService.cs (1)
546if (containers.Length != 0)
InvertIf\CSharpInvertIfCodeRefactoringProvider.cs (2)
128if (statementArray.Length > 0) 135: statementArray.Length == 1
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
84var arrayLengthProperty = TryGetNoArgInt32Property(arrayType, nameof(Array.Length));
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (2)
272var triviaAfterSplit = tokenAfterNamespace.LeadingTrivia.Skip(triviaBeforeSplit.Length).ToArray(); 274if (triviaBeforeSplit.Length > 0)
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (5)
133var name = parts.Length > 0 ? parts[0] : ""; 134var value = parts.Length > 1 ? parts[1] : ""; 135Debug.Assert(!(parts.Length > 2)); 729var builder = ImmutableArray.CreateBuilder<(string Extension, string ItemType)>(pairs.Length); 735if (parts.Length != 2)
SyncedSource\FileBasedPrograms\ProjectLocator.cs (2)
38if (files.Length == 0) 44if (files.Length > 1)
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
Simplification\CSharpSimplificationService.Expander.cs (2)
175if (parameters.Length > 0 && parameters.Any(p => p.Type == null)) 185for (var i = 0; i < parameterSymbols.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
473for (var i = 0; i < originalSwitchLabels.Length; i++)
Microsoft.CodeAnalysis.Extensions.Package (66)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (12)
244return source.Length == 0; 1025return array.Length != 0 ? 1036while (index < source.Length) 1038TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 1039index += chunk.Length; 1064if (size != array.Length) 1069if (i >= array.Length) 1071arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 1083Debug.Assert(local.Length == size); 1084for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 1090if (i != array.Length) 1114return source is TSource[] { Length: 0 } ? [] : IndexIterator(source);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
Microsoft.CodeAnalysis.Features (35)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
588for (var i = 1; i < splicedFileExtensions.Length; i++) 624else if (splicedFileExtensions.Length == 1)
CodeFixes\Suppression\ExportConfigurationFixProviderAttribute.cs (1)
37if (languages.Length == 0)
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (1)
187if (typeNameParts.Length != fileNameParts.Length)
Completion\CommonCompletionItem.cs (1)
115for (var i = 0; i < parts.Length; i += 2)
Completion\CompletionService.ProviderManager.cs (1)
141.Where(lz => lz.Metadata.Roles == null || lz.Metadata.Roles.Length == 0 || roles.Overlaps(lz.Metadata.Roles))
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--)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
1232var bodyHasActiveStatement = activeNodesInBody.Length != 0;
EditAndContinue\TraceLog.cs (1)
154_log[(index - 1) % _log.Length] = entry;
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
30Debug.Assert(Enum.GetNames(typeof(TriviaLocation)).Length == TriviaLocationsCount);
ExtractMethod\ExtractMethodFlowControlInformation.cs (1)
103Contract.ThrowIfFalse(valuesIndex == values.Length);
ExtractMethod\MethodExtractor.cs (1)
254var name = startingWithLetter.Length == 0 ? originalName : new string(startingWithLetter);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (1)
592if (newTrailing.Length > 0)
MoveStaticMembers\MoveStaticMembersOptions.cs (1)
65NamespaceDisplay = string.Join(separator: ".", namespacesAndType.Take(namespacesAndType.Length - 1));
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
325var lookupTable = new bool[Enum.GetValues<DeclaredSymbolInfoKind>().Length];
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
135string.Join(PathSeparatorString, pathParts, refIndex + 1, pathParts.Length - refIndex - 1));
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (1)
60var stream = new MemoryStream(embeddedTextBytes, sizeof(int), embeddedTextBytes.Length - sizeof(int));
QuickInfo\Presentation\QuickInfoContentBuilder.cs (1)
23var result = new Dictionary<Glyph, QuickInfoGlyphElement>(capacity: glyphs.Length);
src\roslyn\src\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (1)
64Debug.Assert(customTags.Length == tags.Length);
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (3)
89if (reformattedCopyrightTextParts.Length != fileHeaderCopyrightTextParts.Length) 95for (var i = 0; i < reformattedCopyrightTextParts.Length; i++)
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (2)
55if (messageArgs == null || messageArgs.Length == 0) 373? (_formatArguments.Length > 0 ? string.Format(formatProvider, messageFormat, _formatArguments) : messageFormat)
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
777if (symbolParameters.Length != expectedParameters.Length) 782for (int i = 0; i < expectedParameters.Length; ++i)
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (2)
152Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 156builder.WriteBytes(0, sizeof(byte) * (DynamicAttributeSize - info.Flags.Length));
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (4)
75if (customDebugInfo.Length < CustomDebugInfoConstants.GlobalHeaderSize) 88while (offset <= customDebugInfo.Length - CustomDebugInfoConstants.RecordHeaderSize) 109if (offset > customDebugInfo.Length - bodySize || alignmentSize > 3 || alignmentSize > bodySize) 868return Encoding.UTF8.GetString(block, 0, block.Length);
Microsoft.CodeAnalysis.Razor.Compiler (157)
Language\CodeGeneration\CodeWriter.cs (2)
101if (_pageOffset == lastPage.Length) 394if (buffer.Length - index < count)
Language\Components\ComponentInjectDirectivePass.cs (2)
32var hasType = tokens.Length > 0 && !string.IsNullOrWhiteSpace(tokens[0].Content); 37var hasMemberName = tokens.Length > 1 && !string.IsNullOrWhiteSpace(tokens[1].Content);
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (1)
371for (var i = 0; i < diagnostics.Length; i++)
Language\DocumentationDescriptor.cs (1)
41if (args is null or { Length: 0 })
Language\DocumentationDescriptor.FormattedDescriptor.cs (2)
48var length = Args.Length; 50if (length != args.Length)
Language\Extensions\DefaultTagHelperOptimizationPass.cs (2)
39if (tagHelperNodes.Length == 0) 49for (var i = 0; i < tagHelperNodes.Length; i++)
Language\InMemoryFileContent.cs (3)
22var bytes = new byte[preamble.Length + contentBytes.Length]; 24contentBytes.CopyTo(bytes, preamble.Length);
Language\Intermediate\IntermediateNodeCollection.cs (2)
117if (arrayIndex < 0 || arrayIndex > array.Length) 121else if (array.Length - arrayIndex < Count)
Language\Intermediate\IntermediateNodeWalker.Stack.cs (3)
27=> _stack is null || _stackPointer == _stack.Length; 58_stackPointer = _stack.Length; 66var length = _stack.Length;
Language\Legacy\CSharpCodeParser.cs (8)
103s_conditionalBlockKeywordKinds.Length + 104s_caseStatementKeywordKinds.Length + 105s_ifStatementKeywordKinds.Length + 106s_tryStatementKeywordKinds.Length + 107s_doStatementKeywordKinds.Length + 108s_usingKeywordKinds.Length; 141var currentKeywordsSet = new HashSet<string>(capacity: s_defaultKeywords.Length + directives.Length, StringComparer.Ordinal); 2614for (var i = 0; i < usingStatementTokens.Length; i++)
Language\Legacy\HtmlMarkupParser.cs (1)
2249if (index == nonAllowedHtmlCommentEnding.Length)
Language\Legacy\HtmlTokenizer.cs (1)
50if (errors.Length == 0 && s_kindToTokenMap.TryGetValue(type, out var token))
Language\Legacy\LegacySyntaxNodeExtensions.ChildSyntaxListReversedEnumeratorStack.cs (2)
46if (++_stackPtr == _stack.Length) 48Array.Resize(ref _stack, _stack.Length * 2);
Language\Legacy\LegacySyntaxNodeExtensions.ChildSyntaxListReversedEnumeratorStack.Policy.cs (2)
27if (stack.Length < MaxArraySize) 29Array.Clear(stack, 0, stack.Length);
Language\Syntax\ArrayElement.cs (4)
35var array = new ArrayElement<T>[items.Length]; 36for (var i = 0; i < items.Length; i++) 51var array = new T[items.Length]; 52for (var i = 0; i < items.Length; i++)
Language\Syntax\Generated\Syntax.xml.Internal.Generated.cs (41)
71if (diags != null && diags.Length > 0) 151if (diags != null && diags.Length > 0) 213if (diags != null && diags.Length > 0) 267if (diags != null && diags.Length > 0) 329if (diags != null && diags.Length > 0) 396if (diags != null && diags.Length > 0) 458if (diags != null && diags.Length > 0) 520if (diags != null && diags.Length > 0) 582if (diags != null && diags.Length > 0) 636if (diags != null && diags.Length > 0) 701if (diags != null && diags.Length > 0) 825if (diags != null && diags.Length > 0) 879if (diags != null && diags.Length > 0) 950if (diags != null && diags.Length > 0) 1015if (diags != null && diags.Length > 0) 1174if (diags != null && diags.Length > 0) 1291if (diags != null && diags.Length > 0) 1402if (diags != null && diags.Length > 0) 1490if (diags != null && diags.Length > 0) 1603if (diags != null && diags.Length > 0) 1710if (diags != null && diags.Length > 0) 1832if (diags != null && diags.Length > 0) 1901if (diags != null && diags.Length > 0) 1955if (diags != null && diags.Length > 0) 2110if (diags != null && diags.Length > 0) 2212if (diags != null && diags.Length > 0) 2279if (diags != null && diags.Length > 0) 2335if (diags != null && diags.Length > 0) 2397if (diags != null && diags.Length > 0) 2459if (diags != null && diags.Length > 0) 2521if (diags != null && diags.Length > 0) 2575if (diags != null && diags.Length > 0) 2651if (diags != null && diags.Length > 0) 2717if (diags != null && diags.Length > 0) 2776if (diags != null && diags.Length > 0) 2842if (diags != null && diags.Length > 0) 2901if (diags != null && diags.Length > 0) 2949if (diags != null && diags.Length > 0) 3025if (diags != null && diags.Length > 0) 3088if (diags != null && diags.Length > 0) 3153if (diags != null && diags.Length > 0)
Language\Syntax\Generated\Syntax.xml.Syntax.Generated.cs (41)
49if (diagnostics != null && diagnostics.Length > 0) 87if (diagnostics != null && diagnostics.Length > 0) 133if (diagnostics != null && diagnostics.Length > 0) 172if (diagnostics != null && diagnostics.Length > 0) 218if (diagnostics != null && diagnostics.Length > 0) 265if (diagnostics != null && diagnostics.Length > 0) 311if (diagnostics != null && diagnostics.Length > 0) 357if (diagnostics != null && diagnostics.Length > 0) 403if (diagnostics != null && diagnostics.Length > 0) 442if (diagnostics != null && diagnostics.Length > 0) 495if (diagnostics != null && diagnostics.Length > 0) 564if (diagnostics != null && diagnostics.Length > 0) 607if (diagnostics != null && diagnostics.Length > 0) 658if (diagnostics != null && diagnostics.Length > 0) 708if (diagnostics != null && diagnostics.Length > 0) 856if (diagnostics != null && diagnostics.Length > 0) 917if (diagnostics != null && diagnostics.Length > 0) 984if (diagnostics != null && diagnostics.Length > 0) 1059if (diagnostics != null && diagnostics.Length > 0) 1120if (diagnostics != null && diagnostics.Length > 0) 1185if (diagnostics != null && diagnostics.Length > 0) 1272if (diagnostics != null && diagnostics.Length > 0) 1333if (diagnostics != null && diagnostics.Length > 0) 1372if (diagnostics != null && diagnostics.Length > 0) 1455if (diagnostics != null && diagnostics.Length > 0) 1533if (diagnostics != null && diagnostics.Length > 0) 1585if (diagnostics != null && diagnostics.Length > 0) 1624if (diagnostics != null && diagnostics.Length > 0) 1668if (diagnostics != null && diagnostics.Length > 0) 1714if (diagnostics != null && diagnostics.Length > 0) 1760if (diagnostics != null && diagnostics.Length > 0) 1799if (diagnostics != null && diagnostics.Length > 0) 1868if (diagnostics != null && diagnostics.Length > 0) 1924if (diagnostics != null && diagnostics.Length > 0) 1981if (diagnostics != null && diagnostics.Length > 0) 2037if (diagnostics != null && diagnostics.Length > 0) 2094if (diagnostics != null && diagnostics.Length > 0) 2132if (diagnostics != null && diagnostics.Length > 0) 2195if (diagnostics != null && diagnostics.Length > 0) 2249if (diagnostics != null && diagnostics.Length > 0) 2302if (diagnostics != null && diagnostics.Length > 0)
Language\Syntax\GreenNode.cs (1)
39if (diagnostics?.Length > 0)
Language\Syntax\InternalSyntax\SyntaxList.cs (7)
107if (children.Length < 10) 308var n = children.Length; 318for (var i = 0; i < children.Length; i++) 326return children.Length; 336Array.Copy(children, 0, array, offset, children.Length); 401var n = children.Length; 429var high = array.Length - 1;
Language\Syntax\InternalSyntax\SyntaxListBuilder.cs (3)
72AddRange(items, 0, items.Length); 137var currentSize = _nodes.Length; 170for (var i = 0; i < array.Length; i++)
Language\Syntax\InternalSyntax\SyntaxListPool.cs (3)
55if (_freeIndex >= _freeList.Length) 70var tmp = new ArrayElement<SyntaxListBuilder>[_freeList.Length * 2]; 71Array.Copy(_freeList, tmp, _freeList.Length);
Language\Syntax\InternalSyntax\SyntaxTokenCache.cs (1)
19=> diagnostics.Length == 0;
Language\Syntax\SyntaxNode.Iterators.cs (3)
86if (stack.Length < 256) 88Array.Clear(stack, 0, stack.Length); 155if (++_stackPtr >= _stack.Length)
Language\Syntax\SyntaxSerializer.cs (2)
121if (node.GetDiagnostics() is { Length: > 0} diagnostics) 165return diagnostics.Length > 0
Language\Syntax\SyntaxToken.cs (1)
192return diagnostics.Length == 0
Language\TagHelperBinder.TagHelperSet.cs (1)
48TagHelperDescriptor[] array => array.Length,
Mvc.Version1_X\ViewComponentTagHelperDescriptorFactory.cs (2)
99if (methods.Length == 0) 105else if (methods.Length > 1)
Mvc.Version2_X\NamespaceDirective.cs (1)
118for (var i = 0; i < segments.Length - 1; i++)
Mvc\InjectDirective.cs (2)
71var hasType = tokens.Length > 0 && !string.IsNullOrWhiteSpace(tokens[0].Content); 76var hasMemberName = tokens.Length > 1 && !string.IsNullOrWhiteSpace(tokens[1].Content);
Mvc\ModelDirective.cs (1)
57if (tokens.Length >= 1)
SourceGenerators\RazorSourceGenerator.cs (3)
175if (oldModules.Length != newModules.Length) 180for (int i = 0; i < oldModules.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.RazorExtensionsResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.AspNetCore.Razor.Language.ComponentResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.AspNetCore.Razor.Language.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.CodeAnalysis.Razor.CodeAnalysisResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.CodeAnalysis.Razor.Compiler.Analyzers.AnalyzerResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\roslyn\artifacts\obj\Microsoft.CodeAnalysis.Razor.Compiler\Release\net11.0\Microsoft.NET.Sdk.Razor.SourceGenerators.Diagnostics.RazorSourceGeneratorResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.CodeAnalysis.Rebuild (4)
CompilationOptionsReader.cs (1)
215var 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.ResxSourceGenerator (154)
AbstractResxGenerator.cs (1)
638if (ResourceInformation.NoWarn.Length > 0)
src\roslyn\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\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (12)
244return source.Length == 0; 1025return array.Length != 0 ? 1036while (index < source.Length) 1038TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 1039index += chunk.Length; 1064if (size != array.Length) 1069if (i >= array.Length) 1071arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 1083Debug.Assert(local.Length == size); 1084for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 1090if (i != array.Length) 1114return source is TSource[] { Length: 0 } ? [] : IndexIterator(source);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
348if (split.Length != 2) 397if (split.Length != 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
693if (trivia.Length == 0) 727if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
106if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
183Contract.ThrowIfFalse(lines.Length > 0); 187if (0 < lines.Length - 1) 193for (var i = 1; i < lines.Length; i++) 204if (i < lines.Length - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
99where nameSplit.Length == 3
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
292WriteArrayLength(array.Length); 372for (var offset = 0; offset < spanLength; offset += buffer.Length) 374var segmentLength = Math.Min(buffer.Length, spanLength - offset); 507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
110if (method.TypeParameters.Length != typeArgumentArray.Length)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
202var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
74if (_sourceLowerCaseCharacters.Length == PooledArraySize)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
57if (taskArray.Length == 0) 61for (var i = 0; i < taskArray.Length; i++) 72var result = new T[taskArray.Length]; 73for (var i = 0; i < taskArray.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
Microsoft.CodeAnalysis.Scripting (17)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (4)
400if (getter.GetParameters().Length > 0) 646if (array.Length == 0) 665int i = indices.Length - 1; 683i = indices.Length - 1;
Hosting\ObjectFormatter\CommonTypeNameFormatter.cs (3)
98if (typeArguments.Length == 0) 288int currentArgCount = (typeInfo.IsGenericTypeDefinition ? typeInfo.GenericTypeParameters.Length : typeInfo.GenericTypeArguments.Length) - genericArgIndex;
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (2)
206if (method.GetParameters().Length == 0) 214if (getter?.GetParameters().Length == 0)
Hosting\Resolvers\NuGetPackageResolver.cs (2)
25Debug.Assert(parts.Length > 0); 29switch (parts.Length)
ScriptExecutionState.cs (2)
159if (SubmissionStateCount >= _submissionStates.Length) 161Array.Resize(ref _submissionStates, Math.Max(SubmissionStateCount, _submissionStates.Length * 2));
src\roslyn\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.VisualBasic (101)
Analysis\FlowAnalysis\AlwaysAssignedWalker.vb (1)
43If (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)
214Dim fieldsCount As Integer = Me._fields.Length 297For 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 4124Dim inferredArrayType = ArrayTypeSymbol.CreateVBArray(inferredElementType, Nothing, knownSizes.Length, Compilation) 4132Dim rank = knownSizes.Length 4135For i As Integer = 0 To knownSizes.Length - 1 4248Dim 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)
246Dim fields = New AnonymousTypeField(selectors.Length - 1) {} 1994Dim resultSelector As TypeSymbol = method.Parameters(groupByArguments.Length - 1).Type 2068Dim resultSelector As TypeSymbol = method.Parameters(groupJoinArguments.Length - 1).Type 2784For i As Integer = 0 To rangeVariables.Length - 1 3803fields = New AnonymousTypeField(selectors.Length - 1) {} 3813fields = New AnonymousTypeField(selectors.Length - 1) {} 3832fields = New AnonymousTypeField(selectors.Length - 1) {} 3868Debug.Assert(selectors.Length > 1)
Binding\Binder_Statements.vb (1)
2083For i = 0 To boundStatements.Length - 1
CodeGen\EmitStatement.vb (1)
1088Dim 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)
332triviaToMove.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)
3346For i As Integer = 0 To conversionKinds.Length - 1 3410For i As Integer = 0 To conversionKinds.Length - 1 3494For i As Integer = 0 To conversionKinds.Length - 1 3521For i As Integer = 0 To conversionBackKinds.Length - 1
Symbols\AnonymousTypes\CRC32.vb (1)
16Debug.Assert(names.Length > 0)
Symbols\AssemblySymbol.vb (2)
581Debug.Assert(parts.Length > 0) 593While 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)
1067Dim count As Integer = paramInfo.Length - 1
Symbols\Metadata\PE\PENamedTypeSymbol.vb (1)
865For i = 0 To ownedParams.Length - 1
Symbols\Metadata\PE\PEPropertySymbol.vb (3)
462If propertyParams.Length < 2 Then 466Dim parameters(propertyParams.Length - 2) As ParameterSymbol 467For 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)
1068For i As Integer = 0 To parameters.Length - 1 1702For 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)
1367Dim 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)
454For i As Integer = 0 To arguments.Length - 1 536For 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)
14If nodesToRemove.Length = 0 Then 53While 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)
298Dim length As Integer = errorInfos.Length
Syntax\VisualBasicSyntaxTree.vb (1)
121If 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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SyntaxKindExtensions.vb (1)
38For i = start To kinds.Length - 1
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)
423If containers.Length <> 0 Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeCleanup\Providers\ReduceTokensCodeCleanupProvider.vb (2)
258If parts.Length() > 1 Then 268Dim exponentPartOpt As String = If(partsAfterDot.Length > 1, "E" + partsAfterDot(1), "")
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SyntaxKindExtensions.vb (1)
38For i = start To kinds.Length - 1
Microsoft.CodeAnalysis.Workspaces (199)
CodeCleanup\Providers\ExportCodeCleanupProvider.cs (1)
24if (languages.Length == 0)
CodeFixes\ExportCodeFixProviderAttribute.cs (2)
87var languages = new string[additionalLanguages.Length + 1]; 89for (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 (5)
35_invalidPattern = _patternSegments.Length == 0 || _patternSegments.Any(s => s.IsInvalid); 57if (_patternSegments.Length > containerParts.Length) 67for (int i = _patternSegments.Length - 1, j = containerParts.Length - 1;
PatternMatching\PatternMatcher.cs (2)
389if (subWordTextChunks.Length == 1) 403for (int i = 0, n = subWordTextChunks.Length; i < n; i++)
PatternMatching\PatternMatcher.PatternSegment.cs (1)
40public readonly bool IsInvalid => this.SubWordTextChunks.Length == 0;
Rename\ConflictEngine\ConflictResolver.Session.cs (3)
533else if (!conflictAnnotation.IsRenameLocation && conflictAnnotation.IsOriginalTextLocation && conflictAnnotation.RenameDeclarationLocationReferences.Length > 1 && newReferencedSymbols.Length == 1) 538else if (newReferencedSymbols.Length != conflictAnnotation.RenameDeclarationLocationReferences.Length) 541if (newReferencedSymbols.Length != 0 && conflictAnnotation.RenameDeclarationLocationReferences.Length == 0)
Serialization\SerializerService_Reference.cs (1)
532stream.Write(content, 0, content.Length);
Shared\Extensions\INamedTypeSymbolExtensions.cs (1)
15for (var i = containers.Length - 1; i >= 0; i--)
Shared\Extensions\SourceTextExtensions.cs (8)
200Contract.ThrowIfTrue(buffer.Length != CharArrayLength); 206var numberOfChunks = 1 + (length / buffer.Length); 215var count = Math.Min(buffer.Length, length - offset); 273Contract.ThrowIfTrue(currentChunk.Length != CharArrayLength); 285Contract.ThrowIfTrue(chunksArray.Any(static (c, s) => c.Length != s, CharArrayLength)); 333if (index < 0 || index >= buffer.Length) 336if (count < 0 || (index + count) > buffer.Length) 353var 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\roslyn\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\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
119int read = stream.Read(buffer, 0, buffer.Length);
src\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
244return source.Length == 0;
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
693if (trivia.Length == 0) 727if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
106if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
183Contract.ThrowIfFalse(lines.Length > 0); 187if (0 < lines.Length - 1) 193for (var i = 1; i < lines.Length; i++) 204if (i < lines.Length - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
99where nameSplit.Length == 3
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
292WriteArrayLength(array.Length); 372for (var offset = 0; offset < spanLength; offset += buffer.Length) 374var segmentLength = Math.Min(buffer.Length, spanLength - offset); 507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
110if (method.TypeParameters.Length != typeArgumentArray.Length)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
202var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
74if (_sourceLowerCaseCharacters.Length == PooledArraySize)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
57if (taskArray.Length == 0) 61for (var i = 0; i < taskArray.Length; i++) 72var result = new T[taskArray.Length]; 73for (var i = 0; i < taskArray.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
55if (typeArguments.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (4)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
13=> array == null || array.Length == 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
442if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
TemporaryStorage\TemporaryStorageService.cs (1)
171var 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\Deque.cs (10)
40return _array[(_head + index) % _array.Length]; 58return _array[(_head + _count - 1) % _array.Length]; 65_array[(_head + _count) % _array.Length] = item; 75_head = (_head + 1) % _array.Length; 84var index = (_head + _count) % _array.Length; 93if (_array.Length >= min) 96var newCapacity = Math.Max(4, _array.Length * 2); 103if (_head + _count <= _array.Length) 109var firstPart = _array.Length - _head; 122if (_array.Length > 0)
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)
Microsoft.CodeAnalysis.Workspaces.MSBuild (4)
MSBuild\MSBuildProjectLoader.Worker.cs (3)
374if (pathNames.Length > 0) 376folders = pathNames.Length > 1 377? [.. pathNames.Take(pathNames.Length - 1)]
Rpc\RpcClient.cs (1)
176await _stream.WriteAsync(requestJsonBytes, 0, requestJsonBytes.Length, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (22)
Build\ProjectBuildManager.cs (1)
236var results = new List<MSB.Execution.ProjectInstance>(targetFrameworks.Length);
MSBuild\ProjectFile\CommandLineArgumentReader.cs (1)
230if (aliases.Length == 0)
MSBuild\ProjectFile\ProjectFile.cs (2)
101if (aliases.Length > 0) 179if (reference.Aliases.Length > 0)
MSBuild\ProjectFile\ProjectInstanceReader.cs (2)
102var metadataReferences = commandLineArgs.Length == 0 ? _projectInstance.GetMetadataReferences().ToArray() : []; 173if (commandLineArgs.Length == 0)
Rpc\RpcMethodInvoker.cs (1)
29arguments[arguments.Length - 1] = CancellationToken.None;
Rpc\RpcServer.cs (8)
128var lastParameterIsCancellationToken = methodParameters.Length > 0 && methodParameters[^1].ParameterType == typeof(CancellationToken); 131Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length - 1, $"The arguments list should contain every parameter for {request.Method} except the final CancellationToken."); 133Contract.ThrowIfFalse(request.Parameters.Length == methodParameters.Length, $"The arguments list should contain every parameter for {request.Method}."); 135var arguments = new object?[methodParameters.Length]; 137for (var i = 0; i < methodParameters.Length; i++) 141if (!(i == methodParameters.Length - 1 && lastParameterIsCancellationToken))
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
Microsoft.CSharp (166)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (11)
32Expression[] parameters = new Expression[args.Length]; 38for (int index = 0; index < args.Length; ++index) 161for (int i = 0; i < arguments.Length; ++i) 290Debug.Assert(args.Length != 0); 308if (sourceTail?.Length != 0) 310T[] array = new T[sourceTail.Length + 1]; 321if (sourceMiddle?.Length != 0) 323T[] array = new T[sourceMiddle.Length + 2]; 325array[array.Length - 1] = sourceLast; 449for (int i = 0; i < typeArgs.Length; i++) 462for (int i = 0; i < argInfos.Length; i++)
Microsoft\CSharp\RuntimeBinder\ComInterop\CollectionExtensions.cs (2)
13T[] result = new T[array.Length - 1]; 14Array.Copy(array, 1, result, 0, result.Length);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComBinderHelpers.cs (3)
55DynamicMetaObject[] newArgs = new DynamicMetaObject[args.Length]; 56bool[] isByRefArg = new bool[args.Length]; 58for (int i = 0; i < args.Length; i++)
Microsoft\CSharp\RuntimeBinder\ComInterop\ComInvokeAction.cs (3)
66Debug.Assert(args.Length == 2); 68int count = ((object[])args[1]).Length; 81delegateArgs[delegateArgs.Length - 1] = typeof(object);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComInvokeBinder.cs (16)
115private ParameterExpression ParamVariantsVariable => _paramVariants ??= Expression.Variable(VariantArray.GetStructType(_args.Length), "paramVariants"); 145_totalExplicitArgs = _args.Length; 147Type[] marshalArgTypes = new Type[_args.Length]; 150for (int i = 0; i < _args.Length; i++) 197if (_keywordArgNames.Length > 0) 230int reverseIndex = _varEnumSelector.VariantBuilders.Length - 1; 231int positionalArgs = _varEnumSelector.VariantBuilders.Length - _keywordArgNames.Length; // args passed by position order and not by name 232for (int i = 0; i < _varEnumSelector.VariantBuilders.Length; i++, reverseIndex--) 319for (int i = 0, n = variants.Length; i < n; i++) 349for (int i = 0, n = _varEnumSelector.VariantBuilders.Length; i < n; i++) 393Debug.Assert(_varEnumSelector.VariantBuilders.Length == _totalExplicitArgs); 485Expression.Constant(_keywordArgNames.Length) 533res = new Expression[_args.Length + 1]; 538res = new Expression[_args.Length]; 541for (int i = 0; i < _args.Length; i++)
Microsoft\CSharp\RuntimeBinder\ComInterop\ComMethodDesc.cs (4)
37typeInfo.GetNames(DispId, rgNames, rgNames.Length, out int cNames); 38if (IsPropertyPut && rgNames[rgNames.Length - 1] == null) 40rgNames[rgNames.Length - 1] = "value"; 43Debug.Assert(cNames == rgNames.Length);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComRuntimeHelpers.cs (2)
328int[] dispIds = new int[names.Length]; 330int hresult = dispatch.TryGetIDsOfNames(ref empty, names, (uint)names.Length, 0, dispIds);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComTypeEnumDesc.cs (2)
66for (int i = 0; i < _memberNames.Length; i++) 79for (int i = 0; i < _memberNames.Length; i++)
Microsoft\CSharp\RuntimeBinder\ComInterop\VarEnumSelector.cs (2)
37VariantBuilders = new VariantBuilder[explicitArgTypes.Length]; 39for (int i = 0; i < explicitArgTypes.Length; i++)
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (1)
83Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (1)
36Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetIndexBinder.cs (3)
27Expr indexerArguments = runtimeBinder.CreateArgumentListEXPR(arguments, locals, 1, arguments.Length); 76_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (3)
27Debug.Assert(arguments.Length == 1); 92_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeBinder.cs (2)
89_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeConstructorBinder.cs (4)
78TypeArguments.Length != otherBinder.TypeArguments.Length || 79_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeMemberBinder.cs (5)
47CSharpArgumentInfo[] array = new CSharpArgumentInfo[_argumentInfo.Length]; 101TypeArguments.Length != otherBinder.TypeArguments.Length || 102_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpSetIndexBinder.cs (2)
95_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpSetMemberBinder.cs (2)
96_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (1)
69Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (4)
179int numberOfArguments = args.Length; 180Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch."); 221object[] argsWithSite = new object[args.Length + 1];
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (3)
18string[] prgpsz = new string[args.Length]; 19int[] prgiarg = new int[args.Length]; 27for (int iarg = 0; iarg < args.Length; iarg++)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (19)
79Debug.Assert(args.Length >= 1); 156int arity = callPayload.TypeArguments?.Length ?? 0; 181DynamicMetaObject[] newArgs = new DynamicMetaObject[args.Length - 1]; 182Array.Copy(args, 1, newArgs, 0, args.Length - 1); 258ArgumentObject[] array = new ArgumentObject[parameters.Length]; 259for (int i = 0; i < parameters.Length; i++) 346LocalVariableSymbol[] locals = new LocalVariableSymbol[parameterExpressions.Length]; 348for (int i = 0; i < parameterExpressions.Length; i++) 617TypeArray typeArgumentsAsTypeArray = typeArguments?.Length > 0 754int arity = payload.TypeArguments?.Length ?? 0; 841BindingFlag.BIND_RVALUEREQUIRED | BindingFlag.BIND_STMTEXPRONLY, memGroup, CreateArgumentListEXPR(arguments, locals, 1, arguments.Length)) as ExprCall; 854if (conditions.Length > 0) 969Debug.Assert(arguments.Length == 1); 1010Debug.Assert(arguments.Length == 2); 1220Debug.Assert(arguments.Length == 1); 1256Debug.Assert(arguments.Length == 1); 1280Debug.Assert(arguments.Length >= 2); 1293indexerArguments = CreateArgumentListEXPR(arguments, locals, 1, arguments.Length - 1); 1305int 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)
322if (o.Length == 1) 336if (o.Length == 1)
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (2)
207for (int ibos = 0; ibos < s_binopSignatures.Length; ibos++) 1430for (int index = 0; index < s_rguos.Length; index++)
Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs (2)
266for (int iTypeArg = 0; iTypeArg < typeArgs.Length; iTypeArg++) 287for (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)
58m.GetParameters().Length == genericParams.Count && 126Debug.Assert(c.GetParameters() == null || c.GetParameters().Length == genericInstanceParams.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (1)
54(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)
215for (int i = 0; i < srcs.Length; i++) 221CType[] dsts = new CType[srcs.Length]; 224while (++i < srcs.Length) 313if (index < pctx.MethodTypes.Length) 322return index < pctx.ClassTypes.Length ? pctx.ClassTypes[index] : type; 454Debug.Assert(tvs.GetIndexInTotalParameters() < pctx.MethodTypes.Length); 455if (index < pctx.MethodTypes.Length) 462Debug.Assert(index < pctx.ClassTypes.Length); 463if (index < pctx.ClassTypes.Length) 712for (int i = 0; i < newTypeArgsTemp.Length; i++)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (20)
247list = new List<Type>(ifaces.Length + 2) 311CType[] ctypes = new CType[genericArguments.Length]; 312for (int i = 0; i < genericArguments.Length; i++) 319for (int i = 0; i < genericArguments.Length; i++) 344for (int i = 0; i < genericArguments.Length; i++) 478if (parentType.GetGenericArguments() == null || pos >= parentType.GetGenericArguments().Length) 484while (parentType.GetGenericArguments().Length > pos) 492if (nextParent?.GetGenericArguments()?.Length > pos) 831int length = types.Length; 838for (int i = 0; i < types.Length; i++) 1178bool isIndexer = property.GetIndexParameters().Length != 0 1467if (parameters.Length > 0) 1470if (parameters[parameters.Length - 1].GetCustomAttribute<ParamArrayAttribute>(false) != null) 1476for (int i = 0; i < parameters.Length; i++) 1642CType[] types = new CType[isVarArg ? parameters.Length + 1 : parameters.Length]; 1644for (int i = 0; i < parameters.Length; i++) 1651types[types.Length - 1] = ArgumentListType.Instance; 1689if (parameters.Length == 0) 1694ParameterInfo p = parameters[parameters.Length - 1];
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (1)
154for (int i = 0; i < oldEntries.Length; i++)
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\ComEventsMethod.cs (6)
55if (_cachedTargetTypes != null && _expectedParamsCount == args.Length) 72_expectedParamsCount = parameters.Length; 155get => _delegateWrappers.Length == 0; 164newWrappers = new DelegateWrapper[wrappers.Length + 1]; 179for (int i = 0; i < wrappers.Length; i++) 195newWrappers = new DelegateWrapper[wrappers.Length - 1];
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)
1304var row = new object[columns.Length];
DataFrameTests.cs (1)
1227Assert.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)
415Assert.Equal(indicesMap.Length, clonedColumn.Length); 417for (int i = 0; i < indicesMap.Length; i++) 436Assert.Equal(indicesMap.Length, clonedColumn.Length); 438for (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)
46Assert.Equal(mapIndices.Length, clonedColumn.Length); 49for (int i = 0; i < mapIndices.Length; i++) 62Assert.Equal(mapIndices.Length, clonedColumn.Length); 65for (int i = 0; i < mapIndices.Length; i++) 66Assert.Equal(stringColumn[mapIndices[mapIndices.Length - 1 - i]], clonedColumn[i]); 78Assert.Equal(mapIndices.Length, clonedColumn.Length); 81for (int i = 0; i < mapIndices.Length; i++) 95Assert.Equal(mapIndices.Length, clonedColumn.Length); 97for (int i = 0; i < mapIndices.Length; i++) 98Assert.Equal(stringColumn[mapIndices[mapIndices.Length - 1 - i]], clonedColumn[i]);
Microsoft.Deployment.DotNet.Releases (11)
ReleaseVersion.cs (11)
463int minParts = dotPartsA.Length < dotPartsB.Length ? dotPartsA.Length : dotPartsB.Length; 507return dotPartsA.Length.CompareTo(dotPartsB.Length); 756if (versionParts.Length != 3) 853if (dotSeparatedPrereleaseIdentifiers.Length > 0) 855for (int i = 0; i < dotSeparatedPrereleaseIdentifiers.Length; i++) 879if (dotSeperatedBuildIdentifiers.Length > 0) 881for (int i = 0; i < dotSeperatedBuildIdentifiers.Length; ++i)
Microsoft.Diagnostics.DataContractReader (2)
ContractDescriptorTarget.cs (2)
267if (global.NumericValue.Value >= (ulong)descriptor.PointerData.Length) 315if (subDescriptor.Value.NumericValue.Value >= (ulong)descriptor.PointerData.Length)
Microsoft.Diagnostics.DataContractReader.Contracts (5)
Contracts\BuiltInCOM_1.cs (1)
118for (int i = 0; i < wrapper.IPtrs.Length; i++)
Contracts\ExecutionManager\Helpers\HashMapLookup.cs (1)
43for (int slotIdx = 0; slotIdx < bucket.Keys.Length; slotIdx++)
Contracts\ManagedTypeSource_1.cs (1)
325for (int i = 1; i < parts.Length; i++)
Contracts\PrecodeStubs_3.cs (1)
94for (ulong i = 0; i < (ulong)expectedBytePattern.Length; i++)
Contracts\StackWalk\Context\X86\GCInfoDecoding\InfoHdr.cs (1)
158if (encoding < 0 || encoding >= INFO_HDR_TABLE.Length)
Microsoft.Diagnostics.DataContractReader.DataGenerator (6)
EquatableArray.cs (4)
26public int Count => _items?.Length ?? 0; 42if (_items.Length != other._items.Length) 47for (int i = 0; i < _items.Length; i++)
Parser.cs (2)
241string descriptorName = rawNames is { Length: > 0 } ? rawNames[0] : prop.Name; 265string descriptorName = rawNames is { Length: > 0 } ? rawNames[0] : prop.Name;
Microsoft.Diagnostics.DataContractReader.Legacy (43)
ClrDataFrame.cs (5)
56*contextSize = (uint)context.Length; 60if (contextBufSize < (uint)context.Length) 63if (contextBufSize > 0 && context.Length > 0) 64Array.Copy(context, 0, contextBuf, 0, context.Length); 494&& locations.Length == 1
ClrDataMethodInstance.cs (3)
270for (int i = 0; i < localIlOffsets.Length; i++) 317if (outputMapIndex < maps.Length) 358int countToCheck = Math.Min(mapsLocal.Length, (int)mapNeededLocal);
ClrDataModule.cs (1)
208for (int i = 1; i < nestingParts.Length && current != null; i++)
ClrDataStackWalk.cs (2)
70if (context.Length > contextBufSize) 75*contextSize = (uint)context.Length;
ClrDataValue.cs (4)
43if (_locations.Length > 0 && (_flags & (uint)ClrDataValueFlag.IS_REFERENCE) != 0) 89if (_locations.Length != 1 || _locations[0].IsRegisterValue) 310*numLocs = (uint)_locations.Length; 339if (loc >= (uint)_locations.Length)
Dbi\DacDbiImpl.cs (2)
1515givenCtx.FillFromBuffer(new Span<byte>(pContext, leafContext.Length)); 1547context.AsSpan().CopyTo(new Span<byte>(pContextBuffer, context.Length));
SOSDacImpl.cs (26)
199if (appDomain != TargetPointer.Null && values.Length > 0) 222if (values is not null && values.Length > 0 && valuesLocal.Length > 0) 499if (modules is not null && modules.Length > 0 && count > 0) 528if (modules is not null && modules.Length > 0) 752if (buckets.Length != 0) 754var dest = new Span<byte>(pGenericModeBlock, buckets.Length); 1318if (heaps.Length == heapCount) 1327else if (heaps.Length != 0) 1678while (written < count && _index < _handles.Length) 1682hr = _index < _handles.Length ? HResults.S_FALSE : HResults.S_OK; 1734*pCount = (uint)_handles.Length; 1740Debug.Assert(countLocal == (uint)_handles.Length); 1779while (written < count && _index < _regions.Length) 1834*pCount = (uint)_regions.Length; 1840Debug.Assert(countLocal == (uint)_regions.Length); 3846if ((uint)regIndex >= (uint)regs.Length) 4001count = Math.Min(count, (uint)refs.Length); 4003while (written < count && _index < _refs.Length) 4010hr = _index < _refs.Length ? HResults.S_FALSE : HResults.S_OK; 4027_index = Math.Min(_index + count, (uint)_refs.Length); 4040*pCount = (uint)_refs.Length; 6497var entries = new (LoaderAllocatorHeapType, nint)[heapTypes.Length]; 6498for (int i = 0; i < heapTypes.Length; i++) 6535int loaderHeapCount = filteredEntries.Length; 6587int loaderHeapCount = filteredEntries.Length;
Microsoft.Diagnostics.NETCore.Client (33)
DiagnosticsClient\DiagnosticsClient.cs (2)
688uint length = byteArray == null ? 0U : (uint)byteArray.Length; 897if (options.HasFlag(ValidateResponseOptions.ErrorMessageReturned) && responseMessage.Payload.Length >= (sizeof(uint) * 2))
DiagnosticsIpc\IpcAdvertise.cs (10)
30private static readonly int IpcAdvertiseV1SizeInBytes = Magic_V1.Length + 16 + 8 + 2; // 34 bytes 49int read = await stream.ReadAsync(buffer, totalRead, buffer.Length - totalRead, token).ConfigureAwait(false); 56while (totalRead < buffer.Length); 59byte[] magic = new byte[Magic_V1.Length]; 60Array.Copy(buffer, magic, Magic_V1.Length); 61index += Magic_V1.Length; 87Array.Copy(Magic_V1, buffer, Magic_V1.Length); 88index += Magic_V1.Length; 91Array.Copy(cookieBuffer, 0, buffer, index, cookieBuffer.Length); 92index += cookieBuffer.Length;
DiagnosticsIpc\IpcClient.cs (2)
96stream.Write(buffer, 0, buffer.Length); 102return stream.WriteAsync(buffer, 0, buffer.Length, cancellationToken);
DiagnosticsIpc\IpcEndpointConfig.cs (2)
134if (parts.Length > 2) 147if (parts.Length == 2)
DiagnosticsIpc\IpcHeader.cs (1)
43Debug.Assert(Magic.Length == MagicSizeInBytes);
DiagnosticsIpc\IpcMessage.cs (1)
97Header.Size = checked((ushort)(IpcHeader.HeaderSizeInBytes + Payload.Length));
DiagnosticsIpc\IpcTcpSocketEndPoint.cs (5)
90if (segments.Length > 2) 92host = string.Join(":", segments, 0, segments.Length - 1); 93port = int.Parse(segments[segments.Length - 1]); 95else if (segments.Length == 2) 139if (hostEntry.AddressList.Length > 0)
DiagnosticsIpc\IpcTransport.cs (3)
404if (parts.Length > 1 && int.TryParse(parts[parts.Length - 1], NumberStyles.Integer, CultureInfo.InvariantCulture, out int parsedPid)) 452if (environData.Length == 0)
DiagnosticsIpc\ProcessEnvironment.cs (3)
47if (envBlock.Length != (long)ExpectedSizeInBytes) 49throw new ApplicationException($"ProcessEnvironment continuation length did not match expected length. Expected: {ExpectedSizeInBytes} bytes, Received: {envBlock.Length} bytes"); 55while (cursor < envBlock.Length)
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (4)
1352using Task<int> readTask = ipcClientStream.ReadAsync(buffer, 0, buffer.Length, cancelReadConnect.Token); 1413await tcpClientStream.WriteAsync(buffer, 0, buffer.Length, token).ConfigureAwait(false); 1558int bytesRead = await _backendStream.ReadAsync(buffer, 0, buffer.Length, token).ConfigureAwait(false); 1601int bytesRead = await _frontendStream.ReadAsync(buffer, 0, buffer.Length, token).ConfigureAwait(false);
Microsoft.DiaSymReader (37)
Extensions\SymUnmanagedExtensions.Document.cs (3)
113if (bytesRead < sizeof(int) || bytesRead > blob.Length) 133int bytesDecompressed = decompressor.Read(uncompressedBytes, position, uncompressedBytes.Length - position); 142if (position != uncompressedBytes.Length || decompressor.ReadByte() != -1)
Extensions\SymUnmanagedExtensions.Method.cs (4)
93ValidateItems(numRead, offsets.Length); 174ValidateItems(count, yieldOffsets.Length); 175ValidateItems(count, breakpointOffsets.Length); 176ValidateItems(count, breakpointMethods.Length);
Extensions\SymUnmanagedExtensions.Reader.cs (1)
196ValidateItems(actualLength, nameBuffer.Length);
Utilities\ComMemoryStream.cs (2)
63bytesToCopy = Math.Min(chunk.Length, remainingBytes); 93bytesToCopy = Math.Min(chunk.Length, remainingBytes);
Utilities\InteropUtilities.cs (6)
92Debug.Assert(buffer[buffer.Length - 1] == 0); 93return new string(buffer, 0, buffer.Length - 1); 116ValidateItems(count, result.Length); 131ValidateItems(count, result.Length); 146ValidateItems(count, result.Length); 161ValidateItems(count, result.Length);
Writer\SymUnmanagedSequencePointsWriter.cs (2)
38if (length > _offsets.Length) 40int newLength = Math.Max(length, (_offsets.Length + 1) * 2);
Writer\SymUnmanagedWriterImpl.cs (19)
169if (algorithmId != default && checksum.Length > 0) 173documentWriter.SetCheckSum(algorithmId, (uint)checksum.Length, checksum); 185documentWriter.SetSource((uint)source.Length, source); 209if (count < 0 || count > startLines.Length || count > startColumns.Length || count > endLines.Length || count > endColumns.Length) 378encodedLength = bytes.Length; 379value = Encoding.UTF8.GetString(bytes, 0, bytes.Length); 480if (yieldOffsets.Length != resumeOffsets.Length) 487int count = yieldOffsets.Length; 530if (metadata.Length == 0) 542symWriter.SetSymAttribute(0, "MD2", metadata.Length, pb); 586if (data.Length == 0) 597symWriter.SetSourceServerData(dataPtr, data.Length); 613if (data.Length == 0) 624symWriter.SetSourceLinkData(dataPtr, data.Length); 735Buffer.BlockCopy(data, 4, guidBytes, 0, guidBytes.Length);
Microsoft.DotNet.ApiCompat.Task (19)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RegexStringTransformer.cs (2)
31_patterns = new (Regex Regex, string ReplacementString)[rawPatterns.Length]; 32for (int i = 0; i < rawPatterns.Length; i++)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\SuppressionFileHelper.cs (1)
31if (suppressionOutputFile == null && suppressionFiles?.Length == 1)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\ValidateAssemblies.cs (9)
34if (options.LeftAssemblies.Length != options.RightAssemblies.Length) 39for (int i = 0; i < options.LeftAssemblies.Length; i++) 52List<MetadataInformation> leftAssembliesMetadataInformation = new(options.LeftAssemblies.Length); 53for (int i = 0; i < options.LeftAssemblies.Length; i++) 58List<MetadataInformation> rightAssembliesMetadataInformation = new(options.RightAssemblies.Length); 59for (int i = 0; i < options.RightAssemblies.Length; i++) 92if (assemblyReferences == null || assemblyReferences.Length == 0) 95if (assemblyReferences.Length > counter)
ValidateAssembliesTask.cs (5)
179if (assembliesReferences == null || assembliesReferences.Length == 0) 182string[][] assembliesReferencesArray = new string[assembliesReferences.Length][]; 183for (int i = 0; i < assembliesReferences.Length; i++) 198var patterns = new (string CaptureGroupPattern, string ReplacementPattern)[transformationPatterns.Length]; 199for (int i = 0; i < transformationPatterns.Length; i++)
ValidatePackageTask.cs (2)
173if (packageAssemblyReferences is null || packageAssemblyReferences.Length == 0) 176Dictionary<NuGetFramework, IEnumerable<string>> packageAssemblyReferencesDict = new(packageAssemblyReferences.Length);
Microsoft.DotNet.ApiCompatibility (18)
Mapping\AssemblyMapper.cs (2)
36for (int i = 0; i < Right.Length; i++) 89mapper = new NamespaceMapper(RuleRunner, Settings, Right.Length, this, typeForwardsOnly: typeForwardsOnly);
Mapping\AssemblySetMapper.cs (2)
32for (int i = 0; i < Right.Length; i++) 49mapper = new AssemblyMapper(RuleRunner, Settings, Right.Length, this);
Mapping\ElementMapper.cs (2)
56if ((uint)setIndex >= Right.Length) 57throw new ArgumentOutOfRangeException(nameof(setIndex), string.Format(Resources.IndexShouldBeWithinSetSizeRange, nameof(Right), Right.Length - 1));
Mapping\MemberMapper.cs (1)
27ContainingType.Right.Length == 1 || ContainingType.Right[rightIndex] != null;
Mapping\NamespaceMapper.cs (2)
56for (int i = 0; i < Right.Length; i++) 96mapper = new TypeMapper(RuleRunner, Settings, Right.Length, this, null);
Mapping\TypeMapper.cs (7)
45return ContainingType.Right.Length == 1 || ContainingType.Right[rightIndex] != null; 59if (Right.Length == 1 && Right[0] == null) 62for (int i = 0; i < Right.Length; i++) 82for (int i = 0; i < Right.Length; i++) 101mapper = new TypeMapper(RuleRunner, Settings, Right.Length, ContainingNamespace, this); 121for (int i = 0; i < Right.Length; i++) 144mapper = new MemberMapper(RuleRunner, Settings, Right.Length, this);
Rules\RuleRunner.cs (1)
26int rightLength = mapper.Right.Length;
Runner\ApiCompatRunner.cs (1)
104resolvedExternallyProvidedAssemblyReferences = aggregatedReferences.Length > 0;
Microsoft.DotNet.ApiSymbolExtensions (5)
AssemblySymbolLoader.cs (4)
72if (assembliesPaths.Length == 0) 78bool atLeastOneReferencePath = assemblyReferencesPaths?.Length > 0; 217IAssemblySymbol?[] assemblySymbols = new IAssemblySymbol[metadataReferences.Length]; 218for (int i = 0; i < metadataReferences.Length; i++)
Filtering\SymbolFilterFactory.cs (1)
34apiExclusionFilePaths?.Length > 0 ?
Microsoft.DotNet.Arcade.Sdk (5)
src\GetLicenseFilePath.cs (2)
57if (matches.Length == 0) 61else if (matches.Length > 1)
src\ValidateLicense.cs (3)
57if (normalizedActual.Length != normalizedExpected.Length) 62for (int i = 0; i < normalizedActual.Length; i++)
Microsoft.DotNet.Build.Manifest (2)
VersionIdentifier.cs (2)
56for (int i = pathSegments.Length - 1; i >= 0; i--) 225for (int i = 0; i < pathSegments.Length; i++)
Microsoft.DotNet.Build.Tasks.Feed (2)
src\PushToBuildStorage.cs (2)
200if (ItemsToPush == null || ItemsToPush.Length == 0) 495if (allowedVisibilities is null || allowedVisibilities.Length == 0)
Microsoft.DotNet.Build.Tasks.Installers (26)
src\CreateControlFile.cs (1)
65if (Depends.Length > 0)
src\CreateWixBuildWixpack.cs (12)
163if (IncludeSearchPaths == null || IncludeSearchPaths.Length == 0) 168for (int i = 0; i < IncludeSearchPaths.Length; i++) 333if (Cultures != null && Cultures.Length > 0) 342if (SuppressSpecificWarnings != null && SuppressSpecificWarnings.Length > 0) 362if (IncludeSearchPaths != null && IncludeSearchPaths.Length > 0) 389if (BindPaths != null && BindPaths.Length > 0) 422if (SourceFiles != null && SourceFiles.Length > 0) 581if (parts.Length < 2) 587if (parts.Length > 2 || parts[1].Contains('\\')) 1035for (int i = 0; i < Extensions.Length; i++) 1048for (int i = 0; i < BindPaths?.Length; i++) 1078for (int i = 0; i < LocalizationFiles?.Length; i++)
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\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}: " +
Microsoft.DotNet.Build.Tasks.Packaging (36)
ApplyBaseLine.cs (1)
47if (PackageIndexes != null && PackageIndexes.Length > 0)
ApplyMetaPackages.cs (1)
83PackageIndex index = 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)
GeneratePackageReport.cs (1)
236if (PackageIndexes != null && PackageIndexes.Length > 0)
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)
150if (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)
36index = PackageIndexes != null && PackageIndexes.Length > 0 ? 54if (libFxs.Length > 0) 68if (refFxs.Length > 0)
SplitReferences.cs (2)
50if (References == null || References.Length == 0) 53PackageIndex index = PackageIndexes != null && PackageIndexes.Length > 0 ?
ValidatePackage.cs (1)
373if (PackageIndexes == null || PackageIndexes.Length == 0)
ValidationTask.cs (1)
149_index = PackageIndexes != null && PackageIndexes.Length > 0 ?
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.Templating (4)
GenerateFileFromTemplate.cs (4)
106if (!fileInfo.Exists || fileInfo.Length != expectedBytes.Length) 115while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) > 0) 118if (offset + bytesRead > expectedBytes.Length) 135return offset == expectedBytes.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.Cli.Definitions (8)
Common\CommonOptions.cs (1)
97var argsToReturn = new List<string>(targets is null ? 0 : 1 + (additionalProperties?.Length ?? 0));
Help\HelpBuilder.cs (3)
249if (defaultArguments.Length == 0) 254var isSingleArgument = defaultArguments.Length == 1; 453if (subcommands.Length > 0)
Help\HelpBuilder.Default.cs (1)
139if (commandArguments.Length > 0)
Help\LocalizationResources.cs (1)
102if (formatArguments.Length > 0)
src\sdk\src\Common\WorkloadSetVersion.cs (2)
11if (sections.Length < 1) 21int coreComponentsLength = SeparateCoreComponents(workloadSetVersion, out _).Length;
Microsoft.DotNet.Cli.Utils (19)
BlockingMemoryStream.cs (2)
32if (!_buffers.TryTake(out byte[]? tmp, Timeout.Infinite) || tmp.Length == 0) 36_remaining = new ArraySegment<byte>(tmp, 0, tmp.Length);
DebugHelper.cs (1)
13if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
FrameworkDependencyFile.cs (2)
72if (runtimeFallbacksCandidates.Length == 0 && !string.IsNullOrEmpty(alternativeCurrentRuntimeIdentifier)) 77if (runtimeFallbacksCandidates.Length == 0)
MSBuildArgs.cs (3)
183if (additionalArgs is null || additionalArgs.Length == 0) 389{ RequestedTargets: null or { Length: 0 } } => GetTargetResult, 390{ GetTargetResult: null or { Length: 0 } } => RequestedTargets,
PathUtility.cs (2)
177var len1 = path1Segments.Length - 1; 178var len2 = path2Segments.Length;
ToolCommandName.cs (2)
54var toolCommandNames = new ToolCommandName[toolCommandNameStringArray.Length]; 55for (int i = 0; i < toolCommandNameStringArray.Length; i++)
Uuid.cs (7)
26var streamToHash = new byte[namespaceBytes.Length + nameBytes.Length]; 28Array.Copy(namespaceBytes, streamToHash, namespaceBytes.Length); 29Array.Copy(nameBytes, 0, streamToHash, namespaceBytes.Length, nameBytes.Length); 32Debug.Assert(hashResult.Length >= 16); 36Array.Copy(hashResult, res, res.Length);
Microsoft.DotNet.CMake.Sdk (2)
src\GetCMakeArtifactsFromFileApi.cs (2)
58if (indexFiles.Length == 0) 203Log.LogMessage(LogImportance.Normal, "Found {0} artifact(s) for source directory '{1}' in configuration '{2}'", Artifacts.Length, SourceDirectory, Configuration);
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.HotReload.Utils.Generator.Frontend (1)
Frontend.cs (1)
54for (int i = 0; i < args.Length; i++) {
Microsoft.DotNet.HotReload.Utils.Generator.Tasks (4)
HotReloadDeltaGeneratorComputeScriptOutputs.cs (4)
77DeltaOutputs = ComputeOutputs (baseAssemblyName, json.Changes.Length); 91int itemsPerRev = outputTypes.Length; 120var count = changes.Length; 121ITaskItem[] result = new TaskItem[changes.Length];
Microsoft.DotNet.HotReload.Watch (22)
Build\ProjectBuildManager.cs (1)
60var buildTasks = new List<Task<BuildResult?>>(buildRequests.Length);
HotReload\HotReloadDotNetWatcher.cs (1)
1204var devices = new List<DeviceInfo>(targetResult.Items.Length);
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (2)
315return authTokens.Length == 2 && 383response.ContentLength = errorResponse.Length;
src\sdk\src\Dotnet.Watch\AspireService\Models\RunSessionRequest.cs (2)
68Debug.Assert(LaunchConfigurations.Length == 1, $"Unexpected number of launch configurations {LaunchConfigurations.Length}");
src\sdk\src\Dotnet.Watch\HotReloadAgent.PipeRpc\StreamExtensions.cs (5)
60await stream.WriteAsync(value.Length, cancellationToken); 66var size = sizeof(int) * (value.Length + 1); 70BinaryPrimitives.WriteInt32LittleEndian(buffer, value.Length); 71for (int i = 0; i < value.Length; i++) 87await stream.Write7BitEncodedIntAsync(bytes.Length, cancellationToken);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\SharedSecretProvider.cs (8)
63EncodeLength(innerWriter, rsaEncryptionOid.Length); 92for (var i = 0; i < base64.Length; i += 64) 94outputStream.Write(base64, i, Math.Min(64, base64.Length - i)); 129for (var i = 0; i < value.Length; i++) 134if (value.Length - prefixZeros == 0) 144EncodeLength(stream, value.Length - prefixZeros + 1); 149EncodeLength(stream, value.Length - prefixZeros); 151for (var i = prefixZeros; i < value.Length; i++)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAssetsManifest.cs (2)
137for (var i = 0; i < validContentRoots.Length; i++) 203if (index < 0 || index >= validContentRoots.Length)
UI\IReporter.cs (1)
303: typeof(TArgs).IsAssignableTo(typeof(ITuple)) ? typeof(TArgs).GenericTypeArguments.Length
Microsoft.DotNet.HotReload.WebAssembly.Browser (6)
_generated\3\WebAssemblyHotReloadJsonSerializerContext.DeltaArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\5\WebAssemblyHotReloadJsonSerializerContext.LogEntryArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\7\WebAssemblyHotReloadJsonSerializerContext.Int32Array.g.cs (1)
57for (int i = 0; i < value.Length; i++)
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (1)
134if (update.MetadataDelta.Length == 0)
src\sdk\src\Dotnet.Watch\HotReloadAgent\MetadataUpdateHandlerInvoker.cs (1)
320var sortedAssemblies = new List<Assembly>(assemblies.Length);
WebAssemblyHotReload.cs (1)
110agent.Reporter.Report($"Reapplying update {i}/{updates.Length}.", AgentMessageSeverity.Verbose);
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
DependencyInjectionValidation.cs (2)
98.OrderBy(c => c.GetParameters().Length) 101if (constructors.Length == 0)
Microsoft.DotNet.InternalAbstractions (2)
DirectoryPath.cs (2)
26string[] insertValueInFront = new string[paths.Length + 1]; 28Array.Copy(paths, 0, insertValueInFront, 1, paths.Length);
Microsoft.DotNet.NuGetRepack.Tasks (2)
src\ReplacePackageParts.cs (2)
75int partCount = Parts?.Length ?? 0; 77if (partCount != (ReplacementFiles?.Length ?? 0))
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.ProjectTools (9)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (5)
133var name = parts.Length > 0 ? parts[0] : ""; 134var value = parts.Length > 1 ? parts[1] : ""; 135Debug.Assert(!(parts.Length > 2)); 839var builder = ImmutableArray.CreateBuilder<(string Extension, string ItemType)>(pairs.Length); 845if (parts.Length != 2)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\ProjectLocator.cs (2)
38if (files.Length == 0) 44if (files.Length > 1)
VirtualProjectBuilder.cs (2)
730processedDirectives += includeOrExcludeDirectives.Length; 732else if (includeOrExcludeDirectives.Length > 0)
Microsoft.DotNet.SdkResolver (1)
NETCoreSdkResolver.cs (1)
99for (int i = availableSdks.Length - 1; i >= 0; i--)
Microsoft.DotNet.SharedFramework.Sdk (12)
src\arcade\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\arcade\src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
38if (Sources == null || Sources.Length == 0) 127if (IgnoredTypes == null || IgnoredTypes.Length == 0) return;
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\ValidateFileVersions.cs (1)
85$"Missing FileVersion in {versionlessFiles.Length} shared framework files:" +
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\WriteUsageReports.cs (1)
98if (segments.Length > 2 &&
Microsoft.DotNet.StrongName (7)
Signing.cs (2)
230peStream.Write(peBuffer, 0, peBuffer.Length); 366Array.Copy(hash, hash.Length - 8, token, 0, 8);
Utils.cs (5)
108for (int i = 0; i < value.Length; i++) 119if (peStream.Read(peImage, 0, peImage.Length) != peImage.Length) 129return CalculateChecksum(GetContentWithoutChecksum(peImage, peHeaders)) + (uint)peImage.Length; 264imageWithoutChecksum.WriteBytes(peImage, checksumEnd, peImage.Length - checksumEnd);
Microsoft.DotNet.TemplateLocator (12)
src\sdk\src\Common\WorkloadSetVersion.cs (2)
11if (sections.Length < 1) 21int coreComponentsLength = SeparateCoreComponents(workloadSetVersion, out _).Length;
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
314for (int b = 0; b < 4 && b < bytes.Length; b++) 369if (_manifestRoots.Length == 1)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkFeatureBand.cs (3)
26var formattedPrerelease = prereleaseComponents.Length > 1 ? 45if (coreComponents.Length == 3) 60if (sections.Length > 1)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (2)
54var readCount = stream.Read(buffer, 0, buffer.Length); 96var readCount = stream.Read(newBuffer, remaining, newBuffer.Length - remaining);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (3)
49if (parts != null && parts.Length == 1) 128string? preReleaseOrBuild = sections.Length > 1 ? sections[1] : null; 136if (coreComponents.Length == 3)
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.Extensions.AI (7)
ChatCompletion\DistributedCachingChatClient.cs (1)
140int length = FixedValuesCount + additionalValues.Length + clientValues.Length;
ChatCompletion\FunctionInvokingChatClient.cs (3)
580if (approvalRequiredFunctions is not { Length: > 0 }) 590Debug.Assert(approvalRequiredFunctions is { Length: > 0 }, "Expected to have approval requiring functions to check against function call contents."); 1212if (allExceptionsArray.Length == 1)
ChatCompletion\ImageGeneratingChatClient.cs (1)
300var result = CopyList(existingTools, toOffsetExclusive, tools.Length);
Embeddings\DistributedCachingEmbeddingGenerator.cs (1)
116int length = FixedValuesCount + clientValues.Length + values.Length;
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Microsoft.Extensions.AI.Abstractions (16)
Embeddings\EmbeddingGeneratorExtensions.cs (1)
200for (int i = 0; i < results.Length; i++)
Functions\AIFunctionFactory.cs (11)
582object?[] args = paramMarshallers.Length != 0 ? new object?[paramMarshallers.Length] : []; 584for (int i = 0; i < args.Length; i++) 648if (parameters.Length != 0 && key.GetBindParameterOptions is not null) 650boundParameters = new(parameters.Length); 651for (int i = 0; i < parameters.Length; i++) 689ParameterMarshallers = parameters.Length > 0 ? new Func<AIFunctionArguments, CancellationToken, object?>[parameters.Length] : []; 690for (int i = 0; i < parameters.Length; i++) 1324if (requiredCapacity <= _buffer.Length) 1329int newCapacity = Math.Max(requiredCapacity, _buffer.Length * 2);
src\LegacySupport\FilePolyfills\FilePolyfills.cs (1)
63segment.Count == segment.Array!.Length)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
Utilities\AIJsonUtilities.Schema.Create.cs (2)
564if (property.AttributeProvider?.GetCustomAttributes(typeof(RequiredAttribute), inherit: true) is { Length: > 0 } || 565property.AssociatedParameter?.AttributeProvider?.GetCustomAttributes(typeof(RequiredAttribute), inherit: true) is { Length: > 0 })
Microsoft.Extensions.AI.Abstractions.Tests (9)
ChatCompletion\ChatResponseTests.cs (2)
141Assert.Equal(2, updates.Length); 183Assert.Equal(3, updates.Length);
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (3)
675Assert.Equal(expected.Count, contents.Length); 961Assert.Equal(2, imageResults.Length); 1002Assert.Equal(3, imageResults.Length);
Contents\UserInputResponseContentTests.cs (1)
50Assert.Equal(contents.Length, deserializedContents.Length);
Embeddings\EmbeddingGeneratorExtensionsTests.cs (1)
121Assert.Equal(count, results.Length);
SpeechToText\SpeechToTextResponseUpdateExtensionsTests.cs (1)
127Assert.Equal(expected.Count, contents.Length);
Utilities\AIJsonUtilitiesTests.cs (1)
371Assert.Equal(parameters.Length, schemaParameters.GetPropertyCount());
Microsoft.Extensions.AI.Evaluation.NLP (22)
Common\BLEUAlgorithm.cs (10)
30int refLength = reference.Length; 65if (references.Length == 0 || hypothesis.Length == 0) 142if (references == null || references.Length == 0) 147if (hypothesis == null || hypothesis.Length == 0) 157if (weights.Length == 0) 162var precisionValues = new RationalNumber[weights.Length]; 163for (int i = 0; i < weights.Length; i++) 177int hypLen = hypothesis.Length; 189for (int i = 0; i < weights.Length; i++)
Common\F1Algorithm.cs (4)
17if (groundTruth == null || groundTruth.Length == 0) 22if (response == null || response.Length == 0) 38double precision = (double)numCommonTokens / response.Length; 39double recall = (double)numCommonTokens / groundTruth.Length;
Common\GLEUAlgorithm.cs (2)
18if (references == null || references.Length == 0) 23if (hypothesis == null || hypothesis.Length == 0)
Common\NGram.cs (2)
27_ = Throw.IfLessThan(values.Length, 1, nameof(values)); 32public int Length => Values.Length;
Common\SmoothingFunction.cs (4)
24double[] smoothed = new double[precisions.Length]; 25for (int i = 0; i < precisions.Length; i++) 54double[] smoothed = new double[precisions.Length]; 57for (int i = 0; i < precisions.Length; i++)
Microsoft.Extensions.AI.Evaluation.NLP.Tests (7)
BLEUAlgorithmTests.cs (7)
57Assert.Equal(num_denom.Length, vals.Length * 2); 59RationalNumber[] prec = new RationalNumber[vals.Length]; 60for (int i = 0; i < num_denom.Length - 1; i += 2) 67Assert.Equal(vals.Length, smoothed.Length); 69for (int i = 0; i < vals.Length; i++)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (5)
ResultStoreTester.cs (5)
88Assert.Equal(6, results.Length); 144Assert.Equal(9, results.Length); 197Assert.Equal(3, results.Length); 232Assert.Equal(3, results.Length); 267Assert.Equal(5, results.Length);
Microsoft.Extensions.AI.Integration.Tests (5)
ChatClientIntegrationTests.cs (1)
991Assert.Equal(2, response.Result.Length);
ImageGeneratingChatClientIntegrationTests.cs (2)
418var imageData = new byte[_testImageData.Length + 4]; 420BitConverter.GetBytes(++ImageCounter).CopyTo(imageData, _testImageData.Length);
ToolReductionTests.cs (2)
527private static int VectorLength => _keywords.Length + 1; 545for (int i = 0; i < _keywords.Length; i++)
Microsoft.Extensions.AI.OpenAI (2)
MicrosoftExtensionsAIChatExtensions.cs (1)
110if (citation.AnnotatedRegions?.OfType<TextSpanAnnotatedRegion>().ToArray() is { Length: > 0 } regions)
OpenAIAssistantsChatClient.cs (1)
593runAndCallIDs.Length != 2 ||
Microsoft.Extensions.AI.OpenAI.Tests (8)
OpenAIConversionTests.cs (8)
663Assert.Equal(6, convertedMessages.Length); 671Assert.Equal(5, convertedMessages.Length); 727Assert.Equal(6, convertedItems.Length); 784Assert.Equal(7, items.Length); 907Assert.Equal(4, convertedMessages.Length); 1573Assert.Equal(3, messageItems.Length); 1606Assert.Equal(4, outputItems.Length); 1637Assert.Equal(3, outputItems.Length);
Microsoft.Extensions.AI.Tests (4)
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
81while (i < expectedUpdates.Length)
ChatCompletion\ReducingChatClientTests.cs (2)
79Assert.Equal(expectedUpdates.Length, updates.Count); 80for (int i = 0; i < expectedUpdates.Length; i++)
SpeechToText\ConfigureOptionsSpeechToTextClientTests.cs (1)
84while (i < expectedUpdates.Length)
Microsoft.Extensions.AsyncState.Tests (1)
AsyncContextTests.cs (1)
253for (int i = 0; i < tasks.Length; i++)
Microsoft.Extensions.Caching.Abstractions (2)
DistributedCacheExtensions.cs (2)
123return Encoding.UTF8.GetString(data, 0, data.Length); 140return Encoding.UTF8.GetString(data, 0, data.Length);
Microsoft.Extensions.Caching.Hybrid (21)
Internal\BufferChunk.cs (2)
33_lengthAndPoolFlag = array!.Length; 42Debug.Assert(Length == array.Length, "array length not respected");
Internal\DefaultHybridCache.L2.cs (3)
89if (buffer.Offset != 0 || arr.Length != buffer.Length) 239if (payload.Length > MaximumPayloadBytes) 241ThrowPayloadLengthExceeded(payload.Length);
Internal\DefaultJsonSerializerFactory.cs (2)
98if (props.Length != 0) 114var haveFields = type.GetFields(BindingFlags.Public | BindingFlags.Instance).Length != 0;
Internal\HybridCachePayload.cs (3)
276if (pendingTagsCount == pendingTagBuffer.Length) 344if (scratch.Length < maxChars) 361charCount = Encoding.GetChars(bPtr, length, cPtr, scratch.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"); 165int currentLength = _buffer.Length; 195if (oldArray.Length != 0)
Internal\TagSet.cs (4)
35Debug.Assert(tags is { Length: > 1 }, "should be non-trivial array"); 69string[] arr => arr.Length, 142if (count == oversized.Length) 155if (count == oversized.Length)
Microsoft.Extensions.Caching.Hybrid.Tests (17)
DistributedCacheTests.cs (5)
291payload = new(arr, 5, arr.Length - 10); 339Assert.Equal(size, segment.Array.Length); 347Assert.NotEqual(size, segment.Array.Length); 360Memory = new(arr, 5, arr.Length - 10); 378public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
LogCollector.cs (4)
42if (_items.Count == expectedErrorIds.Length) 45for (int i = 0; i < expectedErrorIds.Length; i++) 62if (_items.Count > expectedErrorIds.Length) 79if (errorIds.Length == _items.Count)
PayloadTests.cs (8)
48var maxLen = HybridCachePayload.GetMaxBytes(key, tags, bytes.Length); 78var maxLen = HybridCachePayload.GetMaxBytes(key, tags, bytes.Length); 112var maxLen = HybridCachePayload.GetMaxBytes(key, tags, bytes.Length); 142var maxLen = HybridCachePayload.GetMaxBytes(key, tags, bytes.Length); 178var maxLen = HybridCachePayload.GetMaxBytes(key, tags, bytes.Length); 232var maxLen = HybridCachePayload.GetMaxBytes(key, tags, bytes.Length); 259var maxLen = HybridCachePayload.GetMaxBytes(key, tags, bytes.Length) + 1; 345var maxLen = HybridCachePayload.GetMaxBytes(key, writeTags, bytes.Length);
Microsoft.Extensions.Caching.Memory (1)
MemoryDistributedCache.cs (1)
83entry.Size = value.Length;
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 (15)
ConfigurationBinder.cs (15)
282property.GetMethod.GetParameters().Length > 0) 297property.GetMethod.GetParameters().Length > 0) 367if (type == typeof(byte[]) && bindingPoint.Value is byte[] byteArray && byteArray.Length > 0) 369if (convertedValue is byte[] convertedByteArray && convertedByteArray.Length > 0) 371Array a = Array.CreateInstance(type.GetElementType()!, byteArray.Length + convertedByteArray.Length); 372Array.Copy(byteArray, a, byteArray.Length); 373Array.Copy(convertedByteArray, 0, a, byteArray.Length, convertedByteArray.Length); 569type.IsValueType || constructors.Any(ctor => ctor.GetParameters().Length == 0); 571if (!type.IsValueType && constructors.Length == 0) 576if (constructors.Length > 1 && !hasParameterlessConstructor) 581if (constructors.Length == 1 && !hasParameterlessConstructor) 599object?[] parameterValues = new object?[parameters.Length]; 601for (int index = 0; index < parameters.Length; index++)
Microsoft.Extensions.DataIngestion (9)
Chunkers\SemanticSimilarityChunker.cs (2)
136float i = (_thresholdPercentile / 100f) * (sorted.Length - 1); 138int i1 = Math.Min(i0 + 1, sorted.Length - 1);
Processors\ImageAlternativeTextEnricher.cs (3)
102if (response.Result.Length == contents.Count) 104for (int i = 0; i < response.Result.Length; i++) 111_logger?.UnexpectedResultsCount(response.Result.Length, contents.Count);
Utils\Batching.cs (4)
30List<AIContent> contents = new(batch.Length); 44if (response.Result.Length == contents.Count) 46for (int i = 0; i < response.Result.Length; i++) 53logger?.UnexpectedResultsCount(response.Result.Length, contents.Count);
Microsoft.Extensions.DataIngestion.Tests (11)
Chunkers\NoOverlapTokenChunkerTests.cs (2)
35Assert.True(chunks[0].Content.Split(' ').Length <= 512); 36Assert.True(chunks[1].Content.Split(' ').Length <= 512);
Chunkers\SectionChunkerTests.cs (2)
158Assert.True(chunks[0].Content.Split(' ').Length <= 512); 159Assert.True(chunks[1].Content.Split(' ').Length <= 512);
Processors\AlternativeTextEnricherTests.cs (2)
47Assert.Equal(2, materializedMessages.Length); 134Assert.Equal(2, materializedMessages.Length);
Processors\ClassificationEnricherTests.cs (1)
77Assert.Equal(2, materializedMessages.Length);
Processors\KeywordEnricherTests.cs (1)
77Assert.Equal(2, materializedMessages.Length);
Processors\SentimentEnricherTests.cs (1)
61Assert.Equal(2, materializedMessages.Length);
Processors\SummaryEnricherTests.cs (1)
61Assert.Equal(2, materializedMessages.Length);
Readers\MarkdownReaderTests.cs (1)
133Assert.Equal(3, images.Length);
Microsoft.Extensions.DependencyInjection (35)
CallSiteJsonFormatter.cs (3)
32if (constructorCallSite.ParameterCallSites.Length > 0) 87argument.WriteProperty("size", enumerableCallSite.ServiceCallSites.Length); 89if (enumerableCallSite.ServiceCallSites.Length > 0)
ServiceLookup\CallSiteFactory.cs (17)
59if (serviceTypeGenericArguments.Length != implementationTypeGenericArguments.Length) 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 107for (int i = 0; i < serviceTypeGenericArguments.Length; i++) 321for (int i = _descriptors.Length - 1; i >= 0; i--) 338for (int i = _descriptors.Length - 1; i >= 0; i--) 368for (var i = 0; i < callSites.Length; ++i) 390keyedSlotAssignment = new Dictionary<ServiceIdentifier, int>(capacity: _descriptors.Length) 583if (constructors.Length == 0) 587else if (constructors.Length == 1) 591if (parameters.Length == 0) 607(a, b) => b.GetParameters().Length.CompareTo(a.GetParameters().Length)); 611for (int i = 0; i < constructors.Length; i++) 684var parameterCallSites = new ServiceCallSite[parameters.Length]; 686for (int index = 0; index < parameters.Length; index++)
ServiceLookup\CallSiteRuntimeResolver.cs (5)
51if (constructorCallSite.ParameterCallSites.Length == 0) 57parameterValues = new object?[constructorCallSite.ParameterCallSites.Length]; 58for (int index = 0; index < parameterValues.Length; index++) 190enumerableCallSite.ServiceCallSites.Length); 192for (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)
298string debugText = $"ServiceDescriptors = {RootProvider.CallSiteFactory.Descriptors.Length}";
src\runtime\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)
97for (int i = 0; i < constructors.Length; i++) 103for (int j = i + 1; j < constructors.Length; j++) 111InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 127for (int i = 0; i < constructors.Length; i++) 131InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 175if (parameters.Length == 0) 181argumentTypes = new Type[parameters.Length]; 182for (int i = 0; i < argumentTypes.Length; i++) 191InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 200for (int i = 0; i < constructors.Length; i++) 202max = int.Max(max, constructors[i].Parameters.Length); 257ConstructorInfoEx[]? value = new ConstructorInfoEx[constructors.Length]; 258for (int i = 0; i < constructors.Length; i++) 404var constructorArguments = new Expression[constructorParameters.Length]; 406for (int i = 0; i < constructorParameters.Length; i++) 454if (constructorParameters.Length == 0) 461bool useFixedValues = constructorParameters.Length <= FixedArgumentThreshold; 465for (int i = 0; i < constructorParameters.Length; i++) 494if (matchedArgCount == constructorParameters.Length) 523FactoryParameterContext[] parameters = new FactoryParameterContext[constructorParameters.Length]; 524for (int i = 0; i < constructorParameters.Length; i++) 584for (int i = 0; i < constructorExs.Length; i++) 686parameterMap = new int?[constructorParameters.Length]; 688for (int i = 0; i < argumentTypes.Length; i++) 693for (int j = 0; j < constructorParameters.Length; j++) 742for (int i = 0; i < Parameters.Length; i++) 749_parameterKeys ??= new object?[Parameters.Length]; 816for (int givenIndex = 0; givenIndex < givenParameters.Length; givenIndex++) 821for (int applyIndex = 0; applyIndex < _constructor.Parameters.Length; applyIndex++) 839for (int i = 0; i < _constructor.Parameters.Length; i++) 855return _constructor.Parameters.Length; 860for (int index = 0; index < _constructor.Parameters.Length; index++) 884return _constructor.Invoker.Invoke(_parameterValues.Slice(0, _constructor.Parameters.Length)); 901for (int i = 0; i < _constructor.Parameters.Length; i++) 928Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 933switch (parameters.Length) 969object?[] arguments = new object?[parameters.Length]; 970for (int i = 0; i < parameters.Length; i++) 985Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 992switch (parameters.Length) 1122object?[] constructorArguments = new object?[parameters.Length]; 1123for (int i = 0; i < parameters.Length; i++)
ServiceDescriptor.cs (2)
324Debug.Assert(typeArguments.Length == 2); 343Debug.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); 804if (groupRuntimeAssemblies.Length != 0) 816if (groupNativeLibraries.Length != 0)
DependencyContextPaths.cs (1)
50string? application = files != null && files.Length > 0 ? files[0] : null;
Resolution\PackageCompilationAssemblyResolver.cs (1)
73if (_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\runtime\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.ResourceMonitoring (15)
CircularBuffer.cs (3)
23for (var i = 0; i < _elements.Length; i++) 40firstElementCursor += _elements.Length; 48var cursor = (_bufferCursor + 1) % _elements.Length;
Linux\Disk\DiskStatsReader.cs (4)
69if (parts.Length < 14) 71throw new FormatException($"Not enough fields: expected at least 14, got {parts.Length}"); 94if (parts.Length >= 18) 102if (parts.Length >= 20)
Linux\Disk\LinuxSystemDiskMetrics.cs (1)
148if (_diskStatsSnapshot.Length == 0 || (now - _lastRefreshTime).TotalSeconds > MinimumDiskStatsRefreshIntervalInSeconds)
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;
Windows\Disk\WindowsDiskMetrics.cs (1)
82if (instanceNames.Length == 0)
Windows\PerformanceCounterFactory.cs (1)
19return instanceNames == null || instanceNames.Length == 0 ? [] : instanceNames;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (6)
ResourceMonitoringServiceTests.cs (5)
62Assert.Equal(2, publishers.Length); 155Assert.Equal(2, publishers.Length); 478for (int i = 0; i < snapshotsSequence.Length; i++) 499Assert.Equal(0, cpuValuesWithHighSpikes[cpuValuesWithHighSpikes.Length - 1]); 585for (int i = 0; i < snapshotsSequence.Length; i++)
Windows\FakePerformanceCounter.cs (1)
21if (_index >= values.Length)
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.DotNetDeltaApplier (7)
src\sdk\src\Dotnet.Watch\HotReloadAgent.PipeRpc\StreamExtensions.cs (5)
60await stream.WriteAsync(value.Length, cancellationToken); 66var size = sizeof(int) * (value.Length + 1); 70BinaryPrimitives.WriteInt32LittleEndian(buffer, value.Length); 71for (int i = 0; i < value.Length; i++) 87await stream.Write7BitEncodedIntAsync(bytes.Length, cancellationToken);
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (1)
134if (update.MetadataDelta.Length == 0)
src\sdk\src\Dotnet.Watch\HotReloadAgent\MetadataUpdateHandlerInvoker.cs (1)
320var sortedAssemblies = new List<Assembly>(assemblies.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.Hosting (1)
HostingHostBuilderExtensions.cs (1)
276if (args is { Length: > 0 })
Microsoft.Extensions.Http (3)
DefaultHttpClientFactory.cs (1)
151for (int i = _filters.Length - 1; i >= 0; i--)
src\runtime\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 (4)
Latency\Internal\HttpRequestLatencyListenerTest.cs (4)
144for (int i = 0; i < events.Length; i++) 167int numHttpEvents = httpEvents.Length; 180int numSocketEvents = socketEvents.Length; 193int numDnsEvents = dnsEvents.Length;
Microsoft.Extensions.Http.Resilience.Tests (2)
Routing\RoutingStrategyTest.cs (2)
65Assert.Equal(routes.Length, urls.Length);
Microsoft.Extensions.Identity.Core (19)
Base32.cs (2)
56for (int offset = 0; offset < input.Length;) 88while (outputIndex < output.Length)
PasswordHasher.cs (13)
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); 270int subkeyLength = hashedPassword.Length - 13 - salt.Length; 276Buffer.BlockCopy(hashedPassword, 13 + salt.Length, expectedSubkey, 0, expectedSubkey.Length);
Rfc6238AuthenticationService.cs (2)
72var combined = new byte[checked(input.Length + modifierBytes.Length)]; 74Buffer.BlockCopy(modifierBytes, 0, combined, input.Length, modifierBytes.Length);
src\aspnetcore\artifacts\obj\Microsoft.Extensions.Identity.Core\Release\net11.0\Microsoft.Extensions.Identity.Core.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
UserManager.cs (1)
2519uint range = (uint)AllowedChars.Length - 1;
Microsoft.Extensions.Localization (1)
src\aspnetcore\artifacts\obj\Microsoft.Extensions.Localization\Release\net11.0\Microsoft.Extensions.Localization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.Extensions.Logging (11)
Logger.cs (9)
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++) 177for (int i = 0; i < logger.Loggers.Length; i++) 191if (messageLoggers is null || messageLoggers.Length == 0) 314int count = _disposable.Length;
LoggerFactory.cs (2)
187int newLoggerIndex = loggerInformation.Length; 188Array.Resize(ref loggerInformation, loggerInformation.Length + 1);
Microsoft.Extensions.Logging.Abstractions (9)
FormattedLogValues.cs (1)
35if (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\runtime\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 (6)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
52Debug.Assert(buffer.Length > 0); 93public int AvailableLength => _bytes.Length - _availableStart; 98public int Capacity => _bytes.Length; 135if (_bytes.Length == 0) 161int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length)); 191if (_usePool && buffer.Length > 0)
Microsoft.Extensions.Logging.EventSource (3)
LoggingEventSource.cs (3)
440if (ruleStrings.Length > 0 && ruleStrings[0].Equals(UseAppFilters, StringComparison.OrdinalIgnoreCase)) 450for (int i = ruleStringsStartIndex; i < ruleStrings.Length; i++) 466if (parts.Length == 2)
Microsoft.Extensions.Logging.Generators (2)
src\runtime\src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (2)
22public int Count => _values.Length; 63if ((uint)newIndex < (uint)_values.Length)
Microsoft.Extensions.Options (1)
OptionsFactory.cs (1)
74if (_validations.Length > 0)
Microsoft.Extensions.Options.Contextual (2)
Internal\ContextualOptionsFactory.cs (2)
77var loadTasks = ArrayPool<ValueTask<IConfigureContextualOptions<TOptions>>>.Shared.Rent(_loaders.Length); 131if (_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) 793for (var i = 0; i < propertiesOrderedByKey.Length; i++) 796var 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.ServiceDiscovery (2)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
144var minIndex = _schemes.Length;
ServiceEndpointWatcher.cs (1)
318if (_providers.Length == 0)
Microsoft.Extensions.ServiceDiscovery.Dns (9)
DnsSrvServiceEndpointProvider.cs (1)
45if (record.Addresses.Length > 0)
DnsSrvServiceEndpointProviderFactory.cs (1)
113if (components.Length > 1)
FallbackDnsResolver.cs (2)
31var results = new AddressResult[addresses.Length]; 33for (int i = 0; i < addresses.Length; i++)
Resolver\DnsResolver.cs (4)
138AddressResult[] results = new AddressResult[ipv4Addresses.Length + ipv6Addresses.Length]; 140ipv4Addresses.CopyTo(results, ipv6Addresses.Length); 795if (responseLength + 2 > buffer.Length)
Resolver\ResolvConf.cs (1)
28if (tokens.Length >= 2 && IPAddress.TryParse(tokens[1], out IPAddress? address))
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (4)
Resolver\DnsDataReaderTests.cs (1)
58for (int i = 0; i < buffer.Length; i++)
Resolver\DnsDataWriterTests.cs (2)
59for (int i = 0; i < expected.Length; i++) 99for (int i = 0; i < expected.Length; i++)
Resolver\DnsPrimitivesTests.cs (1)
87Assert.Equal(serialized.Length, bytesRead);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (2)
Program.cs (2)
32if (args.Length == 0) 47string? inputFiles = args.Length > 1 ? args[1] : null;
Microsoft.Extensions.Telemetry (22)
Http\HttpRouteFormatter.cs (2)
59for (var i = 0; i < routeSegments.Segments.Length; i++) 81if (i < routeSegments.Segments.Length - 1)
Http\HttpRouteParser.cs (1)
40if (httpRouteParameters == null || httpRouteParameters.Length < paramCount)
Latency\Internal\CheckpointTracker.cs (1)
50Array.Clear(_checkpointAdded, 0, _checkpointAdded.Length);
Latency\Internal\MeasureTracker.cs (1)
48Array.Clear(_measurePosition, 0, _measurePosition.Length);
Latency\Internal\Registry.cs (2)
32int c = OrderedKeys.Length; 57public int KeyCount => OrderedKeys.Length;
Logging\ExtendedLogger.cs (8)
72if (loggers.Length == 0) 76else if (loggers.Length == 1) 81var scope = new Scope(loggers.Length); 83for (int i = 0; i < loggers.Length; i++) 107for (; i < loggers.Length; i++) 129return i < loggers.Length; 276for (int i = 0; i < loggers.Length; i++) 416for (int i = 0; i < loggers.Length; i++)
Logging\ExtendedLogger.LegacyTagJoiner.cs (2)
52int staticTagsCount = StaticTags!.Length; 81get => field + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLogger.ModernTagJoiner.cs (2)
59int staticTagsCount = StaticTags!.Length; 84public int Count => _incomingTagsCount + _redactedTagsCount + _extraTags.Count + StaticTags!.Length;
Logging\ExtendedLogger.Scope.cs (1)
52int count = _disposable.Length;
Logging\ExtendedLoggerFactory.cs (2)
181int newLoggerIndex = loggerInformation.Length; 182Array.Resize(ref loggerInformation, loggerInformation.Length + 1);
Microsoft.Extensions.Telemetry.Abstractions (4)
Logging\LoggerMessageState.cs (4)
46int avail = _tags.Length - TagsCount; 49var need = _tags.Length + (count - avail); 65int avail = _classifiedTags.Length - ClassifiedTagsCount; 68var 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)
1201var a = new KeyValuePair<string, string>[_values.Length];
Microsoft.Extensions.TimeProvider.Testing.Tests (1)
TimerTests.cs (1)
336for (int i = 0; i < triggers.Length; i++)
Microsoft.Extensions.Validation (7)
RuntimeValidatableParameterInfoResolver.cs (1)
47if (validationAttributes.Length == 0 && !IsComplexType(parameterInfo.ParameterType))
ValidatableParameterInfo.cs (1)
102for (var i = 0; i < validationAttributes.Length; i++)
ValidatablePropertyInfo.cs (1)
175for (var i = 0; i < validationAttributes.Length; i++)
ValidatableTypeInfo.cs (1)
204for (var i = 0; i < validationAttributes.Length; i++)
ValidateContext.cs (3)
94var newErrors = new string[existingErrors.Length + errors.Length]; 96errors.CopyTo(newErrors, existingErrors.Length);
Microsoft.Gen.BuildMetadata (1)
src\Generators\Shared\EmitterBase.cs (1)
26for (int i = 0; i < padding.Length; i++)
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
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.MetadataExtractor (4)
src\Generators\Microsoft.Gen.MetricsReports\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.MetadataExtractor.Unit.Tests (1)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
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\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
66if (optionKeyAndValue.Length != 2 || optionKeyAndValue[1].Length < 3)
Microsoft.Interop.JavaScript.JSImportGenerator (9)
JSGeneratorFactory.cs (5)
266(KnownManagedType.Function or KnownManagedType.Action, JSTypeFlags.Function, var argTypes, var argJSTypes) when argTypes.Length != argJSTypes.Length 307for (int i = 0; i < argTypes.Length; i++) 309var isReturn = managedType == KnownManagedType.Function && i == argJSTypes.Length - 1; 316if (argsMarshallerTypes.Length > maxArgs)
Marshaling\FuncJSGenerator.cs (4)
54for (int i = 0; i < info.ArgsTypeInfo.Length; i++) 57if (!isAction && i + 1 == info.ArgsTypeInfo.Length) 75for (int i = 0; i < info.ArgsTypeInfo.Length; i++) 78if (!isAction && i + 1 == info.ArgsTypeInfo.Length)
Microsoft.Interop.LibraryImportGenerator (1)
src\runtime\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 (18)
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."); 473if (parameters.Length == 0) 478var parameterTypes = new Type[parameters.Length]; 479for (var i = 0; i < parameters.Length; i++)
JSInProcessRuntime.cs (1)
47var argsJson = args is not null && args.Length != 0 ? JsonSerializer.Serialize(args, JsonSerializerOptions) : "[]";
JSRuntime.cs (1)
153var argsJson = args is not null && args.Length != 0 ? JsonSerializer.Serialize(args, JsonSerializerOptions) : "[]";
src\aspnetcore\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.Maui (53)
Converters\CornerRadiusTypeConverter.cs (6)
32 if (cornerRadius.Length == 4 38 if (cornerRadius.Length > 1 39 && cornerRadius.Length < 4 46 if (cornerRadius.Length == 2 50 if (cornerRadius.Length == 3 55 if (cornerRadius.Length == 4
Converters\EasingTypeConverter.cs (1)
30 if (parts.Length == 2 && Compare(parts[0], nameof(Easing)))
Converters\KeyboardTypeConverter.cs (3)
26 if (parts != null && parts.Length == 1 || (parts != null && parts.Length == 2 && parts[0] == "Keyboard")) 30 string keyboard = parts[parts.Length - 1];
Converters\ThicknessTypeConverter.cs (2)
42 switch (thickness.Length) 61 switch (thickness.Length)
Core\Extensions\IPickerExtension.cs (1)
11 for (int i = 0; i < returnValue.Length; i++)
Extensions\ArrayExtensions.cs (8)
17 var result = new T[self.Length + 1]; 23 if (index < self.Length) 24 Array.Copy(self, index, result, index + 1, result.Length - index - 1); 50 var result = new T[self.Length - 1]; 54 if (index < self.Length - 1) 55 Array.Copy(self, index + 1, result, index, self.Length - index - 1); 66 public static T Last<T>(this T[] self) => self[self.Length - 1]; 68 internal static T? FirstOrDefaultNoLinq<T>(this T[]? items) => items is null || items.Length == 0 ? default : items[0];
Graphics\PaintExtensions.cs (1)
31 return gradientPaint is null || gradientPaint.GradientStops.Length == 0 || gradientPaint.StartColor is null || gradientPaint.EndColor is null;
Handlers\HybridWebView\HybridWebViewHandler.cs (6)
246 if (requestParams is not null && dotnetParams.Length != requestParams.Length) 248 throw new InvalidOperationException($"The number of parameters on {nameof(jsInvokeTarget)}'s method {requestMethodName} ({dotnetParams.Length}) doesn't match the number of values passed from JavaScript code ({requestParams.Length})."); 255 invokeParamValues = new object?[requestParams.Length]; 256 for (var i = 0; i < requestParams.Length; i++)
HotReload\HotReloadExtensions.cs (1)
48 var foos = type.GetMethods(flags).Where(x => x.GetCustomAttributes(typeof(OnHotReloadAttribute), true).Length > 0).ToList();
HotReload\HotReloadHelper.cs (1)
91 var newView = (IView)(parameters?.Length > 0 ? Activator.CreateInstance(newViewType, args: parameters) : Activator.CreateInstance(newViewType))!;
Layouts\Flex.cs (5)
586 if (layout.need_lines && (layout.lines?.Length ?? 0) > 0) 592 layout_align(item.AlignContent, flex_dim, (uint)(layout.lines?.Length ?? 0), ref pos, ref spacing); 601 for (uint i = 0; i < (layout.lines?.Length ?? 0); i++) 863 Array.Resize(ref layout.lines, (layout.lines?.Length ?? 0) + 1); 865 ref flex_layout.flex_layout_line line = ref layout.lines[layout.lines.Length - 1];
Layouts\GridLayoutManager.cs (15)
140 _cells = new Cell[_childrenToLayOut.Length]; 199 for (int n = 0; n < _childrenToLayOut.Length; n++) 208 var column = _grid.GetColumn(view).Clamp(0, _columns.Length - 1); 209 var columnSpan = _grid.GetColumnSpan(view).Clamp(1, _columns.Length - column); 218 var row = _grid.GetRow(view).Clamp(0, _rows.Length - 1); 219 var rowSpan = _grid.GetRowSpan(view).Clamp(1, _rows.Length - row); 252 var firstColumn = _grid.GetColumn(view).Clamp(0, _columns.Length - 1); 253 var columnSpan = _grid.GetColumnSpan(view).Clamp(1, _columns.Length - firstColumn); 256 var firstRow = _grid.GetRow(view).Clamp(0, _rows.Length - 1); 257 var rowSpan = _grid.GetRowSpan(view).Clamp(1, _rows.Length - firstRow); 341 for (int n = 0; n < definitions.Length; n++) 389 for (int n = 0; n < _cells.Length; n++) 713 for (int n = 0; n < _cells.Length; n++) 737 for (int n = 0; n < _cells.Length; n++) 863 for (int n = 0; n < definitions.Length; n++)
PropertyMapper.cs (1)
161 for (int i = chainedPropertyMappers.Length - 1; i >= 0; i--)
Services\Crc64HashAlgorithm.cs (2)
186 var result = new char[bytes.Length * 2]; 187 for (int i = 0; i < bytes.Length; i++)
Microsoft.Maui.Controls (135)
Accelerator.cs (2)
38 if (acceleratorParts.Length > 1) 41 for (int i = 0; i < acceleratorParts.Length; i++)
BindableObject.cs (3)
221 var resultArray = new (bool IsSet, T Value)[propArray.Length]; 223 for (int i = 0; i < propArray.Length; i++) 684 for (int i = 0, propLength = prop.Length; i < propLength; i++)
BindablePropertyConverter.cs (3)
37 if (parts.Length == 1) 64 if (parts.Length == 2) 88 if (parts.Length != 2)
BindingExpression.cs (4)
194 args = new object[part.Arguments.Length + 1]; 196 args[args.Length - 1] = value; 227 for (var i = 0; i < pathParts.Length; i++) 360 if (array.Length > 0)
Brush\Brush.cs (1)
25 for (int i = 0; i < gradientStopCollection.Length; i++)
Brush\BrushTypeConverter.cs (8)
75 if (parts.Length == 1 || (parts.Length == 2 && parts[0] == "Color")) 120 while (_position < _parts.Length) 214 if (!(_position < _parts.Length)) 327 if (parts.Length > gradientCenterPosition) 332 var directionX = gradientCenterPosition < parts.Length ? parts[gradientCenterPosition].Trim() : string.Empty; 335 var directionY = gradientCenterPosition < parts.Length ? parts[gradientCenterPosition].Trim() : string.Empty; 424 return result.Length > 0;
Button\Button.cs (4)
589 if (parts.Length != 1 && parts.Length != 2) 597 int positionIndex = spacingFirst ? (parts.Length == 2 ? 1 : -1) : 0; 598 int spacingIndex = spacingFirst ? 0 : (parts.Length == 2 ? 1 : -1);
ColumnDefinitionCollectionTypeConverter.cs (2)
28 var definitions = new ColumnDefinition[lengths.Length]; 29 for (var i = 0; i < lengths.Length; i++)
DecorableTextElement.cs (1)
33 if (valueArr.Length <= 1)
DependencyResolver.cs (4)
59 if (args.Length > 0) 62 if (type.GetTypeInfo().DeclaredConstructors.Any(info => info.GetParameters().Length == 2)) 68 if (type.GetTypeInfo().DeclaredConstructors.Any(info => info.GetParameters().Length == args.Length))
DependencyService.cs (1)
141 for (int i = 0; i < attributes.Length; i++)
HybridWebView\HybridWebView.cs (4)
102 if (paramValues != null && paramValues.Length != paramJsonTypeInfos!.Length) 131 if (paramValues != null && paramValues.Length != paramJsonTypeInfos!.Length)
Internals\ImageParser.cs (4)
101 Debug.Assert(toRead <= buffer.Length); 180 Debug.Assert(transparencyIndex < _colorTable.Length); 209 int toRead = _colorData.Length; 606 if (_pixels == null || _pixels.Length < pixelCount)
Layout\BoundsTypeConverter.cs (10)
30 hasX = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out x); 31 hasY = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out y); 32 hasW = xywh.Length == 4 && double.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out w); 33 hasH = xywh.Length == 4 && double.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out h); 35 if (!hasW && xywh.Length == 4 && string.Compare("AutoSize", xywh[2].Trim(), StringComparison.OrdinalIgnoreCase) == 0) 41 if (!hasH && xywh.Length == 4 && string.Compare("AutoSize", xywh[3].Trim(), StringComparison.OrdinalIgnoreCase) == 0) 47 if (hasX && hasY && xywh.Length == 2) 49 if (hasX && hasY && hasW && hasH && xywh.Length == 4)
LayoutOptionsConverter.cs (3)
29 if (parts.Length > 2 || (parts.Length == 2 && parts[0] != "LayoutOptions")) 31 strValue = parts[parts.Length - 1];
LegacyLayouts\Layout.cs (2)
437 for (var index = 0; index < oldBounds.Length; index++) 474 for (var i = 0; i < oldBounds.Length; i++)
LegacyLayouts\StackLayout.cs (3)
108 for (var i = 0; i < layout.Plots?.Length; i++) 244 for (var i = 0; i < layout.Plots.Length; i++) 316 for (var i = 0; i < layout.Plots.Length; i++)
MessagingCenter.cs (2)
87 MethodInfo.Invoke(null, MethodInfo.GetParameters().Length == 1 ? new[] { sender } : new[] { sender, args }); 98 MethodInfo.Invoke(target, MethodInfo.GetParameters().Length == 1 ? new[] { sender } : new[] { sender, args });
MultiBinding.cs (6)
121 for (var i = 0; i < Math.Min(_bpProxies.Length, values.Length); i++) 192 var valuearray = new object[_bpProxies.Length]; 193 for (var i = 0; i < _bpProxies.Length; i++) 218 var types = new Type[_bpProxies.Length]; 219 for (var i = 0; i < _bpProxies.Length; i++)
NavigationStepRequest.cs (2)
88 var pages = new Page[array.Length]; 90 for (var i = 0; i < array.Length; i++)
ObservableList.cs (3)
100 if (startIndex < 0 || startIndex + ritems.Length > Count) 103 var oldItems = new T[ritems.Length]; 104 for (var i = 0; i < ritems.Length; i++)
ObservableWrapper.cs (1)
60 if (array.Length - destIndex < Count)
OrderedDictionary.cs (3)
128 if (Count > array.Length - arrayIndex) 395 if (Count > array.Length - arrayIndex) 397 if (arrayIndex < 0 || arrayIndex > array.Length)
ReadOnlyCastingList.cs (1)
100 for (int i = arrayIndex; i < array.Length; i++)
Region.cs (1)
40 var endLine = lineHeights.Length - 1;
Registrar.cs (11)
68 for (int i = 0; i < supportedVisuals.Length; i++) 120 if (args.Length == 0) 260 for (int i = 0; i < attribute2.SupportedVisuals.Length; i++) 332 var length = attributes.Length; 364 var stylePropertiesLength = styleAttributes?.Length ?? 0; 381 if (effectAttributes == null || effectAttributes.Length == 0) 392 var typedEffectAttributes = new ExportEffectAttribute[effectAttributes.Length]; 393 Array.Copy(effectAttributes, typedEffectAttributes, effectAttributes.Length); 401 var exportEffectsLength = effectAttributes.Length; 478 if (attributes == null || attributes.Length == 0) 481 var length = attributes.Length;
ResourceDictionary.cs (1)
379 if (values == null || values.Length == 0)
RowDefinitionCollectionTypeConverter.cs (2)
28 var definitions = new RowDefinition[lengths.Length]; 29 for (var i = 0; i < lengths.Length; i++)
SetterSpecificityList.cs (1)
136 if (_keys.Length == count)
Shapes\Matrix.cs (1)
217 for (int i = 0; i < points.Length; i++)
Shapes\MatrixTypeConverter.cs (1)
27 if (strs.Length != 6)
Shapes\StrokeShapeTypeConverter.cs (5)
43 if (parts.Length != 2) 65 if (parts.Length != 2) 80 if (parts.Length != 2) 95 if (parts.Length != 2) 118 if (parts.Length > 1)
Shell\ShellAppearance.cs (15)
38 Color[] _colorArray = new Color[s_ingestArray.Length]; 39 Brush[] _brushArray = new Brush[s_ingestBrushArray.Length]; 40 double[] _doubleArray = new double[s_ingestDoubleArray.Length]; 94 for (int i = 0; i < _brushArray.Length; i++) 97 for (int i = 0; i < _doubleArray.Length; i++) 107 for (int i = 0; i < _colorArray.Length; i++) 113 for (int i = 0; i < _brushArray.Length; i++) 119 for (int i = 0; i < _doubleArray.Length; i++) 132 for (int i = 0; i < _colorArray.Length; i++) 135 for (int i = 0; i < _brushArray.Length; i++) 138 for (int i = 0; i < _doubleArray.Length; i++) 150 for (int i = 0; i < s_ingestArray.Length; i++) 160 for (int i = 0; i < s_ingestBrushArray.Length; i++) 170 for (int i = 0; i < s_ingestDoubleArray.Length; i++) 185 for (int i = 0; i < s_ingestArray.Length; i++)
Shell\ShellContent.cs (1)
379 if (queryPropertyAttributes.Length == 0)
Shell\ShellNavigationManager.cs (2)
421 var targetPathsLength = targetPaths.Length; 422 var currentPathsLength = currentPaths.Length;
Shell\ShellNavigationState.cs (2)
78 for (int i = 2; i < 5 && i < parts.Length; i++) 94 for (int i = 5; i < parts.Length; i++)
Shell\ShellRouteParameters.cs (1)
111 if (p.Length != 2)
Shell\ShellUriHandler.cs (4)
23 string queryString = (pathAndQueryString.Length > 1) ? $"?{pathAndQueryString[1]}" : String.Empty; 146 if (pathAndQuery.Length > 1) 448 for (var i = 0; i < currentSegments.Length; i++) 1022 if (segments.Length == 0)
StyleSheets\Selector.cs (1)
214 for (var i = 0; i < styleable.NameAndBases.Length; i++)
TemplatedItemsList.cs (2)
1052 for (var i = 0; i < itemsToMove.Length; i++) 1066 for (var i = 0; i < items.Length; i++)
TypeConversionHelper.cs (1)
150 && parameters.Length == 1
TypedBinding.cs (6)
134 _handlers = new PropertyChangedProxy[handlers.Length]; 135 for (var i = 0; i < handlers.Length; i++) 213 Tuple<Func<TSource, object>, string>[] handlers = _handlers == null ? null : new Tuple<Func<TSource, object>, string>[_handlers.Length]; 216 for (var i = 0; i < _handlers.Length; i++) 512 for (var i = 0; i < _handlers.Length; i++) 528 for (var i = 0; i < _handlers.Length; i++)
Microsoft.Maui.Controls.BindingSourceGen (5)
BindingCodeWriter.cs (4)
338 if (setter.PatternMatchingExpressions.Length > 0) 342 for (int i = 0; i < setter.PatternMatchingExpressions.Length; i++) 359 if (setter.PatternMatchingExpressions.Length > 1) 370 if (setter.PatternMatchingExpressions.Length > 0)
EquatableArray.cs (1)
32 get => array?.Length ?? 0;
Microsoft.Maui.Controls.Build.Tasks (41)
CompiledConverters\BindablePropertyConverter.cs (2)
34 if (parts.Length == 1) 60 else if (parts.Length == 2)
CompiledConverters\BoundsTypeConverter.cs (11)
25 if (xywh.Length != 2 && xywh.Length != 4) 28 hasX = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out x); 29 hasY = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out y); 30 hasW = xywh.Length == 4 && double.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out w); 31 hasH = xywh.Length == 4 && double.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out h); 33 if (!hasW && xywh.Length == 4 && string.Compare("AutoSize", xywh[2].Trim(), StringComparison.OrdinalIgnoreCase) == 0) 39 if (!hasH && xywh.Length == 4 && string.Compare("AutoSize", xywh[3].Trim(), StringComparison.OrdinalIgnoreCase) == 0) 45 if (hasX && hasY && xywh.Length == 2)
CompiledConverters\ColorTypeConverter.cs (3)
40 if (parts.Length == 1 || (parts.Length == 2 && parts[0] == "Color")) 42 var color = parts[parts.Length - 1];
CompiledConverters\ColumnDefinitionCollectionTypeConverter.cs (2)
22 yield return Create(Ldc_I4, parts.Length); 24 for (var i = 0; i < parts.Length; i++)
CompiledConverters\CornerRadiusTypeConverter.cs (1)
21 switch (cornerradius.Length)
CompiledConverters\EasingTypeConverter.cs (2)
22 if (parts.Length == 2 && parts[0] == nameof(Easing)) 23 value = parts[parts.Length - 1];
CompiledConverters\LayoutOptionsConverter.cs (3)
25 if (parts.Length == 1 || (parts.Length == 2 && parts[0] == "LayoutOptions")) 27 var options = parts[parts.Length - 1];
CompiledConverters\RectangleTypeConverter.cs (1)
22 if (xywh.Length != 4 ||
CompiledConverters\RowDefinitionCollectionTypeConverter.cs (2)
22 yield return Create(Ldc_I4, parts.Length); 24 for (var i = 0; i < parts.Length; i++)
CompiledConverters\StrokeShapeTypeConverter.cs (5)
34 if (parts.Length != 2) 86 if (parts.Length != 2) 105 if (parts.Length != 2) 133 if (parts.Length != 2) 167 if (parts.Length != 2)
CompiledConverters\ThicknessTypeConverter.cs (1)
21 switch (thickness.Length)
CompiledConverters\TypeTypeConverter.cs (2)
22 if (split.Length > 2) 26 if (split.Length == 2)
ExpandMarkupsVisitor.cs (1)
129 if (split.Length > 2)
ModuleDefinitionExtensions.cs (5)
41 if (md.Parameters.Count != (parameterTypes?.Length ?? 0)) 79 if (md.Parameters.Count != (parameterTypes?.Length ?? 0)) 93 if (md.Parameters.Count != (parameterTypes?.Length ?? 0)) 176 if (md.Parameters.Count != (parameterTypes?.Length ?? 0)) 202 if (md.Parameters.Count != (parameterTypes?.Length ?? 0))
Microsoft.Maui.Controls.DesignTools (17)
BoundsDesignTypeConverter.cs (10)
19 hasX = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[0], NumberStyles.Number, CultureInfo.InvariantCulture, out _); 20 hasY = (xywh.Length == 2 || xywh.Length == 4) && double.TryParse(xywh[1], NumberStyles.Number, CultureInfo.InvariantCulture, out _); 21 hasW = xywh.Length == 4 && double.TryParse(xywh[2], NumberStyles.Number, CultureInfo.InvariantCulture, out _); 22 hasH = xywh.Length == 4 && double.TryParse(xywh[3], NumberStyles.Number, CultureInfo.InvariantCulture, out _); 23 if (!hasW && xywh.Length == 4 && string.Compare("AutoSize", xywh[2].Trim(), StringComparison.OrdinalIgnoreCase) == 0) 28 if (!hasH && xywh.Length == 4 && string.Compare("AutoSize", xywh[3].Trim(), StringComparison.OrdinalIgnoreCase) == 0) 33 if (hasX && hasY && xywh.Length == 2) 35 if (hasX && hasY && hasW && hasH && xywh.Length == 4)
ButtonContentDesignTypeConverter.cs (3)
26 if (parts.Length > 2) 34 if (parts.Length == 2 && !Enum.TryParse(parts[1], true, out ImagePosition _)) 42 if (parts.Length == 2 && !double.TryParse(parts[1], out _))
CornerRadiusDesignTypeConverter.cs (2)
21 if (parts.Length == 4) 34 if (parts.Length < 4)
DesignTypeConverterHelper.cs (2)
17 if (parts.Length > maxCount) 25 return parts.Length; // all numbers are valid
Microsoft.Maui.Controls.Foldable (1)
DualScreenInfo.cs (1)
273 if (bounds.Length == 0)
Microsoft.Maui.Controls.SourceGen (4)
src\Controls\src\Xaml\TypeArgumentsParser.cs (2)
67 if (split.Length > 2) 71 if (split.Length == 2)
src\Core\src\Services\Crc64HashAlgorithm.cs (2)
186 var result = new char[bytes.Length * 2]; 187 for (int i = 0; i < bytes.Length; i++)
Microsoft.Maui.Controls.Xaml (22)
ApplyPropertiesVisitor.cs (8)
168 && Context.Types[parentElement].GetRuntimeMethods().Any(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) 171 Context.Types[parentElement].GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1); 216 if (xpe == null && (addMethod = collection.GetType().GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1)) != null) 483 var n_params = eventInfo.EventHandlerType.GetMethod("Invoke").GetParameters().Length; 485 .Where(mi => mi.Name == (string)value && mi.GetParameters().Length == n_params) 744 var addMethod = collection.GetType().GetRuntimeMethods().First(mi => mi.Name == "Add" && mi.GetParameters().Length == 1); 809 if (property.ReturnType.GenericTypeArguments.Length != 1 || !property.ReturnType.GenericTypeArguments[0].IsInstanceOfType(value)) 813 var addMethod = GetAllRuntimeMethods(property.ReturnType).FirstOrDefault(mi => mi.Name == "Add" && mi.GetParameters().Length == 1);
CreateValuesVisitor.cs (8)
75 ci.IsPublic && ci.GetParameters().Length != 0 && 81 else if (!type.GetTypeInfo().DeclaredConstructors.Any(ci => ci.IsPublic && ci.GetParameters().Length == 0) && 209 ci.GetParameters().Length != 0 && ci.IsPublic && 235 ci.GetParameters().Length != 0 && ci.IsPublic && 259 if (p.Length != types.Length) 263 for (var i = 0; i < p.Length; i++) 308 var n = ctorInfo.GetParameters().Length;
MarkupExpressionParser.cs (2)
238 if (split.Length > 2) 241 return split.Length == 2 ? (split[0], split[1]) : ("", split[0]);
TypeArgumentsParser.cs (2)
67 if (split.Length > 2) 71 if (split.Length == 2)
XamlServiceProvider.cs (2)
154 if (objectAndParents.Length == 0) 174 for (var i = 0; i < objectAndParents.Length; i++)
Microsoft.Maui.Graphics (34)
GradientPaint.cs (19)
21 _gradientStops = new PaintGradientStop[source.GradientStops.Length]; 23 for (var i = 0; i < _gradientStops.Length; i++) 35 if (_gradientStops == null || _gradientStops.Length == 0) 67 for (var i = 0; i < _gradientStops.Length; i++) 87 for (var i = 0; i < _gradientStops.Length; i++) 96 return index >= 0 ? index : _gradientStops.Length - 1; 118 var vStops = new PaintGradientStop[_gradientStops.Length]; 119 Array.Copy(_gradientStops, vStops, _gradientStops.Length); 127 var stopCount = Math.Min(colors.Length, offsets.Length); 144 var newStops = new PaintGradientStop[oldStops.Length + 1]; 146 for (var i = 0; i < oldStops.Length; i++) 149 newStops[oldStops.Length] = new PaintGradientStop(offset, color); 156 if (index < 0 || index >= GradientStops.Length) 162 var newStops = new PaintGradientStop[oldStops.Length - 1]; 163 for (var i = 0; i < oldStops.Length; i++) 182 if (stops.Length == 1) 192 for (var i = 0; i < stops.Length; i++) 237 if (_gradientStops == null || _gradientStops.Length < 2)
Matrix3x2Extensions.cs (1)
150 count = Math.Min(dst.Length, count);
PathBuilder.cs (2)
69 if (split.Length > 2) 133 for (int i = args.Length - 1; i >= 0; i--)
PathF.cs (4)
777 for (var i = 0; i < points.Length; i++) 790 if (points.Length > 0) 792 _points[pointIndex] = (PointF)points[points.Length - 1]; 793 for (var i = 0; i < points.Length; i++)
PlatformImage.cs (1)
63 stream.Write(_bytes, 0, _bytes.Length);
Point.cs (1)
136 if (xy.Length == 2 && double.TryParse(xy[0], NumberStyles.Number, CultureInfo.InvariantCulture, out var x)
PointF.cs (1)
135 if (xy.Length == 2 && float.TryParse(xy[0], NumberStyles.Number, CultureInfo.InvariantCulture, out var x)
Rect.cs (1)
228 if (xywh.Length == 4
RectF.cs (1)
228 if (xywh.Length == 4
Size.cs (1)
113 if (wh.Length == 2
SizeF.cs (1)
129 if (wh.Length == 2
Text\XmlAttributedTextReader.cs (1)
99 string text = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
Microsoft.Maui.Graphics.Skia (9)
SkiaCanvas.cs (6)
248 var colors = new SKColor[linearGradientPaint.GradientStops.Length]; 249 var stops = new float[colors.Length]; 253 for (var i = 0; i < vStops.Length; i++) 278 var colors = new SKColor[radialGradientPaint.GradientStops.Length]; 279 var stops = new float[colors.Length]; 283 for (var i = 0; i < vStops.Length; i++)
SkiaCanvasState.cs (3)
125 if (pattern == null || pattern.Length == 0 || strokeSize == 0) 135 var scaledPattern = new float[pattern.Length]; 136 for (var i = 0; i < pattern.Length; i++)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (5)
src\Graphics\src\Graphics\Platforms\Windows\PlatformCanvasState.cs (5)
272 if (pattern == null || pattern.Length == 0) 341 var gradientStops = new CanvasGradientStop[linearGradientPaint.GradientStops.Length]; 342 for (int i = 0; i < linearGradientPaint.GradientStops.Length; i++) 359 var gradientStops = new CanvasGradientStop[radialGradientPaint.GradientStops.Length]; 360 for (int i = 0; i < radialGradientPaint.GradientStops.Length; i++)
Microsoft.Maui.Resizetizer (14)
CreatePartialInfoPlistTask.cs (1)
40 if (CustomFonts != null && CustomFonts.Length > 0)
GeneratePackageAppxManifest.cs (5)
71 var appIconInfo = AppIcon?.Length > 0 ? ResizeImageInfo.Parse(AppIcon[0]) : null; 72 var splashInfo = SplashScreen?.Length > 0 ? ResizeImageInfo.Parse(SplashScreen[0]) : null; 358 if (parts.Length > 3 && !string.IsNullOrEmpty(version)) 360 else if (parts.Length > 4) 364 for (var i = 0; i < 4 && i < parts.Length; i++)
GenerateTizenManifest.cs (4)
135 var appIconInfo = AppIcon?.Length > 0 ? ResizeImageInfo.Parse(AppIcon[0]) : null; 158 var splashInfo = SplashScreen?.Length > 0 ? ResizeImageInfo.Parse(SplashScreen[0]) : null; 213 if (parts.Length > 3) 217 for (var i = 0; i < 3 && i < parts.Length; i++)
GetMauiAssetPath.cs (1)
42 if (Input != null && Input.Length > 0)
ResizetizeImages.cs (1)
44 if (dpis == null || dpis.Length <= 0)
Utils.cs (2)
43 if (parts.Length > 0 && int.TryParse(parts[0], out var width)) 45 if (parts.Length > 1 && int.TryParse(parts[1], out var height))
Microsoft.ML.AutoML (103)
API\AutoCatalog.cs (4)
835if (numericFeatureColumnNames.Length > 0) 840if (booleanFeatureColumnNames.Length > 0) 845if (catalogFeatureColumnNames.Length > 0) 866if (option.InputColumnNames.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 (7)
CodeGenerator\CSharp\TransformGeneratorBase.cs (2)
39InputColumns = new string[node.InColumns.Length]; 40OutputColumns = new string[node.OutColumns.Length];
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 (236)
CommandLine\CmdParser.cs (28)
313if (settings == null || settings.Length == 0) 494if (nicks.Length == 0 || nicks.Length == 1 && nicks[0].ToLowerInvariant() == name.ToLowerInvariant()) 566for (int i = 0; i < strs.Length; i++) 589if (value == null && i + 2 < strs.Length && strs[i + 1] == "=") 611hadError |= !info.ArgDef.SetValue(this, ref values[info.Args.Length], str, "", destination); 617if (value == null && i + 2 < strs.Length && strs[i + 1] == "=") 624Contracts.Assert(0 <= arg.Index && arg.Index < info.Args.Length); 635if (i + 2 < strs.Length && strs[i + 1] == "=") 642else if (i + 1 < strs.Length) 661if (!IsCurlyGroup(value) && i + 1 < strs.Length && IsCurlyGroup(strs[i + 1])) 672if (!IsCurlyGroup(value) && i + 1 < strs.Length && IsCurlyGroup(strs[i + 1])) 758var values = new ArgValue[info.Args.Length + 1]; 762for (int i = 0; i < info.Args.Length; i++) 769hadError |= info.ArgDef.Finish(this, values[info.Args.Length], destination); 1259Arg[] args = Utils.BuildArray(argumentInfo.Args.Length, i => new Arg(argumentInfo.Args[i])); 1260Array.Sort(args, 0, args.Length, Comparer<Arg>.Create((x, y) => x.SortOrder.CompareTo(y.SortOrder))); 1345Contracts.Assert(map.Count >= args.Length); 1480if (_infoCustom.ArgDef == null && _infoCustom.Args.Length == 0) 1499if (type.GenericTypeArguments.Length != 2) 1594for (int i = 0; i < arr.Length; i++) 1629for (int i = 0; i < arr.Length; i++) 1637for (int i = 0; i < res.Length; i++) 1647for (int i = 0; i < res.Length; i++) 2315switch (factoryType.GenericTypeArguments.Length) 2345if (settings == null || (settings.Length == 1 && string.IsNullOrEmpty(settings[0]))) 2359if (string.IsNullOrEmpty(Name) && Settings.Length == 0) 2362if (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 (6)
48(read = source.Read(buffer, 0, (int)Math.Min(buffer.Length, remaining))) != 0) 123writer.Write(values.Length); 279writer.Write(bytes, 0, bytes.Length); 494Contracts.Assert(0 <= start && start < array.Length); 495Contracts.Assert(0 < count && count <= array.Length - start); 666Contracts.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 (45)
UnitTests\CoreBaseTestClass.cs (1)
343Func<bool>[] idComps = new Func<bool>[cursors.Length];
UnitTests\TestEntryPoints.cs (3)
2212for (int i = 0; i < summaryDataViews.Summaries.Length; i++) 3320xfNames != null ? xfNames.Length + 1 : 1 6890Assert.Equal(10, ndcgArray.Length);
UnitTests\TestLruCache.cs (6)
33Assert.Equal(2, keys.Length); 39Assert.Equal(2, keys.Length); 48Assert.Equal(2, keys.Length); 56Assert.Equal(2, keys.Length); 64Assert.Equal(2, keys.Length); 71Assert.Equal(2, keys.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)
64for (int i = 0; i < testMatrix2.Length; i++) 354for (int i = 0; i < expected.Length; i++) 380for (int i = 0; i < expected.Length; i++) 407for (int i = 0; i < expected.Length; i++) 412CpuMathUtils.Scale(defaultScale, src, dst, dst.Length); 433for (int i = 0; i < expected.Length; i++) 461for (int i = 0; i < expected.Length; i++) 466CpuMathUtils.AddScale(defaultScale, src, dst, dst.Length); 518for (int i = 0; i < expected.Length; i++) 523CpuMathUtils.AddScaleCopy(defaultScale, src, dst, result, dst.Length); 545for (int i = 0; i < dst.Length; i++) 550for (int i = 0; i < expected.Length; i++) 555CpuMathUtils.Add(src, dst, dst.Length); 607for (int i = 0; i < src2.Length; i++) 614for (int i = 0; i < expected.Length; i++) 619CpuMathUtils.MulElementWise(src1, src2, dst, dst.Length); 638for (int i = 0; i < src.Length; i++) 661for (int i = 0; i < src.Length; i++) 687for (int i = 0; i < src.Length; i++) 709for (int i = 0; i < src.Length; i++) 735for (int i = 0; i < src.Length; i++) 759for (int i = 0; i < src.Length; i++) 788for (int i = 0; i < src.Length; i++) 814for (int i = 0; i < dst.Length; i++) 820for (int i = 0; i < dst.Length; i++) 825var actual = CpuMathUtils.DotProductDense(src, dst, dst.Length); 847for (int i = 0; i < dst.Length; i++) 879for (int i = 0; i < dst.Length; i++) 885for (int i = 0; i < dst.Length; i++) 891var actual = CpuMathUtils.L2DistSquared(src, dst, dst.Length); 941for (int i = 0; i < expected.Length; i++) 947CpuMathUtils.SdcaL1UpdateDense(defaultScale, src.Length, src, defaultScale, v, w);
Microsoft.ML.Data (1165)
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 (3)
92for (int i = 0; i < types.Length; ++i) 100for (int j = 0; j < types.Length; ++j) 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 (17)
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)) 428for (int i = 1; i < order.Length; i++) 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 (30)
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); 645for (int i = 1; i < order.Length; i++) 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 (7)
151Contracts.Assert(active.Length == n); 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 (19)
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; 627if (src == 0 || src > keyMapperCur.Length) 651for (int i = 0; i < views.Length; i++) 677var dvCount = views.Length; 703if (srcValues[j] == 0 || srcValues[j] > keyMapperCur.Length) 714if (srcValues[j] == 0 || srcValues[j] > keyMapperCur.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)
238if (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)
350for (int i = 0; i < outColNames.Length; ++i) 423for (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 (13)
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++) 418ctx.Writer.Write(cols.Length); 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 (4)
129for (int i = 0; i < perm.Length; ++i) 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 (491)
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)
230bytes.Length.ToByteArray(buffer, ref position); 231Array.Copy(bytes, 0, buffer, position, bytes.Length); 232position += bytes.Length; 238byte[] allBytes = new byte[bytes.Length + sizeof(int)]; 240bytes.Length.ToByteArray(allBytes, ref position); 241Array.Copy(bytes, 0, allBytes, position, bytes.Length); 262a.Length.ToByteArray(buffer, ref position); 263Array.Copy(a, 0, buffer, position, a.Length); 264position += a.Length; 286int length = a.Length; 319int length = a.Length; 390int length = a.Length; 423int length = a.Length; 456int length = a.Length; 489int length = a.Length; 522int length = a.Length; 557a.Length.ToByteArray(buffer, ref position); 558for (int i = 0; i < a.Length; ++i) 568for (int i = 0; i < a.Length; ++i) 600for (int i = 0; i < a.Length; ++i)
Utils\VectorUtils.cs (20)
24for (int i = 0; i < vector.Length; i++) 34for (int i = 0; i < vector.Length; i++) 51for (int i = 0; i < vector.Length; i++) 59return GetDotProduct(vector1, vector2, vector1.Length); 64return GetDotProduct(vector1, vector2, vector1.Length); 104for (int i = 0; i < vector.Length; i++) 108return sum / vector.Length; 114for (int i = 0; i < vector.Length; i++) 118return sum / vector.Length; 130for (int i = 0; i < vector.Length; i++) 135return Math.Sqrt(sum / vector.Length); 142for (int i = 1; i < vector.Length; i++) 156int length = vector1.Length; 172int length = vector1.Length; 192int length = vector1.Length; 209for (int i = 0; i < vector.Length; i++) 218for (int i = 0; i < vector.Length; i++) 227for (int i = 0; i < vector.Length; i++) 237int length = vector1.Length; 266for (int f = 0; f < vector.Length; f++)
Microsoft.ML.GenAI.Core (5)
Module\Attention.cs (2)
188Contract.Assert(attnWeights.shape.Length == 4); 197Contract.Assert(attentionMask.shape.Length == 4);
Pipeline\CausalLMPipeline.cs (1)
178var lastN = inputIds[.., ^stopSequence.Length..];
Trainer\CausalLMDataset.cs (2)
90var label = Enumerable.Repeat(-100L, train.Length).Concat([labelIds[i]]).Skip(1).ToArray(); 91var mask = Enumerable.Repeat(1L, train.Length).ToArray();
Microsoft.ML.GenAI.Core.Tests (2)
CausalLMDatasetTest.cs (2)
45dataset.Length.Should().Be(5); 101dataset.Length.Should().Be(14);
Microsoft.ML.ImageAnalytics (23)
ImageGrayscale.cs (1)
165Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
ImageLoader.cs (4)
219Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 266Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 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)
571if (j < categoricalFeatures.Length && curFidx == categoricalFeatures[j]) 802numRow = labels.Length; 829for (int i = 0; i < labels.Length; ++i) 1095if (numElem + cursor.Features.GetValues().Length > features.Length) 1135ch.Assert(features.Length >= numElem + catMetaData.NumCol); 1177ch.Assert(indices.Length >= numElem + numValue); 1178ch.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 (61)
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 (44)
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++) 560_cols = new int[_parent.ColumnPairs.Length]; 561_srcTypes = new DataViewType[_parent.ColumnPairs.Length]; 563for (int i = 0; i < _parent.ColumnPairs.Length; i++) 585var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 586for (int iinfo = 0; iinfo < _parent.ColumnPairs.Length; iinfo++) 600Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 628int numColumns = _parent.ColumnPairs.Length; 649Host.Assert(model.Length == dimension * dimension); 674Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
Microsoft.ML.NugetPackageVersionUpdater (1)
Program.cs (1)
42if (detailSplit.Length == 5)
Microsoft.ML.OnnxTransformer (21)
OnnxTransform.cs (21)
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); 647int n = OutputColumns.Value.Length; 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 (53)
TensorflowTransform.cs (38)
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 Shape[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 Shape[_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++) 659int n = OutputColumns.Value.Length; 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)
419for (int i = 0; i < buffer.Length; i++) 473string[] strings = new string[data.Length]; 474for (int i = 0; i < strings.Length; i++) 539_inputValues = new IntPtr[_inputs.Length]; 540_inputTensors = new Tensor[_inputs.Length]; 541_outputValues = new IntPtr[_outputs.Length]; 542_outputTensors = new Tensor[_outputs.Length]; 552_inputValues = new IntPtr[_inputs.Length]; 553_inputTensors = new Tensor[_inputs.Length]; 554_outputValues = new IntPtr[_outputs.Length]; 555_outputTensors = new Tensor[_outputs.Length]; 599_inputs.Length, _outputs, _outputValues, _outputValues.Length, _operations, 600_operations.Length, IntPtr.Zero, _status.Handle); 620for (int i = 0; i < _outputs.Length; i++)
Microsoft.ML.TensorFlow.Tests (19)
TensorflowTests.cs (19)
321Assert.Equal(sample.OneDim.Length, oneDimValues.Length); 325Assert.Equal(sample.TwoDim.Length, twoDimValues.Length); 329Assert.Equal(sample.ThreeDim.Length, threeDimValues.Length); 333Assert.Equal(sample.FourDim.Length, fourDimValues.Length); 337Assert.Equal(sample.FourDimKnown.Length, fourDimKnownValues.Length); 764if (directories != null && directories.Length > 0) 972for (int i = 0; i < onePrediction.PredictedLabels.Length; i++) 1208for (var i = 0; i < predictions.Length; i++) 1210for (var j = 0; j < predictions[i].PredictedScores.Length; j++) 1301Assert.Equal(2, prediction.Prediction.Length); 1364for (int i = 0; i < input.A.Length; i++) 1555string[] labels = new string[directories.Length]; 1556for (int j = 0; j < labels.Length; j++) 1584Assert.Equal((int)labelCountFirst, predictionFirst.Score.Length); 1585Assert.Equal((int)labelCountSecond, predictionSecond.Score.Length); 1714string[] labels = new string[directories.Length]; 1715for (int j = 0; j < labels.Length; j++) 1743Assert.Equal((int)labelCountFirst, predictionFirst.Score.Length); 1744Assert.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 (81)
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 (12)
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 (114)
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 (9)
666Contracts.CheckParam(index < _getters.Length, nameof(column), "Invalid col value in GetGetter"); 683Contracts.Check(index < _getters.Length); 814Contracts.Assert(active.Length == n); 817Contracts.Assert(activeInput.Length == _bindings.InputSchema.Count); 827col => 0 <= col && col < activeInput.Length && (activeInput[col] || predicateIn(col)); 848Contracts.Assert(active.Length == _bindings.Schema.Count); 887if (inputs.Length == 1 && n > 1 && _bindings.AddedColumnIndices.Any(predicate)) 891var cursors = new DataViewRowCursor[inputs.Length]; 892for (int i = 0; i < inputs.Length; i++)
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 (87)
Model\CodeGenTokenizer.cs (3)
1292if (bytes.Length - bytesIndex < bytesCountToEncode) 1294Helpers.ArrayPoolGrow(ref bytes, (bytes.Length + bytesCountToEncode) * 2); 1609string tokenValue = (uint)c < charToString.Length ? charToString[c] : c.ToString();
Model\EnglishRobertaTokenizer.cs (3)
959Debug.Assert(token[0] < charToString.Length); 967Debug.Assert(c < charToString.Length); 1260if (splitLine.Length != 2)
Model\SentencePieceBaseModel.cs (4)
224if (bytesCount >= bytesPoolArray!.Length) 284if (len > charPoolArray.Length) 497if (bytesCount >= bytesPoolArray!.Length) 622if (len > charPoolArray.Length)
Model\SentencePieceBpeModel.cs (8)
161for (int index = 0; (uint)index < (uint)symbols.Length; index = symbols[index].next) 439for (int index = 0; index != -1 && index < symbols.Length; index = symbols[index].next) 707for (int index = 0; index != -1 && index < symbols.Length; index = symbols[index].next) 909if (splits.Length == 0) 914(int Offset, int Length) current = splits[splits.Length - 1]; 926for (int i = splits.Length - 1; i >= 0 && idsCount < maxTokens; i--) 978while (symbols[lastSymbolIndex].next != -1 && lastSymbolIndex < symbols.Length) 1132Debug.Assert(symbols.Length >= text.Length);
Model\SentencePieceUnigramModel.cs (31)
134if ((uint)id >= (uint)(_vocabReverse.Length)) 146int remainingLength = normalizedString.Length - normalizedStringCountFromEnd; 149char[] utf16NormalizedString = ArrayPool<char>.Shared.Rent(normalizedString.Length << 1); 150normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 155text.CopyTo(normalizedString.AsSpan(normalizedString.Length - normalizedStringCountFromEnd - text.Length)); 161int remainingLength = normalizedString.Length - normalizedStringCountFromEnd; 166char[] utf16NormalizedString = ArrayPool<char>.Shared.Rent(normalizedString.Length << 1); 167normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 172bool res = Helpers.ConvertUtf8ToUtf16(utf8Bytes, normalizedString.AsSpan(normalizedString.Length - normalizedStringCountFromEnd - expectedCount), out int bytesConsumed, out int charsWritten); 185Helpers.ArrayPoolGrow(ref normalizedString, normalizedString.Length << 1); 198Helpers.ArrayPoolGrow(ref normalizedString, normalizedString.Length << 1); 294Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) * 3 <= buffer.Length * sizeof(int)); 729Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 810else if (unknownTokensTracking.Length == unknownTokensCount) 827Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 848Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 874Debug.Assert(unknownTokensCount > 0 && unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 916Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 1122(int Id, int UtfStartOffset, int Utf8Length)[] ids = ArrayPool<(int Id, int UtfStartOffset, int Utf8Length)>.Shared.Rent(bestPathEndsAt.Length); 1125int idsIndex = ids.Length - 1; 1144if ((!ByteFallback || !unknownEncountered) && (maxTokenCount == int.MaxValue || (tokenCount + ids.Length - idsIndex <= maxTokenCount))) 1148tokenCount += ids.Length - idsIndex; 1166for (int i = idsIndex; tokenCount < maxTokenCount && i < ids.Length; i++) 1285if (splits.Length == 0) 1288normalizedText = normalizedString is not null ? normalizedString.AsSpan(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null; 1292(int Offset, int Length) current = splits[splits.Length - 1]; 1300for (int i = splits.Length - 1; i >= 0; i--) 1326normalizedText = normalizedString is not null ? normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null; 1344normalizedText = normalizedString is not null ? normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null;
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);
Normalizer\SentencePieceNormalizer.cs (7)
325while (normalizedLength < _normalized!.Length && _normalized[normalizedLength] != 0) 403if (normalized.Length <= normalizedIndex + _spaceSymbol.Length) 405Helpers.ArrayPoolGrow(ref normalized, ref poolArray, (normalizedIndex + _spaceSymbol.Length) << 1); 410normalizedIndex += _spaceSymbol.Length; 467if (normalized.Length <= normalizedIndex + _spaceSymbol.Length) 469Helpers.ArrayPoolGrow(ref normalized, ref poolArray, (normalizedIndex + _spaceSymbol.Length) << 1); 472normalizedIndex += _spaceSymbol.Length;
RegexGenerator.g.cs (1)
2342if ((uint)p < (uint)s.Length)
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)
97for (int i = 0; i < result.Length; i++)
Utils\DoubleArrayTrie.cs (1)
1061_size = preCompiledData.Length;
Utils\Helpers.cs (3)
24T[] tmp = ArrayPool<T>.Shared.Rent(Math.Max(arrayPoolArray.Length * 2, requiredCapacity)); 221if (bytesIndex >= bytes.Length) 223Helpers.ArrayPoolGrow<byte>(ref bytes, bytes.Length * 2);
Utils\Helpers.netcoreapp.cs (3)
46Debug.Assert(bytes.Length == bytesWritten); 87if (bytesIndex + bytesWritten > destination.Length) 89Helpers.ArrayPoolGrow(ref destination, destination.Length * 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 (251)
BpeTests.cs (33)
305Assert.Equal(expectedTokens.Length, encoding.Count); 306Assert.Equal(offsets.Length, encoding.Count); 307Assert.Equal(ids.Length, encoding.Count); 308Assert.Equal(ids.Length, idsList.Count); 309Assert.Equal(ids.Length, tokenizer.CountTokens(sentence)); 339for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 343Assert.True(idsConsumed < ids.Length); 353Assert.Equal(ids.Length, idsConsumed); 488Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedText, out int length)); 491Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedText, out length)); 495Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text, expectedIds.Length - 2, out normalizedText, out length)); 497int expectedLength = expectedOffsets[expectedOffsets.Length - 3].Index + expectedOffsets[expectedOffsets.Length - 3].Length; 499Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 2, out normalizedText, out length)); 503Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text)); 504Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan())); 506Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedText, out int tokenCount)); 508Assert.Equal(expectedIds.Length - 3, tokenCount); 509Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedText, out tokenCount)); 511Assert.Equal(expectedIds.Length - 3, tokenCount); 513Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedText, out tokenCount)); 516Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedText, out tokenCount)); 851Assert.Equal(ids.Length, idsConsumed); 854Assert.Equal(ids.Length, idsConsumed); 856Assert.True(idsConsumed < ids.Length); 859Assert.True(idsConsumed < ids.Length);
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? normalizedText, out int length)); 382Assert.Equal(ids, codeGenTokenizer.EncodeToIds(text.AsSpan(), ids.Length, out normalizedText, out length)); 386Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text, expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length)); 389Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length)); 393Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text, expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length)); 396Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, 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 normalizedText, 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 normalizedText, out length)); 410Assert.Equal(expectedIds.Take(expectedIds.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, expectedIds.Length - 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length)); 413Assert.Equal(expectedIds.Take(expectedIds.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length)); 417Assert.Equal(expectedIdsWithSpace.Take(expectedIdsWithSpace.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text, expectedIdsWithSpace.Length - 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length)); 420Assert.Equal(expectedIdsWithSpace.Take(expectedIdsWithSpace.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length - 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, 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 normalizedText, 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 normalizedText, 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 normalizedText, 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 normalizedText, 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 normalizedText, 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 normalizedText, 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;
DoubleArrayTrieTest.cs (3)
75DoubleArrayResultPair[] doubleArrayResultPairs = new DoubleArrayResultPair[_entries.Length]; 99int result = trie.Traverse(utf8Bytes, ref nodePos, ref keyPos, utf8Bytes.Length); 102Assert.Equal(utf8Bytes.Length, keyPos);
EnglishRobertaTests.cs (26)
194Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedText, out int length)); 197Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedText, out length)); 201Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text, expectedIds.Length - 2, out normalizedText, 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 normalizedText, 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 normalizedText, 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 normalizedText, out tokenCount)); 217Assert.Equal(expectedIds.Length - 3, tokenCount); 219Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedText, out tokenCount)); 222Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedText, 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}");
SentencePieceTests.cs (12)
766ms.Write(model, 0, model.Length); 784ms.Write(prefix, 0, prefix.Length); 785ms.Write(modelBytes, 0, modelBytes.Length); 786ms.Position = prefix.Length; // skip past prefix 802ms.Write(modelProtoBytes, 0, modelProtoBytes.Length); 875WriteVarint((ulong)bytes.Length); 876_ms.Write(bytes, 0, bytes.Length); 882WriteVarint((ulong)value.Length); 883_ms.Write(value, 0, value.Length); 900WriteVarint((ulong)submessage.Length); 901_ms.Write(submessage, 0, submessage.Length); 927_ms.Write(bytes, 0, bytes.Length);
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (1)
1061_size = preCompiledData.Length;
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (3)
24T[] tmp = ArrayPool<T>.Shared.Rent(Math.Max(arrayPoolArray.Length * 2, requiredCapacity)); 221if (bytesIndex >= bytes.Length) 223Helpers.ArrayPoolGrow<byte>(ref bytes, bytes.Length * 2);
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (3)
46Debug.Assert(bytes.Length == bytesWritten); 87if (bytesIndex + bytesWritten > destination.Length) 89Helpers.ArrayPoolGrow(ref destination, destination.Length * 2);
TiktokenTests.cs (34)
177for (int i = 1; i < destinationBuffer.Length - 1; i += Math.Max(1, destinationBuffer.Length - 3)) // enough to test length 1, and destinationBuffer.Length - 2 only. 181Assert.True(idsConsumed < ids.Length); 191Assert.Equal(ids.Length, idsConsumed); 643Assert.Equal(expectedIds, tokenizer.EncodeToIds(text, expectedIds.Length, out string? normalizedText, out int length)); 646Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedText, out length)); 650Assert.Equal(expectedIds.Take(expectedIds.Length - 4), tokenizer.EncodeToIds(text, expectedIds.Length - 4, out normalizedText, out length)); 652int expectedLength = expectedOffsets[expectedOffsets.Length - 5].Index + expectedOffsets[expectedOffsets.Length - 5].Length; 654Assert.Equal(expectedIds.Take(expectedIds.Length - 4), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 4, out normalizedText, out length)); 658Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text)); 659Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan())); 661Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text, expectedIds.Length - 3, out normalizedText, out int tokenCount)); 663Assert.Equal(expectedIds.Length - 3, tokenCount); 664Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedText, out tokenCount)); 666Assert.Equal(expectedIds.Length - 3, tokenCount); 668Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text, 3, out normalizedText, out tokenCount)); 671Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedText, out tokenCount)); 752Assert.Equal(expectedIds.Length, GPT4.CountTokens(text)); 754for (int tokenCount = 1; tokenCount <= ids.Length; tokenCount++) 757Assert.True(count <= ids.Length); 761Assert.True(count < ids.Length - 1); 775Assert.True(count <= ids.Length); 779Assert.True(ids.Length - tokenCount > 0); 780Assert.True(offsets[offsets.Length - tokenCount].Index < offsets[offsets.Length - tokenCount - 1].Index + offsets[offsets.Length - tokenCount - 1].Length); 785Assert.Equal(offsets[offsets.Length - count].Index, index);
UnigramTests.cs (24)
357int[] expectedIds = new int[ids.Length * 2 + 3]; 359Array.Copy(ids, 0, expectedIds, 1, ids.Length); 360expectedIds[ids.Length + 1] = _unigramTokenizerWithSpecialTokens.SpecialTokens!["<pad>"]; 361Array.Copy(ids, 0, expectedIds, ids.Length + 2, ids.Length); 362expectedIds[ids.Length * 2 + 2] = _unigramTokenizerWithSpecialTokens.EndOfSentenceId; 365string[] expectedTokens = new string[tokens.Length * 2 + 3]; 367Array.Copy(tokens, 0, expectedTokens, 1, tokens.Length); 368expectedTokens[tokens.Length + 1] = "<pad>"; 369Array.Copy(tokens, 0, expectedTokens, tokens.Length + 2, tokens.Length); 370expectedTokens[tokens.Length * 2 + 2] = _unigramTokenizerWithSpecialTokens.EndOfSentenceToken; 421for (int i = 1; i <= ids.Length; i++) 437if (ints.Count > ids.Length) 453if (ints.Count > ids.Length) 465int[] expectedIds = new int[ids.Length * 2 + 3]; 467Array.Copy(ids, 0, expectedIds, 1, ids.Length); 468expectedIds[ids.Length + 1] = _unigramTokenizerWithSpecialTokens.SpecialTokens!["<pad>"]; 469Array.Copy(ids, 0, expectedIds, ids.Length + 2, ids.Length); 470expectedIds[ids.Length * 2 + 2] = _unigramTokenizerWithSpecialTokens.EndOfSentenceId; 473for (int i = 1; i <= expectedIds.Length; i++) 493int totalTokens = ids.Length; 544Assert.Equal(ids.Length, idsConsumed);
Microsoft.ML.TorchSharp (36)
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 (9)
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++) 885int n = OutputColumns.Value.Length;
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)
337for (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 (5)
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++) 836int n = OutputColumns.Value.Length;
TorchSharpBaseTrainer.cs (1)
499int n = OutputColumns.Value.Length;
Utils\MetricUtils.cs (2)
37for (var i = 0; i < starts.Length; ++i) 39for (var j = 0; j < ends.Length; ++j)
Microsoft.ML.Transforms (611)
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 (4)
134var result = new Delegate[_parent.AddedSchema.Columns.Length]; 135if (!Enumerable.Range(0, result.Length).Any(activeOutput)) 157for (int i = 0; i < result.Length; i++) 179if (Enumerable.Range(0, _parent.AddedSchema.Columns.Length).Any(activeOutput))
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 (19)
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++) 611var outputCols = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 612for (int i = 0; i < _parent.ColumnPairs.Length; i++) 635Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
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 (17)
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); 330_types = new DataViewType[_parent.ColumnPairs.Length]; 331_srcTypes = new DataViewType[_parent.ColumnPairs.Length]; 332_srcCols = new int[_parent.ColumnPairs.Length]; 333_norms = new LpNormNormalizingEstimatorBase.NormFunction[_parent.ColumnPairs.Length]; 334_ensureZeroMeans = new bool[_parent.ColumnPairs.Length]; 335for (int i = 0; i < _parent.ColumnPairs.Length; i++) 348var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 349for (int i = 0; i < _parent.ColumnPairs.Length; i++) 363Contracts.Assert(0 <= iinfo && iinfo < _parent.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 (20)
140OutputColumnType = new VectorDataViewType(itemType, SlotMap.Length); 202Host.Assert(Infos.Length == Utils.Size(args.Columns)); 207_exes = new ColumnOptions[Infos.Length]; 208for (int i = 0; i < Infos.Length; i++) 241_exes = new ColumnOptions[Infos.Length]; 242for (int i = 0; i < Infos.Length; i++) 265Host.CheckDecode(slotMap[j].Distinct().Count() == slotMap[j].Length); 307for (int iColumn = 0; iColumn < Infos.Length; iColumn++) 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); 411Host.Assert(0 <= iinfo && iinfo < Infos.Length); 470Host.Assert(0 <= iinfo && iinfo < Infos.Length); 655Host.Assert(iinfo >= 0 && iinfo < _exes.Length);
KeyToVectorMapping.cs (11)
124var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 127for (int i = 0; i < cols.Length; i++) 172_types = new VectorDataViewType[_parent.ColumnPairs.Length]; 173_bitsPerKey = new int[_parent.ColumnPairs.Length]; 174for (int i = 0; i < _parent.ColumnPairs.Length; i++) 191var infos = new ColInfo[_parent.ColumnPairs.Length]; 192for (int i = 0; i < _parent.ColumnPairs.Length; i++) 205var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 206for (int i = 0; i < _parent.ColumnPairs.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++)
MissingValueDroppingTransformer.cs (8)
188_types = new DataViewType[_parent.ColumnPairs.Length]; 189_srcTypes = new DataViewType[_parent.ColumnPairs.Length]; 190_srcCols = new int[_parent.ColumnPairs.Length]; 191_isNAs = new Delegate[_parent.ColumnPairs.Length]; 192for (int i = 0; i < _parent.ColumnPairs.Length; i++) 207var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 208for (int i = 0; i < _parent.ColumnPairs.Length; i++) 220Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
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++)
MissingValueIndicatorTransform.cs (6)
80Host.Assert(Infos.Length == Utils.Size(args.Columns)); 133var types = new VectorDataViewType[Infos.Length]; 134for (int iinfo = 0; iinfo < Infos.Length; iinfo++) 171Host.Assert(0 <= iinfo && iinfo < Infos.Length); 177Host.Assert(0 <= iinfo && iinfo < Infos.Length); 241Host.Assert(0 <= iinfo && iinfo < Infos.Length);
MissingValueIndicatorTransformer.cs (6)
186var infos = new ColInfo[_parent.ColumnPairs.Length]; 187for (int i = 0; i < _parent.ColumnPairs.Length; i++) 205var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 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 (29)
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++) 561_types = new DataViewType[_parent.ColumnPairs.Length]; 562_isNAs = new Delegate[_parent.ColumnPairs.Length]; 563for (int i = 0; i < _parent.ColumnPairs.Length; i++) 596var infos = new ColInfo[_parent.ColumnPairs.Length]; 597for (int i = 0; i < _parent.ColumnPairs.Length; i++) 610var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 611for (int i = 0; i < _parent.ColumnPairs.Length; i++) 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 (14)
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; 802lim = min + bounds.Length + 1; 828lim = min + bounds.Length + 1; 854lim = min + bounds.Length + 1;
OneHotEncoding.cs (1)
285for (int i = 0; i < columns.Length; i++)
OneHotHashEncoding.cs (1)
333for (int i = 0; i < columns.Length; i++)
OptionalColumnTransform.cs (11)
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++) 206Contracts.Assert(active.Length == Input.Count); 214return col => 0 <= col && col < active.Length && active[col]; 352if (inputs.Length != 1) 354var cursors = new DataViewRowCursor[inputs.Length]; 355for (int i = 0; i < inputs.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 (3)
76Contracts.Assert(active.Length == Input.Count); 77return col => 0 <= col && col < active.Length && active[col]; 162for (int c = 0; c < cursors.Length; ++c)
RandomFourierFeaturizing.cs (24)
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++) 480_types = new DataViewType[_parent.ColumnPairs.Length]; 481_srcTypes = new DataViewType[_parent.ColumnPairs.Length]; 482_srcCols = new int[_parent.ColumnPairs.Length]; 483for (int i = 0; i < _parent.ColumnPairs.Length; i++) 496var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 497for (int i = 0; i < _parent.ColumnPairs.Length; i++) 505Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
StatefulCustomMappingTransformer.cs (7)
143if (inputs.Length != 1) 145var cursors = new DataViewRowCursor[inputs.Length]; 146for (int i = 0; i < inputs.Length; i++) 161var getters = new Delegate[_parent.AddedSchema.Columns.Length]; 276Ch.Assert(active == null || active.Length == parent.OutputSchema.Count); 280_getters = new Delegate[parent._parent.AddedSchema.Columns.Length]; 303for (int i = 0; i < active.Length; i++)
Text\LdaTransform.cs (28)
219Contracts.Assert(0 <= columnIndex && columnIndex < _ldas.Length); 400ctx.Writer.Write(termTopicVector.Length); 571_srcCols = new int[_parent.ColumnPairs.Length]; 573for (int i = 0; i < _parent.ColumnPairs.Length; i++) 587var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 588for (int i = 0; i < _parent.ColumnPairs.Length; i++) 599Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.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 (34)
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++) 486_types = new DataViewType[_parent.ColumnPairs.Length]; 487_srcTypes = new DataViewType[_parent.ColumnPairs.Length]; 488_srcCols = new int[_parent.ColumnPairs.Length]; 489for (int i = 0; i < _parent.ColumnPairs.Length; i++) 499var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 500for (int i = 0; i < _parent.ColumnPairs.Length; i++) 527Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 562Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 583for (int i = 0; i < ngramIds.Length; i++) 673Contracts.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 748int numColumns = _parent.ColumnPairs.Length; 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 (22)
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++) 361_types = new DataViewType[_parent.ColumnPairs.Length]; 362_languageColumns = new int[_parent.ColumnPairs.Length]; 363_resourcesExist = new bool?[StopWords.Length]; 366for (int i = 0; i < _parent.ColumnPairs.Length; i++) 392var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 393for (int i = 0; i < _parent.ColumnPairs.Length; i++) 405Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 449for (int i = 0; i < _parent.ColumnPairs.Length; i++) 978var columnsLength = ColumnPairs.Length; 1037var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 1038for (int i = 0; i < cols.Length; i++) 1072_types = new DataViewType[_parent.ColumnPairs.Length]; 1073for (int i = 0; i < _parent.ColumnPairs.Length; i++) 1086var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 1087for (int i = 0; i < _parent.ColumnPairs.Length; i++) 1099Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 1137for (int i = 0; i < _parent.ColumnPairs.Length; i++)
Text\TextFeaturizingEstimator.cs (13)
456if (tparams.NeedInitialSourceColumnConcatTransform && textCols.Length > 1) 466var xfCols = new (string outputColumnName, string inputColumnName)[textCols.Length]; 467string[] dstCols = new string[textCols.Length]; 468for (int i = 0; i < textCols.Length; i++) 483var xfCols = new WordTokenizingEstimator.ColumnOptions[textCols.Length]; 484wordTokCols = new string[textCols.Length]; 485for (int i = 0; i < textCols.Length; i++) 499var xfCols = new StopWordsCol[wordTokCols.Length]; 500var dstCols = new string[wordTokCols.Length]; 501for (int i = 0; i < wordTokCols.Length; i++) 539charTokCols = new string[srcCols.Length]; 540var xfCols = new (string outputColumnName, string inputColumnName)[srcCols.Length]; 541for (int i = 0; i < srcCols.Length; i++)
Text\TextNormalizing.cs (10)
156var columnsLength = ColumnPairs.Length; 179var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 180for (int i = 0; i < cols.Length; i++) 207_types = new DataViewType[_parent.ColumnPairs.Length]; 208for (int i = 0; i < _types.Length; i++) 221for (int iinfo = 0; iinfo < _types.Length; ++iinfo) 259var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 260for (int i = 0; i < _parent.ColumnPairs.Length; i++) 312for (int i = 0; i < _combinedDiacriticsPairs.Length; i++) 329Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
Text\TokenizingByCharacters.cs (11)
173var cols = new (string outputColumnName, string inputColumnName)[options.Columns.Length]; 174for (int i = 0; i < cols.Length; i++) 204_isSourceVector = new bool[_parent.ColumnPairs.Length]; 205_sourceVectorLength = new int[_parent.ColumnPairs.Length]; 206for (int i = 0; i < _isSourceVector.Length; i++) 219for (int iinfo = 0; iinfo < _isSourceVector.Length; ++iinfo) 273var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 274for (int i = 0; i < _parent.ColumnPairs.Length; i++) 299Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 315Host.Assert(bldr.Length == boundaries[boundaries.Length - 1]); 467Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length);
Text\WordBagTransform.cs (15)
128var tokenizeColumns = new WordTokenizingEstimator.ColumnOptions[options.Columns.Length]; 138Columns = new NgramExtractorTransform.Column[options.Columns.Length] 141for (int iinfo = 0; iinfo < options.Columns.Length; iinfo++) 148tokenizeColumns[iinfo] = new WordTokenizingEstimator.ColumnOptions(column.Name, column.Source.Length > 1 ? column.Name : column.Source[0]); 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++) 689if (col.Source.Length > 1) 705string[][] uniqueNames = new string[columns.Length][]; 707for (int iinfo = 0; iinfo < columns.Length; iinfo++) 715int srcCount = col.Source.Length;
Text\WordEmbeddingsExtractor.cs (8)
112ch.Assert(wordVector.Length == Dimension); 231var cols = new WordEmbeddingEstimator.ColumnOptions[options.Columns.Length]; 232for (int i = 0; i < cols.Length; i++) 320for (int i = 0; i < _parent.ColumnPairs.Length; i++) 546Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 554Host.Assert(0 <= iinfo && iinfo < _parent.ColumnPairs.Length); 696dimension = parsedLine.values.Length; 708dimension = wordsInFirstLine.Length - 1;
Text\WordHashBagProducingTransform.cs (12)
103Contracts.Assert(uniqueSourceNames.Length == options.Columns.Length); 106var extractorCols = new NgramHashExtractingTransformer.Column[options.Columns.Length]; 107var colCount = options.Columns.Length; 112int srcCount = column.Source.Length; 114Contracts.Assert(uniqueSourceNames[iinfo].Length == options.Columns[iinfo].Source.Length); 336var ngramHashColumns = new NgramHashingEstimator.ColumnOptions[options.Columns.Length]; 338var colCount = options.Columns.Length; 349int srcCount = column.Source.Length; 388var extractorCols = new Column[cols.Length]; 389for (int i = 0; i < cols.Length; i++)
Text\WordTokenizing.cs (12)
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++) 224var result = new DataViewSchema.DetachedColumn[_parent.ColumnPairs.Length]; 225for (int i = 0; i < _parent.ColumnPairs.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 (10)
114Host.CheckUserArg(options.Columns.Distinct().Count() == options.Columns.Length, nameof(options.Columns), 198return Utils.BuildArray<DataViewRowCursor>(inputCursors.Length, 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 (61)
DnnRetrainTransform.cs (56)
276var inputsForTraining = new string[_inputs.Length + 1]; 277var inputColIndices = new int[inputsForTraining.Length]; 278var isInputVector = new bool[inputsForTraining.Length]; 279var tfInputTypes = new TF_DataType[inputsForTraining.Length]; 280var tfInputShapes = new Shape[inputsForTraining.Length]; 282for (int i = 0; i < _inputs.Length; i++) 286for (int i = 0; i < inputsForTraining.Length - 1; i++) 290var index = inputsForTraining.Length - 1; 302tfInputs = new TF_Output[_tfInputNodes.Length + 2]; //Inputs + Label + Learning Rate. 304tfInputs = new TF_Output[_tfInputNodes.Length + 1]; //Inputs + Label. 306Array.Copy(_tfInputNodes, tfInputs, _tfInputNodes.Length); 308tfInputs[_tfInputNodes.Length] = new TF_Output(labelOp, labelOpIdx); 310tfInputs[_tfInputNodes.Length + 1] = new TF_Output(lr.Item1, lr.Item2); 346for (int i = 0; i < inputsForTraining.Length; i++) 380for (int i = 0; i < inputs.Length; i++) 384if (tensor.Length > 0 && tensor[0].TensorDataPointer != IntPtr.Zero) 390if (tensor.Length > 1 && tensor[1].TensorDataPointer != IntPtr.Zero) 430if (tmpParamDir != null && tmpParamDir.Length > 0) 453if (tmpParamDir != null && tmpParamDir.Length > 0) 485var srcTensorGetters = new ITensorValueGetter[inputColIndices.Length]; 486for (int i = 0; i < inputColIndices.Length; i++) 511for (int j = 0; j < inputs.Length; j++) 517for (int j = 0; j < outputs.Length; j++) 550_tfInputNodes = new TF_Output[_inputs.Length]; 551_tfOutputNodes = new TF_Output[_outputs.Length]; 553for (int index = 0; index < _tfInputOperations.Length; index += 1) 556for (int index = 0; index < _tfOutputOperations.Length; index += 1) 578var tfInputTypes = new TF_DataType[inputs.Length]; 579var tfInputShapes = new Shape[inputs.Length]; 580var tfInputOperations = new (Operation, int)[inputs.Length]; 618c_api.TF_GraphGetTensorShape(graph, output, dims, dims.Length, cstatus.Handle); 625var tfOutputTypes = new TF_DataType[outputs.Length]; 626var outputTypes = new DataViewType[outputs.Length]; 628var tfOutputOperations = new (Operation, int)[outputs.Length]; 630for (int i = 0; i < outputs.Length; i++) 648for (int j = 0; j < dims.Length; j++) 650if (dims == null || dims.Length == 0) 691ctx.Writer.Write(_inputs.Length); 696ctx.Writer.Write(_outputs.Length); 710w.Write(modelFilePaths.Length); 770_inputColIndices = new int[_parent._inputs.Length]; 771_isInputVector = new bool[_parent._inputs.Length]; 772_fullySpecifiedShapes = new Shape[_parent._inputs.Length]; 773for (int i = 0; i < _parent._inputs.Length; i++) 793if (shape == null || (shape.Length == 0)) 833for (int ishape = 1; ishape < l.Length; ishape++) 932for (int i = 0; i < _parent._inputs.Length; i++) 937Contracts.Assert(tensors.Length > 0); 939for (int j = 0; j < activeOutputColNames.Length; j++) 948return col => Enumerable.Range(0, _parent._outputs.Length).Any(i => activeOutput(i)) && _inputColIndices.Any(i => i == col); 953var info = new DataViewSchema.DetachedColumn[_parent._outputs.Length]; 954for (int i = 0; i < _parent._outputs.Length; i++) 985if (tfShape.dims.Length != 0) 1070if (tfShape.dims.Length != 0) 1257for (var i = 0; i < _options.InputColumns.Length; i++) 1268for (var i = 0; i < _options.OutputColumns.Length; i++)
ImageClassificationTrainer.cs (5)
848int featureLength = featurizedImages.Count > 0 ? featurizedImages[0].Item2.Length : 0; 869Contracts.Assert(featurizedImages.All(x => x.Item2.Length == featureLength)); 1099Contracts.Assert(featureTensorShape[0] <= featuresBufferBytes.Length / featureFileRecordSize); 1100Contracts.Assert(labelTensorShape[0] <= labelBufferBytes.Length / sizeof(long)); 1562TF_StringCopy(tstring, src, (UIntPtr)data.Length);
Microsoft.NET.Build.Containers (40)
ContainerHelpers.cs (2)
101if (parts.Length == 2) 107else if (parts.Length == 1)
ImageBuilder.cs (16)
67long imageSize = Encoding.UTF8.GetBytes(imageJsonStr).Length; 158bool setsEntrypoint = entrypoint.Length > 0 || entrypointArgs.Length > 0; 159bool setsCmd = cmd.Length > 0; 163if (baseImageEntrypoint.Length == 1 && (baseImageEntrypoint[0] == "dotnet" || baseImageEntrypoint[0] == "/usr/bin/dotnet")) 173if (!setsCmd && appCommandArgs.Length == 0 && entrypoint.Length == 0) 183if (entrypointArgs.Length > 0) 201if (baseImageEntrypoint.Length > 0) 209if (entrypointArgs.Length > 0 && entrypoint.Length == 0) 215if (appCommandArgs.Length > 0 && appCommand.Length == 0) 224if (appCommand.Length > 0 || appCommandArgs.Length > 0) 250return (entrypoint.Length > 0 ? entrypoint.Concat(entrypointArgs).ToArray() : baseImageEntrypoint, cmd);
ImageConfig.cs (3)
98if (_newEntrypoint?.Length > 0) 103if (_newCmd?.Length > 0) 279if (val.Length != 2)
ImageIndexGenerator.cs (6)
22if (images.Length == 0) 59if (images.Length == 0) 66var manifests = new PlatformSpecificManifest[images.Length]; 68for (int i = 0; i < images.Length; i++) 97var manifests = new PlatformSpecificOciManifest[tags.Length]; 98for (int i = 0; i < tags.Length; i++)
Registry\Registry.cs (3)
482_logger.LogTrace("Uploading {0} bytes of content in chunks of {1} bytes.", contents.Length, chunkBackingStore.Length); 488_logger.LogTrace("Processing next chunk because current position {0} < content size {1}, chunk size: {2}.", contents.Position, contents.Length, chunkBackingStore.Length); 640Debug.Assert(destination.Tags.Length > 0);
Tasks\ComputeDotnetBaseImageAndTag.cs (4)
80FrameworkReferences.Length > 0 128if (muslRidsCount == TargetRuntimeIdentifiers.Length) 292var channel = releaseLabels.Length > 0 ? releaseLabels[0] : null; 298if (releaseLabels.Length > 1)
Tasks\CreateImageIndex.cs (2)
88var images = new BuiltImage[GeneratedContainers.Length]; 90for (int i = 0; i < GeneratedContainers.Length; i++)
Tasks\ParseContainerProperties.cs (4)
89if (!string.IsNullOrEmpty(ContainerImageTag) && ContainerImageTags.Length >= 1) 107else if (ContainerImageTags.Length != 0) 201NewContainerEnvironmentVariables = new ITaskItem[filteredEnvVars.Length]; 203for (int i = 0; i < filteredEnvVars.Length; i++)
Microsoft.NET.Build.Tasks (61)
CheckForDuplicateFrameworkReferences.cs (1)
28if (FrameworkReferences == null || FrameworkReferences.Length == 0)
CollectSDKReferencesDesignTime.cs (1)
54if (packageNames.Length == 0)
CreateAppHost.cs (1)
76if (DotNetSearchLocations?.Length > 0)
FrameworkPackages\FrameworkPackages.cs (1)
86if (frameworkReferences.Length == 0)
GenerateBundle.cs (1)
129var fileSpec = new List<FileSpec>(FilesToBundle.Length);
GenerateDepsFile.cs (2)
125if (RuntimeStorePackages != null && RuntimeStorePackages.Length > 0) 258if (CompileReferences.Length > 0)
GenerateGlobalUsings.cs (2)
21if (Usings.Length == 0) 32var lines = new string[usings.Length + 1];
GenerateRuntimeConfigurationFiles.cs (2)
195if (runtimeFrameworks == null || runtimeFrameworks.Length == 0) 222runtimeFrameworks.Length > 1 &&
GetDefaultPlatformTargetForNetFramework.cs (1)
37if (NativeCopyLocalItems == null || NativeCopyLocalItems.Length == 0)
GetPackageDirectory.cs (5)
30if (Items.Length == 0 || (PackageFolders.Length == 0 && string.IsNullOrEmpty(AssetsFileWithAdditionalPackageFolders))) 52var originalByAbsolute = new Dictionary<string, string>(PackageFolders.Length, StringComparer.Ordinal); 53for (int i = 0; i < PackageFolders.Length; i++) 64var updatedItems = new ITaskItem[Items.Length];
JoinItems.cs (4)
59bool useAllLeftMetadata = LeftMetadata != null && LeftMetadata.Length == 1 && LeftMetadata[0] == "*"; 60bool useAllRightMetadata = RightMetadata != null && RightMetadata.Length == 1 && RightMetadata[0] == "*"; 70(RightMetadata == null || RightMetadata.Length == 0)) 78(LeftMetadata == null || LeftMetadata.Length == 0))
ParseTargetManifests.cs (1)
26if (targetManifestFileList != null && targetManifestFileList.Length > 0)
ProcessFrameworkReferences.cs (3)
451if (FrameworkReferences != null && FrameworkReferences.Length != 0) 657return krp.RuntimePackLabels.Length == 0; 846packSupportedPortableRuntimeIdentifiers = packSupportedPortableRuntimeIdentifiers.Length > 0 ? packSupportedPortableRuntimeIdentifiers : packSupportedRuntimeIdentifiers;
ResolveAppHosts.cs (1)
168if (PackAsToolShimRuntimeIdentifiers.Length > 0)
ResolveCopyLocalAssets.cs (1)
50if (RuntimeStorePackages != null && RuntimeStorePackages.Length > 0)
ResolveFrameworkReferences.cs (2)
25if (FrameworkReferences.Length == 0) 33var resolvedFrameworkReferences = new List<TaskItem>(FrameworkReferences.Length);
ResolvePackageAssets.cs (3)
642for (int i = 0; i < _metadataStringTable.Length; i++) 665for (int i = 0; i < items.Length; i++) 1376if (_task.ShimRuntimeIdentifiers == null || _task.ShimRuntimeIdentifiers.Length == 0)
ResolveRuntimePackAssets.cs (2)
173if (parts.Length > 0 && int.TryParse(parts[0], out int versionNumber)) 224if (SatelliteResourceLanguages.Length >= 1 &&
RunCsWinRTGenerator.cs (2)
122if (ReferenceAssemblyPaths is not { Length: > 0 }) 129if (OutputAssemblyPath is not { Length: 1 })
SelectRuntimeIdentifierSpecificItems.cs (1)
47if (Items.Length == 0)
src\sdk\src\Common\WorkloadSetVersion.cs (2)
11if (sections.Length < 1) 21int coreComponentsLength = SeparateCoreComponents(workloadSetVersion, out _).Length;
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
314for (int b = 0; b < 4 && b < bytes.Length; b++) 369if (_manifestRoots.Length == 1)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkFeatureBand.cs (3)
26var formattedPrerelease = prereleaseComponents.Length > 1 ? 45if (coreComponents.Length == 3) 60if (sections.Length > 1)
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (2)
54var readCount = stream.Read(buffer, 0, buffer.Length); 96var readCount = stream.Read(newBuffer, remaining, newBuffer.Length - remaining);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (3)
49if (parts != null && parts.Length == 1) 128string? preReleaseOrBuild = sections.Length > 1 ? sections[1] : null; 136if (coreComponents.Length == 3)
src\sdk\src\Tasks\Common\ConflictResolution\PackageOverrideResolver.cs (2)
36if (_packageOverrideItems?.Length > 0) 38result = new Dictionary<string, PackageOverride>(_packageOverrideItems.Length, StringComparer.OrdinalIgnoreCase);
src\sdk\src\Tasks\Common\ConflictResolution\PackageRank.cs (1)
12var numPackages = packageIds?.Length ?? 0;
src\sdk\src\Tasks\Common\ConflictResolution\PlatformManifestReader.cs (1)
40if (lineParts.Length != 4)
src\sdk\src\Tasks\Common\ConflictResolution\ResolvePackageFileConflicts.cs (4)
189if (first == null || first.Length == 0) 279var result = new ITaskItem[original.Length - conflicts.Count]; 286if (index >= result.Length) 297if (index != result.Length)
src\sdk\src\Tasks\Common\MessageBase.cs (1)
47if (FormatArguments == null || FormatArguments.Length == 0)
TypeLibraryDictionaryBuilder.cs (2)
17if (typeLibraries is null || typeLibraries.Length == 0) 21else if (typeLibraries.Length == 1)
ValidateExecutableReferences.cs (1)
65if (targetFrameworkMonikerIndex != -1 && targetFrameworkMonikerIndex < targetFrameworkMonikers.Length)
Microsoft.NET.HostModel (33)
AppHost\BinaryUtils.cs (1)
35count: patternToReplace.Length);
AppHost\HostWriter.cs (5)
78if (appPathBytes.Length > MaxAppBinaryPathSizeInBytes) 216if (pathBytes.Length > MaxAppRelativeDotNetSizeInBytes) 220byte[] searchOptionsBytes = new byte[pathBytes.Length + 3]; // +2 for search location + null, +1 for null terminator 223searchOptionsBytes[searchOptionsBytes.Length - 1] = 0; 224if (pathBytes.Length > 0)
Bundle\Bundler.cs (1)
477if (hostSpecs.Length != 1)
Bundle\Manifest.cs (1)
107bundleHash.TransformBlock(hashBytes, 0, hashBytes.Length, hashBytes, 0);
ComHost\ComHost.cs (1)
57if (tlbFileBytes.Length == 0)
MachO\BinaryFormat\Blobs\CodeDirectoryBlob.cs (7)
77(uint)codeHashes.Length, 78(uint)specialSlotHashes.Length, 134for (int i = 0; i < specialSlotHashes.Length; i++) 262for (int i = 0; i < _specialSlotHashes.Length; i++) 270for (int i = 2; i < _codeHashes.Length; i++) 304accessor.WriteByte(offset + sizeof(uint) * 2 + CodeDirectoryHeader.Size + identifierBytes.Length, 0x00); // null terminator 305int specialSlotHashesOffset = (int)(offset + sizeof(uint) * 2 + CodeDirectoryHeader.Size + identifierBytes.Length + 1);
MachO\BinaryFormat\Blobs\SimpleBlob.cs (3)
28public uint Size => sizeof(uint) + sizeof(uint) + (uint)Data.Length; 46if (Data.Length > 0) 49bytesWritten += Data.Length;
MachO\FileUtils\MemoryMappedMachOViewAccessor.cs (3)
31_accessor.ReadArray(offset, buffer, 0, buffer.Length); 51_accessor.WriteArray(offset, buffer, 0, buffer.Length); 56_accessor.WriteArray(offset, buffer, 0, buffer.Length);
MachO\FileUtils\StreamBasedMachOFile.cs (2)
70_stream.Write(buffer, 0, buffer.Length); 86_stream.Write(buffer, 0, buffer.Length);
MachO\FileUtils\StreamExtensions.cs (1)
62stream.Write(buffer, 0, buffer.Length);
ResourceUpdater.cs (1)
185int rsrcSectionDataSize = rsrcSectionData.Length;
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (1)
267IMAGE_RESOURCE_DATA_ENTRY.Write(ref dataBuilder, sectionBase, dataEntryTable[language.Item1], language.Item1.DataEntry.Length);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.ResourcesDataModel.cs (1)
25public uint DataSize => (uint)DataEntry.Length;
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
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.Sdk.BlazorWebAssembly.Tasks (17)
BrotliCompress.cs (2)
80CompressedFiles = new ITaskItem[FilesToCompress.Length]; 82for (var i = 0; i < FilesToCompress.Length; i++)
GenerateServiceWorkerAssetsManifest.cs (2)
36var assets = new AssetsManifestFileEntry[Assets.Length]; 37Parallel.For(0, assets.Length, i =>
GZipCompress.cs (2)
29CompressedFiles = new ITaskItem[FilesToCompress.Length]; 33Parallel.For(0, FilesToCompress.Length, i =>
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (8)
299var included = new List<StaticWebAsset>(assets.Length); 1620var dictionary = new Dictionary<string, StaticWebAsset>(candidateAssets.Length); 1621for (var i = 0; i < candidateAssets.Length; i++) 1632var result = new StaticWebAsset[candidateAssets.Length]; 1633for (var i = 0; i != result.Length; i++) 1650for (var i = 0; i < assets.Length; i++) 1754var result = new List<string>(_defaultPropertyNames.Length + _additionalCustomMetadata.Count); 1766int ITaskItem.MetadataCount => _defaultPropertyNames.Length + (_additionalCustomMetadata?.Count ?? 0);
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAssetGroup.cs (3)
65if (items == null || items.Length == 0) 70var result = new Dictionary<(string SourceId, string Name), StaticWebAssetGroup>(items.Length); 71for (var i = 0; i < items.Length; i++)
Microsoft.NET.Sdk.Publish.Tasks (8)
AppSettingsTransform.cs (1)
35if (destinationConnectionStrings == null || destinationConnectionStrings.Length == 0)
MsDeploy\CommonUtility.cs (1)
1491for (int i = 0; i < Fwlinks.Length; i++)
Tasks\GenerateEFSQLScripts.cs (1)
47EFSQLScripts = new ITaskItem[EFMigrations.Length];
Tasks\MsDeploy\CreateMSDeployScript.cs (1)
46for (int i = 0; i < lines.Length; i++)
Tasks\OneDeploy\DeploymentResponse.cs (2)
92string?[] pathWithIdParts = new string[pathAndQueryParts.Length]; 94for (int i = pathAndQueryParts.Length - 1; i >= 0; i--)
Tasks\ZipDeploy\DeploymentResponse.cs (2)
40string?[] pathWithIdParts = new string[pathAndQueryParts.Length]; 42for (int i = pathAndQueryParts.Length - 1; i >= 0; i--)
Microsoft.NET.Sdk.Razor.Tasks (17)
EncodeRazorInputItem.cs (2)
30EncodedRazorInputItems = new ITaskItem[RazorInputItems.Length]; 32for (var i = 0; i < RazorInputItems.Length; i++)
FindAssembliesWithReferencesTo.cs (1)
25var referenceItems = new List<AssemblyItem>(Assemblies.Length);
SdkRazorGenerate.cs (6)
64if (Configuration.Length == 0) 70for (var i = 0; i < Sources.Length; i++) 81for (var i = 0; i < Extensions.Length; i++) 108for (var i = 0; i < Sources.Length; i++) 136for (var i = 0; i < Sources.Length; i++) 191for (var i = 0; i < Extensions.Length; i++)
SdkRazorTagHelper.cs (6)
38if (Assemblies.Length == 0) 57if (Configuration.Length == 0) 63for (var i = 0; i < Assemblies.Length; i++) 72for (var i = 0; i < Extensions.Length; i++) 91for (var i = 0; i < Assemblies.Length; i++) 108for (var i = 0; i < Extensions.Length; i++)
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerLogger.cs (1)
121s_loggingStream.Write(bytes, 0, bytes.Length);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerResponse.cs (1)
103responseBuffer.Length,
Microsoft.NET.Sdk.StaticWebAssets.Tasks (171)
_generated\10\StaticWebAssetsJsonSerializerContext.StaticWebAssetEndpointPropertyArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\12\StaticWebAssetsJsonSerializerContext.StaticWebAssetEndpointResponseHeaderArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\14\StaticWebAssetsJsonSerializerContext.StaticWebAssetEndpointSelectorArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\18\StaticWebAssetsJsonSerializerContext.StaticWebAssetsDiscoveryPatternArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\21\StaticWebAssetsJsonSerializerContext.ReferencedProjectConfigurationArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\28\StaticWebAssetsJsonSerializerContext.StringArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\3\StaticWebAssetsJsonSerializerContext.StaticWebAssetPatternArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\6\StaticWebAssetsJsonSerializerContext.StaticWebAssetArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
_generated\8\StaticWebAssetsJsonSerializerContext.StaticWebAssetEndpointArray.g.cs (1)
57for (int i = 0; i < value.Length; i++)
ApplyCompressionNegotiation.cs (6)
30var updatedEndpoints = new HashSet<StaticWebAssetEndpoint>(CandidateEndpoints.Length, StaticWebAssetEndpoint.RouteAndAssetComparer); 165for (var i = 0; i < endpoint.ResponseHeaders.Length; i++) 180var result = new HashSet<string>(compressedEndpoint.ResponseHeaders.Length, StringComparer.Ordinal); 181for (var i = 0; i < compressedEndpoint.ResponseHeaders.Length; i++) 295for (var i = 0; i < compressedEndpoint.ResponseHeaders.Length; i++) 309for (var i = 0; i < compressedEndpoint.Selectors.Length; i++)
Compression\BrotliCompress.cs (1)
85for (var i = 0; i < FilesToCompress.Length; i++)
Compression\GZipCompress.cs (1)
30Parallel.For(0, FilesToCompress.Length, i =>
Compression\ResolveCompressedAssets.cs (2)
69var matchingCandidateAssets = new List<StaticWebAsset>(CandidateAssets.Length); 118var assetsToCompress = new ITaskItem[matchingCandidateAssets.Count * formats.Length];
ComputeEndpointsForReferenceStaticWebAssets.cs (2)
30for (var i = 0; i < CandidateEndpoints.Length; i++) 49for (var j = 0; j < candidateEndpoint.EndpointProperties.Length; j++)
ComputeReferenceStaticWebAssetItems.cs (1)
152if (patterns.Length == 0)
ComputeStaticWebAssetsTargetPaths.cs (2)
29AssetsWithTargetPath = new ITaskItem[Assets.Length]; 34for (var i = 0; i < Assets.Length; i++)
Data\StaticWebAsset.cs (8)
299var included = new List<StaticWebAsset>(assets.Length); 1620var dictionary = new Dictionary<string, StaticWebAsset>(candidateAssets.Length); 1621for (var i = 0; i < candidateAssets.Length; i++) 1632var result = new StaticWebAsset[candidateAssets.Length]; 1633for (var i = 0; i != result.Length; i++) 1650for (var i = 0; i < assets.Length; i++) 1754var result = new List<string>(_defaultPropertyNames.Length + _additionalCustomMetadata.Count); 1766int ITaskItem.MetadataCount => _defaultPropertyNames.Length + (_additionalCustomMetadata?.Count ?? 0);
Data\StaticWebAssetEndpoint.cs (26)
178var result = new Dictionary<string, List<StaticWebAssetEndpoint>>(candidateEndpoints.Length / 2); 197var result = new StaticWebAssetEndpoint[endpoints.Length]; 198for (var i = 0; i < endpoints.Length; i++) 287for (var i = 0; i < Selectors.Length; i++) 291for (var i = 0; i < ResponseHeaders.Length; i++) 295for (var i = 0; i < EndpointProperties.Length; i++) 304$"{nameof(StaticWebAssetEndpoint)}: Route = {Route}, AssetFile = {AssetFile}, Selectors = {StaticWebAssetEndpointSelector.ToMetadataValue(Selectors ?? [])}, ResponseHeaders = {ResponseHeaders?.Length}, EndpointProperties = {StaticWebAssetEndpointProperty.ToMetadataValue(EndpointProperties ?? [])}"; 320if (Selectors.Length > other.Selectors.Length) 324else if (Selectors.Length < other.Selectors.Length) 329for (var i = 0; i < Selectors.Length; i++) 344if (EndpointProperties.Length > other.EndpointProperties.Length) 348else if (EndpointProperties.Length < other.EndpointProperties.Length) 353for (var i = 0; i < EndpointProperties.Length; i++) 368if (ResponseHeaders.Length > other.ResponseHeaders.Length) 372else if (ResponseHeaders.Length < other.ResponseHeaders.Length) 377for (var i = 0; i < ResponseHeaders.Length; i++) 465var result = new List<string>(_defaultPropertyNames.Length + _additionalCustomMetadata.Count); 477int ITaskItem.MetadataCount => _defaultPropertyNames.Length + (_additionalCustomMetadata?.Count ?? 0); 639for (var j = 0; j < endpoint.EndpointProperties.Length; j++) 658for (var j = 0; j < endpoint.EndpointProperties.Length; j++)
Data\StaticWebAssetGroup.cs (3)
65if (items == null || items.Length == 0) 70var result = new Dictionary<(string SourceId, string Name), StaticWebAssetGroup>(items.Length); 71for (var i = 0; i < items.Length; i++)
DefineStaticWebAssetEndpoints.cs (14)
32var endpoints = new List<StaticWebAssetEndpoint>(CandidateAssets.Length); 36CandidateAssets.Length, 55if (ContentTypeMappings == null || ContentTypeMappings.Length == 0) 59var result = new ContentTypeMapping[ContentTypeMappings.Length]; 60for (var i = 0; i < ContentTypeMappings.Length; i++) 71if (ExistingEndpoints != null && ExistingEndpoints.Length > 0) 73Dictionary<string, HashSet<string>> existingEndpointsByAssetFile = new(ExistingEndpoints.Length, OSPath.PathComparer); 74var assets = new HashSet<string>(CandidateAssets.Length, OSPath.PathComparer); 80for (var i = 0; i < ExistingEndpoints.Length; i++) 108if (AdditionalEndpointDefinitions == null || AdditionalEndpointDefinitions.Length == 0) 113var result = new AdditionalEndpointDefinition[AdditionalEndpointDefinitions.Length]; 114for (var i = 0; i < AdditionalEndpointDefinitions.Length; i++) 240if (AdditionalEndpointDefinitions.Length > 0) 249for (var d = 0; d < AdditionalEndpointDefinitions.Length; d++)
DefineStaticWebAssets.cs (3)
88if (StaticWebAssetGroupDefinitions != null && StaticWebAssetGroupDefinitions.Length > 0) 118var assetsByRelativePath = new Dictionary<string, (ITaskItem First, ITaskItem Second)>(CandidateAssets.Length); 220PropertyOverrides == null || PropertyOverrides.Length == 0 ? candidate.ItemSpec : candidate.GetMetadata("OriginalItemSpec"));
FilterStaticWebAssetEndpoints.cs (5)
40for (var i = 0; i < endpoints.Length; i++) 78for (var i = 0; i < filterCriteria.Length; i++) 85for (var j = 0; j < endpoint.EndpointProperties.Length; j++) 102for (var j = 0; j < endpoint.Selectors.Length; j++) 119for (var j = 0; j < endpoint.ResponseHeaders.Length; j++)
FilterStaticWebAssetGroups.cs (1)
74for (var i = 0; i < Assets.Length; i++)
GeneratePackageAssetsManifestFile.cs (5)
32if (StaticWebAssets.Length == 0) 92var identityToPackagePath = new Dictionary<string, string>(parsedAssets.Length, Utils.OSPath.PathComparer); 93var packagePaths = new string[parsedAssets.Length]; 94for (var i = 0; i < parsedAssets.Length; i++) 114var indices = Enumerable.Range(0, parsedAssets.Length)
GenerateStaticWebAssetEndpointsManifest.cs (4)
72if (parsedPatterns.Length > 0) 144for (var i = 0; i < endpoint.ResponseHeaders.Length; i++) 152for (var j = 0; j < headerValues.Length; j++) 176for (var j = 0; j < segments.Length; j++)
GenerateStaticWebAssetEndpointsPropsFile.cs (1)
39if (endpoints.Length == 0)
GenerateStaticWebAssetsDevelopmentManifest.cs (16)
45if (Assets.Length == 0 && DiscoveryPatterns.Length == 0) 79var lengthResult = x.Item1.Length.CompareTo(y.Item1.Length); 84for (var i = 0; i < x.Item1.Length; i++) 178for (var i = 0; i < segments.Length; i++) 181if (segments.Length - 1 == i) 223if (segments.Length == 0) 244for (var i = 0; i < segments.Length; i++) 247if (segments.Length - 1 == i) 261Depth = segments.Length 378if (PathSegments.Length != other.PathSegments.Length) 380return PathSegments.Length.CompareTo(other.PathSegments.Length); 383for (var i = 0; i < PathSegments.Length; i++)
GenerateStaticWebAssetsManifest.cs (2)
57Log.LogMessage(MessageImportance.Low, "Generating manifest for '{0}' assets and '{1}' endpoints", assets.Length, endpoints.Length);
GenerateStaticWebAssetsPropsFile.cs (2)
57if (StaticWebAssets.Length == 0) 193for (var i = 0; i < StaticWebAssets.Length; i++)
JSModules\ApplyJsModules.cs (2)
33for (var i = 0; i < RazorComponents.Length; i++) 46for (var i = 0; i < RazorGenerate.Length; i++)
Legacy\GenerateStaticWebAssetsPropsFile50.cs (2)
51if (StaticWebAssets.Length == 0) 146for (var i = 0; i < StaticWebAssets.Length; i++)
Legacy\GenerateV1StaticWebAssetsManifest.cs (2)
103for (var i = 0; i < ContentRootDefinitions.Length; i++) 135for (var i = 0; i < ContentRootDefinitions.Length; i++)
Legacy\UpgradeLegacyStaticWebAssetsToV2.cs (3)
20if (Assets != null && Assets.Length > 0) 23UpgradedAssets = new ITaskItem[Assets.Length]; 24for (var i = 0; i < Assets.Length; i++)
Legacy\ValidateStaticWebAssetsUniquePaths.cs (2)
25for (var i = 0; i < StaticWebAssets.Length; i++) 54for (var i = 0; i < WebRootFiles.Length; i++)
MergeConfigurationProperties.cs (3)
28ProjectConfigurations = new ITaskItem[CandidateConfigurations.Length]; 30for (var i = 0; i < CandidateConfigurations.Length; i++) 105for (var j = 0; j < ProjectReferences.Length; j++)
OverrideHtmlAssetPlaceholders.cs (2)
175if (endpoint.Selectors?.Length == 0) 178for (var i = 0; i < endpoint.EndpointProperties?.Length; i++)
ResolveFingerprintedStaticWebAssetEndpointsForAssets.cs (4)
35for (var i = 0; i < candidateAssets.Length; i++) 48for (var j = 0; j < endpoints.Length; j++) 67for (var j = 0; j < endpoints.Length; j++) 101for (var i = 0; i < endpoint.EndpointProperties.Length; i++)
ResolveStaticWebAssetsEmbeddedProjectConfiguration.cs (6)
43var embeddedProjectAssetConfigurations = new EmbeddedStaticWebAssetProjectConfiguration[StaticWebAssetProjectConfiguration.Length]; 44for (var i = 0; i < StaticWebAssetProjectConfiguration.Length; i++) 49var embeddingRules = new StaticWebAssetEmbeddingConfiguration[EmbeddingConfiguration.Length]; 50for (var i = 0; i < EmbeddingConfiguration.Length; i++) 55var targetFrameworks = TargetFrameworks.Length > 0 ? TargetFrameworks.Select(t => t.ItemSpec).ToArray() : [TargetFramework]; 78if (CrossTargetingBuildConfigurations.Length > 0)
ScopedCss\ApplyCssScopes.cs (2)
36for (var i = 0; i < RazorComponents.Length; i++) 49for (var i = 0; i < RazorGenerate.Length; i++)
ScopedCss\ComputeCssScope.cs (2)
26ScopedCss = new ITaskItem[ScopedCssInput.Length]; 28for (var i = 0; i < ScopedCssInput.Length; i++)
ScopedCss\ConcatenateCssFiles.cs (5)
34if (ProjectBundles.Length > 0) 41if (ProjectBundles.Length > 0) 64var prefix = string.Join("/", Enumerable.Repeat("..", currentBasePathSegments.Length)); 65for (var i = 0; i < ProjectBundles.Length; i++) 79for (var i = 0; i < ScopedCssFiles.Length; i++)
ScopedCss\ConcatenateCssFiles50.cs (5)
34if (ProjectBundles.Length > 0) 41if (ProjectBundles.Length > 0) 64var prefix = string.Join("/", Enumerable.Repeat("..", currentBasePathSegments.Length)); 65for (var i = 0; i < ProjectBundles.Length; i++) 82for (var i = 0; i < ScopedCssFiles.Length; i++)
ScopedCss\ResolveAllScopedCssAssets.cs (1)
26for (var i = 0; i < StaticWebAssets.Length; i++)
ScopedCss\RewriteCss.cs (1)
38Parallel.For(0, FilesToTransform.Length, i =>
ServiceWorker\GenerateServiceWorkerAssetsManifest.cs (2)
42var entries = new ManifestEntry[Assets.Length]; 43for (var i = 0; i < Assets.Length; i++)
StaticWebAssetsGeneratePackManifest.cs (1)
37if (Assets.Length == 0)
UpdateExternallyDefinedStaticWebAssets.cs (4)
156for (var i = 0; i < fingerprintExpressions.Length; i++) 184if (fingerprintInferenceExpressions == null || fingerprintInferenceExpressions.Length == 0) 193var result = new Regex[fingerprintInferenceExpressions.Length]; 194for (var i = 0; i < fingerprintInferenceExpressions.Length; i++)
UpdatePackageStaticWebAssets.cs (2)
44for (var i = 0; i < Assets.Length; i++) 91for (var i = 0; i < parsedEndpoints.Length; i++)
UpdateStaticWebAssetEndpoints.cs (4)
88for (var i = 0; i < operations.Length; i++) 157for (var i = 0; i < elements.Length; i++) 186for (var i = 0; i < elements.Length; i++) 263for (var i = 0; i < elements.Length; i++)
Utils\HashingUtils.cs (2)
59var hashSet = new Dictionary<string, ITaskItem>(candidateAssets.Length); 60for (var i = 0; i < candidateAssets.Length; i++)
Microsoft.NET.Sdk.WorkloadManifestReader (12)
SdkDirectoryWorkloadManifestProvider.cs (2)
314for (int b = 0; b < 4 && b < bytes.Length; b++) 369if (_manifestRoots.Length == 1)
SdkFeatureBand.cs (3)
26var formattedPrerelease = prereleaseComponents.Length > 1 ? 45if (coreComponents.Length == 3) 60if (sections.Length > 1)
src\sdk\src\Common\WorkloadSetVersion.cs (2)
11if (sections.Length < 1) 21int coreComponentsLength = SeparateCoreComponents(workloadSetVersion, out _).Length;
WorkloadManifestReader.SystemTextJson.cs (2)
54var readCount = stream.Read(buffer, 0, buffer.Length); 96var readCount = stream.Read(newBuffer, remaining, newBuffer.Length - remaining);
WorkloadSet.cs (3)
49if (parts != null && parts.Length == 1) 128string? preReleaseOrBuild = sections.Length > 1 ? sections[1] : null; 136if (coreComponents.Length == 3)
Microsoft.Private.Windows.Core (20)
System\Collections\Generic\ArrayBuilder.cs (6)
37if ((uint)count < (uint)_items.Length) 50if (_items.Length == _maxCount) 55Debug.Assert(_count == _items.Length); 58Debug.Assert(_items.Length > 0); 59int newCapacity = Math.Min(_maxCount, 2 * _items.Length); 69Debug.Assert(_count == _items.Length);
System\IO\BinaryReaderExtensions.cs (1)
122Span<byte> arrayData = new(a, array.Length * sizeof(T));
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
468for (int i = 0; i < keys.Length; i++)
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (1)
317if (files is null || files.Length == 0)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (2)
176index = s_serializedObjectID.Length; 179return new MemoryStream(bytes, index, bytes.Length - index);
System\Private\Windows\Ole\DataStore.cs (2)
146for (int i = 0; i < formats.Length; i++) 167int definedCount = definedFormats.Length;
System\Private\Windows\Ole\FormatEnumerator.cs (1)
41for (int i = 0; i < formats.Length; i++)
System\TypeExtensions.cs (2)
73if (genericNames.Length != genericTypes.Length) 78for (int i = 0; i < genericTypes.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\VARIANTVector.cs (2)
18var variants = new VARIANT[values.Length]; 21for (int i = 0; i < values.Length; ++i)
Microsoft.SourceLink.AzureDevOpsServer.Git (19)
src\sourcelink\src\Common\AzureDevOps\AzureDevOpsUrlParser.cs (9)
27if (!UriUtilities.TrySplitRelativeUrl(relativeUrl, out var parts) || parts.Length == 0) 59if (index == parts.Length) 88if (!UriUtilities.TrySplitRelativeUrl(relativeUrl, out var parts) || parts.Length == 0 || 95if (!parts.Take(virtualDirectoryParts.Length).SequenceEqual(virtualDirectoryParts, StringComparer.OrdinalIgnoreCase)) 101var i = virtualDirectoryParts.Length; 109projectPath = string.Join("/", parts, 0, virtualDirectoryParts.Length) + "/" + collection + "/" + Uri.EscapeDataString(projectName ?? repositoryName); 120if (!UriUtilities.TrySplitRelativeUrl(uri.GetPath(), out var parts) || parts.Length == 0) 127parts.Length >= 3 && 231var i = parts.Length - 1;
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.AzureRepos.Git (21)
GetSourceLinkUrl.cs (2)
59if (items.Length % 2 != 0) 64for (var i = 0; i < items.Length; i += 2)
src\sourcelink\src\Common\AzureDevOps\AzureDevOpsUrlParser.cs (9)
27if (!UriUtilities.TrySplitRelativeUrl(relativeUrl, out var parts) || parts.Length == 0) 59if (index == parts.Length) 88if (!UriUtilities.TrySplitRelativeUrl(relativeUrl, out var parts) || parts.Length == 0 || 95if (!parts.Take(virtualDirectoryParts.Length).SequenceEqual(virtualDirectoryParts, StringComparer.OrdinalIgnoreCase)) 101var i = virtualDirectoryParts.Length; 109projectPath = string.Join("/", parts, 0, virtualDirectoryParts.Length) + "/" + collection + "/" + Uri.EscapeDataString(projectName ?? repositoryName); 120if (!UriUtilities.TrySplitRelativeUrl(uri.GetPath(), out var parts) || parts.Length == 0) 127parts.Length >= 3 && 231var i = parts.Length - 1;
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.Bitbucket.Git (12)
GetSourceLinkUrl.cs (2)
68if (!UriUtilities.TrySplitRelativeUrl(relativeUrl, out var parts) || parts.Length < 2) 74var i = parts.Length - 1;
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.Common (9)
SourceLinkHasSingleProvider.cs (1)
20HasSingleProvider = (ProviderTargets ?? "").Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Length == 1;
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.Gitea (10)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.Gitee (10)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.GitHub (10)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.GitLab (10)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.SourceLink.GitWeb (10)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
112if (mappings.Length == 0)
src\sourcelink\src\Common\GitProvider\TranslateRepositoryUrlGitTask.cs (1)
50if (hostUris.Length == 0)
src\sourcelink\src\Common\Utilities\Hash.cs (2)
96var maxSize = Math.Min(maxItemsToHash, values.Length); 205for (var i = 0; i < data.Length; i++)
src\sourcelink\src\Common\Utilities\SequenceComparer.cs (6)
22=> (prefix.Length <= sequence.Length) && Compare(sequence, prefix.Length, prefix, prefix.Length) == 0; 43return Compare(left, left.Length, right, right.Length);
Microsoft.TemplateEngine.Cli (9)
Commands\AliasAssignmentCoordinator.cs (6)
167string[] buckets = new string[parts.Length]; 169for (int i = 0; i < buckets.Length; ++i) 174int lastBucket = parts.Length - 1; 179int end = (lastBucket + 1) % parts.Length; 180int i = (lastBucket + 1) % parts.Length; 181for (; first || i != end; first = false, i = (i + 1) % parts.Length)
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (1)
262if (filesInDir.Length > 0)
TemplatePackageCoordinator.cs (2)
211string? version = split.Length > 1 ? split[1] : null; 215Reporter.Output.WriteLine(string.Format(LocalizableStrings.Colon_Separator_Deprecated, split[0], split.Length > 1 ? split[1] : string.Empty).Yellow());
Microsoft.TemplateEngine.Core (66)
Matching\Trie.cs (5)
20if (path.Length > MaxRemainingLength) 22MaxRemainingLength = path.Length; 25int remainingLength = path.Length - 1; 27for (int i = 0; i < path.Length; ++i, --remainingLength) 44if (i == path.Length - 1)
Operations\ExpandVariables.cs (2)
55processor.WriteToTarget(outputBytes, 0, outputBytes.Length); 56return outputBytes.Length;
Operations\Include.cs (11)
96while (totalBytesRead < composite.Length) 98int bytesRead = data!.Read(composite, totalBytesRead, composite.Length - totalBytesRead); 110byte[] newBuffer = new byte[composite.Length + pageSize]; 111Buffer.BlockCopy(composite, 0, newBuffer, 0, composite.Length); 115while (totalBytesRead < composite.Length) 117int bytesRead = data!.Read(composite, totalBytesRead, composite.Length - totalBytesRead); 134composite = Encoding.Convert(realEncoding, processor.Encoding, composite, bom.Length, totalBytesRead - bom.Length); 135nBytesToWrite = composite.Length; 139offset = bom.Length; 140nBytesToWrite = totalBytesRead - bom.Length;
Operations\InlineMarkupConditional.cs (3)
118fragment.Write(condition, 0, condition.Length); 156int sz = bufferLength == processorState.CurrentBuffer.Length ? _structureTrie.MaxLength : _structureTrie.MinLength; 234int sz = bufferLength == processorState.CurrentBuffer.Length ? _closeConditionTrie.MaxLength : _closeConditionTrie.MinLength;
Operations\PhasedOperation.cs (2)
117processor.WriteToTarget(match.Replacement!, 0, match.Replacement!.Length); 118return match.Replacement.Length;
Operations\Replacement.cs (2)
66processor.WriteToTarget(_replacement, 0, _replacement.Length); 67return _replacement.Length;
TokenConfig.cs (16)
31int realEnd = end != -1 ? end : (data.Length - start - 1); 51byte[] buffer = new byte[pre.Length + core.Length + post.Length]; 53if (pre.Length > 0) 55Buffer.BlockCopy(pre, 0, buffer, 0, pre.Length); 58if (core.Length > 0) 60Buffer.BlockCopy(core, 0, buffer, pre.Length, core.Length); 63if (post.Length > 0) 65Buffer.BlockCopy(post, 0, buffer, pre.Length + core.Length, post.Length); 68return new Token(buffer, pre.Length, buffer.Length - post.Length - 1);
Util\CombinedStream.cs (2)
38if (count + offset > buffer.Length) 41count = buffer.Length - offset;
Util\ProcessorState.cs (17)
64CurrentBufferLength = ReadExactBytes(source, CurrentBuffer, 0, CurrentBuffer.Length); 68_bomSize = bom.Length; 120int nRead = ReadExactBytes(_source, tmp, CurrentBufferLength - CurrentBufferPosition, tmp.Length - CurrentBufferLength); 160if (CurrentBufferLength < CurrentBuffer.Length && bytesToPreserveInBuffer == 0) 359if (_target.Position - _bomSize < buffer.Length) 365_target.Position -= buffer.Length; 368int nRead = ReadExactBytes(_target, buffer, 0, buffer.Length); 390if (_target.Position - _bomSize < buffer.Length) 396_target.Position -= buffer.Length; 411if (_target.Position - _bomSize < buffer.Length) 417_target.Position -= buffer.Length; 420int nRead = ReadExactBytes(_target, buffer, 0, buffer.Length); 442if (_target.Position - _bomSize < buffer.Length) 448_target.Position -= buffer.Length; 472int sz = bufferLength == CurrentBuffer.Length ? match.MaxLength : match.MinLength; 531if (count + offset > buffer.Length) 534count = buffer.Length - offset;
Util\Token.cs (1)
11: base(token.Length, start, end)
Util\TokenTrie.cs (4)
48if (token.Value.Length > MaxLength) 50MaxLength = token.Value.Length; 53if (token.Value.Length < MinLength) 55MinLength = token.Value.Length;
VariableCollection.cs (1)
155if (index >= array.Length)
Microsoft.TemplateEngine.Edge (4)
Mount\Archive\ZipFileMountPoint.cs (1)
54for (int i = 0; parentDir != null && i < parts.Length - 1; ++i)
Settings\SettingsFilePaths.cs (1)
137for (int i = 0; i < parts.Length; ++i)
Settings\TemplateCache.cs (1)
180if (lastTemplate.TemplatePackage is IManagedTemplatePackage && managedTemplates.Length > 1)
Template\WellKnownSearchFilters.cs (1)
174anyParts &= parts.Length == template.Classifications.Count;
Microsoft.TemplateEngine.Utils (35)
ArrayExtensions.cs (3)
13combinedLength += arg.Length; 20Array.Copy(arg, 0, combinedArray, nextIndex, arg.Length); 21nextIndex += arg.Length;
FileSystemInfoExtensions.cs (2)
39for (int i = 0; i < paths.Length; ++i) 116for (int i = 0; i < parts.Length; ++i)
InMemoryFileSystem.cs (27)
49for (int i = 0; i < parts.Length; ++i) 73for (int i = 0; i < parts.Length - 1; ++i) 84if (!currentDir.Files.TryGetValue(parts[parts.Length - 1], out FileSystemFile targetFile)) 86targetFile = new FileSystemFile(parts[parts.Length - 1], Path.Combine(currentDir.FullPath, parts[parts.Length - 1])); 87currentDir.Files[parts[parts.Length - 1]] = targetFile; 115for (int i = 0; i < parts.Length; ++i) 152for (int i = 0; i < parts.Length; ++i) 185for (int i = 0; i < parts.Length; ++i) 265for (int i = 0; i < parts.Length; ++i) 347for (int i = 0; i < parts.Length; ++i) 447for (int i = 0; i < parts.Length - 1; ++i) 458_ = currentDir.Files.Remove(parts[parts.Length - 1]); 473for (int i = 0; i < parts.Length - 1; ++i) 483return currentDir.Files.ContainsKey(parts[parts.Length - 1]); 503for (int i = 0; i < parts.Length - 1; ++i) 514if (!currentDir.Files.TryGetValue(parts[parts.Length - 1], out FileSystemFile targetFile)) 561for (int i = 0; i < parts.Length - 1; ++i) 572if (!currentDir.Files.TryGetValue(parts[parts.Length - 1], out FileSystemFile targetFile)) 593for (int i = 0; i < parts.Length - 1; ++i) 604if (!currentDir.Files.TryGetValue(parts[parts.Length - 1], out FileSystemFile targetFile)) 624for (int i = 0; i < parts.Length - 1; ++i) 635if (!currentDir.Files.TryGetValue(parts[parts.Length - 1], out FileSystemFile targetFile)) 655for (int i = 0; i < parts.Length - 1; ++i) 666if (!currentDir.Files.TryGetValue(parts[parts.Length - 1], out FileSystemFile targetFile)) 717for (int i = 0; i < parts.Length; ++i) 864_ = target.Read(_data, 0, _data.Length);
RangeVersionSpecification.cs (1)
50if (parts.Length != 2)
VersionStringHelpers.cs (2)
72if (parts.Length is < 2 or > 4) 81for (int i = 0; i < parts?.Length; i++)
Microsoft.TestPlatform.AdapterUtilities (16)
ManagedNameUtilities\ManagedNameHelper.Reflection.cs (13)
176if (hierarchyPos is null || hierarchyPos.Length != 3) 182var arity = method.GetGenericArguments().Length; 199if (paramList.Length != 0) 301if (mbr is not MethodInfo method || method.Name != methodName || method.GetGenericArguments().Length != methodArity) 307if (paramList.Length == 0 && parameterTypes == null) 311else if (parameterTypes == null || paramList.Length != parameterTypes.Length) 316for (int i = 0; i < paramList.Length; i++) 331return (MethodInfo?)(methods.Length switch 527: info.GenericTypeParameters.Length > 0 528? info.GenericTypeParameters.Length 529: info.GenericTypeArguments.Length; 550if (genericArguments.Length != 0)
TestIdProvider.cs (3)
44_sha.TransformBlock(bytes, 0, bytes.Length, null, 0); 61if (bytes.Length == 0) 66_sha.TransformBlock(bytes, 0, bytes.Length, null, 0);
Microsoft.TestPlatform.Build (1)
Tasks\VSTestTask2.cs (1)
268data = parts.Skip(2).Take(parts.Length).Select(p => p?.Replace("~~~~", "\r").Replace("!!!!", "\n")).ToArray();
Microsoft.TestPlatform.CoreUtilities (8)
Helpers\CommandLineArgumentsHelper.cs (2)
27for (int i = 0; i < args.Length; i++) 31if (i < args.Length - 1 && !args[i + 1].StartsWith("-"))
Helpers\DotnetHostHelper.cs (2)
420ReadExactly(headerReader, magicBytes, 0, magicBytes.Length); 421ReadExactly(headerReader, cpuInfoBytes, 0, cpuInfoBytes.Length);
Helpers\FileHelper.cs (1)
51if (endsWithSearchPatterns == null || endsWithSearchPatterns.Length == 0)
Output\OutputExtensions.cs (1)
108string message = args != null && args.Length > 0 ? string.Format(CultureInfo.CurrentCulture, format, args) : format;
Utilities\MulticastDelegateUtilities.cs (2)
65invocationList.Length, 78invocationList.Length,
Microsoft.TestPlatform.CrossPlatEngine (6)
AttachmentsProcessing\DataCollectorAttachmentsProcessorsFactory.cs (1)
30if (invokedDataCollectors?.Length > 0)
AttachmentsProcessing\TestRunAttachmentsProcessingManager.cs (3)
119for (int i = 0; i < dataCollectorAttachmentsProcessors.Length; i++) 149if (attachmentsToBeProcessed.Length == 0) 161new TestRunAttachmentsProcessingProgressEventArgs(attachmentsHandlerIndex, attachmentProcessorUris, progress, dataCollectorAttachmentsProcessors.Length)));
PostProcessing\ArtifactProcessingManager.cs (1)
148if (testArtifacts?.Length > 0)
TestSession\ProxyTestSessionManager.cs (1)
125for (int i = 0; i < taskList.Length; ++i)
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
ProcessCodeMethods.cs (1)
124return parts.Length < 5 ? InvalidProcessId : int.Parse(parts[3], CultureInfo.CurrentCulture);
Microsoft.TestPlatform.Filter.Source (4)
Condition.cs (3)
112if (multiValue is null or { Length: 0 } 192if (parts.Length == 1) 199if (parts.Length != 3)
FastFilter.cs (1)
105else if (multiValues is { Length: > 0 })
Microsoft.TestPlatform.PlatformAbstractions (1)
common\Tracing\PlatformEqtTrace.cs (1)
396if (args != null && args.Length != 0)
Microsoft.TestUtilities (2)
XUnit\ConditionalTheoryDiscoverer.cs (1)
52if (skipReason == null && dataRow?.Length > 0)
XUnit\EnvironmentVariableConditionAttribute.cs (1)
33if (values == null || values.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 988ElseIf result.Length > 1 Then 1028If attributes IsNot Nothing AndAlso attributes.Length > 0 Then 1043If result.Length > 1 Then 1074If result.Length = 0 Then 1086If result.Length = 0 Then 1153If indices.Length <> rank Then 1202If arguments.Length - 1 <> rank Then 1208Dim 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)
57buffer:=content.AsMemory(start:=0, length:=content.Length),
Microsoft\VisualBasic\Logging\FileLogTraceListener.vb (1)
847Dim bound As Integer = data.Length - 1
Microsoft.VisualStudio.TestPlatform.Common (18)
DataCollection\DataCollectorConfig.cs (3)
85if (typeUriAttributes.Length > 0) 105if (attachmentsProcessor.Length > 0) 126if (friendlyNameAttributes != null && friendlyNameAttributes.Length > 0)
DataCollection\TestPlatformDataCollectionEvents.cs (1)
111return listeners != null && listeners.Length != 0;
ExtensionFramework\TestPluginDiscoverer.cs (2)
139if (discoveredExtensions?.Length > 0) 166if (e.Types?.Length > 0)
ExtensionFramework\Utilities\TestDiscovererPluginInformation.cs (2)
94if (attributes != null && attributes.Length > 0) 119if (attributes != null && attributes.Length > 0)
ExtensionFramework\Utilities\TestExtensionPluginInformation.cs (1)
71if (attributes.Length > 0)
ExtensionFramework\Utilities\TestLoggerPluginInformation.cs (1)
57if (attributes.Length > 0)
ExtensionFramework\Utilities\TestRunTimePluginInformation.cs (1)
57if (attributes != null && attributes.Length > 0)
ExtensionFramework\Utilities\TestSettingsProviderPluginInformation.cs (1)
71if (attributes != null && attributes.Length > 0)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\Condition.cs (3)
112if (multiValue is null or { Length: 0 } 192if (parts.Length == 1) 199if (parts.Length != 3)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FastFilter.cs (1)
105else if (multiValues is { Length: > 0 })
Utilities\AssemblyResolver.cs (1)
241for (var index = 0; index < requestedPublicKey.Length; ++index)
Utilities\RunSettingsProviderExtensions.cs (1)
204for (var i = 0; i < path.Length; i++)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (9)
Utility\TrxFileHelper.cs (6)
194TPDebug.Assert(pathTokens.Length > 0 && basePathTokens.Length > 0); 195int max = Math.Min(pathTokens.Length, basePathTokens.Length); 232for (int j = i; j < basePathTokens.Length; j++) 245for (int j = i; j < pathTokens.Length; j++)
XML\XmlPersistence.cs (3)
468for (int i = 0; i < counters.Length; i++) 609return attributes.Length > 0 ? (T)attributes[0] : default; 715return parts.Length > 1 ? EnsureLocationExists((XmlElement)firstChild, parts[1]) : firstChild;
Microsoft.VisualStudio.TestPlatform.ObjectModel (12)
DataCollector\Common\FileHelper.cs (1)
21InvalidFileNameChars = new(invalidCharsArray.Length);
Nuget.Frameworks\DefaultPortableFrameworkMappings.cs (1)
118var profileOptionalFrameworks = new List<KeyValuePair<int, NuGetFramework[]>>(ProfilesWithOptionalFrameworks.Length);
Nuget.Frameworks\FrameworkReducer.cs (3)
306var results = new List<NuGetFramework>(input.Length); 308for (var i = 0; i < input.Length; i++) 314for (var j = 0; !dupe && j < input.Length; j++)
Nuget.Frameworks\NuGetFrameworkFactory.cs (4)
420while (versionStart < chars.Length 438while (profileStart < chars.Length 451if (profileStart < chars.Length) 457if (actualProfileStart == chars.Length)
TraitCollection.cs (2)
74var traits = new Trait[traitsKvp.Length]; 75for (int i = 0; i < traits.Length; i++)
Utilities\EqtHash.cs (1)
35TPDebug.Assert(Guid.Empty.ToByteArray().Length == 16, "Expected Guid to be 16 bytes");
Microsoft.Web.XmlTransform (1)
XmlFileInfoDocument.cs (1)
94stream.ReadExactly(buffer, 0, buffer.Length);
Microsoft.Win32.Registry (17)
Microsoft\Win32\RegistryKey.cs (17)
423Debug.Assert(index >= 0 && index < s_hkeyNames.Length, "index is out of range!"); 453if (index < 0 || index >= s_hkeyNames.Length || ((int)hKey & 0xFFFFFFF0) != 0x80000000) 787if (cpt >= names.Length) // possible new item during loop 789Array.Resize(ref names, names.Length * 2); 804if (cpt < names.Length) 869int nameLength = name.Length; 886if (cpt >= names.Length) // possible new item during loop 888Array.Resize(ref names, names.Length * 2); 902if (cpt >= names.Length) // possible new item during loop 904Array.Resize(ref names, names.Length * 2); 915int oldLength = oldName.Length; 928nameLength = name.Length; 938if (cpt < names.Length) 1147if (count == strings.Length) 1286for (int i = 0; i < dataStrings.Length; i++) 1300for (int i = 0; i < dataStrings.Length; i++) 1325dataBytes.Length);
Microsoft.Win32.SystemEvents (3)
Microsoft\Win32\SystemEvents.cs (3)
990Debug.Assert(args != null && args.Length == 2); 1015for (int i = 0; i < invokeItemArray.Length; i++) 1034for (int i = 0; i < invokeItemArray.Length; i++)
Mono.Cecil (156)
Mono.Cecil.Cil\CodeReader.cs (2)
257 var branches = new Instruction [offsets.Length]; 258 for (int j = 0; j < offsets.Length; j++)
Mono.Cecil.Cil\CodeWriter.cs (4)
209 WriteInt32 (targets.Length); 210 var diff = instruction.Offset + opcode.Size + (4 * (targets.Length + 1)); 211 for (int i = 0; i < targets.Length; i++) 403 for (int i = 0; i < targets.Length; i++)
Mono.Cecil.Cil\Instruction.cs (2)
74 return size + (1 + ((Instruction []) operand).Length) * 4; 122 for (int i = 0; i < labels.Length; i++) {
Mono.Cecil.Cil\MethodBody.cs (2)
448 for (int i = 0; i < items.Length; i++) { 468 for (int i = cache_index; i < items.Length; i++) {
Mono.Cecil.Cil\OpCode.cs (2)
429 for (int i = 0, p = 0; i < names.Length; i++) { 432 for (int j = 0; j < buffer.Length; j++)
Mono.Cecil.Cil\PortablePdb.cs (9)
92 if (data.Length < 24) 371 codeViewDirectory.SizeOfData = data.Length; 395 pdbChecksumDirectory.SizeOfData = data.Length; 411 mdi.length = mdi.rows.Length; 450 for (int i = 0; i < tables.Length; i++) { 459 for (int i = 0; i < tables.Length; i++) { 572 var debugHeaderEntries = new ImageDebugHeaderEntry [pdbDebugHeader.Entries.Length + 1]; 573 for (int i = 0; i < pdbDebugHeader.Entries.Length; i++) 575 debugHeaderEntries [debugHeaderEntries.Length - 1] = new ImageDebugHeaderEntry (directory, data.ToArray ());
Mono.Cecil.Cil\Symbols.cs (5)
990 for (var i = 0; i < bytesHeader.Length; i++) { 1170 var entries = new ImageDebugHeaderEntry [header.Entries.Length + 1]; 1171 Array.Copy (header.Entries, entries, header.Entries.Length); 1172 entries [entries.Length - 1] = entry; 1191 for (var i = 0; i < header.Entries.Length; i++) {
Mono.Cecil.Metadata\BlobHeap.cs (3)
24 if (index == 0 || index > this.data.Length - 1) 30 if (length > data.Length - position) 42 if (signature == 0 || signature > data.Length - 1) {
Mono.Cecil.Metadata\Buffers.cs (5)
133 for (int i = 0; i < tables.Length; i++) { 144 for (int i = 0; i < tables.Length; i++) { 157 for (int i = 0; i < tables.Length; i++) { 180 for (int i = 0; i < tables.Length; i++) { 251 WriteInt32 (resource.Length);
Mono.Cecil.Metadata\GuidHeap.cs (1)
26 if (index == 0 || ((index - 1) + guid_size) > data.Length)
Mono.Cecil.Metadata\StringHeap.cs (1)
35 if (index > data.Length - 1)
Mono.Cecil.Metadata\Utilities.cs (1)
643 for (int i = 0; i < tables.Length; i++) {
Mono.Cecil.PE\ByteBuffer.cs (10)
34 this.length = this.buffer.Length; 165 if (position == buffer.Length) 181 if (position + 2 > buffer.Length) 198 if (position + 4 > buffer.Length) 217 if (position + 8 > buffer.Length) 272 var length = bytes.Length; 273 if (position + length > buffer.Length) 285 if (position + length > buffer.Length) 296 if (position + buffer.length > this.buffer.Length) 329 var current_length = current.Length;
Mono.Cecil.PE\Image.cs (2)
109 for (int i = 0; i < sections.Length; i++) { 121 for (int i = 0; i < sections.Length; i++) {
Mono.Cecil.PE\ImageReader.cs (1)
343 for (int i = 0; i < entries.Length; i++) {
Mono.Cecil.PE\ImageWriter.cs (12)
304 WriteUInt32 ((uint) (debug_header.Entries.Length * ImageDebugDirectory.Size)); 506 WriteUInt32 ((uint) version.Length); 589 var data_start = (int) BaseStream.Position + (debug_header.Entries.Length * ImageDebugDirectory.Size); 591 for (var i = 0; i < debug_header.Entries.Length; i++) { 603 data_start += entry.Data.Length; 608 for (var i = 0; i < debug_header.Entries.Length; i++) { 710 var directories_len = debug_header.Entries.Length * ImageDebugDirectory.Size; 714 for (var i = 0; i < debug_header.Entries.Length; i++) { 718 directory.AddressOfRawData = entry.Data.Length == 0 ? 0 : data_address; 721 data_len += entry.Data.Length; 722 data_address += entry.Data.Length; 807 int size = public_key.Length;
Mono.Cecil\AssemblyNameReference.cs (6)
99 Array.Copy (hash, (hash.Length - 8), local_public_key_token, 0, 8); 152 if (!pk_token.IsNullOrEmpty () && pk_token.Length > 0) { 153 for (int i = 0 ; i < pk_token.Length ; i++) { 179 for (int i = 0; i < tokens.Length; i++) { 188 if (parts.Length != 2) 204 for (int j = 0; j < name.PublicKeyToken.Length; j++)
Mono.Cecil\AssemblyReader.cs (18)
806 var type_count = mtypes.Length - metadata.NestedTypes.Count; 809 for (int i = 0; i < mtypes.Length; i++) { 827 for (int i = 0; i < types.Length; i++) { 1082 var length = metadata.TypeReferences.Length; 1178 if (index < 0 || index >= scopes.Length) 1909 for (int i = 0; i < ranges.Length; i++) 2507 for (int i = 0; i < ranges.Length; i++) 2537 for (int i = 0; i < ranges.Length; i++) 2660 for (int i = 0; i < ranges.Length; i++) 3001 value = Encoding.Unicode.GetString (bytes, 0, bytes.Length); 3179 return rows.Length > 0; 3190 var infos = new Collection<CustomDebugInformation> (rows.Length); 3192 for (int i = 0; i < rows.Length; i++) { 3353 for (int i = 0; i < sizes.Length; i++) 3357 for (int i = 0; i < low_bounds.Length; i++) 3365 if (i < low_bounds.Length) 3368 if (i < sizes.Length) 3807 if (position + length > buffer.Length)
Mono.Cecil\AssemblyWriter.cs (9)
220 if (rows.Length == length) 229 var rows = new TRow [this.rows.Length * 2]; 230 Array.Copy (this.rows, rows, this.rows.Length); 2496 signature.WriteInt32 (content.Length); 2646 for (int i = 0; i < parts.Length; i++) { 2726 WriteCompressedUInt32 ((uint) bytes.Length); 2977 WriteInt32 (values.Length); 2979 if (values.Length == 0) 2984 for (int i = 0; i < values.Length; i++)
Mono.Cecil\BaseAssemblyResolver.cs (1)
96 Array.Copy (this.directories.items, directories, directories.Length);
Mono.Cecil\EmbeddedResource.cs (1)
92 while ((read = stream.Read (buffer, 0, buffer.Length)) > 0)
Mono.Cecil\Import.cs (11)
276 var instance = new GenericInstanceType (element_type, arguments.Length); 281 for (int i = 0; i < arguments.Length; i++) 415 for (int i = 0; i < parameters.Length; i++) { 433 for (int i = 0; i < arguments.Length; i++) 455 for (int i = 0; i < arguments.Length; i++) 563 ? new byte [name.PublicKeyToken.Length] 566 if (pk_token.Length > 0) 567 Buffer.BlockCopy (name.PublicKeyToken, 0, pk_token, 0, pk_token.Length); 795 if (a.Length != b.Length) 797 for (int i = 0; i < a.Length; i++)
Mono.Cecil\MetadataSystem.cs (9)
165 if (rid < 1 || rid > AssemblyReferences.Length) 173 if (rid < 1 || rid > Types.Length) 186 if (rid < 1 || rid > TypeReferences.Length) 199 if (rid < 1 || rid > Fields.Length) 212 if (rid < 1 || rid > Methods.Length) 225 if (rid < 1 || rid > MemberReferences.Length) 323 if (rid < 1 || rid > Documents.Length) 341 if (rid < 1 || rid > ImportScopes.Length) 365 int max = types.Length - 1;
Mono.Cecil\ModuleDefinition.cs (2)
770 for (int i = 1; i < names.Length; i++) { 1388 while ((read = self.Read (buffer, 0, buffer.Length)) != 0)
Mono.Cecil\TypeParser.cs (6)
70 for (int i = 0; i < nested_names.Length; i++) 267 for (int i = 0; i < specs.Length; i++) { 299 var instance = new GenericInstanceType (type, generic_arguments.Length); 302 for (int i = 0; i < generic_arguments.Length; i++) 335 for (int i = 0; i < nested_names.Length; i++) { 381 for (int i = 0; i < nested_names.Length; i++) {
Mono.Cecil\TypeSystem.cs (1)
44 for (int i = 0; i < types.Length; i++) {
Mono.Collections.Generic\Collection.cs (6)
48 get { return items.Length; } 119 this.size = this.items.Length; 124 if (size == items.Length) 146 if (size == items.Length) 247 if (new_size <= items.Length) 253 System.Math.Max (items.Length * 2, default_capacity),
Mono.Collections.Generic\ReadOnlyCollection.cs (1)
53 Initialize (array, array.Length);
Mono.Security.Cryptography\CryptoConvert.cs (8)
59 for (int i=0; i < array.Length; i++) { 61 byte[] result = new byte [array.Length - i]; 62 Buffer.BlockCopy (array, i, result, 0, result.Length); 135 if (pos + byteLen + offset <= blob.Length) { 235 if (offset >= blob.Length) 257 int keyLength = p.Modulus.Length; // in bytes 277 int n = p.Exponent.Length; 283 int len = part.Length;
Mono.Security.Cryptography\CryptoService.cs (9)
35 var publicKey = new byte [12 + cspBlob.Length]; 36 Buffer.BlockCopy (cspBlob, 0, publicKey, 12, cspBlob.Length); 45 publicKey [8] = (byte) (cspBlob.Length >> 0); 46 publicKey [9] = (byte) (cspBlob.Length >> 8); 47 publicKey [10] = (byte) (cspBlob.Length >> 16); 48 publicKey [11] = (byte) (cspBlob.Length >> 24); 64 stream.Write (strong_name, 0, strong_name.Length); 117 int read = stream.Read (buffer, 0, System.Math.Min (buffer.Length, length)); 150 for (int i = 0; i < buffers.Length; i++) {
Mono\Empty.cs (3)
36 return self == null || self.Length == 0; 57 self = self.Resize (self.Length + 1); 58 self [self.Length - 1] = item;
Mono\MergeSort.cs (3)
24 this.buffer = new T [elements.Length]; 25 Array.Copy (this.elements, this.buffer, elements.Length); 31 Sort (source, 0, source.Length, comparer);
Mono.Cecil.Mdb (24)
Mono.Cecil.Mdb\MdbReader.cs (4)
93 if (index < 0 || index >= scopes.Length) 108 info.sequence_points = new Collection<SequencePoint> (table.LineNumbers.Length); 110 for (var i = 0; i < table.LineNumbers.Length; i++) { 139 var scopes = new ScopeDebugInformation [blocks.Length + 1];
Mono.Cecil.Mdb\MdbWriter.cs (1)
63 var entry = writer.DefineDocument (url, null, document.Hash != null && document.Hash.Length == 16 ? document.Hash : null);
Mono.CompilerServices.SymbolWriter\MonoSymbolTable.cs (14)
862 for (int i = 0; i < LineNumbers.Length; i++) { 914 for (int i = 0; i < LineNumbers.Length; i++) { 922 for (int i = 0; i < LineNumbers.Length; i++) { 1016 for (int i = 0; i < _line_numbers.Length; ++i) { 1023 for (int i = 0; i < _line_numbers.Length; ++i) { 1040 if (_line_numbers.Length > 1) { 1042 end = _line_numbers [_line_numbers.Length - 1]; 1149 file.NumLineNumbers += lines.Length; 1151 int num_locals = locals != null ? locals.Length : 0; 1190 for (int i = 0; i < line_numbers.Length; i++) { 1224 int num_locals = locals != null ? locals.Length : 0; 1231 int num_code_blocks = code_blocks != null ? code_blocks.Length : 0; 1237 int num_scope_vars = scope_vars != null ? scope_vars.Length : 0; 1436 bw.WriteLeb128 (UsingClauses.Length);
Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs (5)
190 if (blocks.Length > 0) { 196 var sorted = new List<CodeBlockEntry> (blocks.Length); 198 for (int i = 0; i < blocks.Length; ++i) { 208 if (i < blocks.Length && blocks [i].Index == scope_index) { 214 for (int ii = 0; ii < blocks.Length; ++ii) {
Mono.Cecil.Pdb (37)
Microsoft.Cci.Pdb\BitAccess.cs (9)
33if (buffer.Length < newCapacity) { 35Array.Copy(buffer, newBuffer, buffer.Length); 53if (buffer.Length < capacity) { 148for (int i = 0; i < values.Length; i++) { 154for (int i = 0; i < values.Length; i++) { 160for (int i = 0; i < bytes.Length; i++) { 198while (offset + len < buffer.Length && buffer[offset + len] != 0) { 207while (offset + len < buffer.Length && buffer[offset + len] != 0) { 244while (offset + len < buffer.Length && buffer[offset + len] != 0) {
Microsoft.Cci.Pdb\IntHashTable.cs (12)
130for (int i = 0; i < primes.Length; i++) { 297uint hashcode = InitHash(key, lbuckets.Length, out seed, out incr); 302int bucketNumber = (int)(seed % (uint)lbuckets.Length); 311} while (b.hash_coll < 0 && ++ntry < lbuckets.Length); 327rehash(GetPrime(1+buckets.Length*2)); 332rehash(buckets.Length); 350for (nb = 0; nb < buckets.Length; nb++) { 401uint hashcode = InitHash(key, buckets.Length, out seed, out incr); 407int bucketNumber = (int)(seed % (uint)buckets.Length); 457} while (++ntry < buckets.Length); 480uint incr = (uint)(1 + (((seed >> 5) + 1) % ((uint)newBuckets.Length - 1))); 483int bucketNumber = (int)(seed % (uint)newBuckets.Length);
Microsoft.Cci.Pdb\MsfDirectory.cs (1)
13int directoryRootPages = head.directoryRoot.Length;
Microsoft.Cci.Pdb\PdbFile.cs (4)
196while (funcIndex < funcs.Length-1 && func.lines != null) { 302for (int i = 0; i < funcs.Length; i++) { 389pdbInfo.SourceServerData = bits.ReadBString(bytes.Length); 406for (int m = 0; m < modules.Length; m++) {
Mono.Cecil.Pdb\NativePdbReader.cs (7)
76 if (data.Length < 24) 117 if (function.scopes.Length > 1) { 118 for (int i = 1; i < function.scopes.Length; i++) { 154 var symbols = new Collection<ScopeDebugInformation> (scopes.Length); 170 parent.variables = new Collection<VariableDebugInformation> (scope.slots.Length); 185 parent.constants = new Collection<ConstantDebugInformation> (scope.constants.Length); 236 if (function.scopes.Length != 1)
Mono.Cecil.Pdb\SymDocumentWriter.cs (2)
30 writer.SetSource ((uint) source.Length, source); 35 writer.SetCheckSum (hashAlgo, (uint) checkSum.Length, checkSum);
Mono.Cecil.Pdb\SymWriter.cs (2)
116 writer.DefineSequencePoints (document.Writer, offsets.Length, offsets, lines, columns, endLines, endColumns); 154 writer.SetSymAttribute (0, name, (uint) metadata.Length, handle.AddrOfPinnedObject ());
Mono.Cecil.Rocks (3)
Mono.Cecil.Rocks\TypeReferenceRocks.cs (3)
66 if (arguments.Length == 0) 68 if (self.GenericParameters.Count != arguments.Length) 71 var instance = new GenericInstanceType (self, arguments.Length);
MSBuild (110)
CommandLine\CommandLineParser.cs (2)
549Assumed.LessThanOrEqual(projectSwitchParameters.Length, 1, "Expect exactly one project at a time."); 551if (projectSwitchParameters.Length == 1)
CommandLine\CommandLineSwitches.cs (6)
453Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 455Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 458for (int i = 0; i < s_parameterlessSwitchesMap.Length; i++) 468for (int i = 0; i < s_parameterizedSwitchesMap.Length; i++) 591for (int i = 0; i < _parameterlessSwitches.Length; i++) 599for (int i = 0; i < _parameterizedSwitches.Length; i++)
JsonOutputFormatter.cs (4)
30if (propertyNames.Length == 0) 48if (itemNames.Length == 0) 84if (itemNames.Length == 0) 125if (targetNames.Length == 0)
OutOfProcTaskAppDomainWrapperBase.cs (2)
410if (value.GetCustomAttributes(typeof(OutputAttribute), true).Length > 0) 478string[] filtered = new string[stringArray.Length - nullCount];
OutOfProcTaskHostNode.cs (6)
515Assumed.True(targetOutputsPerProject is null || projectFileNames.Length == targetOutputsPerProject.Length, $"projectFileNames has {projectFileNames.Length} entries but targetOutputsPerProject has {targetOutputsPerProject?.Length ?? 0} -- lengths must match."); 519BuildEngineResult result = BuildProjectFilesInParallel(projectFileNames, targetNames, globalProperties, new List<string>[projectFileNames.Length], toolsVersion, includeTargetOutputs); 523for (int i = 0; i < targetOutputsPerProject.Length && i < result.TargetOutputsPerProject.Count; i++)
src\msbuild\src\Shared\NodeEndpointOutOfProcBase.cs (2)
667if (bytesRead != headerByte.Length) 687CommunicationsUtilities.Trace($"Incomplete header read from server. {bytesRead} of {headerByte.Length} bytes read");
src\msbuild\src\Shared\OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
src\msbuild\src\Shared\ResourceUtilities.cs (1)
362if (args?.Length > 0)
src\msbuild\src\Shared\TaskHostBuildRequest.cs (5)
82var result = new Dictionary<string, string>?[globalProperties.Length]; 83for (int i = 0; i < globalProperties.Length; i++) 138int length = array?.Length ?? 0; 165int length = _globalProperties?.Length ?? 0; 192int length = _removeGlobalProperties?.Length ?? 0;
src\msbuild\src\Shared\TaskParameter.cs (6)
132ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 134for (int i = 0; i < inputAsITaskItemArray.Length; i++) 291int length = wrappedItems?.Length ?? 0; 295for (int i = 0; i < wrappedItems.Length; i++) 422int length = array.Length; 505int length = array.Length;
src\msbuild\src\Shared\TypeLoader.cs (2)
266Dictionary<string, string> assembliesDictionary = new(localAssemblies.Length + runtimeAssemblies.Length);
XMake.cs (73)
787&& switchesNotFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0 788&& switchesFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0 804bool outputPropertiesItemsOrTargetResults = getProperty.Length > 0 || getItem.Length > 0 || getTargetResult.Length > 0; 816getProperty.Length > 0 ? "getProperty" : 817getItem.Length > 0 ? "getItem" : 820else if ((getProperty.Length > 0 || getItem.Length > 0) && (targets is null || targets.Length == 0)) 904if (outputPropertiesItemsOrTargetResults && targets?.Length > 0 && result is not null) 1128if (getProperty.Length == 1 && getItem.Length == 0) 1161else if (getProperty.Length == 1 && getItem.Length == 0 && getTargetResult.Length == 0) 1356if (loggers.Length == 1 && 1606bool restoreOnly = targets.Length == 1 && string.Equals(targets[0], MSBuildConstants.RestoreTargetName, StringComparison.OrdinalIgnoreCase); 2239bool minimizeStdOutOutput = getProperty.Length + getItem.Length + getTargetResult.Length > 0 && getResultOutputFile.Length == 0; 2457if (parameterAndValue[0].Equals("default", StringComparison.InvariantCultureIgnoreCase) && parameterAndValue.Length > 1) 2490terminalLoggerArg = switches[switches.Length - 1]; 2557return terminalLoggerParameters?.Length > 0 ? MSBuildApp.AggregateParameters(string.Empty, terminalLoggerParameters) : string.Empty; 2654if (parameters.Length == 1 && bool.TryParse(parameters[0], out bool boolValue)) 2688if (parameters.Length == 1 && bool.TryParse(parameters[0], out var boolValue)) 2738if (parameters.Length > 0) 2742parentPacketVersion = byte.Parse(parameters[parameters.Length - 1], CultureInfo.InvariantCulture); 2746CommunicationsUtilities.Trace($"Invalid node packet version value '{parameters[parameters.Length - 1]}': {ex.Message}"); 2751CommunicationsUtilities.Trace($"Node packet version value '{parameters[parameters.Length - 1]}' out of range: {ex.Message}"); 2772if (parameters.Length > 0) 2777enableNodeReuse = bool.Parse(parameters[parameters.Length - 1]); 2781CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message); 2785CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message); 2800if (parameters.Length > 0) 2804writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 2808CommandLineSwitchException.Throw("InvalidPreprocessPath", parameters[parameters.Length - 1], ex.Message); 2819if (parameters.Length > 0) 2823writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 2827CommandLineSwitchException.Throw("TargetsCouldNotBePrinted", parameters[parameters.Length - 1], ex.Message); 2882if (parameters.Length > 0) 2886value = bool.Parse(parameters[parameters.Length - 1]); 2890CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message); 2894CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message); 2911if (parameters == null || parameters.Length == 0) 2918var profilerFile = parameters[parameters.Length - 1]; 2933CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 2938CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 2943CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 2977if (input.Length > 0) 3079if (parameters.Length > 0) 3083cpuCount = int.Parse(parameters[parameters.Length - 1], CultureInfo.InvariantCulture); 3087CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message); 3091CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message); 3094CommandLineSwitchException.VerifyThrow(cpuCount > 0 && cpuCount <= 1024, "InvalidMaxCPUCountValueOutsideRange", parameters[parameters.Length - 1]); 3112Assumed.LessThanOrEqual(parameters.Length, 1, "Expect exactly one project at a time."); 3117if (parameters.Length == 1) 3244if (projectExtensionsToIgnore?.Length > 0) 3294if (parameters.Length > 0) 3298return parameters[parameters.Length - 1]; 3319Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2), 3323CommandLineSwitchException.VerifyThrow((parameterSections[0].Length > 0) && (parameterSections.Length == 2), 3373if (verbositySwitchParameters.Length > 0) 3376originalVerbosity = ProcessVerbositySwitch(verbositySwitchParameters[verbositySwitchParameters.Length - 1]); 3435for (int i = 0; i < parametersToAggregate.Length; i++) 3460for (int i = 0; i < groupedFileLoggerParameters.Length; i++) 3480if (groupedFileLoggerParameters[i].Length > 0) 3515if (binaryLoggerParameters == null || binaryLoggerParameters.Length == 0) 3574if ((consoleLoggerParameters?.Length > 0)) 3696if ((fileLoggerParameters?.Length > 0)) 3784value = (nameValuePair.Length > 1) ? nameValuePair[1] : null; 4264if (features.Length == 1)
NuGet.Build.Tasks (19)
GetReferenceNearestTargetFrameworkTask.cs (10)
85FallbackTargetFrameworks.Length > 0) 102AssignedProjects = new ITaskItem[AnnotatedProjectReferences.Length]; 103for (var index = 0; index < AnnotatedProjectReferences.Length; index++) 134if (referencedProjectTargetFrameworkMonikers.Length > 0 && 135(referencedProjectTargetFrameworkMonikers.Length != referencedProjectTargetPlatformMonikers.Length || 136referencedProjectTargetFrameworkMonikers.Length != referencedProjectFrameworks.Length)) 146var useTargetMonikers = referencedProjectTargetFrameworkMonikers.Length > 0; 147for (int i = 0; i < referencedProjectFrameworks.Length; i++)
GetRestoreNuGetAuditSuppressionsTask.cs (3)
38if (NuGetAuditSuppressions.Length == 0) return true; 40var entries = new List<ITaskItem>(NuGetAuditSuppressions.Length); 41var seenIds = new HashSet<string>(NuGetAuditSuppressions.Length, StringComparer.Ordinal);
GetRestorePrunedPackageReferencesTask.cs (3)
38if (PrunePackageReferences.Length == 0) return true; 40var entries = new List<ITaskItem>(PrunePackageReferences.Length); 42var seenIds = new HashSet<string>(PrunePackageReferences.Length, StringComparer.Ordinal);
RestoreSettingsUtils.cs (1)
76for (var i = 0; EqualityComparer<T>.Default.Equals(result, default(T)) && i < funcs.Length; i++)
RestoreTask.cs (1)
167if (RestoreGraphItems.Length < 1 && !HideWarningsAndErrors)
WriteRestoreGraphTask.cs (1)
53if (RestoreGraphItems.Length < 1)
NuGet.Build.Tasks.Console (7)
MSBuildStaticGraphRestore.cs (2)
519if (projectFrameworkStrings.Length > 0) 697return parts.Length > 0 ? LibraryIncludeFlagUtils.GetFlags(parts) : defaultValue;
Program.cs (5)
141.Where(i => i.Length == 2 && !string.IsNullOrWhiteSpace(i[0]) && !string.IsNullOrWhiteSpace(i[1]))) 166if (args.Length < 3 || args.Length > 4) 169LogError(errorWriter, Strings.Error_StaticGraphRestoreArgumentParsingFailedInvalidNumberOfArguments, args.Length); 183if (args.Length == 3)
NuGet.Build.Tasks.Pack (1)
PackTaskLogic.cs (1)
607if (packageTypeSplitInPart.Length > 1)
NuGet.CommandLine.XPlat (18)
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (1)
94if (matchingPackageSpecs.Length != 1)
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (3)
492for (int i = 0; i < tasks.Length; i++) 507for (int i = 0; i < tasks.Length; i++) 519for (int i = 0; i < tasks.Length; i++)
Commands\PackageSearch\Table.cs (4)
48_maxColumnWidth = Math.Max(MinimumCharactersInAColumn, (consoleWidth - MinimumCharactersInAColumn * headers.Length) / headers.Length); 62if (row.Length != _columns.Count) 67for (int i = 0; i < row.Length; i++)
Commands\PushCommand.cs (1)
116if (packagePaths == null || packagePaths.Length < 1)
Commands\Signing\SignCommand.cs (1)
191packagePaths.Length == 0 ||
Commands\Signing\VerifyCommand.cs (1)
93packagePaths.Length == 0 ||
Program.cs (1)
112if (args.Length > 0 && args[0] == "package")
Utility\MSBuildAPIUtility.cs (1)
765if (splitFrameworkAndRID.Length == 1)
Utility\TableParser.cs (5)
34Debug.Assert(columnHeaders.Length == valueSelectors.Length); 43for (var rowIndex = 0; rowIndex < values.Length; rowIndex++) 47for (var colIndex = 0; colIndex < valueSelectors.Length; colIndex++) 96for (var colIndex = 0; colIndex < valueSelectors.Length; colIndex++)
NuGet.Commands (16)
MSBuildProjectFactory.cs (1)
143for (var i = 0; i < targetFolders.Length; i++)
RestoreCommand\DependencyGraphResolver.cs (6)
505ToParentLibraryRangeIndex: childResolvedDependencyGraphItem.Path[childResolvedDependencyGraphItem.Path.Length - 1], 776for (int i = 0; i < left.Length && i < right.Length; i++) 1041if (currentDependencyGraphItem.Path.Length > 2 && currentDependencyGraphItem.Path[currentDependencyGraphItem.Path.Length - 2] == parentRangeIndex) 1175chosenResolvedItem.ParentPathsThatHaveBeenEclipsed.Add(currentDependencyGraphItem.Path[currentDependencyGraphItem.Path.Length - 1]);
RestoreCommand\DependencyGraphResolver.DependencyGraphItemIndexer.cs (3)
164LibraryRangeIndex[] newPath = new LibraryRangeIndex[existingPath.Length + 1]; 165Array.Copy(existingPath, newPath, existingPath.Length); 166newPath[newPath.Length - 1] = libraryRangeIndex;
RestoreCommand\Diagnostics\DiagnosticUtility.cs (1)
118if (group.Length == 1)
RestoreCommand\Utility\AuditUtility.cs (1)
459for (int i = 0; i < results.Length; i++)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (2)
904if (parts.Length > 0) 1176for (var i = 0; i < HttpPrefixes.Length; i++)
RestoreCommand\Utility\PackageSpecFactory.cs (2)
773return parts.Length > 0 ? LibraryIncludeFlagUtils.GetFlags(parts) : defaultValue; 886for (var i = 0; EqualityComparer<T>.Default.Equals(result, default) && i < funcs.Length; i++)
NuGet.Common (5)
MsBuildStringUtility.cs (3)
99if (split.Length == 0) 107for (int i = 0; i < split.Length; i++) 112logCodes ??= ArrayPool<NuGetLogCode>.Shared.Rent(split.Length);
PathUtil\PathUtility.cs (2)
229var len1 = path1Segments.Length - 1; 230var len2 = path2Segments.Length;
NuGet.Configuration (2)
Proxy\ProxyCache.cs (1)
121if (credentials.Length > 1)
Proxy\WebProxy.cs (1)
71if (_regExBypassList != null && _regExBypassList.Length > 0)
NuGet.Frameworks (9)
DefaultPortableFrameworkMappings.cs (1)
118var profileOptionalFrameworks = new List<KeyValuePair<int, NuGetFramework[]>>(ProfilesWithOptionalFrameworks.Length);
FrameworkNameProvider.cs (1)
503var result = new List<NuGetFramework>(shortNames.Length);
FrameworkReducer.cs (3)
306var results = new List<NuGetFramework>(input.Length); 308for (var i = 0; i < input.Length; i++) 314for (var j = 0; !dupe && j < input.Length; j++)
NuGetFrameworkFactory.cs (4)
417while (versionStart < chars.Length 435while (profileStart < chars.Length 448if (profileStart < chars.Length) 454if (actualProfileStart == chars.Length)
NuGet.LibraryModel (2)
FrameworkDependencyFlagsUtils.cs (1)
66if (splitFlags.Length > 0)
LibraryIncludeFlagUtils.cs (1)
114if (splitFlags.Length > 0)
NuGet.PackageManagement (7)
ConsoleProjectContext.cs (1)
33if (args.Length > 0)
NuGetPackageManager.cs (3)
2970if (nuGetProjectActions.Length == 0) 3084List<(NuGetProjectAction, BuildIntegratedInstallationContext)> projectActionsAndInstallationContexts = new(nuGetProjectActions.Length); 3105if (nuGetProjectActions.Length == 1 &&
Telemetry\ActionEventBase.cs (2)
36{ nameof(ProjectsCount), projectIds.Length } 42for (var i = 0; i < projectIds.Length; i++)
Utility\StreamUtility.cs (1)
112bytesRead = stream.Read(buffer, 0, buffer.Length);
NuGet.Packaging (149)
ContentModel\ContentItemCollection.cs (1)
147if (definitions.Length == 0)
ContentModel\ContentQueryDefinition.cs (2)
34PatternExpression[] patternExpressions = new PatternExpression[patternDefinitions.Length]; 35for (int i = 0; i < patternDefinitions.Length; i++)
NuspecReader.cs (2)
191if (items.Length > 0) 645var set = new HashSet<string>(splitFlags.Length, StringComparer.OrdinalIgnoreCase);
PackageCreation\Authoring\ManifestSchemaUtility.cs (1)
76if (version <= 0 || version > VersionToSchemaMappings.Length)
PackageCreation\Authoring\PackageBuilder.cs (4)
381hashFunc.Update(data, 0, data.Length); 397uint end = (uint)sArray.Length; 1108if (parts.Length > 1) 1294hashFunc.Update(data, 0, data.Length);
PackageFolderReader.cs (2)
71if (nuspecFiles.Length == 0) 78else if (nuspecFiles.Length > 1)
PackageReaderBase.cs (2)
459if (parts.Length == 3 460|| (parts.Length > 3 && allowSubFolders))
Rules\AccidentallyCompatibleWithAllFrameworksRule.cs (2)
53if (buildFrameworks.Length == 0) 81suggestedFrameworks = new List<string>(buildFrameworks.Length);
Rules\InvalidFrameworkFolderRule.cs (1)
30if (parts.Length >= 3 && parts[0].Equals(LibDirectory, StringComparison.OrdinalIgnoreCase))
Rules\ReferencesInNuspecMatchRefAssetsRule.cs (3)
101if (missingFiles.Length != 0) 106if (missingNuspecReferences.Length != 0) 117if (refs.Length != 0)
Signing\Archive\Crc32.cs (1)
34var crc = UpdateCrc(0xffffffff, data, data.Length);
Signing\Archive\EndOfCentralDirectoryRecord.cs (1)
75for (var i = buffer.Length - 1; i >= 0; --i)
Signing\Archive\ReadOnlyBufferedStream.cs (2)
166if (count > buffer.Length - offset) 335var count = _buffer.Length;
Signing\Archive\SignedPackageArchiveIOUtility.cs (18)
62var bytesToRead = (int)Math.Min(position - currentPosition, buffer.Length); 102var bytesToRead = (int)Math.Min(position - currentPosition, buffer.Length); 119HashBytes(hashAlgorithm, bytes, bytes?.Length ?? 0); 129if (bytes == null || bytes.Length == 0) 134if (count <= 0 || bytes.Length < count) 173var bytesToRead = (int)Math.Min(position - currentPosition, buffer.Length); 189HashBytes(hashFunc, bytes, bytes?.Length ?? 0); 205if (bytes == null || bytes.Length == 0) 210if (count <= 0 || bytes.Length < count) 381for (var i = 0; i < orderedRecords.Length - 1; ++i) 389if (orderedRecords.Length > 0) 606writer.Write((uint)fileData.Length); 609writer.Write((uint)fileData.Length); 613var fileNameLength = fileNameBytes.Length; 640var writtenDataLength = (long)fileData.Length; 683writer.Write((uint)fileData.Length); 686writer.Write((uint)fileData.Length); 690var fileNameLength = fileNameBytes.Length;
Signing\Archive\SignedPackageArchiveUtility.cs (5)
105reader.BaseStream.ReadExactly(buffer, offset: 0, count: buffer.Length); 448if (expectedHash == null || expectedHash.Length == 0) 636if (expectedHash.Length != actualHash.Length) 641for (var i = 0; i < expectedHash.Length; i++)
Signing\ChainBuilding\X509ChainBuildPolicyFactory.cs (1)
59if (parts.Length == 2
Signing\Cms\HeapBlockRetainer.cs (3)
32var pb = Alloc(b.Length + 1); 33Marshal.Copy(b, 0, pb, b.Length); 36((byte*)pb)[b.Length] = 0; // NUL termination.
Signing\Cms\NativeCms.cs (9)
75length: countersignatureSignatureValue.Length); 198Marshal.Copy(attributeValue.pbData, bytes, startIndex: 0, length: bytes.Length); 229if (!NativeMethods.CryptMsgUpdate(handle, input, (uint)input.Length, fFinal: true)) 244var unmanagedCert = hb.Alloc(encodedCert.Length); 245Marshal.Copy(encodedCert, 0, unmanagedCert, encodedCert.Length); 248cbData = (uint)encodedCert.Length, 438var unmanagedData = hb.Alloc(data.Length); 439Marshal.Copy(data, 0, unmanagedData, data.Length); 442cbData = (uint)data.Length,
Signing\Cms\NativeUtility.cs (8)
55signedInfo.cCertEncoded = certificateBlobs.Length; 57using (var certificatesHandle = new SafeLocalAllocHandle(Marshal.AllocHGlobal(Marshal.SizeOf(certificateBlobs[0]) * certificateBlobs.Length))) 59for (var i = 0; i < certificateBlobs.Length; ++i) 79(uint)data.Length, 184if (attrData.Length > 0) 188blob->cbData = (uint)attrData.Length; 189blob->pbData = hb.Alloc(value.RawData.Length); 191Marshal.Copy(attrData, 0, blob->pbData, attrData.Length);
Signing\DerEncoding\DerEncoder.cs (57)
141return SegmentedEncodeUnsignedInteger(bigEndianBytes, 0, bigEndianBytes.Length); 155Debug.Assert(bigEndianBytes.Length > 0); 156Debug.Assert(bigEndianBytes.Length >= count - offset); 195EncodeLength(dataBytes.Length), 236Debug.Assert(unusedBits == 0 || data!.Length > 0); 238byte[] encodedData = new byte[data!.Length + 1]; 241Buffer.BlockCopy(data, 0, encodedData, 1, data.Length); 255encodedData[data.Length] &= lastByteSemanticMask; 260EncodeLength(encodedData.Length), 313int lastBitProvided = (bigEndianBytes!.Length * 8) - 1; 369Debug.Assert(semanticBytes <= bigEndianBytes.Length); 387EncodeLength(dataSegment.Length), 405EncodeLength(data!.Length), 519return SegmentedEncodeUtf8String(chars!, 0, chars!.Length); 533Debug.Assert(offset <= chars!.Length); 535Debug.Assert(count <= chars.Length - offset); 548EncodeLength(encodedBytes.Length), 573EncodeLength(data.Length), 601EncodeLength(data.Length), 623EncodeLength(data.Length), 645EncodeLength(data.Length), 663return IsValidPrintableString(chars!, 0, chars!.Length); 681Debug.Assert(offset <= chars!.Length); 683Debug.Assert(count <= chars.Length - offset); 707return SegmentedEncodePrintableString(chars!, 0, chars!.Length); 721Debug.Assert(offset <= chars!.Length); 723Debug.Assert(count <= chars.Length); 724Debug.Assert(offset + count <= chars.Length); 743EncodeLength(encodedString.Length), 757return SegmentedEncodeIA5String(chars!, 0, chars!.Length); 771Debug.Assert(offset <= chars!.Length); 773Debug.Assert(count <= chars.Length); 774Debug.Assert(offset + count <= chars.Length); 798EncodeLength(encodedString.Length), 848EncodeLength(asciiDateBytes.Length), 902EncodeLength(asciiDateBytes.Length), 932payloadLength += segment.Length; 939byte[] encodedSequence = new byte[1 + encodedLength.Length + payloadLength]; 945Buffer.BlockCopy(encodedLength, 0, encodedSequence, writeStart, encodedLength.Length); 947writeStart += encodedLength.Length; 952Debug.Assert(segments!.Length == 3); 958Buffer.BlockCopy(segment!, 0, encodedSequence, writeStart, segment!.Length); 959writeStart += segment.Length; 1080length += segment.Length; 1092Buffer.BlockCopy(segment, 0, concatenated, offset, segment.Length); 1093offset += segment.Length; 1107Debug.Assert(x!.Length == 3, $"x.Length is {x.Length} when it should be 3"); 1108Debug.Assert(y!.Length == 3, $"y.Length is {y.Length} when it should be 3"); 1139Debug.Assert(x[0].Length == 1, $"x[0].Length is {x[0].Length} when it should be 1"); 1140Debug.Assert(y[0].Length == 1, $"y[0].Length is {y[0].Length} when it should be 1"); 1149comparison = x[2].Length - y[2].Length; 1154for (int i = 0; i < x[2].Length; i++)
Signing\DerEncoding\DerSequenceReader.cs (5)
56: this(data, 0, data.Length) 67if (offset < 0 || length < 2 || length > data.Length - offset) 84return new DerSequenceReader(true, payload, 0, payload.Length); 534if (position >= data.Length) 580Debug.Assert(end <= data.Length);
Signing\Signatures\GeneralName.cs (2)
113var lengthByteCount = reader.ContentLength - 1 - value.Length; 116Array.Copy(bytes, sourceIndex: 1, destinationArray: length, destinationIndex: 0, length: length.Length);
Signing\Signatures\Signature.cs (1)
216if (!chainBuildingSucceeded && chainStatuses.Length == 0)
Signing\Timestamp\MessageImprint.cs (1)
43if (hashedMessage == null || hashedMessage.Length == 0)
Signing\Timestamp\Rfc3161TimestampTokenInfoNetstandard21Wrapper.cs (2)
50if (hash.Length != value.Length)
Signing\Timestamp\Rfc3161TimestampUtils.cs (1)
99StringBuilder builder = new StringBuilder(bytes.Length * 2);
Signing\Timestamp\Timestamp.cs (1)
171else if (chainStatusList.Length == 0)
Signing\Timestamp\TstInfo.cs (1)
87if (serialNumber == null || serialNumber.Length == 0)
Signing\Utility\CertificateChainUtility.cs (2)
126if (chain.ChainStatus.Length == 0 || fatalStatuses.Count > 0) 225status = new X509ChainStatus[chain.ChainStatus.Length];
Signing\Utility\CertificateUtility.cs (1)
347if (!buildSuccess && chain.ChainStatus.Length == 0)
Signing\Utility\SignatureUtility.cs (2)
618return essCertId.CertificateHash.Length == SHA1HashLength; 666if (!buildSuccess && chain.ChainStatus.Length == 0)
TopologicalSortUtility.cs (5)
107var sorted = new List<ItemDependencyInfo>(toSort.Length); 111for (var i = 0; i < toSort.Length; i++) 113Array.Sort(toSort, i, toSort.Length - i, itemComparer); 146for (var i = 0; i < dependencies.Length; i++) 164packageChildren = new List<ItemDependencyInfo>(dependencies.Length - i);
NuGet.ProjectModel (15)
CircularMemoryStream.cs (2)
49var bytesToWrite = Math.Min(_buffer.Length - (int)Position, count - bytesWritten); 82if (Position == _buffer.Length)
FnvHash64Function.cs (1)
63count = data.Length;
JsonPackageSpecReader.Utf8JsonStreamReader.cs (2)
1165else if (items.Length == index) 1169items = ArrayPool<NuGetLogCode>.Shared.Rent(items.Length * 2);
LockFile\LockFile.cs (1)
100var length = orderedLogMessages.Length;
ProjectLockFile\PackagesLockFileFormat.cs (2)
210if (parts.Length == 2) 237RuntimeIdentifier = parts.Length == 2 ? parts[1] : null,
ProjectLockFile\PackagesLockFileUtilities.cs (1)
111if (project.TargetFrameworks.Count != lockFileFrameworks.Length)
src\nuget-client\build\Shared\Utf8JsonStreamReader.cs (6)
218else if (strings.Length == index) 222strings = ArrayPool<string>.Shared.Rent(strings.Length * 2); 345if (leftover.Length == _buffer.Length) 347_buffer = _bufferPool.Rent(_buffer.Length * 2); 372var spaceLeftInBuffer = _buffer.Length - _bufferUsed; 376while (bytesRead != 0 && _bufferUsed != _buffer.Length);
NuGet.Protocol (12)
Converters\ServiceIndexEntryStringOrArrayConverter.cs (1)
51if (value.Length == 1)
LegacyFeed\V2FeedPackageInfo.cs (3)
258if (parts.Length != 0) 265if (parts.Length > 1) 279if (parts.Length > 2)
Plugins\PluginCacheEntry.cs (1)
82await fileStream.WriteAsync(json, 0, json.Length);
Resources\PackageSearchResourceV3.cs (3)
123log.LogVerbose($"Found {_searchEndpoints.Length} search endpoints."); 125for (var i = 0; i < _searchEndpoints.Length; i++) 176catch when (i < _searchEndpoints.Length - 1)
Resources\RawSearchResourceV3.cs (2)
45for (var i = 0; i < _searchEndpoints.Length; i++) 97catch when (i < _searchEndpoints.Length - 1)
Resources\VulnerabilityInfoResourceV3.cs (2)
152for (int i = 0; i < tasks.Length; i++) 162for (int i = 0; i < tasks.Length; i++)
NuGet.Resolver (3)
CombinationSolver.cs (3)
161if (i > _solution.Length) 167else if (i == _solution.Length) 234|| i >= _solution.Length)
NuGet.Versioning (21)
NuGetVersion.cs (1)
196get { return (_releaseLabels != null && _releaseLabels.Length > 1) || HasMetadata; }
NuGetVersionFactory.cs (1)
71for (int i = 0; i < releaseLabels.Length; i++)
SemanticVersion.cs (3)
158if (_releaseLabels.Length < 1) 198if (_releaseLabels.Length == 1) 223for (int i = 0; i < _releaseLabels.Length; i++)
SemanticVersionFactory.cs (3)
46if (parts.Length != 3) 64for (int i = 0; i < releaseLabels.Length; i++) 114for (int i = 0; i < parts.Length; i++)
VersionComparer.cs (7)
288var count = Math.Max(version1.Length, version2.Length); 292var aExists = i < version1.Length; 293var bExists = i < version2.Length; 402if (xLabels.Length != yLabels.Length) 408for (var i = 0; i < xLabels.Length; i++)
VersionRangeFactory.cs (6)
126&& charArray.Length == 1 161switch (charArray[charArray.Length - 1]) 179if (parts.Length > 2) 187for (int i = 0; i < parts.Length; i++) 204if (parts.Length == 1 212maxVersionString = (parts.Length == 2) ? parts[1] : parts[0];
Pipelines.AppHost (1)
AppHost.cs (1)
280var fileCount = files.Length;
PresentationBuildTasks (133)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (3)
186Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 301Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 715for (int i = 0; i < pItemList.Length; i++)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (23)
111if ((PageMarkup == null || PageMarkup.Length == 0) && 112(ApplicationMarkup == null || ApplicationMarkup.Length == 0)) 150for (int i = 0; i < CompilerAnalyzer.RecompileMarkupPages.Length; i++) 391if (SplashScreen != null && SplashScreen.Length > 0) 891if (PageMarkup != null && PageMarkup.Length > 0) 896if (SplashScreen != null && SplashScreen.Length > 1) 914if (ApplicationMarkup != null && ApplicationMarkup.Length > 0) 930if (ApplicationMarkup != null && ApplicationMarkup.Length > 0) 932if (ApplicationMarkup.Length > 1) 1114if (References != null && References.Length > 0) 1119for (int i = 0; i < References.Length; i++) 1159for (int i = 0; i < CompilerAnalyzer.RecompileMarkupPages.Length; i++) 1297if (PageMarkup != null && PageMarkup.Length > 0) 1405for (int i = 0; i < GeneratedBamlFiles.Length; i++) 1410for (int i = 0; i < GeneratedCodeFiles.Length; i++) 1415for (int i = 0; i < GeneratedLocalizationFiles.Length; i++) 1458for (int i = 0; i < inputXamlItemList.Length; i++) 1497if (!SkipMarkupCompilation && inputLocalRefXamlFileList != null && inputLocalRefXamlFileList.Length > 0) 1499for (int i = 0; i < inputLocalRefXamlFileList.Length; i++) 1528for (int i = 0; i < inputXamlItemList.Length; i++) 1596for (int j = 0; j < listCarryOverAttribute.Length; j++) 1621if (ApplicationMarkup != null && ApplicationMarkup.Length > 0 && ApplicationMarkup[0] != null) 1635for (int i = 0; i < PageMarkup.Length; i++)
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (7)
493if (_localApplicationFile != null || (_localMarkupPages != null && _localMarkupPages.Length > 0)) 577if (_localMarkupPages != null && _localMarkupPages.Length > 0) 579int localFileNum = _localMarkupPages.Length; 595if (References != null && References.Length > 0) 600for (int i = 0; i < References.Length; i++) 729if (_localMarkupPages != null && _localMarkupPages.Length > 0) 732for (int i = 0; i < _localMarkupPages.Length; i++)
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
51if (GeneratedLocalizationFiles.Length > 0)
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (1)
153if (OutputResourcesFile?.Length > 1)
Microsoft\Build\Tasks\Windows\UidManager.cs (4)
71if (MarkupFiles == null || MarkupFiles.Length == 0) 345if (_markupFiles.Length > countGoodFiles) 347Log.LogErrorWithCodeFromResources(nameof(SR.FilesFailedUidCheck), _markupFiles.Length - countGoodFiles); 352return _markupFiles.Length == countGoodFiles;
MS\Internal\MarkupCompiler\MarkupCompiler.cs (14)
268for (int i = 0; i < cu.FileList.Length; i++) 287if (!cu.Pass2 && ContentList != null && ContentList.Length > 0) 1455sb.Append(_typeArgsList.Length); 1606for (int i = 1; i < dirs.Length; i++) 1828CodeExpression[] expressions = new CodeExpression[args.Length]; 1834for (int i = 0; i < args.Length; i++) 1851for (int i = 0; i < args.Length; i++) 1888Debug.Assert(pis != null && pis.Length == 2 && KnownTypes.Types[(int)KnownElements.DependencyObject].IsAssignableFrom(pis[0].ParameterType)); 2036for (int i = 0; i < pars.Length; i++) 2167for (int i = 1; i < contexts.Length; ++i) 2239for (int i = 0; i < _typeArgsList.Length; i++) 2373for (int i = 0; i < refTypeParams.Length; i++) 2380Debug.Assert(typeArgsList != null && typeArgsList.Length == refTypeParams.Length);
MS\Internal\MarkupCompiler\ParserExtension.cs (6)
185if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 217bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 252localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 270if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 317if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 459bool isLocal = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly;
MS\Internal\MarkupCompiler\VersionHelper.cs (6)
74hasWildcard = allowWildcard && elements[elements.Length - 1] == "*"; 76if ((hasWildcard && elements.Length < 3) || elements.Length > 4) 83int lastExplicitValue = hasWildcard ? elements.Length - 1 : elements.Length; 151for (int i = lastExplicitValue; i < values.Length; i++)
MS\Internal\Tasks\CompilerLocalReference.cs (2)
215if (LocalMarkupPages != null && LocalMarkupPages.Length > 0) 217for (int i = 0; i < LocalMarkupPages.Length; i++)
MS\Internal\Tasks\CompilerState.cs (5)
92Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 152Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 206if (fileItemList != null && fileItemList.Length > 0) 210int iCount = fileItemList.Length; 238for (int i = 0; i < fileItemList.Length; i++)
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (7)
204for (int i = 0; i < _mcPass1.PageMarkup.Length; i++) 386numLocalTypeXamls = CompilerLocalReference.LocalMarkupPages.Length; 456int count = _mcPass1.PageMarkup.Length; 488int count = _mcPass1.ContentFiles.Length; 528if (_mcPass1.ApplicationMarkup != null && _mcPass1.ApplicationMarkup.Length > 0 && _mcPass1.ApplicationMarkup[0] != null) 557for (int i = 0; i < fileList.Length; i++) 596if (list != null && list.Length > 0)
MS\Internal\Tasks\TaskFileService.cs (1)
168fileChecksummer.CalculateCheckSum(hashGuid, tempBytes.Length, tempBytes, out actualSize);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (2)
60for (int i = 0; i < pairs.Length; i++) 360for (int i = 0; i < _enumNames.Length; i++)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (1)
171int end = _knownStrings.Length;
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (4)
1189if (AssemblyIds != null && AssemblyIds.Length > 0) 1191count = (short) AssemblyIds.Length; 4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (2)
686if (nsMapEntry != null && nsMapEntry.Length > 0) 689for (int i = 0; i < nsMapEntry.Length; i++)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypesHelper.cs (1)
70Array.Clear(_typeTable, 0, _typeTable.Length);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (4)
1205if (parInfo.Length >= maxConstructorArguments) 1207maxConstructorArguments = parInfo.Length; 1304for (int i=0; i<infos.Length; i++) 1308if (paramInfos.Length == numberOfConstructorAttributes)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (5)
159if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 227bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 263localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 280if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 298if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (5)
174if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 261bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 300localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 317if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 335if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (4)
567localAssembly = (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly); 3201if (methodInfo.GetParameters().Length == 1) 3207propertyCanWrite = methodInfo != null && methodInfo.GetParameters().Length == 2; 3515return (methodInfo.GetParameters().Length == 2) ||
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (16)
1287if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1356if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1367if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1448if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1516if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1527if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1947for (int i = 0; i < infos.Length; i++) 2058propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType; 2059propertyCanWrite = parameters.Length == 1 ? false : true; 2528for (int count = 0; count < namespaceMaps.Length;) 2565if (knownTypesOnly && (count == namespaceMaps.Length)) 2833localAssembly = (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly); 2956namespaceMaps.Length == 1 && 3158result = (namespaceMaps != null && namespaceMaps.Length > 0) || 3239for (int i = 0; i < _namespaceMaps.Length; i++) 3305for (int k = 0; k < _assemblyNames.Length; k++)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsCache.cs (4)
299for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 304for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++) 368for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 378for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (3)
632if (_lastDecl == _nsDeclarations.Length - 1) 634NamespaceDeclaration[] new_nsDeclarations = new NamespaceDeclaration[_nsDeclarations.Length * 2]; 636Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
87if (nameFrags.Length == 1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
80if (methodInfo.GetParameters().Length == 1)
PresentationCore (704)
MS\Internal\Automation\TextRangeProviderWrapper.cs (2)
187ITextRangeProvider[] outArray = new ITextRangeProvider[argument.Length]; 188for (int i = 0; i < argument.Length; i++)
MS\Internal\FontCache\BufferCache.cs (4)
171length <= _buffers[index].Length) 203(_buffers[index].Length < buffer.Length && buffer.Length <= MaxBufferLength))
MS\Internal\FontCache\FamilyCollection.cs (2)
126for (int i = 0; i < _legacyArabicFonts.Length; ++i) 255for (int i = 0; i < _systemCompositeFontsNames.Length; ++i)
MS\Internal\FontCache\FontCacheUtil.cs (1)
523for (int i = 0; i < SupportedExtensions.Length; ++i)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (10)
403for (int i = 0; i < fastTextRanges.Length; i++) 406ushort[] glyphIndices = BufferCache.GetUShorts(codepoints.Length); 414CharacterMap.TryGetValues(pCodepoints, checked((uint)codepoints.Length), pGlyphIndices); 419for (int j = 0; j < codepoints.Length; j++) 467for (int i = 0; i < complexScripts.Length && typography != loclBitsTest; i++) 538for (int i = 0; i < complexScripts.Length; i++) 727ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 728ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count); 945for (int i = 0; i < majorLanguages.Length; i++) 967for (int i = 0; i < majorLanguages.Length; i++)
MS\Internal\FontCache\FontSource.cs (2)
403 bits.Length, 404 bits.Length,
MS\Internal\FontFace\CompositeFontInfo.cs (4)
206for (int i = FirstFamilyMapRange; i < familyMapRanges.Length; i += 2) 246if (count + 2 > ranges.Length) 248ushort[] temp = new ushort[ranges.Length * 2 - FirstFamilyMapRange]; 268if (count < ranges.Length)
MS\Internal\FontFace\FontDriver.cs (1)
197for (int i = 0; i < _tableDirectory.Length; ++i)
MS\Internal\FontFace\TypefaceCollection.cs (2)
68ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 69ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
MS\Internal\Ink\ErasingStroke.cs (4)
60_erasingStrokeNodes = new List<StrokeNode>(points.Length); 69_nodeIterator = _nodeIterator.GetIteratorForNextSegment(points.Length > 1 ? FilterPoints(points) : points); 258System.Diagnostics.Debug.Assert(path.Length > 1); 278while (i < path.Length)
MS\Internal\Ink\ExtendedProperty.cs (5)
63if (array1.Length == array2.Length) 65for (int i = 0; i < array1.Length; i++) 196Array newArray = Array.CreateInstance(elementType, ((Array)_value).Length); 197Array.Copy((Array)_value, newArray, ((Array)_value).Length);
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (5)
366uint cRanges = (uint)( enabledGestures.Length ); 483Debug.Assert(propertyGuids.Length == StylusPointDescription.RequiredCountOfProperties); 486packetDescription.cbPacketSize = (uint)(propertyGuids.Length * sizeof(Int32)); 487packetDescription.cPacketProperties = (uint)propertyGuids.Length; 534int packetCount = rawPackets.Length;
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (12)
22if (input.Length < 3) 38for(; n < input.Length; n++) 86if (((compressedData.Count - 1/*for the algo byte we just made room for*/) >> 2) > input.Length) 148if (input.Length < 2) 153if (outputBuffer.Length == 0) 193if (input.Length < 3) 210Debug.Assert(outputBufferIndex < outputBuffer.Length); 219Debug.Assert(outputBufferIndex < outputBuffer.Length); 249List<byte> compressedData = new List<byte>(input.Length + 1); //reasonable default based on profiling. 274int unitCount = input.Length; 308if (input.Length < 2) 345int unitsToDecode = ((input.Length - inputIndex << 3) / bitCount) - padCount;
MS\Internal\Ink\InkSerializedFormat\Compress.cs (1)
83size > compressedInput.Length ||
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (20)
24for (int i = 0; i < KnownIdCache.OriginalISFIdTable.Length; i++) 32for (int i = 0; i < KnownIdCache.TabletInternalIdTable.Length; i++) 108for( int i = 0; i < data.Length; i++ ) 115for( int i = 0; i < data.Length; i++ ) 122for( int i = 0; i < data.Length; i++ ) 129for( int i = 0; i < data.Length; i++ ) 136for( int i = 0; i < data.Length; i++ ) 143for( int i = 0; i < data.Length; i++ ) 150for( int i = 0; i < data.Length; i++ ) 157for( int i = 0; i < data.Length; i++ ) 164for( int i = 0; i < data.Length; i++ ) 171for (int i = 0; i < data.Length; i++) 191for( int i = 0; i < data.Length; i++ ) 323cbSize = (uint)data.Length; 353cbWrite += SerializationHelper.Encode(strm, (uint)(compresseddata.Length - 1)); 356strm.Write(compresseddata, 0, (int)compresseddata.Length); 357cbWrite += (uint)compresseddata.Length; 371strm.Write(data, 0, (int)data.Length); 372cbWrite += (uint)data.Length; 929for (int i = 0; i < data.Length; i++)
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (1)
183if (data != null && data.Length > 0)
MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (20)
79if (0 == input.Length) 84testDelDel = testDelDel && (input.Length < 3); 126for (uint dataIndex = startIndex; dataIndex < input.Length; dataIndex++) 180if(0 == input.Length) 185int countOfInts = ((0 == (input.Length & 0x03)) ? input.Length >> 2 : 0); 193int countOfShorts = ((0 == (input.Length & 0x01)) ? input.Length >> 1 : 0); 236for (; n < input.Length; ++n) 252int padCount = ((((~(bitCount * input.Length)) & 0x07) + 1) & 0x07) / bitCount; 343if (index < _gorIndexMap.Length && index >= 0) 379for (int i = startInputIndex; i < input.Length; i++) 391for (int i = startInputIndex; i < input.Length; i++) 496ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(inputIndex, input.Length); 498ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(outputBufferIndex, outputBuffer.Length); 528Debug.Assert(outputBufferIndex < outputBuffer.Length); 530if (outputBufferIndex == outputBuffer.Length) 545Debug.Assert(outputBufferIndex < outputBuffer.Length); 547if (outputBufferIndex == outputBuffer.Length) 557return (uint)((outputBuffer.Length * bitCount + 7) >> 3);
MS\Internal\Ink\InkSerializedFormat\GuidTagList.cs (3)
49for (byte iIndex = 0; iIndex < KnownIdCache.OriginalISFIdTable.Length; ++iIndex) 120if (KnownIdCache.OriginalISFIdTable.Length <= nIndex) 187for (uint i = 0; i < KnownIdCache.OriginalISFIdTable.Length; ++i)
MS\Internal\Ink\InkSerializedFormat\HuffCodec.cs (8)
56for (uint i = 0; i < input.Length; i++) 64for (uint i = 0; i < input.Length; i++) 81Debug.Assert(input.Length >= 2); 84Debug.Assert(outputBuffer.Length != 0); 96Debug.Assert(outputBufferIndex < outputBuffer.Length); 98if (outputBufferIndex == outputBuffer.Length) 111Debug.Assert(outputBufferIndex < outputBuffer.Length); 113if (outputBufferIndex == outputBuffer.Length)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (11)
109byte[] isfData = Convert.FromBase64CharArray(chars, 0, chars.Length); 731if ((uint)isfTag >= KnownIdCache.CustomGuidBaseIndex || ((uint)isfTag >= KnownTagCache.KnownTagCount && ((uint)isfTag < (KnownTagCache.KnownTagCount + KnownIdCache.OriginalISFIdTable.Length)))) 1208requestedCount > buffer.Length) 1643for (int i = 0; i < buttonguids.Length; i++) 2008for (int i = 0; i < strkIds.Length; i++) 2041cbWrote += SerializationHelper.Encode(strm, (uint)(data.Length + SerializationHelper.VarSize((uint)strokes.Count))); 2045strm.Write(data, 0, (int)data.Length); 2046cbWrote += (uint)data.Length; 2064for (int i = 0; i < strkIds.Length; i++) 2158for (i = 0; i < descriptionGuids.Length; i++) 2707for (int x = 0; x < strokeIds.Length; x++)
MS\Internal\Ink\InkSerializedFormat\LZCodec.cs (2)
28Debug.Assert(input.Length > 1); 29Debug.Assert(inputIndex < input.Length);
MS\Internal\Ink\InkSerializedFormat\MetricEntry.cs (5)
150if( data.Length > MAX_METRIC_DATA_BUFF ) 153_size = (uint)data.Length; 335for( ul = 0; ul < MetricEntry_Never.Length ; ul++ ) 346for( ul = 0; ul<MetricEntry_Must.Length; ul++ ) 363for( ul = 0; ul<MetricEntry_Optional.Length; ul++ )
MS\Internal\Ink\InkSerializedFormat\MultiByteCodec.cs (4)
65Debug.Assert(inputIndex < input.Length); 68uint cb = (input.Length - inputIndex > 5) ? 5 : (uint)(input.Length - inputIndex); 100ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(inputIndex, input.Length);
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (4)
516if (byteCounter != buttonData.Length) 946if (packetdata.Length == 0) 961stream.Write(data, 0, (int)data.Length); 963return (uint)data.Length;
MS\Internal\Ink\StrokeIntersection.cs (6)
185System.Diagnostics.Debug.Assert(intersections.Length > 0); 187List<StrokeFIndices> inFIndices = new List<StrokeFIndices>(intersections.Length); 188for (int j = 0; j < intersections.Length; j++) 217System.Diagnostics.Debug.Assert(intersections.Length > 0); 219List<StrokeFIndices> hitFIndices = new List<StrokeFIndices>(intersections.Length); 220for (int j = 0; j < intersections.Length; j++)
MS\Internal\Ink\StrokeNode.cs (10)
231int maxCount = vertices.Length * 2; 237Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor); 268for (int j = 0; i < maxCount && j < vertices.Length; i++, j++) 271Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor); 351int maxCount = vertices.Length * 2; 356Point point = _thisNode.Position + (vertices[i % vertices.Length] * pressureFactor); 380for (int j = 0; i < maxCount && j < vertices.Length; i++, j++) 383Point point = _thisNode.Position + (vertices[i % vertices.Length] * pressureFactor); 616for (int i = 0; i < vertices.Length; i++) 618Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor);
MS\Internal\Ink\StrokeNodeOperations.cs (20)
61for (i = 0; (i + 1) < _vertices.Length; i += 2) 65if (i < _vertices.Length) 94for (int i = 0; i < _vertices.Length; i++) 101for (int i = 0; i < _vertices.Length; i++) 122Point vertex = node.Position + (_vertices[_vertices.Length - 1] * node.PressureFactor); 123for (int i = 0; i < _vertices.Length; i++) 134for (int i = 0, count = _vertices.Length; i < count; i++) 203int count = _vertices.Length; 350int i = 0, count = _vertices.Length; 375count = _vertices.Length; 378i = (i + 1) % _vertices.Length; 409count = _vertices.Length; 412i = (i + 1) % _vertices.Length; 689Vector lastVertex = _vertices[_vertices.Length - 1]; 699for (int k = 0, count = _vertices.Length; k < count || (k == count && testNextEdge); k++) 1073int i = 0, count = _vertices.Length; 1088count = _vertices.Length; 1099i = (i + 1) % _vertices.Length; 1139count = _vertices.Length; 1142i = (i + 1) % _vertices.Length;
MS\Internal\Ink\StrokeNodeOperations2.cs (2)
39System.Diagnostics.Debug.Assert((null != vertices) && (2 < vertices.Length)); 42int count = vertices.Length;
MS\Internal\Ink\StylusShape.cs (15)
105vertices = new Vector[m_vertices.Length]; 109for (int i = 0; i < vertices.Length; i++) 116for (int i = 0; i < vertices.Length; i++) 132vertices = new Vector[p.Length]; 133for (int i = 0; i < vertices.Length; i++) 226System.Diagnostics.Debug.Assert(vertices.Length == 4); 228Point prevVertex = (Point)vertices[vertices.Length - 1]; 231for (int i = 0; i < vertices.Length; i++) 237double det = Vector.Determinant(edge, (Point)vertices[(i + 1) % vertices.Length] - (Point)vertex); 251System.Diagnostics.Debug.Assert(clockWiseIndex == vertices.Length || counterClockIndex == vertices.Length); 253if (counterClockIndex == vertices.Length) 256int lastIndex = vertices.Length -1; 257for (int j = 0; j < vertices.Length/2; j++) 308for (int i = 0; i < controlPoints.Length; i++)
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (6)
237int[,] outByteRanges = new int[(inByteRanges.Length / 2),2]; 239for (int i=0, j=0; i < inByteRanges.Length; ++i, ++j) 265int[] outByteRanges = new int[inByteRanges.Length]; 693if (byteRanges.Length < 2 || (byteRanges.Length % 2) != 0) 698for (int i = 0; i < byteRanges.Length; i++)
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (4)
291int guidBytePosition = _guid.Length - ((int) readPosition % _guid.Length) - 1; 297guidBytePosition = _guid.Length - 1; 338for (int i = 0; i < guidBytes.Length; i++)
MS\Internal\IO\Packaging\NetStream.cs (4)
140if (offset + count > buffer.Length) 337while (Read(buf, 0, buf.Length) > 0) 473_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this); 1005_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this);
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (17)
227for (int i = 0; i < visCorners.Length; i++) 280for (int i = 0; i < visualTexCoordBounds.Length; i++) 470Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match"); 476for (int i = 0; i < visualTexCoordBounds.Length; i++) 479Point visEdgeEnd = visualTexCoordBounds[(i + 1) % visualTexCoordBounds.Length]; 487for (int j = 0; j < uv.Length; j++) 490Point uv2 = uv[(j + 1) % uv.Length]; 492Point3D p3D2 = p[(j + 1) % p.Length]; 823for (int i = 0; i < p.Length; i++) 827Point3D p3D2 = p[(i + 1) % p.Length]; 838uv2 = uv[(i + 1) % p.Length]; 844uv1 = uv[(i + 1) % p.Length]; 907for (int i = 0; i < bounds.Length; i++) 910Point visEdgeEnd = bounds[(i + 1) % bounds.Length]; 991for (int i = 0; i < polygon.Length; i++) 993double crossProduct = Vector.CrossProduct(polygon[(i + 1) % polygon.Length] - polygon[i],
MS\Internal\Media3D\M3DUtil.cs (1)
348for(int i = 1; i < points.Length; i++)
MS\Internal\PartialArray.cs (4)
22Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length); 33public PartialArray(T[] array) : this(array, 0, array.Length) 135if (arrayIndex >= array.Length) 145if ((array.Length - Count - arrayIndex) < 0)
MS\Internal\Resources\ContentFileHelper.cs (3)
61if (assemblyAttributes != null && assemblyAttributes.Length > 0) 63contentFiles = new HashSet<string>(assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase); 65for (int i=0; i<assemblyAttributes.Length; i++)
MS\Internal\Shaping\OpenTypeCommon.cs (5)
963for(int j = 0; j < featureTagsList.Length; j++) 1272for(int j = 0; !complexFeatureFound && j < featureTagsList.Length; j++) 1302if (complexLanguages.Length == complexLanguageCount) 1305new WritingSystem[complexLanguages.Length * 3 /2]; 1307for(int i = 0; i < complexLanguages.Length; i++)
MS\Internal\Shaping\OpenTypeLayout.cs (6)
123m_length = (uint)data.Length; 1210_lookupUsageFlags.Length < requiredLookupUsageArraySize) 1244if (flagByte >= _lookupUsageFlags.Length) 1260if (flagByte >= _lookupUsageFlags.Length) 1287if (_cachePointers != null && _cachePointers.Length >= glyphRunLength) return; 1313if (_cachePointers.Length < newLength)
MS\Internal\Shaping\OpenTypeLayoutCache.cs (1)
1071if (recordCount == records.Length)
MS\Internal\Shaping\ShaperBuffers.cs (6)
218newSize > _features.Length || 249_features.Length != 0 && 251_features.Length >= keepCount) 255ushort currentLength = (ushort)_features.Length; 311if ( _featuresCount == _features.Length ) 333if ( _featuresCount == _features.Length )
MS\Internal\Shaping\TypefaceMap.cs (2)
878for (int i = 0; i < familyList.Length; i++) 940i = familyList.Length;
MS\Internal\Shaping\UshortList2.cs (6)
182get { return _array.Length; } 200((index + count) <= _array.Length ? count : _array.Length) * sizeof(ushort) 210if (newLength > _array.Length) 215int extra = newLength - _array.Length; 216int newArraySize = _array.Length + ((extra - 1) / _leap + 1) * _leap;
MS\Internal\TextFormatting\FormattedTextSymbols.cs (11)
160int[] nominalAdvances = new int[charArray.Length]; 336_glyphAdvances = new double[glyphAdvances.Length]; 340for (int i = 0; i < glyphAdvances.Length; i++) 352_glyphOffsets = new PartialArray<Point>(new Point[glyphOffsets.Length]); 354for (int i = 0; i < glyphOffsets.Length; i++) 363Debug.Assert(glyphAdvances.Length <= glyphIndices.Length); 365if (glyphAdvances.Length != glyphIndices.Length) 367_glyphIndices = new ushort[glyphAdvances.Length]; 369for (int i = 0; i < glyphAdvances.Length; i++)
MS\Internal\TextFormatting\FullTextLine.cs (3)
710if (collapsingPropertiesList == null || collapsingPropertiesList.Length == 0) 2453subLineInfo.Length, 2510subLineInfo.Length,
MS\Internal\TextFormatting\FullTextState.cs (1)
528rawText.Length,
MS\Internal\TextFormatting\LineServicesCallbacks.cs (1)
1759for (int i = 0; i < lsruns.Length; i++)
MS\Internal\TextFormatting\LineServicesRun.cs (5)
906Debug.Assert(lsruns != null && lsruns.Length > 0 && lsruns[0] != null); 914for (int i = 1; i < lsruns.Length; i++) 929fontFeatures = new DWriteFontFeature[lsruns.Length][]; 930fontFeatureRanges = new uint[lsruns.Length]; 932for (int i = 0; i < lsruns.Length; i++)
MS\Internal\TextFormatting\SimpleTextLine.cs (13)
577if (_runs.Length <= 0) 651for(int i = 0; i < _runs.Length; i++) 882TextSpan<TextRun>[] textRunSpans = new TextSpan<TextRun>[_runs.Length]; 884for (int i = 0; i < _runs.Length; i++) 898List<IndexedGlyphRun> indexedGlyphRuns = new List<IndexedGlyphRun>(_runs.Length); 912displayGlyphAdvances = new ThousandthOfEmRealDoubles(run.EmSize, run.NominalAdvances.Length); 921displayGlyphAdvances = new List<double>(run.NominalAdvances.Length); 922for (int i = 0; i < run.NominalAdvances.Length; i++) 1199while (runIndex < _runs.Length) 1266while (runIndex < _runs.Length && cpRunStart + _runs[runIndex].Length <= cp) 1758displayGlyphAdvances = new ThousandthOfEmRealDoubles(EmSize, NominalAdvances.Length); 1767displayGlyphAdvances = new List<double>(NominalAdvances.Length); 1768for (int i = 0; i < NominalAdvances.Length; i++)
MS\Internal\TextFormatting\TextMarkerSource.cs (3)
147if (textSourceCharacterIndex < _characterArray.Length) 153_characterArray.Length - textSourceCharacterIndex, 177Math.Min(_characterArray.Length, textSourceCharacterIndexLimit)
MS\Internal\TextFormatting\TextRunCacheImp.cs (1)
312for (int i = 0; i < textRunList.Length; i++)
MS\Internal\TextFormatting\TextShapeableCharacters.cs (4)
139caretStops = new bool[clusterMap.Length + 1]; 143caretStops[clusterMap.Length] = true; 147for (int i = 1; i < clusterMap.Length; i++) 227characterString.Length
MS\Internal\TextFormatting\TextStore.cs (6)
317|| cchResolved <= bidiLevels.Length) 509int effectedRangeEnd = Math.Min(cpFetched - offset + runInfo.Length, bounds[bounds.Length - 1].Position); 513for (int i = 0; i < bounds.Length && currentPosition < effectedRangeEnd; i++) 549if (currentEffectsCount == 0 && i < bounds.Length - 1) 974Invariant.Assert(resolvedLength <= bidiLevels.Length); 2290stringBuilder.CopyTo(0, rawText, 0, rawText.Length);
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (8)
61return _shortList.Length; 65return _doubleList.Length; 104_doubleList = new double[_shortList.Length]; 105for (int i = 0; i < _shortList.Length; i++) 143for (int i = 0; i < _shortList.Length; i++) 150for (int i = 0; i < _doubleList.Length; i++) 176if (arrayIndex >= array.Length) 186if ((array.Length - Count - arrayIndex) < 0)
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (2)
121if (arrayIndex >= array.Length) 131if ((array.Length - Count - arrayIndex) < 0)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (4)
196get { return _characterArray.Length; } 244Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 247|| characterOffset + characterLength > _characterArray.Length) 249characterLength = _characterArray.Length - characterOffset;
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (4)
25_bufferLengthInBits = (uint)buffer.Length * (uint)Native.BitsPerByte; 38ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, buffer.Length); 42_bufferLengthInBits = (uint)(buffer.Length - startIndex) * (uint)Native.BitsPerByte; 54if (bufferLengthInBits > (buffer.Length * Native.BitsPerByte))
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\LegacyPriorityQueue.cs (1)
140if (_count == _heap.Length)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (4)
108for (int i = assemblies.Length - 1; i >= 0; i--) 237if (reqKeyToken.Length == curKeyToken.Length) 241for (int i = 0; i < reqKeyToken.Length; i++)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SequentialUshortCollection.cs (2)
47ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 48ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Automation\Peers\AutomationPeer.cs (1)
480for(int i = 0; i < roots.Length; i++)
System\Windows\ClassHandlersStore.cs (1)
60int length = handlers.Handlers.Length;
System\Windows\DataObjectPastingEventArgs.cs (1)
126if (availableFormats == null || availableFormats.Length == 0)
System\Windows\DragDrop.cs (1)
1411for (int i = 0; i < formats.Length; i++)
System\Windows\FreezableCollection.cs (2)
367ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 477ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Generated\ContentElement.cs (1)
641for (int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Generated\TextDecorationCollection.cs (2)
279ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 389ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Generated\UIElement.cs (1)
641for (int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Generated\UIElement3D.cs (1)
447for (int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Ink\IncrementalHitTester.cs (1)
671System.Diagnostics.Debug.Assert(stroke != null && hitFragments != null && hitFragments.Length > 0);
System\Windows\Ink\Stroke.cs (15)
715System.Diagnostics.Debug.Assert(cutAt.Length != 0); 725if (cutAt.Length == 0) 730if ((cutAt.Length == 1) && cutAt[0].IsFull) 746System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast) || 747Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) <= sourceStylusPoints.Count - 1); 749for (int i = 0; i < cutAt.Length; i++) 777System.Diagnostics.Debug.Assert(cutAt.Length != 0); 788if ((cutAt.Length == 0) || ((cutAt.Length == 1) && cutAt[0].IsFull)) 802System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast) || 803Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) <= sourceStylusPoints.Count - 1); 813for (; i < cutAt.Length; i++) 996if (fragments.Length == 0) 1000if (fragments.Length == 1) 1006for (int x = 0; x < fragments.Length; x++)
System\Windows\Ink\Stroke2.cs (3)
609if(cutAt.Length == 0) 633if (cutAt.Length == 0) 643if (inSegments.Length == 0)
System\Windows\Ink\StrokeCollection.cs (5)
392for ( int x = indexes.Length - 1; x >= 0; x-- ) 510for ( int x = indexes.Length - 1; x >= 0; x-- ) 740for ( int x = 0; x < indexes.Length; x++ ) 770for ( int y = 0; y < indexes.Length; y++ ) 777for ( int i = indexes.Length - 1; i > y; i-- )
System\Windows\Input\Cursor.cs (1)
226for (dataSize = cursorData.Length;
System\Windows\Input\CursorConverter.cs (2)
60object[] values = new object[properties.Length]; //Could use Cursor but its wrapped in ICollection anyways 62for (int i = 0; i < properties.Length; i++)
System\Windows\Input\InputManager.cs (4)
699for(int i = (handlers.Length - 1); i >= 0; i--) 722for(int i = (handlers.Length - 1); i >= 0; i--) 822for(int i = (handlers.Length - 1); i >= 0; i--) 890for(int i = (handlers.Length - 1); i >= 0; i--)
System\Windows\Input\InputMethod.cs (2)
1439for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++) 1463for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++)
System\Windows\Input\InputMethodStateTypeInfo.cs (1)
83for (int i = 0; i < _iminfo.Length; i++)
System\Windows\Input\InputProcessorProfiles.cs (2)
87for (i = 0; (i < hklList.Length) && (i < count); i++) 115for (int i = 0; i < langArray.Length; i++)
System\Windows\Input\Stylus\Common\RawStylusInputReport.cs (1)
269int lastXIndex = _data.Length - packetLength;
System\Windows\Input\Stylus\Common\StylusPoint.cs (8)
117if (additionalValues.Length != expectedAdditionalValues) 299int buttonData = _additionalValues[_additionalValues.Length - 1]; 392int buttonData = _additionalValues[_additionalValues.Length - 1]; 405_additionalValues[_additionalValues.Length - 1] = buttonData; 518for (int x = 0; x < stylusPoint1._additionalValues.Length; x++) 592for (int x = 0; x < _additionalValues.Length; x++) 627count += _additionalValues.Length; 644for (int x = 0; x < _additionalValues.Length; x++)
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (5)
143int logicalPointCount = rawPacketData.Length / lengthPerPoint; 144Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 532Debug.Assert(additionalData.Length == countToCopy); 609additionalData.Length -1 == countToCopy : 610additionalData.Length == countToCopy);
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (20)
128get { return _stylusPointPropertyInfos.Length; } 177Guid[] ret = new Guid[_stylusPointPropertyInfos.Length]; 178for (int x = 0; x < ret.Length; x++) 192int propertyLength = (_stylusPointPropertyInfos.Length - _buttonCount) + buttonLength; 207int expectedLength = ((_stylusPointPropertyInfos.Length - _buttonCount) + buttonLength) - 3 /*x, y, p*/; 247for (int x = _stylusPointPropertyInfos.Length - _buttonCount; //start of the buttons 248x < _stylusPointPropertyInfos.Length; x++) 297Debug.Assert( stylusPointDescription1._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 302Debug.Assert( stylusPointDescription2._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 307if (stylusPointDescription1._stylusPointPropertyInfos.Length != stylusPointDescription2._stylusPointPropertyInfos.Length) 311for (int x = RequiredCountOfProperties; x < stylusPointDescription1._stylusPointPropertyInfos.Length; x++) 338Debug.Assert(stylusPointDescription._stylusPointPropertyInfos.Length >= 3 && 343Debug.Assert(stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length >= 3 && 356for (int x = RequiredCountOfProperties; x < stylusPointDescription._stylusPointPropertyInfos.Length; x++) 358for (int y = RequiredCountOfProperties; y < stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length; y++) 380if (stylusPointDescriptionSuperset._stylusPointPropertyInfos.Length < _stylusPointPropertyInfos.Length) 388for (int x = 0; x < _stylusPointPropertyInfos.Length; x++) 405for (int x = 0; x < _stylusPointPropertyInfos.Length; x++)
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (4)
156if (!elementHasCapture && inputReport.Data != null && inputReport.Data.Length >= pointLength) 159System.Diagnostics.Debug.Assert(data.Length % pointLength == 0); 160Point ptTablet = new Point(data[data.Length - pointLength], data[data.Length - pointLength + 1]);
System\Windows\Input\Stylus\Wisp\PenContext.cs (1)
439int itemsPerPacket = data.Length / numPackets;
System\Windows\Input\Stylus\Wisp\PenContexts.cs (12)
157for (int i = 0; i < _contexts.Length; i++) 173for (int i = 0; i < _contexts.Length; i++) 204if (_contexts is not null && index <= _contexts.Length && _inputSource.Handle != 0) 206PenContext[] ctxs = new PenContext[_contexts.Length + 1]; 208uint postCopyCount = (uint)_contexts.Length - index; 229if (_contexts != null && index < _contexts.Length) 233PenContext[] ctxs = new PenContext[_contexts.Length - 1]; 235uint postCopyCount = (uint)_contexts.Length - index - 1; 482if (!elementHasCapture && inputReport.Data != null && inputReport.Data.Length >= pointLength) 485System.Diagnostics.Debug.Assert(data.Length % pointLength == 0); 486Point ptTablet = new Point(data[data.Length - pointLength], data[data.Length - pointLength + 1]);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (10)
759_cachedMoveData = new int [data0.Length + data.Length]; 761data.CopyTo(_cachedMoveData, data0.Length); 1003for (i=0; i<_penContexts.Length; i++) 1062for (i=0; i<_penContexts.Length; i++) 1174for (int j=0; j<workerOps.Length; j++) 1197if (_handles.Length == 1) 1211_handles.Length, _handles, _pimcResetHandle, 1247for (int i = 0; i < _penContexts.Length; i++) 1275for (int i = 0; i < _pimcContexts.Length; i++)
System\Windows\Input\Stylus\Wisp\WispLogic.cs (4)
202int[] mergedData = new int[oldData.Length + newData.Length]; 205newData.CopyTo(mergedData, oldData.Length); 3497return tabletdevices.Length;
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
35int count = tabletInfo.StylusDevicesInfo.Length; 94int cCursors = stylusDevicesInfo.Length;
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (16)
261PenThread penThread = _tablets.Length > 0 ? _tablets[0].As<WispTabletDevice>().PenThread : 275for (uint i = 0; i < tabletdevices.Length; i++) 290for (uint k = 0; k < tabletdevices.Length; k++) 299for (uint iTablet = 0; iTablet < tabletdevices.Length; iTablet++) 309if (tabletsIndex < _tablets.Length && _tablets[tabletsIndex] != null && _tablets[tabletsIndex].Id == id) 319for (uint i = 0; i < _tablets.Length; i++) 358if (unchangedTabletCount == _tablets.Length && 409PenThread penThread = _tablets.Length > 0 ? _tablets[0].As<WispTabletDevice>().PenThread : 436for (uint i = 0; i < _tablets.Length; i++) 462if (tabletIndex <= _tablets.Length) 523if (tabletIndex >= _tablets.Length) 545uint postCopyCount = (uint)_tablets.Length - index; 563TabletDevice[] tablets = new TabletDevice[_tablets.Length - 1]; 566uint postCopyCount = (uint)_tablets.Length - index - 1; 591for (int iTablet = 0, cTablets = _tablets.Length; iTablet < cTablets; iTablet++) 607for (int iTablet = 0, cTablets = _tablets.Length; iTablet < cTablets; iTablet++)
System\Windows\Input\TextServicesCompartmentContext.cs (1)
50for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++)
System\Windows\InterOp\HwndMouseInputProvider.cs (1)
240for (int i = 0; i < n && cpt < points.Length; i++)
System\Windows\InterOp\HwndPointerInputProvider.cs (4)
136int pointerPropertyCount = tabletDevice.DeviceInfo.SupportedPointerProperties.Length; 155int numButtons = tabletDevice.DeviceInfo.SupportedPointerProperties.Length - tabletDevice.DeviceInfo.SupportedButtonPropertyIndex; 166for (int i = 0, j = rawPointerData.Length - pointerPropertyCount; i < data.Length; i += rawDataPointSize, j -= pointerPropertyCount)
System\Windows\InterOp\HwndSource.cs (2)
235for (int i = handlers.Length -1; i >= 0; --i) 1631for (int i = handlers.Length -1; i >= 0; --i)
System\Windows\LayoutManager.cs (4)
580for(int i=0; i<copy.Length; i++) 683for(int i=0; i<copy.Length; i++) 734AutomationPeer[] peers = new AutomationPeer[copy.Length]; 737for(int i=0; i<copy.Length; i++)
System\Windows\Media\Animation\Clock.cs (1)
4220for (int index = 0; index < idTable.Length; index++)
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 815int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 815int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 815int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 815int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 815int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\TimelineCollection.cs (2)
278ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 388ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\TimeIntervalCollection.cs (5)
222if (_nodeTime != null && _nodeTime.Length > _minimumCapacity) 1240projection.EnsureAllocatedCapacity(this._nodeTime.Length); 1624Debug.Assert(_nodeTime.Length >= _minimumCapacity); // Assert that we indeed have memory allocated 1780else if (_nodeTime.Length < requiredCapacity) // We may need to grow by up to 2 units 1785int newCapacity = _nodeTime.Length << 1; // Dynamically grow by a factor of 2
System\Windows\Media\Animation\Timeline.cs (1)
999for (int index = 0; index < idTable.Length; index++)
System\Windows\Media\ByteStreamGeometryContext.cs (8)
420_chunkList[0].Length != _currOffset) 468while (bufferOffset > _chunkList[currentChunk].Length) 470bufferOffset -= _chunkList[currentChunk].Length; 479_chunkList[currentChunk].Length - bufferOffset); 486&& (_chunkList[currentChunk].Length >= bufferOffset + cbDataForThisChunk)); 489Invariant.Assert(_chunkList[currentChunk].Length > 0); 514int newChunkSize = Math.Min(2*_chunkList[_chunkList.Count-1].Length, c_maxChunkSize); 746if (chunk.Length == c_defaultChunkSize)
System\Windows\Media\CharacterMetricsDictionary.cs (8)
120if (index >= array.Length) 128for (int i = 0; i < pageTable.Length; ++i) 133for (int j = 0; j < page.Length; ++j) 138if (k >= array.Length) 177if (index >= array.Length) 180if (Count > array.Length - index) 442for (int i = 0; i < pageTable.Length; ++i) 447for (int j = 0; j < page.Length; ++j)
System\Windows\Media\Color.cs (13)
50for (int i = 0; i < c1.nativeColorValue.Length; i++) 73if (values.Length != c1.nativeColorValue.Length) 78for (int numChannels = 0; numChannels < values.Length; numChannels++) 298for (int i = 0; i < nativeColorValue.Length; ++i ) 301if (i < nativeColorValue.Length - 1) 343for (int i = 0; i < color.nativeColorValue.Length; i++) 412for (int i = 0; i < c1.nativeColorValue.Length; i++) 529for (int i = 0; i < c1.nativeColorValue.Length; i++) 736if (color1.nativeColorValue.Length != color2.nativeColorValue.Length) 741for (int i = 0; i < color1.nativeColorValue.Length; i++) 1096if (this.nativeColorValue.Length > 0)
System\Windows\Media\ColorContext.cs (3)
123_colorContextHandle, sRGBProfile, (uint)sRGBProfile.Length)) 131FromRawBytes(sRGBProfile, sRGBProfile.Length, dontThrowException: true); 622Invariant.Assert(dataLength <= data.Length);
System\Windows\Media\ColorContextHelper.cs (1)
82Invariant.Assert(buffer == null || bufferSize <= buffer.Length);
System\Windows\Media\ColorTransformHelper.cs (2)
85(UInt32)handles.Length, 87(UInt32)dwIntents.Length,
System\Windows\Media\CultureSpecificStringDictionary.cs (4)
112if (index >= array.Length) 115if (_innerDictionary.Count > array.Length - index) 146if (index >= array.Length) 149if (_innerDictionary.Count > array.Length - index)
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (2)
281ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 391ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Effects\PixelShader.cs (3)
134if (_shaderBytecode != null && _shaderBytecode.Length > 3) 176data.PixelShaderBytecodeSize = (uint)(_shaderBytecode?.Length ?? 0); 259destinationBytecode = new byte[sourceBytecode.Length];
System\Windows\Media\EllipseGeometry.cs (1)
258for (int i=0; i<points.Length; i++)
System\Windows\Media\FamilyMap.cs (2)
93for (int i = 0; i < _ranges.Length; ++i) 327for(int i = 0; i < _ranges.Length; i++)
System\Windows\Media\FamilyMapCollection.cs (5)
76if (index >= array.Length) 79if (_count > array.Length - index) 97if (index >= array.Length) 100if (_count > array.Length - index) 270else if (_count == _items.Length)
System\Windows\Media\FamilyTypefaceCollection.cs (3)
248else if (_count == _items.Length) 375if (index >= array.Length) 378if (_count > array.Length - index)
System\Windows\Media\Fonts.cs (2)
322ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 323ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Media\FormattedText.cs (2)
952return _that._maxTextWidths[Math.Min(line, _that._maxTextWidths.Length - 1)]; 1269if (maxTextWidths == null || maxTextWidths.Length <= 0)
System\Windows\Media\Generated\DoubleCollection.cs (2)
240ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 363ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\DrawingCollection.cs (2)
300ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 410ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GeneralTransformCollection.cs (2)
288ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 398ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GeometryCollection.cs (2)
300ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 410ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GradientStopCollection.cs (2)
288ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 398ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\Int32Collection.cs (2)
240ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 363ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PathFigureCollection.cs (2)
289ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 399ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PathSegmentCollection.cs (2)
288ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 398ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PointCollection.cs (2)
240ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 363ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\RenderData.cs (3)
544Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1113Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1453Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length));
System\Windows\Media\Generated\TextEffectCollection.cs (2)
288ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 398ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\TransformCollection.cs (2)
300ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 410ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\VectorCollection.cs (2)
240ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 363ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Geometry.cs (3)
931if ((SerializedData == null) || (SerializedData.Length <= 0)) 955if ((SerializedData == null) || (SerializedData.Length <= 0)) 967Invariant.Assert(size <= (uint)SerializedData.Length);
System\Windows\Media\GlyphTypeface.cs (5)
1225Invariant.Assert(glyphsLength <= glyphs.Length); 1820ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 1821ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count); 1905ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 1906ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Media\GuidelineCollection.cs (2)
48Debug.Assert(!isDynamic || guidelinesX.Length % 2 == 0); 57Debug.Assert(!isDynamic || guidelinesY.Length % 2 == 0);
System\Windows\Media\ImageSourceConverter.cs (1)
267return new MemoryStream(rawData, i, rawData.Length - i);
System\Windows\Media\Imaging\BitmapDecoder.cs (1)
937Invariant.Assert(colorContextPtrs == null || numContexts <= colorContextPtrs.Length);
System\Windows\Media\Imaging\BitmapFrameDecode.cs (1)
214Invariant.Assert(colorContextPtrs == null || numContexts <= colorContextPtrs.Length);
System\Windows\Media\Imaging\BitmapSource.cs (2)
664uint destBufferSize = checked((uint)elementSize * (uint)(pixels.Length - offset)); 667if (offset >= pixels.Length)
System\Windows\Media\Imaging\CachedBitmap.cs (1)
132int destBufferSize = elementSize * pixels.Length;
System\Windows\Media\Imaging\PropVariant.cs (7)
128int length = array.Length; 167int length = value.Length; 248for (int i=0; i<charArray.Length; i++) 298short[] array = new short[boolArray.Length]; 300for (int i=0; i<boolArray.Length; i++) 385pclsidVal = Marshal.AllocCoTaskMem(guid.Length); 386Marshal.Copy(guid, 0, pclsidVal, guid.Length);
System\Windows\Media\MatrixStack.cs (3)
41if (_size == _items.Length) 187Debug.Assert(_highWaterMark <= _items.Length); 193if (newSize * (s_shrinkFactor) <= _items.Length)
System\Windows\Media\Parsers.cs (3)
93if (preSplit.Length < 2) 102int numTokens = split.Length; 131if (result.ColorContext.NumChannels != values.Length)
System\Windows\Media\PathGeometry.cs (9)
116Invariant.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHGEOMETRY)); 134Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHFIGURE)); 154Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT)); 164Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 179Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 196Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 212Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 233Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 245Debug.Assert(pathData.SerializedData.Length >=
System\Windows\Media\PixelFormat.cs (4)
82int leftNumChannels = left._mask != null ? left._mask.Length : 0; 83int rightNumChannels = right._mask != null ? right._mask.Length : 0; 127for (int i = 0, count = _mask.Length; i < count; ++i) 368Debug.Assert(cbBytes == channelMask.Length);
System\Windows\Media\RectangleGeometry.cs (1)
319for (int i=0; i<points.Length; i++)
System\Windows\Media\RenderData.cs (8)
91if ((_buffer == null) || (newOffset > _buffer.Length)) 98Debug.Assert((_buffer != null) && (_buffer.Length >= newOffset)); 101Debug.Assert(_buffer.Length > 0); 461Debug.Assert(_buffer.Length < cbRequiredSize); 467int newSize = Math.Max((_buffer.Length << 1) - (_buffer.Length >> 1), cbRequiredSize); 480Buffer.MemoryCopy(pBuffer, pNewBuffer, _buffer.Length, _buffer.Length);
System\Windows\Media\StreamGeometry.cs (16)
61if ((_data == null) || (_data.Length <= 0)) 68Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 91Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 115Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 135Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 195Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 219Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 241Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 475if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 477_data = new byte[sourceStream._data.Length]; 490if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 492_data = new byte[sourceStream._data.Length]; 506if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 508_data = new byte[sourceStream._data.Length]; 522if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 524_data = new byte[sourceStream._data.Length];
System\Windows\Media\VisualCollection.cs (6)
178ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _size); 201ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _size); 237return _items != null ? _items.Length : 0; 241int currentCapacity = _items != null ? _items.Length : 0; 447if ((_items == null) || (_size == _items.Length)) 690if ((_items == null) || (_size == _items.Length))
System\Windows\Media\VisualProxy.cs (5)
67int tailLength = _tail.Length; 177else if (count > _tail.Length) 312else if (count == _tail.Length) 565int newLength = _tail.Length + delta; 571Array.Copy(_tail, reallocatedTail, Math.Min(_tail.Length, newLength));
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (2)
286ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 396ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\MaterialCollection.cs (2)
298ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 408ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
298ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 408ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Point3DCollection.cs (2)
238ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 361ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
298ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 408ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
238ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 361ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Matrix3D.cs (3)
512for(int i = 0; i < points.Length; i++) 538for(int i = 0; i < points.Length; i++) 564for(int i = 0; i < vectors.Length; i++)
System\Windows\Media3D\Visual3DCollection.cs (4)
138ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, array.Length); 139ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - Count); 154ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, array.Length); 155ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - Count);
System\Windows\Navigation\BaseUriHelper.cs (2)
270int count = assemblyInfo.Length; 320int count = assemblyInfo.Length;
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
278for (int i = 0; i < keys.Length; i++)
System\Windows\Ole\WpfOleServices.cs (1)
47else if (data is MemoryStream memoryStream && memoryStream.GetBuffer() is { } buffer && buffer.Length != 0)
PresentationFramework (874)
Microsoft\Win32\CommonItemDialog.cs (3)
466if (_itemNames?.Length > 0) 597string[] names = new string[items.Length]; 598for (int i = 0; i < items.Length; i++)
Microsoft\Win32\FileDialog.cs (9)
137string[] safeFileNames = new string[unsafeFileNames.Length]; 139for (int i = 0; i < unsafeFileNames.Length; i++) 489if (filterItems.Length > 0) 491dialog.SetFileTypes((uint)filterItems.Length, filterItems); 559for (int i = 0; i < MutableItemNames.Length; i++) 643if (tokens.Length % 2 == 0) 645extensions = new COMDLG_FILTERSPEC[tokens.Length / 2]; 646for (int i = 0; i < extensions.Length; i++) 710if (indexOfExtension >= tokens.Length)
Microsoft\Win32\OpenFileDialog.cs (2)
92Stream[] streams = new Stream[cachedFileNames.Length]; 95for (int i = 0; i < cachedFileNames.Length; i++)
Microsoft\Win32\OpenFolderDialog.cs (2)
124string[] safeFolderNames = new string[unsafeFolderNames.Length]; 126for (int i = 0; i < unsafeFolderNames.Length; i++)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
587if (realLocator != null && prefixes != null && prefixes.Length > 0)
MS\Internal\Annotations\ObservableDictionary.cs (1)
189ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, target.Length);
MS\Internal\AppModel\IconHelper.cs (1)
234Marshal.Copy(colorArray, 0, bits, colorArray.Length);
MS\Internal\AppModel\ReturnEventSaver.cs (3)
57list = _returnList = new ReturnEventSaverInfo[delegates.Length]; 59for (int i = 0; i < delegates.Length; i++) 109for (int i = 0; i < list.Length; i++)
MS\Internal\Controls\EnumUnknown.cs (1)
28this.size = (arr == null) ? 0 : arr.Length;
MS\Internal\Data\AccessorTable.cs (2)
62if (age >= _ages.Length) 147for (int i=0; i<_ages.Length; ++i)
MS\Internal\Data\ClrBindingWorker.cs (1)
98if (path.SVI.Length > 0)
MS\Internal\Data\DefaultValueConverter.cs (4)
486for (int i = 0; i < SupportedTypes.Length; ++i) 491for (; i < SupportedTypes.Length; ++i) 500for (; i < SupportedTypes.Length; ++i) 513for (int i = 0; i < CharSupportedTypes.Length; ++i)
MS\Internal\Data\IndexedEnumerable.cs (3)
311if (index < array.Length) 486for (int i = 0; i <= defaultMembers.Length - 1; i++) 492if (indexerParameters.Length == 1)
MS\Internal\Data\LiveShapingList.cs (3)
258Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos"); 259int n = _compInfos.Length; 474for (int k = 0; k < infos.Length; ++k)
MS\Internal\Data\PropertyPathWorker.cs (32)
48for (int i = _arySVS.Length - 1; i >= 0; --i) 177if (args != null && args.Length == 1 && 242bool indexerIsNext = (level + 1 < SVI.Length && SVI[level + 1].type == SourceValueType.Indexer); 269if (args != null && args.Length == 1 && 336int level = _arySVS.Length - 1; 408for (int k = 1; k < _arySVS.Length; ++k) 433for (int k = 0; k < _arySVS.Length; ++k) 483for (int k = 0; k < _arySVS.Length; ++k) 500UpdateSourceValueState(_arySVS.Length, null, BindingExpression.NullDataItem, isASubPropertyChange); 506for (k = 0; k < _arySVS.Length; ++k) 537result = (pi != null) && pi.GetIndexParameters().Length > 0; 606Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 611for (++k; k < _arySVS.Length; ++k) 646if (initialLevel < _arySVS.Length) 651_arySVS.Length > 0 && 652SVI[_arySVS.Length - 1].type != SourceValueType.Direct && 653!(_arySVS[_arySVS.Length - 1].info is DependencyProperty) && 654typeof(DependencyObject).IsAssignableFrom(_arySVS[_arySVS.Length - 1].type); 657if (!suppressTransfer && _arySVS.Length > 0 && 658_arySVS[_arySVS.Length - 1].info == FrameworkElement.DataContextProperty && 1167if (aryInfo.Length == 1 && 1178args = new object[aryInfo.Length]; 1186for (int ii = 0; info == null && ii < aryMembers.Length; ++ii) 1193for (int jj = 0; jj < defaultMembers.Length; ++jj) 1214info = SystemCoreHelper.GetIndexerAccessor(args.Length); 1264int len1 = (args != null) ? args.Length : 0; 1265int len2 = (svs.args != null) ? svs.args.Length : 0; 1344if (aryPI != null && aryPI.Length != aryInfo.Length) 1348for (int i = 0; i < args.Length; ++i) 1424if (isIList && aryPI.Length == 1 && aryPI[0].ParameterType == typeof(int)) 1492if (k >= _arySVS.Length)
MS\Internal\Data\RBTree.cs (1)
569if (arrayIndex + Count > array.Length)
MS\Internal\Data\SortFieldComparer.cs (3)
56for (int k = 0; k < _fields.Length; ++k) 89int nFields = sfc._fields.Length; 216if (++index < _values.Length)
MS\Internal\Data\StaticPropertyChangedEventManager.cs (1)
460for (int i = keys.Length - 1; i >= 0; --i)
MS\Internal\Data\ValueChangedEventManager.cs (1)
154for (int i = keys.Length - 1; i >= 0; --i)
MS\Internal\Data\ValueTable.cs (1)
284for (int i = localKeys.Length - 1; i >= 0; --i)
MS\Internal\Data\XDeferredAxisSource.cs (2)
77Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer"); 78PropertyInfo pi = (aryMembers.Length > 0) ? aryMembers[0] as PropertyInfo : null;
MS\Internal\Documents\ContentElementCollection.cs (4)
75if (array.Length - index < Size) 107if (array.Length - index < Size) 749return (Items.Length); 753if (value != Items.Length)
MS\Internal\Documents\MultiPageTextView.cs (1)
1111for (i = 0; i < textViewProximities.Length; i++)
MS\Internal\Documents\TableColumnCollectionInternal.cs (2)
37if (Size == Items.Length) 102if (Size == Items.Length)
MS\Internal\Documents\TableTextElementCollectionInternal.cs (1)
352if (Size == Items.Length)
MS\Internal\Documents\TextBoxLine.cs (2)
476int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 477Invariant.Assert(charactersCopied == textBuffer.Length);
MS\Internal\Documents\TextContainerHelper.cs (4)
53Invariant.Assert(other._ranges.Length >= (other._size * 2)); 55for (int i = 0; i < _ranges.Length; i++) 261if (_ranges.Length < (_size + 1) * 2) 263int[] ranges = new int[_ranges.Length * 2];
MS\Internal\Globalization\BamlTreeMap.cs (8)
387for (int i = 0; i < comment.LocalizationAttributes.Length; i++) 405for (int i = 0; i < comment.LocalizationComments.Length; i++) 566for (int i = 0; i < _comments.Length; i++) 603i < node.Children.Count && (comment.LocalizationComments.Length == 0 || comment.LocalizationAttributes.Length == 0); 612&& comment.LocalizationComments.Length == 0) 618&& comment.LocalizationAttributes.Length == 0) 629_commentsIndex = (_commentsIndex + 1) % _comments.Length;
MS\Internal\Globalization\BamlTreeUpdater.cs (1)
807if (contentPropertyAttributes.Length > 0)
MS\Internal\Globalization\LocalizationComments.cs (2)
60for (int i = 0; i < pairs.Length; i++) 360for (int i = 0; i < _enumNames.Length; i++)
MS\Internal\Helper.cs (4)
650Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 881for (int j = 0; j < dpIndices.Length; j++) 983for (int i = 0; i < dpIndices.Length; i++) 1038for (int j=0; j<dpIndices.Length; j++)
MS\Internal\Ink\LassoSelectionBehavior.cs (2)
185if ( 0 != lassoPoints.Length ) 612if ( 0 != lassoPoints.Length )
MS\Internal\Interop\InternalDispatchObject.cs (1)
60_dispId2MethodMap = new Dictionary<int, MethodInfo>(methods.Length);
MS\Internal\IO\Packaging\ByteStream.cs (2)
277if (!((buffer.Length > 0) && ((buffer.Length - offset) >= count)))
MS\Internal\IO\Packaging\CorePropertiesFilter.cs (3)
268if (attributes != null && attributes.Length > 0) 341while (_currentIndex < _attributes.Length) 404if (_currentIndex < 0 || _currentIndex >= _attributes.Length)
MS\Internal\IO\Packaging\PackageFilter.cs (4)
533for (int keyNameIndex = 0; keyNameIndex < keyPath.Length; ++keyNameIndex) 609for (int i = 0; i < path.Length; ++i) 613Debug.Assert(stopGaps.Length > nextStopGapToUse); 621Debug.Assert(stopGaps.Length == nextStopGapToUse);
MS\Internal\IO\Packaging\XamlFilter.cs (2)
169if (aAttributes != null && aAttributes.Length > 0) 173for (int i = 0; i < aAttributes.Length; i++)
MS\Internal\IO\Packaging\XmlFixedPageInfo.cs (2)
59if (position < 0 || position >= GlyphRunList.Length) 85return GlyphRunList.Length;
MS\Internal\Printing\PrintDlgExMarshaler.cs (9)
371Marshal.Copy(pDevMode, devModeData, 0, devModeData.Length); 722int cbDevNames = checked(((printer.Length + 3) * Marshal.SystemDefaultCharSize) + 737devNames.wDriverOffset = checked((ushort)(devNames.wDeviceOffset + printer.Length + 1)); 750checked((IntPtr)((long)offsetName + (printer.Length * Marshal.SystemDefaultCharSize))); 761Array.Clear(nulls, 0, nulls.Length); 766printer.Length); 771nulls.Length); 815IntPtr hDevMode = Marshal.AllocHGlobal(devModeData.Length); 816Marshal.Copy(devModeData, 0, hDevMode, devModeData.Length);
MS\Internal\PtsHost\CellParaClient.cs (4)
79&& (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length); 359&& (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length); 455_columnWidths = new double[tpc.CalculatedColumns.Length]; 457for(int index = 0; index < tpc.CalculatedColumns.Length; index++)
MS\Internal\PtsHost\ContainerParaClient.cs (3)
287for (int i = 0; i < arrayParaDesc.Length; i++) 339List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 340for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\DtrList.cs (6)
125if (_count == _dtrs.Length) { Resize(); } 135if (_count == _dtrs.Length) { Resize(); } 299if (_count == _dtrs.Length) { Resize(); } 310Debug.Assert(_dtrs.Length > 0); 313DirtyTextRange [] newdtrs = new DirtyTextRange[_dtrs.Length * 2]; 314Array.Copy(_dtrs, newdtrs, _dtrs.Length);
MS\Internal\PtsHost\FigureParaClient.cs (16)
114for (int index = 0; index < arrayColumnDesc.Length; index++) 164emptySubpage = (arrayColumnDesc.Length == 0); 167for (int index = 0; index < arrayColumnDesc.Length; index++) 255for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 314for (int index = 0; index < arrayColumnDesc.Length; index++) 414emptySubpage = (arrayColumnDesc.Length == 0); 444for (int index = 0; index < arrayColumnDesc.Length; index++) 449ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 451for (int index = 0; index < arrayColumnDesc.Length; index++) 514Invariant.Assert(arrayColumnDesc.Length == 1); 517for (int index = 0; index < arrayColumnDesc.Length; index++) 578paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 579for (int i = 0; i < arrayParaDesc.Length; i++) 603Debug.Assert(arrayColumnDesc.Length == 1); 618paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 619for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\FloaterParaClient.cs (15)
99for (int index = 0; index < arrayColumnDesc.Length; index++) 149emptySubpage = (arrayColumnDesc.Length == 0); 152for (int index = 0; index < arrayColumnDesc.Length; index++) 260for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 319for (int index = 0; index < arrayColumnDesc.Length; index++) 421emptySubpage = (arrayColumnDesc.Length == 0); 451for (int index = 0; index < arrayColumnDesc.Length; index++) 456ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 458for (int index = 0; index < arrayColumnDesc.Length; index++) 523for (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\FlowDocumentPage.cs (4)
486for (int i = 0; i < arrayColumnDesc.Length; i++) 545for (int i = 0; i < arrayParaDesc.Length; i++) 580List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 581for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\LineBase.cs (2)
116int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 176run = new TextCharacters(textBuffer, 0, textBuffer.Length, textProps);
MS\Internal\PtsHost\PtsContext.cs (9)
117for (index = 0; index < _unmanagedHandles.Length; ++index) 134for (int i = 0; i < _unmanagedHandles.Length; ++i) 210Invariant.Assert(handleLong > 0 && handleLong < _unmanagedHandles.Length, "Invalid object handle."); 228if (handleLong < 0 || handleLong >= _unmanagedHandles.Length) 247Invariant.Assert(handleLong > 0 && handleLong < _unmanagedHandles.Length, "Invalid object handle."); 430while (freeIndex < _unmanagedHandles.Length) 444int freeIndex = _unmanagedHandles.Length; 447HandleIndex[] newItems = new HandleIndex[_unmanagedHandles.Length * 2]; 448Array.Copy(_unmanagedHandles, newItems, _unmanagedHandles.Length);
MS\Internal\PtsHost\PtsHelper.cs (9)
155for (int index = 0; index < arrayParaDesc.Length; index++) 252for (int index = 0; index < arrayParaDesc.Length; index++) 296if (arrayParaDesc.Length < visualCollection.Count) 298visualCollection.RemoveRange(arrayParaDesc.Length, visualCollection.Count - arrayParaDesc.Length); 343for (int index = 0; index < arrayParaDesc.Length; index++) 408for (int index = 0; index < arrayParaDesc.Length && ie == null; index++) 487for (int index = 0; index < arrayParaDesc.Length; index++) 743for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\PtsPage.cs (14)
536for (int index = 0; index < arraySectionDesc.Length; index++) 581for (int index = 0; index < arraySectionDesc.Length; index++) 925for (int index = 0; index < arrayColumnDesc.Length; index++) 973for (int index = 0; index < arrayColumnDesc.Length; index++) 1061emptyPage = (arraySectionDesc.Length == 0); 1064ErrorHandler.Assert(arraySectionDesc.Length == 1, ErrorHandler.NotSupportedMultiSection); 1135emptySection = (arrayColumnDesc.Length == 0); 1146for (int index = 0; index < arrayColumnDesc.Length; index++) 1151ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 1152for (int index = 0; index < arrayColumnDesc.Length; index++) 1226for (int index = 0; index < arraySectionDesc.Length && ie == null; index++) 1280for (int index = 0; index < arraySectionDesc.Length; index++) 1339for (int index = 0; index < arrayColumnDesc.Length; index++) 1401for (int index = 0; index < arrayColumnDesc.Length; index++)
MS\Internal\PtsHost\RowParagraph.cs (9)
46for(int index = 0; index < _cellParagraphs.Length; index++) 247Invariant.Assert(cCells == i + _spannedCells.Length); // Protect against buffer overflow 250if (_spannedCells.Length > 0) 254for (int j = 0; j < _spannedCells.Length; ++j) 310_spannedCells = new CellParagraph[Row.SpannedCells.Length]; 317for(int index = 0; index < _spannedCells.Length; index++) 331(isLastRowOfRowGroup && _spannedCells.Length > 0)) 389for(int index = 0; index < _cellParagraphs.Length; index++) 399for(int index = 0; index < previousRow._spannedCells.Length; index++)
MS\Internal\PtsHost\SectionVisual.cs (7)
44if (arrayColumnDesc.Length > 1) 49rulePositions = new Point[(arrayColumnDesc.Length - 1)*2]; 50for (int index = 1; index < arrayColumnDesc.Length; index++) 67int prevSize = _rulePositions == null ? 0 : _rulePositions.Length; 68int newSize = rulePositions == null ? 0 : rulePositions.Length; 71for (int index = 0; index < rulePositions.Length; index++) 111for (int index = 0; index < rulePositions.Length; index += 2)
MS\Internal\PtsHost\SubpageParaClient.cs (14)
131for (int index = 0; index < arrayColumnDesc.Length; index++) 194for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 252for (int index = 0; index < arrayColumnDesc.Length; index++) 350emptySubpage = (arrayColumnDesc.Length == 0); 380for (int index = 0; index < arrayColumnDesc.Length; index++) 385ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 386for (int index = 0; index < arrayColumnDesc.Length; index++) 446emptySubpage = (arrayColumnDesc.Length == 0); 449for (int index = 0; index < arrayColumnDesc.Length; index++) 500for (int index = 0; index < arrayColumnDesc.Length; index++) 580for (int i = 0; i < arrayColumnDesc.Length; i++) 619List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 620for (int i = 0; i < arrayParaDesc.Length; i++) 655for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\TableParaClient.cs (48)
100for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 124for (int iC = 0; iC < arrayFsCell.Length; ++iC) 235for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 283CalculatedColumns.Length, 304if (rowVisualsCollection.Count > arrayTableRowDesc.Length) 307arrayTableRowDesc.Length, 308rowVisualsCollection.Count - arrayTableRowDesc.Length); 326for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 338for (int iC = 0; iC < arrayFsCell.Length; ++iC) 372for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 386for (int iC = 0; iC < arrayFsCell.Length; ++iC) 450for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 460for (int iC = 0; iC < arrayFsCell.Length; ++iC) 522for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 551for (int iC = 0; iC < arrayFsCell.Length; ++iC) 615for (int iR = 0; iR < arrayTableRowDesc.Length && cpcFound == null; ++iR) 627for (int iC = 0; iC < arrayFsCell.Length && cpcFound == null; ++iC) 697for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 748for (int iC = 0; iC < arrayFsCell.Length; ++iC) 832for (int iR = 0; iR < arrayTableRowDesc.Length && !passedEndPosition; ++iR) 844for (int iC = 0; iC < arrayFsCell.Length; ++iC) 899for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 911for (int iC = 0; iC < arrayFsCell.Length; ++iC) 956for (int iR = arrayTableRowDesc.Length - 1; iR >= 0; --iR) 971for (int iC = arrayFsCell.Length - 1; iC >= 0; --iC) 1035for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1050for (int iC = arrayFsCell.Length - 1; iC >= 0; --iC) 1130for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1274for (int i = 0; i < cols.Length; i++) 1346row = ((RowParagraph)(PtsContext.HandleToObject(arrayTableRowDesc[arrayTableRowDesc.Length - 1].fsnmRow))).Row; 1350arrayTableRowDesc[arrayTableRowDesc.Length - 1].pfstablerow, 1544for (int iC = 0; iC < arrayFsCell.Length; ++iC) 1663for (int iC = 0; iC < arrayFsCell.Length; ++iC) 1688for (int columnIndex = 0; columnIndex < arrayCellParaClients.Length; ++columnIndex) 1758for (int iC = CalculatedColumns.Length-1; iC >= 0; iC--) 1777for (int iC = 0; iC < CalculatedColumns.Length; iC++) 1808if(IsLastChunk && rowIndex == arrayTableRowDesc.Length - 1) 1833if(arrayTableRowDesc.Length > 0) 1838for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1888for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1920else if (_calculatedColumns.Length != columns) 1927Math.Min(_calculatedColumns.Length, columns)); 1932if (_calculatedColumns.Length > 0) 1936while (i < _calculatedColumns.Length && i < Table.Columns.Count) 1942while (i < _calculatedColumns.Length) 1951for (int i = 0; i < _calculatedColumns.Length; ++i) 2038for (int i = 0; i < _calculatedColumns.Length; ++i) 2324for (int i = 0; i < _calculatedColumns.Length; ++i)
MS\Internal\PtsHost\TableParagraph.cs (2)
504for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++) 522for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++)
MS\Internal\PtsHost\TextParaClient.cs (87)
172for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 267for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 396floaters = new List<ParagraphResult>(arrayAttachedObjectDesc.Length); 399for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 433figures = new List<ParagraphResult>(arrayAttachedObjectDesc.Length); 436for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 540for (index = 0; index < arrayLineDesc.Length; index++) 564for (index = 0; index < arrayLineDesc.Length; index++) 574for (elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 589if (elIndex < arrayLineElement.Length) 999for (index = 0; index < arrayLineDesc.Length; index++) 1024for (index = 0; index < arrayLineDesc.Length; index++) 1034for (elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1051if (elIndex < arrayLineElement.Length) 1256for (int index = 0; index < arrayLineDesc.Length; index++) 1282for (int index = 0; index < arrayLineDesc.Length; index++) 1290for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1320for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 1525List<LineResult> lines = new List<LineResult>(arrayLineDesc.Length); 1528for (int index = 0; index < arrayLineDesc.Length; index++) 1577List<LineResult> lines = new List<LineResult>(arrayLineDesc.Length); 1580for (int index = 0; index < arrayLineDesc.Length; index++) 1589for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1647for (int index = 0; index < arrayLineDesc.Length; index++) 1656|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 1735for (int index = 0; index < arrayLineDesc.Length; index++) 1744for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1753|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 1830int lineCount = arrayLineDesc.Length; 1868|| ( (lineIndex == arrayLineDesc.Length - 1) 1879if ( (handleEndOfPara && lineIndex == (arrayLineDesc.Length - 1)) 1936for (int lineIndex = 0; lineIndex < arrayLineDesc.Length; ++lineIndex) 1948for (int elemIndex = 0; elemIndex < arrayLineElement.Length; ++elemIndex) 1979&& (elemIndex == arrayLineElement.Length - 1) 1980&& (lineIndex == arrayLineDesc.Length - 1) ) ) 1989if ( (handleEndOfPara && lineIndex == (arrayLineDesc.Length - 1)) 2333for (int index = 0; index < arrayAttachedObjectDesc.Length; ++index) 2379for (int index = 0; index < arrayLineDesc.Length; index++) 2386|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2389if (dcp >= lineDesc.dcpLim - 1 && index == arrayLineDesc.Length - 1) 2471for (int index = 0; index < arrayLineDesc.Length; index++) 2483for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 2490|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 2493if (dcp >= element.dcpLim - 1 && elIndex == arrayLineElement.Length - 1 && index == arrayLineDesc.Length - 1) 2533element = arrayLineElement[arrayLineElement.Length - 1]; 2598for (int index = 0; index < arrayLineDesc.Length; index++) 2605|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2625if (index == arrayLineDesc.Length - 1) 2664if (index == arrayLineDesc.Length - 1) 2723for (int index = 0; index < arrayLineDesc.Length; index++) 2732for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 2739|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 2776element = arrayLineElement[arrayLineElement.Length - 1]; 2786Debug.Assert(elIndex == arrayLineElement.Length - 1); 2787Debug.Assert(index == arrayLineDesc.Length - 1); 2790else if (dcp == element.dcpLim - 1 && elIndex == arrayLineElement.Length - 1 && index == arrayLineDesc.Length - 1) 2827if (index == arrayLineDesc.Length - 1) 2888for (int index = 0; index < arrayLineDesc.Length; index++) 2895|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2980for (int index = 0; index < arrayLineDesc.Length; index++) 2989for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 2996|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 3033element = arrayLineElement[arrayLineElement.Length - 1]; 3104for (int index = 0; index < arrayLineDesc.Length; index++) 3157for (int index = 0; index < arrayLineDesc.Length; index++) 3166for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3227for (int index = 0; index < arrayLineDesc.Length; index++) 3299for (int index = textDetails.cLinesBeforeChange + textDetails.cLinesChanged; index < arrayLineDesc.Length; index++) 3402for (lineIndex = 0; lineIndex < arrayLineDesc.Length; lineIndex++) 3417for (lineIndex = lineIndexFirstVisible; lineIndex < arrayLineDesc.Length; lineIndex++) 3598for (int index = 0; index < arrayLineDesc.Length; index++) 3621for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3690for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3718for (int index = textDetails.cLinesBeforeChange + textDetails.cLinesChanged; index < arrayLineDesc.Length; index++) 3751for (index = 0; index < arrayAttachedObjectDesc.Length; index++) 3792for (int index = 0; index < arrayLineDesc.Length; index++) 3880for (int index = 0; index < arrayLineDesc.Length; index++) 3972for (int index = 0; index < arrayLineDesc.Length; index++) 3985for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 4057for (int index = 0; index < arrayLineDesc.Length; index++) 4104for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++)
MS\Internal\PtsHost\TextParagraph.cs (1)
1403for(int index = 0; arrayAttachedObjectDesc != null && index < arrayAttachedObjectDesc.Length; index++)
MS\Internal\PtsTable\RowSpanVector.cs (5)
96if (_size == _entries.Length) 248Debug.Assert( _entries.Length > 0 249&& _size <= _entries.Length ); 251Entry[] newEntries = new Entry[_entries.Length * 2]; 252Array.Copy(_entries, newEntries, _entries.Length);
MS\Internal\Text\ComplexLine.cs (2)
364int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 397run = new TextCharacters(textBuffer, 0, textBuffer.Length, textProps);
MS\Internal\UncommonValueTable.cs (2)
46int n = _table.Length; 69int n = _table.Length - 1;
MS\Internal\WeakDictionary.cs (1)
301ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - count);
MS\Internal\WeakHashSet.cs (1)
48ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - count);
MS\Internal\WindowsRuntime\Generated\WinRT\IInspectable.cs (1)
56iidCount = (uint)iids.Length;
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (18)
142var length = array.Length; 163return (m._marshalers?.Length ?? 0, m._array); 209var length = array.Length; 231DisposeAbiArrayElements((array.Length, data)); 236var length = array.Length; 287return (((Array)m._gchandle.Target).Length, m._gchandle.AddrOfPinnedObject()); 307var length = array.Length; 319int byte_length = array.Length * Marshal.SizeOf<T>(); 457int length = array.Length; 481return (m._marshalers?.Length ?? 0, m._array); 537int length = array.Length; 562DisposeAbiArrayElements((array.Length, data)); 567int length = array.Length; 639int length = array.Length; 661return (m._marshalers?.Length ?? 0, m._array); 697int length = array.Length; 720DisposeAbiArrayElements((array.Length, data)); 725int length = array.Length;
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (2)
153var newArguments = new Type[genericArguments.Length]; 154for (int i = 0; i < genericArguments.Length; i++)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IEnumerable.cs (2)
391while (index < items.Length && HasCurrent) 403for (int i = index; i < items.Length; ++i)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (2)
184uint itemCount = Math.Min((uint)items.Length, (uint)_list.Count - startIndex); 196for (uint i = itemCount; i < items.Length; ++i)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (3)
237if (reqKeyToken.Length == curKeyToken.Length) 241for (int i = 0; i < reqKeyToken.Length; i++)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\ItemMap.cs (2)
37if ((Count + 1) > Entries.Length) 39destEntries = new Entry[Entries.Length * 2];
System\Windows\Annotations\AnnotationService.cs (2)
1012for (int i = 0; i < adorners.Length; i++) 1305List<AttachedAnnotationChangedEventArgs> eventsToFire = new List<AttachedAnnotationChangedEventArgs>(list.Length);
System\Windows\Application.cs (2)
2367int l = bamlConvertUriSegments.Length; 2368int m = curUriSegments.Length;
System\Windows\BroadcastEventHelper.cs (4)
44Debug.Assert(loadedPending.Length == 3); 92Debug.Assert(unloadedPending.Length == 3); 165Debug.Assert(loadedPending != null && loadedPending.Length == 3, 202Debug.Assert(unloadedPending != null && unloadedPending.Length == 3,
System\Windows\Controls\BorderGapMaskConverter.cs (1)
39values.Length != 3 ||
System\Windows\Controls\ColumnDefinition.cs (5)
84if (array.Length - index < _size) 106if (array.Length - index < _size) 675else if (_size == _items.Length) 677PrivateSetCapacity(Math.Max(_items.Length * 2, c_defaultCapacity)); 748else if (_items == null || value != _items.Length)
System\Windows\Controls\DataGridCell.cs (1)
424for (int i = 0; i < bindingExpressionsCopy.Length; i++)
System\Windows\Controls\DataGridClipboardHelper.cs (1)
82int bytecountEndOfFragment = bytecountPrefixContext + destinationBytes.Length;
System\Windows\Controls\DataGridHelper.cs (2)
533for (int i = 0; i < bindingExpressionsCopy.Length; i++) 649for (int i = 0; i < bindingExpressionsCopy.Length; i++)
System\Windows\Controls\DataGridLengthConverter.cs (1)
213int numUnitStrings = _unitStrings.Length;
System\Windows\Controls\DateTimeHelper.cs (2)
254if (monthNames != null && monthNames.Length > 0) 256result = monthNames[(date.Value.Month - 1) % monthNames.Length];
System\Windows\Controls\Grid.cs (66)
438Array.Clear(_definitionIndices, 0, _definitionIndices.Length); 446Array.Clear(_roundingErrors, 0, _roundingErrors.Length); 466Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 635bool canResolveStarsU = extData.CellGroup2 > PrivateCells.Length; 722Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 733for (int currentCell = 0; currentCell < PrivateCells.Length; ++currentCell) 818value = definitions[(columnIndex + 1) % definitions.Length].FinalOffset; 840value = definitions[(rowIndex + 1) % definitions.Length].FinalOffset; 936for (int i = PrivateCells.Length - 1; i >= 0; --i) 953ColumnIndex = Math.Min(GetColumn(child), DefinitionsU.Length - 1), 956RowIndex = Math.Min(GetRow(child), DefinitionsV.Length - 1) 962cell.ColumnSpan = Math.Min(GetColumnSpan(child), DefinitionsU.Length - cell.ColumnIndex); 966cell.RowSpan = Math.Min(GetRowSpan(child), DefinitionsV.Length - cell.RowIndex); 968Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length); 969Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length); 1067Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0); 1114Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0); 1129for (int i = 0; i < definitions.Length; ++i) 1173double[] minSizes = isRows ? new double[DefinitionsV.Length] : new double[DefinitionsU.Length]; 1175for (int j=0; j<minSizes.Length; j++) 1193} while (i < PrivateCells.Length); 1200for (int i=0; i<minSizes.Length; i++) 1245if (cellsHead >= PrivateCells.Length) 1298} while (i < PrivateCells.Length); 1427Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1454Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1482Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length); 1684for (int i = 0; i < definitions.Length; ++i) 1780int defCount = definitions.Length; 2078for (int i = 0; i < definitions.Length; ++i) 2114int nonStarIndex = definitions.Length; // traverses from the last entry down 2130for (int i = 0; i < definitions.Length; ++i) 2258Array.Sort(definitionIndices, 0, definitions.Length, new DistributionOrderIndexComparer(definitions)); 2261for (int i = 0; i < definitions.Length; ++i) 2264double final = definitions[definitionIndex].SizeCache + (sizeToDistribute / (definitions.Length - i)); 2289for (int i = 0; i < definitions.Length; ++i) 2296Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2302int i = definitions.Length - 1; 2319while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length) 2336for (int i = 0; i < definitions.Length; ++i) 2338definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache; 2359int defCount = definitions.Length; 2705for (int i = 0; i < definitions.Length; ++i) 2759for (int i = 0; i < definitions.Length; ++i) 2765Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2771int i = definitions.Length - 1; 2788while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length) 2806for (int i = 0; i < definitions.Length; ++i) 2808definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache; 2915Array.Clear(extData.TempDefinitions, 0, Math.Max(DefinitionsU.Length, DefinitionsV.Length)); 3120int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length) * 2; 3123|| extData.TempDefinitions.Length < requiredLength ) 3135|| extData.TempDefinitions.Length < requiredLength ) 3153int requiredLength = Math.Max(Math.Max(DefinitionsU.Length, DefinitionsV.Length), 1) * 2; 3155if (_definitionIndices == null || _definitionIndices.Length < requiredLength) 3171int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length); 3177else if (_roundingErrors == null || _roundingErrors.Length < requiredLength) 4045for (int i = 1; i < grid.DefinitionsU.Length; ++i) 4053for (int i = 1; i < grid.DefinitionsV.Length; ++i)
System\Windows\Controls\GridViewHeaderRowPresenter.cs (3)
1351for (int i = 0, n = s_DPList[0].Length; i < n; i++) 1668for (int i = 0; i < s_DPList.Length; i++) 1670for (int j = 0; j < s_DPList[i].Length; j++)
System\Windows\Controls\MenuScrollingVisibilityConverter.cs (1)
43values.Length != 4 ||
System\Windows\Controls\Panel.cs (1)
1034if (_zLut == null || _zLut.Length != count)
System\Windows\Controls\PopupControlService.cs (3)
1541for (int i=0, N=_points.Length; i<N; ++i) 1651for (int i = 0, N = _points.Length; i < N; ++i) 1671for (int i = 0, N = _points.Length; i < N; ++i)
System\Windows\Controls\Primitives\CalendarItem.cs (3)
1000if (daytitle != null && shortestDayNames != null && shortestDayNames.Length > 0) 1004daytitle.DataContext = shortestDayNames[(childIndex + (int)this.Owner.FirstDayOfWeek) % shortestDayNames.Length]; 1008daytitle.DataContext = shortestDayNames[(childIndex + (int)DateTimeHelper.GetDateFormat( DateTimeHelper.GetCulture(this)).FirstDayOfWeek) % shortestDayNames.Length];
System\Windows\Controls\Primitives\Popup.cs (3)
2035positions = customPlacements == null ? 0 : customPlacements.Length; 2454for (int i = 1; i < interestPoints.Length; i++) 2777if (UnsafeNativeMethods.GetBitmapBits(iconInfo.hbmMask.MakeHandleRef(null), curMask.Length, curMask) != 0)
System\Windows\Controls\Primitives\TabPanel.cs (4)
263bool lastHeaderInRow = isMultiRow && (separatorIndex < solution.Length && solution[separatorIndex] == childIndex || childIndex == _numHeaders - 1); 319if (solution.Length > 0) 333if (activeRow < solution.Length && solution[activeRow] == childIndex) 386int numHeaders = headerWidth.Length;
System\Windows\Controls\RichTextBox.cs (4)
636for (int i = 0; i < inheritableFormattingProperties.Length; i++) 644for (int i = 0; i < inheritableBehavioralProperties.Length; i++) 663for (int i = 0; i < inheritableFormattingProperties.Length; i++) 677for (int i = 0; i < inheritableBehavioralProperties.Length; i++)
System\Windows\Controls\RowDefinition.cs (5)
79if (array.Length - index < _size) 101if (array.Length - index < _size) 670else if (_size == _items.Length) 672PrivateSetCapacity(Math.Max(_items.Length * 2, c_defaultCapacity)); 743else if (_items == null || value != _items.Length)
System\Windows\Controls\SinglePageViewer.cs (3)
831for (index = 0; index < pageRects.Length; index++) 839if (index >= pageRects.Length) 843for (index = 1; index < pageRects.Length; index++)
System\Windows\Controls\TextBlock.cs (1)
313for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Controls\TextBox.cs (1)
60for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Controls\TextRangeAdaptor.cs (2)
1816double[] asDoubles = new double[rects.Length * 4]; 1817for (int i = 0; i < rects.Length; i++)
System\Windows\Controls\WebBrowser.cs (2)
300dp.cArgs = (uint)((args == null) ? 0 : args.Length); 331UnsafeNativeMethods.ArrayToVARIANTHelper.FreeVARIANTVector(dp.rgvarg, args.Length);
System\Windows\Data\BindingExpressionBase.cs (6)
451int n = (_sources != null) ? _sources.Length : 0; 2432for (int i=0; i < commonSources.Length; ++i) 2443int m = (sources == null) ? 0 : sources.Length; 2859sources = new DependencySource[newSources.Length]; 2861for (int i = 0; i < newSources.Length; ++i) 2872if (n < newSources.Length)
System\Windows\Data\BindingGroup.cs (3)
1154for (int i=_proposedValueBindingExpressions.Length-1; i>=0; --i) 1187for (int i=_proposedValueBindingExpressions.Length-1; i>=0; --i) 1435for (int i=0, n=_proposedValueBindingExpressions.Length; i<n; ++i)
System\Windows\Data\CollectionView.cs (4)
1395object[] newArray = new object[array.Length + 1]; 1397newArray[array.Length] = value; 1505for (int i=0; i<interfaces.Length; ++i) 1513if (typeParameters.Length == 1)
System\Windows\Data\MultiBindingExpression.cs (18)
538for (int i=0; i<values.Length; ++i) 551if (values.Length != count && TraceData.IsEnabled) 554traceParameters: new object[] { Converter.GetType().Name, count, values.Length, TraceData.DescribeTarget(target, TargetProperty) }); 558if (values.Length < count) 559count = values.Length; 600Array.Clear(_tempTypes, 0, _tempTypes.Length); 655for (int i=0; i<values.Length; ++i) 687if (values.Length < count) 688count = values.Length; 752if (values.Length < count) 753count = values.Length; 796if (values.Length < count) 797count = values.Length; 888if (convertedValues.Length < count) 889count = convertedValues.Length; 1045for (int j = 0; j < sources.Length; ++j) 1194for (int i=0; i<_tempValues.Length; ++i) 1259Array.Clear(_tempValues, 0, _tempValues.Length);
System\Windows\Data\ObjectDataProvider.cs (1)
390if (ciAry.Length != 0)
System\Windows\Data\PriorityBindingExpression.cs (1)
576for (int j=0; j<sources.Length; ++j)
System\Windows\Data\XmlNamespaceMappingCollection.cs (1)
135int maxLength = array.Length;
System\Windows\DataTrigger.cs (1)
187Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\Documents\AdornerLayer.cs (3)
416for (int i = 0; i < zOrderMapEntries.Length; i++) 450for (int i = 0; i < zOrderMapEntries.Length; i++) 793for (int i = 0; i < keys.Length; i++)
System\windows\Documents\CaretElement.cs (1)
557for (int i = 0; i < adorners.Length; i++)
System\Windows\Documents\DocumentSequenceTextPointer.cs (4)
660if (startIndex > textBuffer.Length) 662throw new ArgumentException(SR.Format(SR.StartIndexExceedsBufferSize, startIndex, textBuffer.Length)); 668if (count > textBuffer.Length - startIndex) 670throw new ArgumentException(SR.Format(SR.MaxLengthExceedsBufferSize, count, textBuffer.Length, startIndex));
System\Windows\Documents\FixedLineResult.cs (1)
104return _nodes[_nodes.Length - 1];
System\Windows\Documents\FixedNode.cs (8)
95int[] completePath = new int[childPath.Length + 1]; 132Debug.Assert(path != null && path.Length >= 2); // At least a page index and an element index 197for (int i = 0; i < childPath.Length && i < _path.Length - 1; i++) 287for (int i = 1; i < _path.Length; i++) 339Debug.Assert(level < _path.Length); 350Debug.Assert(_path.Length >= 2); 351return _path.Length - 1;
System\Windows\Documents\FixedPage.cs (1)
160if (adorners != null && adorners.Length > 0)
System\Windows\Documents\FixedPageStructure.cs (9)
114while (line < _lineResults.Length - 1 && count > 0) 131line = Math.Max(0, Math.Min(line, _lineResults.Length - 1)); 223for (int line = 0; line < _lineResults.Length; line++) 248int lineCount = _lineResults.Length; 552ft = new FormattedText($"{fn}-{(int)(fn.Cookie)}-{somElements.Length}", 642for (int i=0; i<_lineResults.Length; i++) 690if (_lineResults.Length > 0) 692return _lineResults[_lineResults.Length - 1].Nodes; 702if (_lineResults.Length > 0)
System\Windows\Documents\FixedSchema.cs (1)
85predefinedNamespaces = new string[_predefinedNamespaces.Length + 1];
System\Windows\Documents\FixedTextBuilder.cs (9)
402int loIndex = 0, hiIndex = fixes.Length - 1; 470if (flowNodes.Length <= 0) 477FlowNode flowEnd = flowNodes[flowNodes.Length - 1]; 496Debug.Assert(fixes.Length == 1); 539if (somElements.Length == 0) 791int[] newPath = new int[pathPrefix.Length + 1]; 793newPath[newPath.Length - 1] = childIndex; 995newPathPrefix = new int[pathPrefix.Length + 1]; 1000newPathPrefix[newPathPrefix.Length - 1] = childIndex;
System\Windows\Documents\FixedTextContainer.cs (2)
407for(int i=0; i<elements.Length; i++) 450if (i == elements.Length - 1)
System\Windows\Documents\FixedTextView.cs (4)
595FixedNode lastNode = fixedNodes[fixedNodes.Length - 1]; 813if (fixedNodes != null && fixedNodes.Length > 0) 881if (fixedNodes != null && fixedNodes.Length > 0) 899for (int i = fixedNodes.Length - 1; i >= 0; i--)
System\Windows\Documents\FlowDocument.cs (1)
84for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Documents\FlowNode.cs (1)
167if (this.FixedSOMElements != null && this.FixedSOMElements.Length > 0)
System\Windows\Documents\FlowPosition.cs (1)
253if (elements != null && elements.Length > 0)
System\Windows\Documents\Glyphs.cs (9)
222if (glyphRunProperties.clusterMap != null && glyphRunProperties.clusterMap.Length != 0) 223caretStopCount = glyphRunProperties.clusterMap.Length + 1; 227caretStopCount = glyphRunProperties.glyphIndices.Length + 1; 254if (i >= caretStops.Length) 261if (i >= caretStops.Length) 268if (i >= caretStops.Length) 275if (i >= caretStops.Length) 284while (i < caretStops.Length) 459if (index < 0 || index >= clusterMap.Length)
System\Windows\Documents\ImmComposition.cs (9)
907int compositionLength = compositionChars == null ? 0 : compositionChars.Length; 908resultLength = resultChars == null ? 0 : resultChars.Length; 928int originalLength = (compositionText == null) ? 0 : compositionText.Length; 941(caretOffset < attributes.Length) && 945((caretOffset - 1) < attributes.Length) && 1151for (int i = 0; i < attributes.Length; i++) 1153if ((i + 1) < attributes.Length) 1395int copied = navigator.GetTextInRun(LogicalDirection.Backward, buffer, 0, buffer.Length); 1447int copied = navigator.GetTextInRun(LogicalDirection.Forward, buffer, 0, buffer.Length);
System\Windows\Documents\NaturalLanguageHyphenator.cs (3)
108&& characterSource.Length > 0 110&& length <= characterSource.Length 132isHyphenPositions.Length
System\Windows\Documents\RangeContentEnumerator.cs (2)
295else if (_buffer.Length < size) 297newBuffer = new char[Math.Max(2*_buffer.Length, size)];
System\Windows\Documents\RtfToXamlLexer.cs (12)
64if (_rtfIndex >= _rtfBytes.Length) 97if (_rtfIndex >= _rtfBytes.Length) 224if (_rtfIndex + skip < _rtfBytes.Length) 230_rtfIndex = _rtfBytes.Length - 1; 351while (e < _rtfBytes.Length) 356&& e + 3 < _rtfBytes.Length 433while (_rtfIndex < _rtfBytes.Length && IsControlCharValid(CurByte)) 451if (_rtfIndex < _rtfBytes.Length) 471while (_rtfIndex < _rtfBytes.Length && IsParameterFollow(CurByte)) 480if (_rtfIndex < _rtfBytes.Length && CurByte == ' ') 559_rtfControlTable = new Hashtable(controlWordInfoTable.Length); 561for (int i = 0; i < controlWordInfoTable.Length; i++)
System\Windows\Documents\RtfToXamlReader.cs (1)
3390for (int i = 0; i < CodePageList.Length; i++)
System\Windows\Documents\RubberbandSelector.cs (1)
264while (nodesInLine != null && nodesInLine.Length > 0)
System\windows\Documents\SelectionWordBreaker.cs (7)
54if (position == text.Length) 69if (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]; 207for (int i = 0; i < text.Length; i++)
System\Windows\Documents\Speller.cs (1)
1682runCount = Math.Min(runCount, _text.Length - _textLength);
System\Windows\Documents\TableRow.cs (1)
239_formatCellCount += _spannedCells.Length;
System\Windows\Documents\TextContainer.cs (4)
1070UpdateContainerSymbolCount(elementNode.GetContainingNode(), /* symbolCount */ elementText == null ? 2 : elementText.Length, deltaCharCount + formerFirstIMEVisibleNodeCharDelta + newFirstIMEVisibleNodeCharDelta); 1113AddChange(startEdgePosition, elementText == null ? 2 : elementText.Length, deltaCharCount, PrecursorTextChangeType.ContentAdded); 1534length = ((char[])text).Length; 2450Invariant.Assert(elementText.Length == elementNode.SymbolCount);
System\Windows\Documents\TextElement.cs (1)
44for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Documents\TextElementCollection.cs (3)
607if (arrayIndex > array.Length) 612if (array.Length < arrayIndex + count) 614throw new ArgumentException(SR.Format(SR.TextElementCollection_CannotCopyToArrayNotSufficientMemory, count, arrayIndex, array.Length));
System\Windows\Documents\TextElementCollectionHelper.cs (3)
42for (int i = 0; i < _cleanParentList.Length; i++) 70index = firstFreeIndex >= 0 ? firstFreeIndex : _cleanParentList.Length - 1; 129for (int i = 0; i < _cleanParentList.Length; i++)
System\Windows\Documents\TextFindEngine.cs (12)
230int textStartIndex = matchLast ? findText.Length - findTextLength : 0; 240GetContextualInformation(startFindTextPosition, matchLast ? -findTextPositionMap[findTextPositionMap.Length - findTextLength - 1] : findTextPositionMap[findTextLength], 283navigator.MoveByOffset(matchLast ? - findTextPositionMap[findText.Length - findTextLength + findPattern.Length] : findTextPositionMap[findTextLength - findPattern.Length]); 652findTextPositionMap[findTextPositionMap.Length - 1] = 0; 661runCount = Math.Min(runCount, findText.Length - findTextLength); 679findText.Length - findTextLength - runCount, 684int mapIndex = findText.Length - findTextLength - 1; 720findText[findText.Length - findTextLength] = '\n'; 721findTextPositionMap[findText.Length - findTextLength] = findTextLength + inlineCount; 741findText[findText.Length - findTextLength] = '\xf8ff'; 742findTextPositionMap[findText.Length - findTextLength] = findTextLength + inlineCount; 749if (findTextLength >= findText.Length)
System\Windows\Documents\TextPointer.cs (4)
1754if (startIndex > textBuffer.Length) 1756throw new ArgumentException(SR.Format(SR.StartIndexExceedsBufferSize, startIndex, textBuffer.Length)); 1762if (count > textBuffer.Length - startIndex) 1764throw new ArgumentException(SR.Format(SR.MaxLengthExceedsBufferSize, count, textBuffer.Length, startIndex));
System\Windows\Documents\TextRangeBase.cs (4)
873else if (charArray.Length < textLength) 875int newLength = charArray.Length * 2; 937textBuffer.Append(charArray, 0, charArray.Length); 1380int length = textParagraphs.Length;
System\Windows\Documents\TextRangeEdit.cs (11)
93for (int i = 0; i < inheritableProperties.Length; i++) 134for (int i = 0; i < noninheritableProperties.Length; i++) 346for (int i = 0; i < inheritableProperties.Length; i++) 371for (int i = 0; i < nonInheritableProperties.Length; i++) 492for (int i = 0; i < nonFormattingCharacterProperties.Length; i++) 1781for (int i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1813for (i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1820return (i < TextSchema.StructuralCharacterProperties.Length); 1828for (i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1835return (i < TextSchema.StructuralCharacterProperties.Length); 2323for (int i = 0; i < _ranges.Length; i++)
System\Windows\Documents\TextRangeEditTables.cs (7)
1137for (int i = 0; i < spannedCells.Length; i++) 1314for (int i = 0; i < spannedCells.Length; i++) 1674while (table.Columns.Count < columnWidths.Length) 2299for (int i = 0; i < nonInheritableProperties.Length; i++) 2308for (int i = 0; i < inheritableProperties.Length; i++) 2383for (int i = 0; i < spannedCells.Length; i++) 2467for (int i = 0; i < spannedCells.Length; i++)
System\Windows\Documents\TextRangeSerialization.cs (8)
726for (int i = 0; i < inheritableProperties.Length; i++) 775for (int i = 0; i < inheritableProperties.Length; i++) 835for (int i = 0; i < elementProperties.Length; i++) 1035for (int i = 0; i < inheritableProperties.Length; i++) 1043for (int i = 0; i < nonInheritableProperties.Length; i++) 1119for (int i = 0; i < elementProperties.Length; i++) 1171for (int i = 0; i < imageProperties.Length; i++) 1770Invariant.Assert(text.Length >= length, "Asserting that text.Length >= length");
System\Windows\Documents\TextSchema.cs (22)
54_inheritableTextElementProperties = new DependencyProperty[textElementPropertyList.Length + Typography.TypographyPropertiesList.Length]; 55Array.Copy(textElementPropertyList, 0, _inheritableTextElementProperties, 0, textElementPropertyList.Length); 56Array.Copy(Typography.TypographyPropertiesList, 0, _inheritableTextElementProperties, textElementPropertyList.Length, Typography.TypographyPropertiesList.Length); 66_inheritableBlockProperties = new DependencyProperty[blockPropertyList.Length + _inheritableTextElementProperties.Length]; 67Array.Copy(blockPropertyList, 0, _inheritableBlockProperties, 0, blockPropertyList.Length); 68Array.Copy(_inheritableTextElementProperties, 0, _inheritableBlockProperties, blockPropertyList.Length, _inheritableTextElementProperties.Length); 77_inheritableTableCellProperties = new DependencyProperty[tableCellPropertyList.Length + _inheritableTextElementProperties.Length]; 78Array.Copy(tableCellPropertyList, _inheritableTableCellProperties, tableCellPropertyList.Length); 79Array.Copy(_inheritableTextElementProperties, 0, _inheritableTableCellProperties, tableCellPropertyList.Length, _inheritableTextElementProperties.Length); 655for (int i = 0; i < _inheritableBlockProperties.Length; i++) 664for (int i = 0; i < _paragraphProperties.Length; i++) 680for (int i = 0; i < _inheritableTextElementProperties.Length; i++) 689for (int i = 0; i < _inlineProperties.Length; i++) 704for (int i = 0; i < _nonFormattingCharacterProperties.Length; i++) 735for (i = 0; i < _structuralCharacterProperties.Length; i++) 741return (i < _structuralCharacterProperties.Length);
System\windows\Documents\TextSelection.cs (3)
1473for (int i = 0; i < inheritableProperties.Length; i++) 1484for (int i = 0; i < noninheritableProperties.Length; i++) 1680(keyboardListIndex < keyboardList.Length) && (keyboardListIndex < keyboardListCount);
System\Windows\Documents\TextStore.cs (7)
521change.newEnd = endIndex + text.Length - (endIndex - startIndex); 1490navigator.GetTextInRun(LogicalDirection.Forward, nextChars, 0, nextChars.Length); 2443runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit); 2446hitLimit = (text.Length == charsCopied) || (limit != null && navigator.CompareTo(limit) == 0); 2559hitLimit = (text.Length == charsCopied) || (limit != null && navigator.CompareTo(limit) == 0); 2759for (i = 0; i < _supportingattributes.Length; i++) 4350for (int i = units.Length - 1; i >= 0; i--)
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (1)
116for (int columnIndex = 0; columnIndex < savedColumns.Length; columnIndex++)
System\Windows\Documents\TextTreeTextBlock.cs (9)
87if (_text.Length < MaxBlockSize && count > _gapSize) 95rightOfGapLength = _text.Length - (_gapOffset + _gapSize); 96Array.Copy(_text, _gapOffset + _gapSize, newText, newText.Length - rightOfGapLength, rightOfGapLength); 97_gapSize += newText.Length - _text.Length; 142Invariant.Assert(_text.Length == MaxBlockSize, "Splitting non-max sized block!"); 231Invariant.Assert(_gapOffset + _gapSize <= _text.Length); 262copyCount = Math.Min(count, _text.Length - logicalOffset); 429return (_text.Length - _gapSize);
System\Windows\Documents\TextTreeUndoUnit.cs (1)
176for (i = 0; i < records.Length; i++)
System\Windows\Documents\WinRTSpellerInterop.cs (1)
569if (matches.Length != 3)
System\Windows\Documents\XamlToRtfWriter.cs (1)
3465for (int i = 0; i < entries.Length; i++)
System\Windows\FrameworkElement.cs (1)
3039for (int i=0; i<handlers.Length; i++)
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
2585if (bytes.Length == 2)
System\Windows\Markup\Baml2006\SharedStream.cs (2)
168ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(offset, buffer.Length); 169ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length - count);
System\Windows\Markup\Baml2006\WpfKnownTypeInvoker.cs (2)
20if ((arguments == null || arguments.Length == 0) && _type.DefaultConstructor != null) 27if(!_type.Constructors.TryGetValue(arguments.Length, out ctorInfo))
System\Windows\Markup\BamlMapTable.cs (2)
171int end = _knownStrings.Length; 606Debug.Assert(-id <= _knownStrings.Length);
System\Windows\Markup\BamlReader.cs (1)
1014for (int i = 0; i < infos.Length; i++)
System\Windows\Markup\BamlRecordReader.cs (4)
1487for (int i=0; i<infos.Length; i++) 1491if (paramInfos.Length == paramCount) 1493object[] paramArray = new object[paramInfos.Length]; 1515for (int j=0; j<paramInfos.Length; j++)
System\Windows\Markup\BamlRecords.cs (4)
1189if (AssemblyIds != null && AssemblyIds.Length > 0) 1191count = (short) AssemblyIds.Length; 4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlWriter.cs (3)
1135if(pi.GetIndexParameters().Length == 0) 1207if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1219if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1)
System\Windows\Markup\DependencyPropertyConverter.cs (1)
115if (bytes.Length == 2)
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (2)
298if (arrayIndex >= array.Length) 303if (Count > (array.Length - arrayIndex))
System\Windows\Markup\MarkupExtensionParser.cs (2)
1205if (parInfo.Length >= maxConstructorArguments) 1207maxConstructorArguments = parInfo.Length;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
260if (parameters.Length == 1) 382if (ctorParameters != null && ctorParameters.Length == instanceDescriptor.Arguments.Count)
System\Windows\Markup\SetterTriggerConditionValueConverter.cs (1)
153if (bytes != null && bytes.Length == 1)
System\Windows\Markup\XamlFigureLengthSerializer.cs (2)
199for (i = 1; i < UnitStrings.Length; ++i) 214if (i >= UnitStrings.Length)
System\Windows\Markup\XamlGridLengthSerializer.cs (2)
199for (i = 1; i < UnitStrings.Length; ++i) 214if (i >= UnitStrings.Length)
System\Windows\Markup\XamlTypeMapper.cs (23)
882if (attachedPropertyInfo != null && attachedPropertyInfo.GetParameters().Length == paramCount) 1287if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1356if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1367if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1448if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1516if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1527if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1694count < namespaceMaps.Length && !foundNamespaceMatch; 1947for (int i = 0; i < infos.Length; i++) 2058propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType; 2059propertyCanWrite = parameters.Length == 1 ? false : true; 2217for (int i = 0; i < namespaces.Length; i++) 2528for (int count = 0; count < namespaceMaps.Length;) 2565if (knownTypesOnly && (count == namespaceMaps.Length)) 3158result = (namespaceMaps != null && namespaceMaps.Length > 0) || 3190if (assemblyIds != null && assemblyIds.Length > 0) 3192asmNameList = new string[assemblyIds.Length]; 3194for (int i = 0; i < assemblyIds.Length; i++) 3239for (int i = 0; i < _namespaceMaps.Length; i++) 3305for (int k = 0; k < _assemblyNames.Length; k++) 3679_parameters = new ParameterInfo[_constructors.Length][]; 3754if (trimAttribute.Length > 0) 3756Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute");
System\Windows\Markup\XmlnsCache.cs (6)
167Assembly[] asmList = new Assembly[asmNameList.Length]; 168for (int i = 0; i < asmNameList.Length; i++) 338for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 343for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++) 368for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 378for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++)
System\Windows\Markup\XmlnsDictionary.cs (3)
632if (_lastDecl == _nsDeclarations.Length - 1) 634NamespaceDeclaration[] new_nsDeclarations = new NamespaceDeclaration[_nsDeclarations.Length * 2]; 636Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (2)
337Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 907int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\MultiDataTrigger.cs (3)
105for (int i = 0; i < TriggerConditions.Length; ++i) 145bool retVal = (TriggerConditions.Length > 0); 147for( int i = 0; retVal && i < TriggerConditions.Length; i++ )
System\Windows\MultiTrigger.cs (3)
99for (int i = 0; i < TriggerConditions.Length; i++) 123bool retVal = (TriggerConditions.Length > 0); 125for( int i = 0; retVal && i < TriggerConditions.Length; i++ )
System\Windows\Navigation\JournalEntryListConverter.cs (1)
106if (values != null && values.Length == 2)
System\Windows\PropertyPath.cs (7)
83if (pathParameters != null && pathParameters.Length > 0) 151internal int Length { get { return _arySVI.Length; } } 370if (_arySVI.Length == 0) 389for (int i=0; i<_arySVI.Length; ++i) 431Debug.Assert(aryIPI.Length > 0); 450if (j < aryIPI.Length) 699for (int i = 0; i < args.Length; ++i)
System\Windows\StartupEventArgs.cs (3)
56Invariant.Assert(args.Length >= 1); 58int newLength = args.Length - 1; 63for (int i = 1; i < args.Length; i++)
System\Windows\Style.cs (1)
738for (int k=0; k<conditions.Length; k++)
System\Windows\StyleHelper.cs (11)
543for (int i = 0; i < propertyValue.Conditions.Length; i++) 587for (int i = 0; i < propertyValue.Conditions.Length; i++) 926for (int k=0; k<conditions.Length; k++) 2647for (int j = 0; triggerMatch && j < valueLookupList.List[i].Conditions.Length; j++) 3064for (int j = 0; j < conditions.Length; j++) 4850Debug.Assert( conditions != null && conditions.Length == 1, 4880Debug.Assert( conditions != null && conditions.Length == 1, 4909for( int i = 0; i < conditions.Length; i++ ) 5780if (Conditions.Length == other.Conditions.Length) 5783for (int i = 0; i < Conditions.Length; i++)
System\Windows\SystemParameters.cs (1)
5048for (int i = 0; i < param.Length; i++)
System\Windows\Trigger.cs (1)
232Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\TriggerBase.cs (1)
237for (int j = 0; j < propertyValue.Conditions.Length; j++)
System\Windows\Window.cs (2)
6688HRESULT hr = _taskbarList.ThumbBarAddButtons(Handle, (uint)nativeButtons.Length, nativeButtons); 6799return _taskbarList.ThumbBarUpdateButtons(Handle, (uint)nativeButtons.Length, nativeButtons);
PresentationFramework.Aero (1)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (1)
33values.Length != 3 ||
PresentationFramework.Aero2 (1)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (1)
33values.Length != 3 ||
PresentationFramework.AeroLite (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
33values.Length != 5 ||
PresentationFramework.Classic (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
33values.Length != 5 ||
PresentationFramework.Luna (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
33values.Length != 5 ||
PresentationFramework.Royale (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
33values.Length != 5 ||
PresentationFramework-SystemCore (5)
DynamicAccessorImpl.cs (5)
109int rank = args.Length; 120int rank = args.Length; 133if (_accessors.Length < rank || _accessors[rank-1] == null) 137if (_accessors.Length < rank) 140Array.Copy(_accessors, 0, newAccessors, 0, _accessors.Length);
PresentationUI (7)
MS\Internal\Documents\PeoplePickerWrapper.cs (4)
228List<String> addresses = new List<String>(paths.Length); 230for (int i = 0; i < paths.Length; i++) 325_ptrToDsObjectNames = Marshal.AllocHGlobal(data.Length); 329Marshal.Copy(data, 0, _ptrToDsObjectNames, data.Length);
MS\Internal\Documents\RightsManagementResourceHelper.cs (1)
117_brushResources = new DrawingBrush[statusList.Length];
MS\Internal\Documents\RMPublishingDialog.cs (1)
689if (userNames != null && userNames.Length > 0)
MS\Internal\Documents\SignatureResourceHelper.cs (1)
143_brushResources = new DrawingBrush[statusList.Length];
QuarantineTools.Tests (2)
ActiveIssueTests.cs (1)
314var beforeMethod = parts.Take(parts.Length - 1)
QuarantineScriptTests.cs (1)
258var beforeMethod = parts.Take(parts.Length - 1)
ReachFramework (65)
AlphaFlattener\Optimizer.cs (1)
171for (int primIndex = 0; primIndex < addedPrimitives.Length; primIndex++)
AlphaFlattener\SegmentTree.cs (4)
148int len = values.Length; 223_xCount = _xCoord.Length; 226_yCount = _yCoord.Length; 282SegmentTree st = new SegmentTree(uniqueY, 0, uniqueY.Length);
MS\Internal\Printing\Configuration\DevMode.cs (7)
385this.Size = (ushort)this._byteData.Length; 473Array.Copy(ticketDevMode.ByteData, this.dmFieldsByteOffset, this.ByteData, this.dmFieldsByteOffset, this.ByteData.Length - this.dmFieldsByteOffset); 522if (byteOffset >= data.Length) 533if (byteOffset >= data.Length) 544if (byteOffset >= data.Length) 556if (byteOffset >= data.Length) 704int byteDataLength = this.ByteData.Length;
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (2)
26SafeMemoryHandle buffer = SafeMemoryHandle.Create(devMode.ByteData.Length); 27buffer.CopyFromArray(devMode.ByteData, 0, devMode.ByteData.Length);
PrintConfig\FallbackPTProvider.cs (4)
440for (int i = 0; i < originalDevMode.ByteData.Length; i++) 501using (SafeMemoryHandle buffer = SafeMemoryHandle.Create(devModeBytes.Length)) 503buffer.CopyFromArray(devModeBytes, 0, devModeBytes.Length); 519outPtr.CopyToArray(devModeBytes, 0, devModeBytes.Length);
PrintConfig\PageMediaSize.cs (1)
466for (int i = 0; i < PrintSchema.StdMediaSizeTable.Length; i++)
PrintConfig\PrintSchema.cs (3)
2289for (int i=0; i < map.Length; i++) 2319for (int i=1; i < enumNames.Length; i++) 2403for (int i=1; i < enumNames.Length; i++)
PrintConfig\PrtCap_Builder.cs (2)
436for (int i=0; i<handlersTable.Length; i++) 473for (int i=0; i<handlersTable.Length; i++)
PrintConfig\PrtCap_Public.cs (2)
55_countRootFeatures = Enum.GetNames(typeof(CapabilityName)).Length; 56_countLocalParamDefs = Enum.GetNames(typeof(PrintSchemaLocalParameterDefs)).Length;
PrintConfig\PrtTicket_Base.cs (2)
86for (int i=0; i<_propertyMaps.Length; i++) 355for (int i=0; i<_propertyMaps.Length; i++)
PrintConfig\PTProvider.cs (9)
390IntPtr umDevMode = Marshal.AllocCoTaskMem(devMode.Length); 394Marshal.Copy(devMode, 0, umDevMode, devMode.Length); 400(uint)devMode.Length, 631CopyIStreamToArray(stream, result, (uint)result.Length); 647Invariant.Assert(src.Length >= byteCount); 671int bytesToWrite = Math.Min(data.Length, (int)(byteCount - totalBytesWritten)); 705Invariant.Assert(dst.Length >= byteCount); 725int bytesToRead = Math.Min(data.Length, (int)(byteCount - totalBytesRead)); 727Array.Clear(data, 0, data.Length);
Serialization\ColorTypeConverter.cs (3)
182for (int i = 0; i < color.GetNativeColorValues().Length; ++i) 185if (i < color.GetNativeColorValues().Length - 1) 331while ( (count = profileStream.Read( buffer, 0, buffer.Length) ) > 0 )
Serialization\Crc32.cs (1)
98int bytes = data.Length;
Serialization\Manager\MetroSerializationManager.cs (7)
549int[] serializableIndeces = new int[clrProperties.Length]; 558indexInClrProperties < clrProperties.Length; 594indexInClrProperties < clrProperties.Length; 623int[] serializableIndeces = new int[dependencyProperties.Length]; 632indexInDependencyProperties < dependencyProperties.Length; 671indexInDependencyProperties < dependencyProperties.Length; 835i<properties.Length && propertyInfo == null;
Serialization\Manager\ReachSerializableProperties.cs (2)
228indexInClrSerializableProperties < clrProperties.Length; 278indexInSerializableDependencyProperties < dependencyProperties.Length;
Serialization\Manager\ReachSerializationCacheItems.cs (6)
93int[] propertiesIndex = new int[properties.Length]; 94TypePropertyCache[] cachedProperties = new TypePropertyCache[properties.Length]; 98indexInProperties < properties.Length; 209propertyInfo.GetIndexParameters().Length == 0) 216numberOfAttributes < attributes.Length; 490numberOfAttributes < attributes.Length;
Serialization\Manager\ReachSerializationUtils.cs (2)
165if ((Count + delta) > List.Length) 167System.Windows.DependencyProperty[] newList = new System.Windows.DependencyProperty[Math.Max(List.Length * 2, Count + delta)];
Serialization\Manager\XpsSerializationManager.cs (6)
1278IndexInTypes < ReachSerializationServices._xpsTypesRequiringXMLNS.Length; 1304numberOfDependencyPropertiesInFixedPage < _fixedPageDependencyProperties.Length; 1321numberOfDependencyPropertiesInFixedDocument < _fixedDocumentDependencyProperties.Length; 1338numberOfDependencyPropertiesInFixedDS < _fixedDocumentSequenceDependencyProperties.Length; 1368numberOfClrPropertiesInFixedDocument < _fixedDocumentExcludedClrProperties.Length; 1385numberOfClrPropertiesInFixedDS < _fixedDocumentSequenceExcludedClrProperties.Length;
Serialization\XpsFontSubsetter.cs (1)
595stream.Write(fontData, 0, fontData.Length);
RepoTasks (14)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (8)
236if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 702Array.Clear(keyBytes, 0, keyBytes.Length); 703Array.Clear(pem, 0, pem.Length); 709Array.Clear(keyBytes, 0, keyBytes.Length); 710Array.Clear(pem, 0, pem.Length); 760Array.Clear(bytes, 0, bytes.Length); 788Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (2)
177Array.Clear(export, 0, export.Length); 624if (availableCommands.Count == commands.Length)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
66Array.Clear(export, 0, export.Length);
Uuid.cs (3)
36byte[] hashBuffer = new byte[namespaceBytes.Length + nameBytes.Length]; 42Buffer.BlockCopy(nameBytes, 0, hashBuffer, 16, nameBytes.Length);
Roslyn.Diagnostics.Analyzers (160)
src\roslyn\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\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (6)
583if (directoryPathParts.Length == 0 || fullPathParts.Length == 0) 591var maxSearchIndex = Math.Min(directoryPathParts.Length, fullPathParts.Length); 608var remainingParts = directoryPathParts.Length - index; 618for (int i = index; i < fullPathParts.Length; i++)
src\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (2)
103var maxSize = Math.Min(maxItemsToHash, values.Length); 212for (int i = 0; i < data.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
60return (int)WaitForMultipleObjects((uint)waitHandles.Length, waitHandles, waitAll, (uint)millisecondsTimeout);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (3)
73if (p.Length != paramTypes.Length) 79for (int i = 0; i < paramTypes.Length; i++)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
68int actualLength = TryReadAll(stream, buffer, 0, buffer.Length);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (5)
72ThrowIfTrue(_index + values.Length > _values.Length); 79ThrowIfTrue(_index + values.Count > _values.Length); 86ThrowIfTrue(_index + values.Count > _values.Length); 93ThrowIfTrue(_index + values.Count > _values.Length); 127ThrowIfTrue(_index != _values.Length);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (12)
244return source.Length == 0; 1025return array.Length != 0 ? 1036while (index < source.Length) 1038TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 1039index += chunk.Length; 1064if (size != array.Length) 1069if (i >= array.Length) 1071arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 1083Debug.Assert(local.Length == size); 1084for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 1090if (i != array.Length) 1114return source is TSource[] { Length: 0 } ? [] : IndexIterator(source);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
688int last = copy.Length - 1;
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
355if (array.Length < index + Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
63if (length > destinationArray.Length) 495var remainingInSegment = firstSegment.Length - offset; 598var remainingInFirstSegment = firstSegment.Length - firstOffset; 599var remainingInSecondSegment = secondSegment.Length - secondOffset; 737var remainingInSegment = segment.Length - offset; 786var remainingInSegment = segment.Length - offset;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (11)
83for (var i = 0; i < _items.Length - 1; i++) 92var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 94_items[_items.Length - 1] = new T[lastPageSize]; 147for (var i = 0; i < items.Length; i++) 157for (var i = 0; i < _items.Length; i++) 165for (var i = 0; i < _items.Length; i++) 241for (var i = 0; i < _items.Length; i++) 256for (var i = 0; i < _items.Length; i++) 394if (_items.Length == 0) 397if (_nextItemIndex == _items[_nextItemSegment].Length) 399if (_nextItemSegment == _items.Length - 1)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (13)
365if ((uint)index > (uint)array.Length) 370if (array.Length - index < Count) 676var oldSegmentCount = segments.Length; 892if ((uint)index > (uint)array.Length) 897if (array.Length - index < Count) 1320if (index < 0 || index > array.Length) 1325if (array.Length - index < _dictionary.Count) 1387if ((uint)index > (uint)array.Length) 1392if (array.Length - index < _dictionary.Count) 1528if ((uint)index > array.Length) 1533if (array.Length - index < _dictionary.Count) 1595if ((uint)index > (uint)array.Length) 1600if (array.Length - index < _dictionary.Count)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
816if (arrayIndex > array.Length || count > array.Length - arrayIndex) 930var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
98if (SegmentedCollectionsMarshal.AsSegments(_items) is { Length: 1 } segments) 162var oldSegmentCount = segments.Length;
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (6)
45for (var i = 0; i < result.Length; i++) 411for (int i = 0; i < result.Length; i++) 672Debug.Assert(start + length <= items.Length); 851for (int i = 0; i < result.Length; i++) 887for (int i = 0; i < result.Length; i++) 923for (int i = 0; i < result.Length; i++)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (3)
140for (var i = 0; i < items.Length; i++) 187for (var i = 0; i < items.Length; i++) 232for (var i = 0; i < items.Length; i++)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (2)
348if (split.Length != 2) 397if (split.Length != 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
693if (trivia.Length == 0) 727if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxTokenExtensions.cs (1)
106if (trivia.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (4)
183Contract.ThrowIfFalse(lines.Length > 0); 187if (0 < lines.Length - 1) 193for (var i = 1; i < lines.Length; i++) 204if (i < lines.Length - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser.cs (1)
99where nameSplit.Length == 3
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (4)
292WriteArrayLength(array.Length); 372for (var offset = 0; offset < spanLength; offset += buffer.Length) 374var segmentLength = Math.Min(buffer.Length, spanLength - offset); 507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (1)
110if (method.TypeParameters.Length != typeArgumentArray.Length)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (1)
202var currentType = typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Serialization.cs (1)
14writer.WriteCharArray(_concatenatedLowerCaseWords, 0, _concatenatedLowerCaseWords.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
74if (_sourceLowerCaseCharacters.Length == PooledArraySize)
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (4)
57if (taskArray.Length == 0) 61for (var i = 0; i < taskArray.Length; i++) 72var result = new T[taskArray.Length]; 73for (var i = 0; i < taskArray.Length; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
681=> typeArguments.Length > 0 ? type.Construct(typeArguments) : type;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
55if (typeArguments.Length == 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (4)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
13=> array == null || array.Length == 0;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (1)
442if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (1)
473for (var i = 0; i < originalSwitchLabels.Length; i++)
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SyntaxKindExtensions.vb (1)
38For i = start To kinds.Length - 1
rzc (23)
Application.cs (1)
95var expandedArgs = new List<string>(args.Length);
CommandLine\CommandLineApplication.cs (4)
143for (var index = 0; index < args.Length; index++) 224if (longOption.Length == 2) 293if (shortOption.Length == 2) 590command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
ConcurrentLruCache.cs (1)
47: this(array.Length)
DebugMode.cs (1)
12if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
DefaultExtensionDependencyChecker.cs (4)
62for (var i = 0; i < items.Length; i++) 96for (var i = 0; i < items.Length; i++) 103for (var i = 0; i < items.Length; i++) 110for (var i = 0; i < items.Length; i++)
DiscoverCommand.cs (5)
162var metadataReferences = new MetadataReference[assemblies.Length]; 163for (var i = 0; i < assemblies.Length; i++) 229if (x.Length != y.Length) 234for (var i = 0; i < x.Length; i++)
GenerateCommand.cs (3)
324for (var i = 0; i < items.Length; i++) 374var outputs = new OutputItem[inputs.Length]; 375Parallel.For(0, outputs.Length, new ParallelOptions() { MaxDegreeOfParallelism = Debugger.IsAttached ? 1 : 4 }, i =>
Json\ObjectReaders_TagHelpers.cs (1)
193if (args is { Length: > 0 and var length })
Json\ObjectWriters_TagHelpers.cs (1)
38if (value.Args is { Length: > 0 })
ServerProtocol\ServerLogger.cs (1)
121s_loggingStream.Write(bytes, 0, bytes.Length);
ServerProtocol\ServerResponse.cs (1)
103responseBuffer.Length,
ScenarioTests.Common.Tests (8)
ScenarioTestHelpers.cs (1)
252return new string(chars, 0, chars.Length);
ScenarioTestTypes.cs (7)
541if (_byteArrayValue.Length != other._byteArrayValue.Length) { return false; } 542for (int i = 0; i < _byteArrayValue.Length; i++) 547for (int i = 0; i < _charArrayValue.Length; i++) 578sb.AppendLine("ByteArrayValue: " + (_byteArrayValue != null ? "Length: " + _byteArrayValue.Length : "null")); 579sb.AppendLine("CharArrayValue: " + (_charArrayValue != null ? "Length: " + _charArrayValue.Length : "null")); 1211readResult = stream.Read(buffer, 0, buffer.Length);
sdk-tasks (34)
CopyPreservingRelativeSymlinks.cs (6)
39if (SourceFiles.Length == 0) 44if (SourceFiles.Length != DestinationFiles.Length) 46Log.LogError($"SourceFiles count ({SourceFiles.Length}) must match DestinationFiles count ({DestinationFiles.Length})."); 60for (int i = 0; i < SourceFiles.Length; i++)
DeduplicateAssembliesWithLinks.cs (1)
155return relativePath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Length - 1;
ExtractArchiveToDirectory.cs (1)
81if (DirectoriesToCopy != null && DirectoriesToCopy.Length != 0)
FilterItemsByDuplicateHash.cs (1)
74$"FilterItemsByDuplicateHash: {unmatched.Count} of {CandidateFiles.Length} candidates are unique.");
GenerateGuidFromName.cs (6)
25var streamToHash = new byte[namespaceBytes.Length + nameBytes.Length]; 27Array.Copy(namespaceBytes, streamToHash, namespaceBytes.Length); 28Array.Copy(nameBytes, 0, streamToHash, namespaceBytes.Length, nameBytes.Length); 34Array.Copy(hashResult, res, res.Length);
GetLinuxNativeInstallerDependencyVersions.cs (1)
32if (prereleaseSplit.Length > 1)
ReplaceFileContents.cs (11)
56if (ReplacementPatterns.Length != ReplacementStrings.Length) 58throw new Exception($"Expected {nameof(ReplacementPatterns)} (length {ReplacementPatterns.Length}) and {nameof(ReplacementStrings)} (length {ReplacementStrings.Length}) to have the same length."); 61if (InputFiles.Length != DestinationFiles.Length) 63throw new Exception($"Expected {nameof(InputFiles)} (length {InputFiles.Length}) and {nameof(DestinationFiles)} (length {DestinationFiles.Length}) to have the same length."); 73Log.LogMessage(MessageImportance.High, $"ReplacingContents for `{InputFiles.Length}` files."); 75for (var i = 0; i < InputFiles.Length; i++) 109for (int i = 0; i < ReplacementPatterns.Length; ++i)
src\sdk\src\Common\WorkloadSetVersion.cs (2)
11if (sections.Length < 1) 21int coreComponentsLength = SeparateCoreComponents(workloadSetVersion, out _).Length;
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkFeatureBand.cs (3)
26var formattedPrerelease = prereleaseComponents.Length > 1 ? 45if (coreComponents.Length == 3) 60if (sections.Length > 1)
ZipFileCreateFromDirectory.cs (2)
68Regex[] regexes = new Regex[ExcludePatterns.Length]; 69for (int i = 0; i < ExcludePatterns.Length; ++i)
Security.TransportSecurity.IntegrationTests (1)
Tcp\StreamingTests.4.1.0.cs (1)
169while ((bytesRead = returnStream.ReadAsync(buffer, 0, buffer.Length).Result) != 0)
Shared (21)
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;
ServerSentEvents\ArrayBuffer.cs (6)
53Debug.Assert(buffer.Length > 0); 94public readonly int AvailableLength => _bytes.Length - _availableStart; 99public readonly int Capacity => _bytes.Length; 136if (_bytes.Length == 0) 156int newSize = _bytes.Length; 191if (_usePool && buffer.Length > 0)
ServerSentEvents\SseParser_1.cs (9)
284Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}"); 309if (_lineOffset + _lineLength == _lineBuffer.Length) 321else if (_lineLength == _lineBuffer.Length) 323GrowBuffer(ref _lineBuffer, _lineBuffer.Length * 2); 407if (_dataBuffer is null || _dataLength + _lineLength + 1 > _dataBuffer.Length) 499_lineBuffer, offset, _lineBuffer.Length - offset); 525new ValueTask<int>(_stream.ReadAsync(_lineBuffer, offset, _lineBuffer.Length - offset, cancellationToken)) 564Array.Copy(toReturn, buffer, toReturn.Length);
Stress.ApiService (1)
TraceCreator.cs (1)
113for (var i = 0; i < links.Length; i++)
Stress.AppHost (1)
TestResource.cs (1)
82var randomState = states[Random.Shared.Next(0, states.Length)];
SuperFileCheck (10)
Program.cs (10)
231for (var i = 0; i < typeDecls.Length; i++) 295if (trivia.Length > 0) 483if (checkPrefixes.Length == 0) 635if (args.Length >= 1) 639if (args.Length == 1) 650if (methodDeclInfos.Length == 0) 674if (args.Length == 1) 705if (methodDeclInfos.Length > 0) 709var tasks = new Task<FileCheckResult>[methodDeclInfos.Length]; 715for (int i = 0; i < methodDeclInfos.Length; i++)
System.CodeDom (44)
Microsoft\CSharp\CSharpCodeGenerator.cs (10)
2398Debug.Assert(names.Length > 0); 2400for (int i = 1; i < names.Length; i++) 3010string[] filenames = new string[ea.Length]; 3012for (int i = 0; i < ea.Length; i++) 3051string[] filenames = new string[sources.Length]; 3053for (int i = 0; i < sources.Length; i++) 3070if (sa == null || sa.Length == 0) 3075if (sa.Length == 1) 3081for (int i = 0; i < sa.Length - 1; i++) 3089sb.Append(sa[sa.Length - 1]);
Microsoft\CSharp\CSharpModifierAttributeConverter.cs (2)
25for (int i = 0; i < names.Length; i++) 44for (int i = 0; i < modifiers.Length; i++)
Microsoft\VisualBasic\VBCodeGenerator.cs (2)
2322Debug.Assert(names.Length > 0); 2324for (int i = 1; i < names.Length; i++)
Microsoft\VisualBasic\VBModifierAttributeConverter.cs (2)
25for (int i = 0; i < names.Length; i++) 44for (int i = 0; i < modifiers.Length; i++)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (2)
100for (int i = 0; i < genericArgs.Length; i++) 275if (typeArguments != null && typeArguments.Length > 0)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs (1)
46for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeAttributeArgumentCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeAttributeDeclarationCollection.cs (1)
36for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeCatchClauseCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeCommentStatementCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeDirectiveCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeExpressionCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\codemethodreferenceexpression.cs (1)
20if (typeParameters != null && typeParameters.Length > 0)
System\CodeDom\CodeNamespaceCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeParameterDeclarationExpressionCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeStatementCollection.cs (1)
36for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeTypeDeclarationCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeTypeMemberCollection.cs (1)
34for (int i = 0; i < value.Length; i++)
System\CodeDom\CodeTypeParameterCollection.cs (1)
36for (int i = 0; i < value.Length; i++)
System\CodeDom\Compiler\CodeCompiler.cs (8)
136var filenames = new string[ea.Length]; 138for (int i = 0; i < ea.Length; i++) 203var filenames = new string[sources.Length]; 205for (int i = 0; i < sources.Length; i++) 221if (sa == null || sa.Length == 0) 226if (sa.Length == 1) 232for (int i = 0; i < sa.Length - 1; i++) 240sb.Append(sa[sa.Length - 1]);
System\CodeDom\Compiler\CompilerErrorCollection.cs (1)
34for (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 (82)
src\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
65if (count == arr.Length)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (2)
26ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length); 34if (array.Length - index < sourceCount)
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)
212public int Capacity => _entries?.Length ?? 0; 442if (entries.Length == _count) 444Resize(HashHelpers.ExpandPrime(entries.Length)); 534Array.Clear(_buckets, 0, _buckets.Length); 645if ((uint)i >= (uint)entries.Length) 660while (collisionCount <= (uint)entries.Length); 674if ((uint)i >= (uint)entries.Length) 689while (collisionCount <= (uint)entries.Length); 900int currentCapacity = _entries?.Length ?? 0; 993if (++collisionCount > entries.Length) 1045if (++collisionCount > entries.Length) 1071Resize(entries.Length, forceNewHashCodes: true); 1146return ref buckets[HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)]; 1150return ref buckets[(uint)hashCode % buckets.Length]; 1208if (array.Length - arrayIndex < _count) 1296if (array.Length - index < _count) 1509if (array.Length - arrayIndex < count) 1539if (array.Length - index < _dictionary.Count) 1698if (array.Length - arrayIndex < count) 1848if (array.Length - index < _dictionary.Count)
System\Collections\Generic\PriorityQueue.cs (14)
172public int Capacity => _nodes.Length; 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)
540if (array.Length - index < Count) 564if (array.Length - index < _dictionary.Count) 701if (array.Length - index < Count) 725if (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) 1149Debug.Assert(count >= 0 && count <= other.Length); 1572for (int i = 0; i < items.Length; i++)
System\Collections\Generic\Stack.cs (19)
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; 378if ((uint)index < (uint)array.Length)
System.Collections.Concurrent (33)
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, 1317for (int i = 0; i < collections.Length; i++) 1402if (collections.Length != handles.Count - 1) // -1 because of the combined token handle 1404for (int i = 0; i < collections.Length; i++) 1567Array.Copy(collectionSnapShot, 0, array, index, collectionSnapShot.Length); 1658if (collections.Length < 1) 1663if ((collections.Length > 63) || 1664((collections.Length == 63) && (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA))) 1671for (int i = 0; i < collections.Length; ++i)
System\Collections\Concurrent\ConcurrentBag.cs (7)
289if (index > array.Length - count) 785var newArray = new T[_array.Length << 1]; 789Array.Copy(_array, newArray, _array.Length); 793Array.Copy(_array, headIdx, newArray, 0, _array.Length - headIdx); 794Array.Copy(_array, 0, newArray, _array.Length - headIdx, headIdx); 1024Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1033Debug.Assert(arrayIndex <= array.Length - count);
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 (146)
src\runtime\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)
392Debug.Assert(keys.Length == values.Length); 394for (int i = 0; i < keys.Length; i++) 415if ((uint)index > (uint)array.Length) 420if (array.Length - index < Count) 682Debug.Assert(keys.Length == values.Length); 692if ((uint)_index < (uint)_keys.Length) 697_index = _keys.Length; 706if ((uint)_index >= (uint)_keys.Length)
System\Collections\Frozen\FrozenHashTable.cs (7)
30Debug.Assert(hashCodes.Length != 0); 31Debug.Assert(buckets.Length != 0); 93for (int bucketNum = 0; bucketNum < hashtableBuckets.Length; bucketNum++) 118Debug.Assert(count == hashtableHashcodes.Length); 135ref Bucket b = ref buckets[HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 140public int Count => HashCodes.Length; 241Array.Clear(seenBuckets, 0, Math.Min(numBuckets, seenBuckets.Length));
System\Collections\Frozen\FrozenSet.cs (4)
292Array.Copy(items, 0, array!, index, items.Length); 500if ((uint)_index < (uint)_entries.Length) 505_index = _entries.Length; 514if ((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\Integer\DenseIntegralFrozenDictionary.cs (5)
76var values = new TValue[keys.Length]; 130private protected override int CountCore => _keys.Length; 138if ((uint)index < (uint)values.Length) 163private protected override int CountCore => _keys.Length; 171if ((uint)index < (uint)optionalValues.Length)
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)
44for (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)
40for (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)
37_max = _keys[_keys.Length - 1]; 43private protected override int CountCore => _keys.Length; 51for (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) 49for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.AlternateLookup.cs (2)
35if (bucketIndex >= 0 && bucketEndIndex <= lengthBuckets.Length) 43if ((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)
35if (bucketIndex >= 0 && bucketEndIndex <= lengthBuckets.Length) 42if ((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)
191if (items == null || items.Length == 0) 200var tmp = new T[items.Length]; 201Array.Copy(items, tmp, items.Length); 218Requires.Range(start >= 0 && start <= items.Length, nameof(start)); 219Requires.Range(length >= 0 && length <= items.Length - start, nameof(length)); 285for (int i = 0; i < array.Length; i++) 319for (int i = 0; i < array.Length; i++) 353for (int i = 0; i < array.Length; i++) 391for (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)); 705Requires.Range(index >= 0 && index + this.Count <= array.Length, nameof(index)); 731Requires.Range(destinationIndex >= 0 && destinationIndex + length <= destination.Length, nameof(destinationIndex)); 741if (_elements.Length < capacity) 743int newCapacity = Math.Max(_elements.Length * 2, capacity); 1096Array.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)
156get { return this.array!.Length == 0; } 173return this.array!.Length; 195return self.array == null || self.array.Length == 0; 419_ = this.array!.Length;
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (1)
333Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableDictionary_2.cs (2)
620Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 760Requires.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)
840Requires.Range(array.Length >= this.Count, nameof(array)); 865Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 896Requires.Range(arrayIndex + count <= array.Length, nameof(arrayIndex)); 916Requires.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)
379return immutableArray.array!.Length > 0 ? immutableArray.array[0] : default; 632if (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.CommandLine (11)
ArgumentValidation.cs (1)
149if (values?.Length > 0)
Binding\ArgumentConversionResult.cs (2)
53if (completionItems.Length > 0) 68if (completionItems.Length > 0)
Binding\TypeExtensions.cs (1)
32{ Length: 1 } genericTypeArguments => genericTypeArguments[0],
Help\HelpBuilder.cs (3)
178if (subcommands.Length > 0) 472if (defaultArguments.Length == 0) 477var isSingleArgument = defaultArguments.Length == 1;
Help\HelpBuilder.Default.cs (1)
210if (commandArguments.Length > 0)
LocalizationResources.cs (1)
250if (formatArguments.Length > 0)
Option.cs (1)
27if (aliases is { Length: > 0 })
Parsing\StringExtensions.cs (1)
343for (var i = 0; i < lines.Length; i++)
System.CommandLine.StaticCompletions (13)
shells\BashShellProvider.cs (3)
98if (visibleSubcommands.Length > 0) 141if (argCompletions.Length != 0) 164if (optionHandlers.Length == 0)
shells\FishShellProvider.cs (4)
109if (visibleSubs.Length == 0 && valueOptions.Length == 0) 133if (singleValueNames.Length > 0) 250if (valueOptions.Length == 0)
shells\PowershellShellProvider.cs (1)
131if (argCompletions is not null && argCompletions.Length > 0)
shells\ZshShellProvider.cs (5)
158if (argumentValues is null || argumentValues.Length == 0) 162else if (argumentValues.Length == 1) 334if (staticCompletions.Length == 0) 354var lines = new List<string>(staticCompletions.Length + 2) { "((" }; 376path.Length == 0 ? [command.Name] : [.. path, command.Name];
System.ComponentModel.Annotations (10)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (1)
58if (newMetadata.Length > 0)
System\ComponentModel\DataAnnotations\CompareAttribute.cs (1)
43if (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)
86for (int i = 0; i < parameters.Length; i++) 296WriteTypeArgumentsString(typeName, types.Length, false, typeArguments, formatGenericName); 332return type.GetGenericArguments().Length; 338int delclaringTypeGenericArguments = type.DeclaringType.GetGenericArguments().Length; 339int 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)
300if (_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++) 215MemberInfo[] accessors = new MemberInfo[genericAccessors.Length]; 217for (int i = 0; i < genericAccessors.Length; i++) 440metadata[CompositionConstants.GenericContractMetadataName] = GenericServices.GetGenericName(originalImport.ContractName, importParametersOrder, _specialization.Length); 545if (partArity != specialization.Length) 564if (genericParameterConstraints.Length != partArity) 569if (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)
144if (arguments.Length == 2) 179if (arguments.Length == 1) 187else 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)
344if (attributes.Length != 0) 519int length = candidateConstructor.GetParameters().Length; 538int length = candidateConstructor.GetParameters().Length;
System.ComponentModel.TypeConverter (115)
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) 228for (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)
182long[] ulValues = new long[objValues.Length]; 183for (int idx = 0; idx < objValues.Length; idx++) 260if (fields != null && fields.Length > 0) 262objValues = 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)
257argTypes = new Type[args.Length]; 258for (int idx = 0; idx < args.Length; idx++) 574if (extenders.Length == 0) 600for (int idx = 0; idx < extenders.Length; idx++) 604propertyList ??= new List<PropertyDescriptor>(propertyArray.Length * extenders.Length); 606for (int propIdx = 0; propIdx < propertyArray.Length; propIdx++) 713for (curIdx = 0; curIdx < currentExtenders.Length; curIdx++) 721if (!newExtenders && (idx >= existingExtenders!.Length || currentExtenders[curIdx] != existingExtenders[idx++])) 738if (!newExtenders && (idx >= existingExtenders!.Length || prov != existingExtenders[idx++])) 746if (existingExtenders != null && extenderCount != existingExtenders.Length) 752if (currentExtenders == null || extenderCount != currentExtenders.Length) 761while (curIdx < currentExtenders.Length) 1173events = new EventDescriptor[eventInfos.Length]; 1176for (int idx = 0; idx < eventInfos.Length; idx++) 1195if (eventCount != events.Length) 1304properties = new PropertyDescriptor[extendedProperties.Length]; 1305for (int idx = 0; idx < extendedProperties.Length; idx++) 1356properties = new PropertyDescriptor[propertyInfos.Length]; 1360for (int idx = 0; idx < propertyInfos.Length; idx++) 1366if (propertyInfo.GetIndexParameters().Length > 0) 1392if (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)
380for (int idx = attrs.Length - 1; idx >= 0; idx--) 498if (argTypes.Length != args.Length) 579for (int attrIdx = 0; attrIdx < attributes.Length; attrIdx++) 1138if (attributes != null && attributes.Length > 0) 1375if (attributes != null && attributes.Length > 0) 1889if (filter == null || filter.Length == 0) 2377for (int idx = 0; idx < s_pipelineFilterKeys.Length; idx++) 2919Attribute[] newArray = new Attribute[existing.Count + newAttrs.Length]; 2923for (int idx = 0; idx < newAttrs.Length; idx++) 2947if (actualCount < newArray.Length) 2980if (_filter.Length != filter.Length) return false; 2982for (int idx = 0; idx < filter.Length; idx++) 3258if (argTypes.Length != args.Length)
System\ComponentModel\TypeListConverter.cs (2)
98objTypes = new object[_types.Length]; 99Array.Copy(_types, objTypes, _types.Length);
System.Composition.Convention (4)
System\Composition\Convention\PartConventionBuilder.cs (4)
538if (attributes.Length != 0) 617&& mi.GetParameters().Length == 0) 765int length = candidateConstructor.GetParameters().Length; 784int 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)
44m.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\runtime\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)
450for (int i = 0; i < attributes.Length; i++) 557for (int i = 0; i < properties.Length; i++) 596for (int i = 0; i < _classAttributes.Length; i++) 719for (int i = 0; i < allProps.Length; i++) 722for (int j = 0; j < attributes.Length; j++)
System\Configuration\BaseConfigurationRecord.cs (2)
1438if (iKey < keys.Length - 1) 1545string 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)
69if (array.Length < c + index) throw new ArgumentOutOfRangeException(nameof(index));
System\Configuration\ConfigurationSectionGroupCollection.cs (1)
73if (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)
46if (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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
53if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
86if (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)
264if (args.Length > 0) 267if (args.Length > 1) 374Interop.Sys.SNPrintF(ptr, bytes.Length, format, stringArg) : 375Interop.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 (686)
_generated\0\RegexGenerator.g.cs (2)
593if ((uint)p < (uint)s.Length) 619if ((uint)(p + 1) < (uint)s.Length)
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
477internal static bool IsEmptyArray([NotNullWhen(false)] string?[]? array) => (null == array) || (0 == array.Length);
src\runtime\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, StringComparer.InvariantCultureIgnoreCase); 784int startIndex = columnNameArray.Length; // lowest non-unique index 785for (int i = columnNameArray.Length - 1; 0 <= i; --i) 804for (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++) 364for (int i = 0; i < s_storageClassType.Length; ++i) 402for (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++) 272for (int i = 0; i < _values.Length; i++) 282for (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)
250for (int i = 0; i < values.Length; ++i) 546if ((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)); 377if (_typename.Length == 2) 542for (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)
1232if ((null != o) && (o.ColumnsReference.Length == 1) && (o.ColumnsReference[0] == this)) 1559for (int i = 0; i < parentRelations.Length; i++) 1563if (key.ColumnsReference.Length == 1 && key.ColumnsReference[0] == this) 1710for (int i = 0; i < rows.Length; i++) 1716return (rows.Length > 0);
System\Data\DataColumnCollection.cs (5)
662if (array.Length - index < _list.Count) 926DataColumn[] tempColumns = new DataColumn[columns.Length + 1]; 928tempColumns[columns.Length] = dataColumn; 935DataColumn[] tempColumns = new DataColumn[columns.Length - 1]; 936for (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)
551int[] parentInfo = new int[rel.ParentColumns.Length + 1]; 554for (int j = 1; j < parentInfo.Length; j++) 559int[] childInfo = new int[rel.ChildColumns.Length + 1]; 561for (int j = 1; j < childInfo.Length; j++) 594DataColumn[] parentkeyColumns = new DataColumn[parentInfo.Length - 1]; 595for (int i = 0; i < parentkeyColumns.Length; i++) 601DataColumn[] childkeyColumns = new DataColumn[childInfo.Length - 1]; 602for (int i = 0; i < childkeyColumns.Length; i++) 798if ((dt.NestedParentRelations.Length == 0) || 799(dt.NestedParentRelations.Length == 1 && dt.NestedParentRelations[0].ChildTable == dt)) 1339for (int i = 0; i < bitMatrix.Length; ++i) 1348for (int i = 0; i < bitMatrix.Length; ++i) 1388for (int tableIndex = 0; tableIndex < bitMatrix.Length; ++tableIndex) 3397if (props.Length < propStart + 1) 3649var dataTables = new DataTable[tables.Length]; 3650for (int i = 0; i < tables.Length; i++) 3683if (dataTables.Length == 0) 3688for (int i = 0; i < dataTables.Length; i++)
System\Data\DataTable.cs (61)
536int[] colInfo = new int[uc.Columns.Length]; 537for (int j = 0; j < colInfo.Length; j++) 559int[] parentInfo = new int[fk.RelatedColumns.Length + 1]; 561for (int j = 1; j < parentInfo.Length; j++) 566int[] childInfo = new int[fk.Columns.Length + 1]; 568for (int j = 1; j < childInfo.Length; j++) 609DataColumn[] keyColumns = new DataColumn[keyColumnIndexes.Length]; 610for (int i = 0; i < keyColumnIndexes.Length; i++) 635DataColumn[] parentkeyColumns = new DataColumn[parentInfo.Length - 1]; 636for (int i = 0; i < parentkeyColumns.Length; i++) 643DataColumn[] childkeyColumns = new DataColumn[childInfo.Length - 1]; 644for (int i = 0; i < childkeyColumns.Length; i++) 909if (dcArr.Length > 0) 911int[] columnsInError = new int[dcArr.Length]; 912string[] columnErrors = new string[dcArr.Length]; 913for (int i = 0; i < dcArr.Length; i++) 945Debug.Assert(columnsInError.Length == columnErrors.Length); 946for (int i = 0; i < columnsInError.Length; i++) 1569Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken"); 1570for (int i = 0; i < nRel.Length; i++) 1653if ((value != null) && (value.Length != 0)) 1656for (int i = 0; i < value.Length; i++) 1671if (count != value.Length) 1738for (int i = 0; i < key.ColumnsReference.Length; i++) 1795if (nestedRelations.Length == 0) 1860if (nestedRelations.Length > 0) 1862for (int i = 0; i < nestedRelations.Length; i++) 1873while (j < nestedRelations.Length && ((nestedRelations[j].ParentTable == this) || (visitedTables.Contains(nestedRelations[j].ParentTable)))) 1877if (j < nestedRelations.Length) 2124for (int i = 0; i < keyValues.Length; i++) 2271for (int i = 0; i < cols.Length; i++) 2304for (int i = 0; i < oldRows.Length; ++i) 2442if (pkey.Length > 0) 2444DataColumn[] key = new DataColumn[pkey.Length]; 2445for (int i = 0; i < pkey.Length; i++) 3011for (int i = 0; i < cols.Length; i++) 3271for (int i = 0; i < cols.Length; i++) 3375IndexField[] newIndexDesc = new IndexField[indexDesc.Length]; 3376Array.Copy(indexDesc, newIndexDesc, indexDesc.Length); 3390if (colCount < value.Length) 3397for (int i = 0; i < value.Length; i++) 3408for (int i = value.Length; i < colCount; i++) 3711indexDesc = new IndexField[split.Length]; 3713for (int i = 0; i < split.Length; i++) 3790Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same"); 3791Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 3978for (int i = 0; i < oldRows.Length; i++) 4839if (pkey.Length == 1) 4868if (pkey.Length == 0) 4979if (PrimaryKey.Length == 0) 5018primaryKeyIndex = new int[_primaryKey.ColumnsReference.Length]; 5019for (int i = 0; i < _primaryKey.ColumnsReference.Length; i++) 5025object[] keys = new object[primaryKeyIndex.Length]; 5026for (int i = 0; i < primaryKeyIndex.Length; i++) 5045for (int count = 0; count < values.Length; count++) 5052for (int count = values.Length; count < _columnCollection.Count; count++) 5546for (int j = 0; j < dependency.Length; j++) 6638for (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)
241for (int i = 0; i < rows.Length; i++) 402if (targetPKey.Length != tablePKey.Length) 406if (targetPKey.Length == 0) 408DataColumn[] key = new DataColumn[tablePKey.Length]; 409for (int i = 0; i < tablePKey.Length; i++) 415else if (tablePKey.Length != 0) 422for (int i = 0; i < targetPKey.Length; i++) 533if (relation.ParentKey.ColumnsReference.Length != destRelation.ParentKey.ColumnsReference.Length) 539for (int i = 0; i < relation.ParentKey.ColumnsReference.Length; i++) 575DataColumn[] parentColumns = new DataColumn[relation.ParentKey.ColumnsReference.Length]; 576DataColumn[] childColumns = new DataColumn[relation.ParentKey.ColumnsReference.Length]; 577for (int i = 0; i < relation.ParentKey.ColumnsReference.Length; i++) 634DataColumn[] srcColumns = new DataColumn[dstColumns.Length]; 635for (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; 377for (i = 0; i < _candidateColumns.Length; i++) 435for (i = 0; i < _candidateColumns.Length; i++) 469int lenId = fields.Length; 480int lenCanColumns = _candidateColumns.Length; 516for (int i = 0; i < _candidateColumns.Length; i++) 535if (_index == null && (_indexFields.Length > 0 || _linearExpression == _expression)) 573_recordCount = _records.Length; 585for (int i = 0; i < newRows.Length; i++) 783Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 850int 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)
825for (int i = foundColumns.Length - 1; i >= 0; --i) 1066for (int i = foundColumns.Length - 1; i >= 0; --i) 1093for (int i = foundColumns.Length - 1; i >= 0; --i)
System\Data\xmlsaver.cs (24)
663if (top.Length == 0 || _schFormat == SchemaFormat.WebServiceSkipSchema || _schFormat == SchemaFormat.RemotingSkipSchema) 696for (int i = 0; i < top.Length; i++) 783for (int i = 0; i < rels.Length; ++i) 1174if (1 < key.Length) 1178for (int i = 1; i < key.Length; i++) 1188if (1 < key.Length) 1199for (int i = 1; i < key.Length; i++) 1398if (nestedParentRelations.Length != 0) 1400for (int i = 0; i < nestedParentRelations.Length; i++) 1645if (rel.ChildColumnsReference.Length != 1) 1651if (rel.ParentColumnsReference.Length != 1) 1677if (unique.Key.ColumnsReference.Length != 1) 1713if (fk.RelatedColumnsReference.Length != 1) 1750if (nestedParentRelations.Length == 0) 1756for (int i = 0; i < nestedParentRelations.Length; i++) 1809if (childRelations[j].Nested && childRelations[j].ParentKey.ColumnsReference.Length == 1 && childRelations[j].ParentKey.ColumnsReference[0] == col) 2034if (0 < fields.Length) 2037for (int k = 0; k < fields.Length; k++) 2102if (0 < fields.Length) 2105for (int k = 0; k < fields.Length; k++) 2186if (0 < fields.Length) 2189for (int k = 0; k < fields.Length; k++) 2510if ((state == DataRowState.Deleted) && (row.Table.NestedParentRelations.Length != 0)) 2853int countTopTable = _topLevelTables.Length;
System\Data\XMLSchema.cs (21)
265for (int i = 0; i < attrs.Length; i++) 322for (int i = 0; i < attrs.Length; i++) 363for (int i = 0; i < attrs.Length; i++) 383for (int i = 0; i < nodeAttributes.Length; i++) 467keyLength = parentNames.Length; 468if (keyLength != childNames.Length) 809if (dt.NestedParentRelations.Length == 0 && dt.Namespace == ds.Namespace) 863for (int i = 0; i < relations.Length; i++) 1180colName = split[split.Length - 1]; 1412if (0 < key.Length) 1430for (int i = 0; i < key.Length; i++) 1783for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 1849for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 1897for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 2029for (int i = 0; i < attrs.Length; i++) 2143for (int i = 0; i < attrs.Length; i++) 2737for (int i = 0; i < qualifiedNames.Length; i++) 2753for (int i = 0; i < qualifiedNames.Length; i++) 2769string QualifiedTableName = split[split.Length - 1]; //get the last string after '/' and ':' 2788string tableName = split[split.Length - 1]; //get the last string after '/' and ':' 2805for (int i = 0; i < attribs.Length; i++)
System\Xml\XmlDataDocument.cs (4)
808if (relations.Length == 0) 1249for (int i = 0; i < orderedTables.Length; i++) 1711for (int i = 0; i < columns.Length; i++) 2907if (relations.Length != 0 && relations[0].ParentTable == parentRow.Table) // just backward compatible
System.Data.Odbc (94)
_generated\1\RegexGenerator.g.cs (2)
593if ((uint)p < (uint)s.Length) 619if ((uint)(p + 1) < (uint)s.Length)
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\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
477internal static bool IsEmptyArray([NotNullWhen(false)] string?[]? array) => (null == array) || (0 == array.Length);
src\runtime\src\libraries\Common\src\System\Data\Common\BasicFieldNameLookup.cs (2)
114int length = _fieldNames.Length; 129int length = _fieldNames.Length;
src\runtime\src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (1)
51int limit = ary.Length;
src\runtime\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\runtime\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.Data.OleDb (165)
_generated\4\RegexGenerator.g.cs (2)
593if ((uint)p < (uint)s.Length) 619if ((uint)(p + 1) < (uint)s.Length)
ColumnBinding.cs (9)
674Marshal.Copy(ptr, value, 0, value.Length); 693int length = ((ValueBindingOffset < value.Length) ? (value.Length - ValueBindingOffset) : 0); 759int length = ((ValueBindingOffset < value.Length) ? (value.Length - ValueBindingOffset) : 0); 786int bytecount = ((ValueBindingOffset < value.Length) ? Math.Min(value.Length - ValueBindingOffset, ColumnBindingMaxLen) : 0); 1223int charCount = ((ValueBindingOffset < value.Length) ? Math.Min(value.Length - ValueBindingOffset, (ColumnBindingMaxLen - 2) / 2) : 0);
DbBindings.cs (13)
35for (int i = 0; i < _dbbindings.Length; ++i) 42internal Bindings(OleDbParameter[] parameters, int collectionChangeID) : this(parameters.Length) 44_bindInfo = new tagDBPARAMBINDINFO[parameters.Length]; 257Debug.Assert(columnBindings.Length == _dbcolumns.Length, "length mismatch"); 258for (int i = 0; i < columnBindings.Length; ++i) 272return (indexStart + columnBindings.Length); 281for (int i = 0; i < parameters.Length; ++i) 303for (int i = 0; i < parameters.Length; ++i) 319if (!ForceRebind && ((collection.ChangeID == _collectionChangeID) && (_parameters.Length == collection.Count))) 321for (int i = 0; i < columnBindings.Length; ++i) 348for (int i = 0; i < columnBindings.Length; ++i) 390for (int i = 0; i < columnBindings.Length; ++i)
DbConnectionStringCommon.cs (5)
20for (int i = 0; i < items.Length; ++i) 29Array.Copy(_items, 0, array, arrayIndex, _items.Length); 34Array.Copy(_items, 0, array, arrayIndex, _items.Length); 84get { return _items.Length; } 104return (++_index < _items.Length);
DbParameterHelper.cs (2)
252return bvalue.Length; 257return cvalue.Length;
DbPropSet.cs (5)
194for (int i = 0; i < properties.Length; ++i) 227Debug.Assert((null != properties) && (0 < properties.Length), "invalid properties"); 229nuint countOfBytes = (nuint)(properties.Length * ODB.SizeOf_tagDBPROP); 230tagDBPROPSET propset = new tagDBPROPSET(properties.Length, propertySet); 262for (int i = 0; i < properties.Length; ++i)
OleDbCommand.cs (7)
403for (int i = 0; i < parameters.Length; ++i) 423IntPtr[] ordinals = new IntPtr[bindInfo.Length]; 424for (int i = 0; i < ordinals.Length; ++i) 433tagDBPARAMBINDINFO_x86[] bindInfo_x86 = new tagDBPARAMBINDINFO_x86[bindInfo.Length]; 434for (int i = 0; i < bindInfo.Length; i++) 443hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, (IntPtr)p); 450hr = commandWithParameters.SetParameterInfo((IntPtr)bindInfo.Length, ordinals, (IntPtr)p);
OleDbCommandBuilder.cs (4)
142for (int i = 0; i < list.Length; ++i) 230plist = new OleDbParameter[dataRows.Length]; 231for (index = 0; index < dataRows.Length; ++index) 319if ((0 == plist.Length) && connection.SupportSchemaRowset(OleDbSchemaGuid.Procedures))
OleDbConnection.cs (4)
435if ((null == restrictions) || (0 == restrictions.Length)) 443if ((null == restrictions) || (0 == restrictions.Length)) 451if ((null == restrictions) || (0 == restrictions.Length)) 549Debug.Assert(1 == dbprops.Length, "too many Properties");
OleDbConnectionInternal.cs (6)
489for (int i = 0; i < values.Length; ++i) 519for (int i = 0; i < supportedSchemas.Length; ++i) 599for (int i = 0, offset = 0; i < supportedSchemas.Length; ++i, offset += ODB.SizeOf_Guid) 607for (int i = 0; i < supportedSchemas.Length; ++i) 635hr = dbSchemaRowset.GetRowset(IntPtr.Zero, in schema, restrictions.Length, restrictions, in ODB.IID_IRowset, 0, IntPtr.Zero, out rowset); 686for (int i = 0; i < schemaSupport.Length; ++i)
OleDbConnectionString.cs (2)
313int count = fstream.Read(bytes, 0, bytes.Length); 325count = fstream.Read(bytes, 0, bytes.Length);
OleDbConnectionStringBuilder.cs (6)
215knownKeywords = new string[s_validKeywords.Length + dynamic.Count]; 217dynamic.Keys.CopyTo(knownKeywords, s_validKeywords.Length); 243string[] tmp = new string[knownKeywords.Length + count]; 246int index = knownKeywords.Length; 293for (int i = 0; i < s_validKeywords.Length; ++i) 684Array.Sort(objValues, 0, objValues.Length);
OleDbDataReader.cs (53)
155return ((null != metadata) ? metadata.Length : 0); 263if ((null != metadata) && (0 < metadata.Length)) 265if ((0 < metadata.Length) && _useIColumnsRowset && (null != _connection)) 295if (null != _metadata && 0 < _metadata.Length) 306if (null != _metadata && 0 < _metadata.Length) 326schemaTable.MinimumCapacity = metadata.Length; 374if (_visibleFieldCount < metadata.Length) 384for (int i = 0; i < metadata.Length; ++i) 414if (_visibleFieldCount < metadata.Length) 752for (int i = 0; i < bindings.Length; ++i) 860return value.Length; 863int byteCount = Math.Min(value.Length - srcIndex, length); 866throw ADP.InvalidSourceBufferIndex(value.Length, srcIndex, "dataIndex"); 868else if ((bufferIndex < 0) || (bufferIndex >= buffer.Length)) 870throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex"); 905else if ((bufferIndex < 0) || (bufferIndex >= buffer.Length)) 907throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex"); 1160int count = Math.Min(values.Length, _visibleFieldCount); 1161for (int i = 0; (i < _metadata!.Length) && (i < count); ++i) 1410return (0 < _metadata!.Length); 1418Debug.Assert(0 <= _metadata!.Length, "incorrect state for fieldCount"); 1431Debug.Assert(0 <= _metadata.Length, "incorrect state for fieldCount"); 1450for (int i = 0; (i < bindings.Length) && (i < _nextAccessorForRetrieval); ++i) 1469Debug.Assert(null != _metadata && 0 < _metadata.Length, "no columns"); 1474for (int i = 0; i < dbBindings.Length; ++i) 1518int[] indexToBinding = new int[metadata.Length]; 1519int[] indexWithinBinding = new int[metadata.Length]; 1526for (int i = 0; i < indexToBinding.Length; ++i) 1555for (int i = 0; i < indexToBinding.Length; ++i) 1560bindingCount = metadata.Length; 1565for (int i = 0; i < indexToBinding.Length; ++i) 1578for (int index = 0; index < metadata.Length; ++index) 1580Debug.Assert(indexToBinding[index] < dbbindings.Length, "bad indexToAccessor"); 1585for (int i = index; (i < metadata.Length) && (bindingCount == indexWithinBinding[i]); ++i) 1669for (int i = 0; i < dbbindings.Length; ++i) 1674for (int k = 0; k < columnBindings.Length; ++k) 1844bool[] mustRelease = new bool[columnBindings.Length]; 1845StringMemHandle?[] sptr = new StringMemHandle[columnBindings.Length]; 1849for (int i = 0; i < columnBindings.Length; ++i) 1874hr = irow.GetColumns((IntPtr)access.Length, access); 1882for (int i = 0; i < mustRelease.Length; i++) 1913if (_metadata.Length <= 0) 1919for (int i = 0; i < _metadata.Length; ++i) 1933for (int i = 0; i < _metadata.Length; ++i) 1988Hashtable baseColumnNames = new Hashtable(_metadata.Length * 2); 1990for (int i = _metadata.Length - 1; 0 <= i; --i) 1998for (int i = 0; i < _metadata.Length; ++i) 2085for (int i = 0; i < _metadata!.Length; ++i) 2130bool[] keys = new bool[_metadata!.Length]; 2131bool[]? uniq = new bool[_metadata.Length]; 2202for (int i = 0; i < _metadata.Length; ++i) 2217for (int i = 0; i < _metadata.Length; ++i) 2505if ((null != metadata) && (0 < metadata.Length))
OleDbMetaDataFactory.cs (13)
114for (int i = 0; i < _schemaMapping.Length; i++) 132for (int i = 0; i < schemaSupport.Length; i++) 400Debug.Assert(sourceColumns.Length == targetColumns.Length); 415for (int i = 0; i < sourceColumns.Length; i++) 528for (int i = 0; i < _schemaMapping.Length; i++) 550if (numberOfSupportedRestictions < restrictions.Length) 564(restrictions.Length >= indexRestrictionTypeSlot + 1) && 567mungedRestrictions = new object[restrictions.Length]; 568for (int j = 0; j < restrictions.Length; j++) 608(restrictions.Length >= procedureRestrictionTypeSlot + 1) && 611mungedRestrictions = new object[restrictions.Length]; 612for (int j = 0; j < restrictions.Length; j++)
PropertyIDSet.cs (3)
38internal PropertyIDSet(Guid[] propertySets) : base(PropertyIDSetSize * propertySets.Length) 40_count = propertySets.Length; 41for (int i = 0; i < propertySets.Length; ++i)
RowBinding.cs (6)
99OleDbHResult hr = iaccessor.CreateAccessor(flags, (IntPtr)rowBindStatus.Length, this, (IntPtr)_dataLength, out _accessorHandle, rowBindStatus); 101for (int k = 0; k < rowBindStatus.Length; ++k) 125Debug.Assert(dbbindings.Length == BindingCount(), "count mismatch"); 135for (int i = 0; i < dbbindings.Length; ++i) 149ColumnBinding[] columns = new ColumnBinding[dbbindings.Length]; 150for (int indexWithinAccessor = 0; indexWithinAccessor < columns.Length; ++indexWithinAccessor)
SafeHandles.cs (1)
30int count = (null != literals) ? literals.Length : 0;
src\runtime\src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (1)
51int limit = ary.Length;
System\Data\Common\AdapterUtil.cs (3)
916for (int i = 0; i < d.Length; i++) 1044if (values.Length != 1) 1316return ((null == array) || (0 == array.Length));
System\Data\Common\FieldNameLookup.cs (2)
105int length = _fieldNames.Length; 120int length = _fieldNames.Length;
System\Data\ProviderBase\DbBuffer.cs (8)
122Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 155Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 214Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 266Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 411Debug.Assert(startIndex + length <= source.Length, "source too small"); 437Debug.Assert(startIndex + length <= source.Length, "source too small"); 492Debug.Assert(startIndex + length <= source.Length, "source too small"); 542Debug.Assert(startIndex + length <= source.Length, "source too small");
System\Data\ProviderBase\DbConnectionFactory.cs (3)
162for (idx = 0; idx < s_pendingOpenNonPooled.Length; idx++) 177if (idx == s_pendingOpenNonPooled.Length) 179idx = s_pendingOpenNonPooledNext++ % s_pendingOpenNonPooled.Length;
System\Data\ProviderBase\DbMetaDataFactory.cs (4)
139if ((restrictions != null) && (restrictions.Length > numberOfRestrictions)) 153if ((restrictions != null) && (restrictions.Length > i) && (restrictions[i] != null)) 422for (int i = 0; i < restrictions!.Length; i++) 497for (int i = 0; i < hiddenColumnNames.Length; i++)
System\Data\ProviderBase\DbReferenceCollection.cs (3)
102if ((!itemAdded) && (_lastItemIndex + 1 < _items.Length)) 127Array.Resize<CollectionEntry>(ref _items, _items.Length * 2); 207if (_items.Length > 100)
System.Diagnostics.DiagnosticSource (39)
System\Diagnostics\ActivitySource.cs (9)
437T[] newArray = new T[_volatileArray.Length + 1]; 439Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items 440newArray[_volatileArray.Length] = item;// copy new item 457T[] newArray = new T[_volatileArray.Length + 1]; 459Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items 460newArray[_volatileArray.Length] = item;// copy new item 479T[] newArray = new T[_volatileArray.Length - 1]; 485newArray, index, _volatileArray.Length - index - 1// remaining items accounting for removed item 493public int Count => _volatileArray.Length;
System\Diagnostics\DsesFilterAndTransform.cs (1)
1026if (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)
96QuantileValue[] quantiles = new QuantileValue[_config.Quantiles.Length]; 98if (nextQuantileIndex == _config.Quantiles.Length) 118if (nextQuantileIndex == _config.Quantiles.Length)
System\Diagnostics\Metrics\Measurement.cs (1)
48_tags = new KeyValuePair<string, object?>[tags.Length];
System\Diagnostics\Metrics\MetricsEventSource.cs (5)
753if (specStrings.Length == 0) 884if (buckets.Length > 0) 889for (int i = 1; i < buckets.Length; i++) 900for (int i = 0; i < quantiles.Length; i++) 907if (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 (4)
126else if (_tagsCount == _overflowTags.Length) 161ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)arrayIndex, (uint)array.Length, nameof(arrayIndex)); 165ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)arrayIndex, (uint)array.Length, nameof(arrayIndex)); 194if (_tagsCount == _overflowTags.Length)
System.Diagnostics.EventLog (61)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (3)
176for (int i = 0; i < majorVersions.Length; i++) 187if (splitVersion.Length != 2) 254for (int i = 0; i < minorVersions.Length; i++)
System\Diagnostics\EventLog.cs (15)
551for (int i = 0; i < logNames.Length; i++) 649List<EventLog> logs = new List<EventLog>(logNames.Length); 650for (int i = 0; i < logNames.Length; i++) 811if (insertionStrings.Length == 0) 863if (largestNumber > insertionStrings.Length) 866Array.Copy(insertionStrings, newStrings, insertionStrings.Length); 867for (int i = insertionStrings.Length; i < newStrings.Length; i++) 888IntPtr[] addresses = new IntPtr[insertionStrings.Length]; 889GCHandle[] handles = new GCHandle[insertionStrings.Length]; 892if (insertionStrings.Length == 0) 899for (int i = 0; i < handles.Length; i++) 913buf.Length, 920buf = new char[buf.Length * 2]; 930for (int i = 0; i < handles.Length; i++)
System\Diagnostics\EventLogEntry.cs (4)
159for (int i = 0; i < strings.Length; i++) 213while (i < strings.Length) 277sid, 0, sid.Length); 418for (int i = 0; i < fileNames.Length; i++)
System\Diagnostics\EventLogEntryCollection.cs (1)
67Array.Copy(entries, 0, array, index, entries.Length);
System\Diagnostics\EventLogInternal.cs (20)
724while (idx < entries.Length) 728oldestEntry + idx, buf, buf.Length, out bytesRead, out minBytesNeeded); 740else if (minBytesNeeded > buf.Length) 745oldestEntry + idx, buf, buf.Length, out bytesRead, out _); 759while (sum < bytesRead && idx < entries.Length) 766if (idx != entries.Length) 904cache, cache.Length, out bytesRead, out minBytesNeeded); 919if (minBytesNeeded > cache.Length) 925cache, cache.Length, out bytesRead, out _); 1195for (int i = 0; i < interestedComponents.Length; i++) 1344strings = new string[values.Length]; 1345for (int i = 0; i < values.Length; i++) 1358if (strings.Length >= 256) 1361for (int i = 0; i < strings.Length; i++) 1379IntPtr[] stringRoots = new IntPtr[strings.Length]; 1380GCHandle[] stringHandles = new GCHandle[strings.Length]; 1384for (int strIndex = 0; strIndex < strings.Length; strIndex++) 1393sid, (short)strings.Length, rawData.Length, stringsRootHandle.AddrOfPinnedObject(), rawData); 1402for (int i = 0; i < strings.Length; i++)
System\Diagnostics\EventLogTraceListener.cs (4)
90if (args == null || args.Length == 0) 96string?[] strings = new string[args.Length]; 97for (int i = 0; i < args.Length; i++) 140for (int i = 0; i < data.Length; i++)
System\Diagnostics\Reader\EventLogPropertySelector.cs (1)
34Handle = NativeWrapper.EvtCreateRenderContext(paths.Length, paths, UnsafeNativeMethods.EvtRenderContextFlags.EvtRenderContextValues);
System\Diagnostics\Reader\EventLogReader.cs (5)
134if (_batchSize != _eventsBuffer.Length) 312if (channelNames.Length != errorStatuses.Length) 315var list = new List<EventLogStatus>(channelNames.Length); 316for (int i = 0; i < channelNames.Length; i++)
System\Diagnostics\Reader\EventLogRecord.cs (1)
285if (theValues.Length == i)
System\Diagnostics\Reader\EventLogWatcher.cs (1)
240results = NativeWrapper.EvtNext(_handle, _eventsBuffer.Length, _eventsBuffer, 0, 0, ref _numEventsInBuffer);
System\Diagnostics\Reader\NativeWrapper.cs (6)
299bool status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Length, buffer, out buffUsed, out _); 307status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Length, buffer, out buffUsed, out _); 1079UnsafeNativeMethods.EvtStringVariant[] stringVariants = new UnsafeNativeMethods.EvtStringVariant[values.Length]; 1080for (int i = 0; i < values.Length; i++) 1086bool status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, 0, emptyBuffer, out bufferNeeded); 1107status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, bufferNeeded, buffer, out bufferNeeded);
System.Diagnostics.PerformanceCounter (33)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (3)
176for (int i = 0; i < majorVersions.Length; i++) 187if (splitVersion.Length != 2) 254for (int i = 0; i < minorVersions.Length; i++)
System\Diagnostics\CounterCreationDataCollection.cs (1)
46for (int i = 0; i < value.Length; i++)
System\Diagnostics\PerformanceCounterCategory.cs (6)
435if (instanceNames.Length == 1 && instanceNames[0] == PerformanceCounterLib.SingleInstanceName) 447if (GetInstanceNames().Length != 0) 466PerformanceCounter[] counters = new PerformanceCounter[counterNames.Length]; 467for (int index = 0; index < counters.Length; index++) 491PerformanceCounterCategory[] categories = new PerformanceCounterCategory[categoryNames.Length]; 492for (int index = 0; index < categories.Length; index++)
System\Diagnostics\PerformanceCounterLib.cs (20)
161for (int index2 = 0; index2 < newCategoryEntry.CounterIndexes.Length; ++index2) 178if (index3 < newCategoryEntry.CounterIndexes.Length) 400for (int index = 0; index < entry.CounterIndexes.Length; ++index) 609if (categoryKey.GetValueNames().Length == 0) 752if (categories.Length != 0) 881string[] counters = new string[entry.CounterIndexes.Length]; 882for (int index = 0; index < counters.Length; ++index) 894if (index2 < counters.Length) 946for (int index = 0; index < entry.CounterIndexes.Length; ++index) 1049if ((names == null) || (names.Length == 0)) 1083stringTable = new Hashtable(names.Length / 2); 1085for (int index = 0; index < (names.Length / 2); ++index) 1449for (int index = 0; index < samples.Length; ++index) 1480for (int index = 0; index < samples.Length; ++index) 1499if (parentInstanceNames != null && perfInstance.ParentObjectInstance >= 0 && perfInstance.ParentObjectInstance < parentInstanceNames.Length - 1) 1522for (int index = 0; index < samples.Length; ++index) 1578for (int index = 0; index < samples.Length; ++index) 1611for (int index = 0; index < _entry.CounterIndexes.Length; ++index) 1646for (int index = 0; index < _entry.CounterIndexes.Length; ++index) 1771for (int index = 0; index < keys.Length; ++index)
System\Diagnostics\SharedPerformanceCounter.cs (3)
682for (int i = 0; i < counterNamesBytes.Length - 1; i += 2) 698for (int i = 0; i < counterNames.Length; i++) 1781Marshal.Copy(tmp, 0, (nint)nativePointer, tmp.Length);
System.Diagnostics.Process (26)
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
164if (bytesConsumed < bytes.Length)
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (5)
55inheritedFdCount = inheritedHandles.Length; 56inheritedFds = inheritedHandles.Length <= 4 61for (int i = 0; i < inheritedHandles.Length; i++) 77setUser ? 1 : 0, userId, groupId, pGroups, groups?.Length ?? 0, 116int count = arr.Length;
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
53if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\runtime\src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
System\Diagnostics\Process.cs (1)
1015for (int i = 0; i < processes.Length; i++)
System\Diagnostics\Process.Linux.cs (1)
138_processInfo.HandleCount = Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly).Length;
System\Diagnostics\Process.Multiplexing.cs (5)
178if (charEndIndex + charCount > charBuffer.Length && charStartIndex > 0) 186while (charEndIndex + charCount > charBuffer.Length) 492if (bytesRead == buffer.Length) 672int newSize = (int)Math.Min((long)buffer.Length * 2, Array.MaxLength); 673newSize = Math.Max(buffer.Length + 1, newSize);
System\Diagnostics\Process.Multiplexing.Unix.cs (2)
310if (currentBytesRead == currentBuffer.Length) 333int bytesRead = Interop.Sys.Read(handle, pBuffer + offset, buffer.Length - offset);
System\Diagnostics\ProcessStartInfo.cs (3)
467for (int i = 0; i < snapshot.Length; i++) 549if (inheritedHandles is null || inheritedHandles.Length == 0 || !ProcessUtils.PlatformSupportsConsole) 560for (int i = 0; i < inheritedHandles.Length; i++)
System\Diagnostics\ProcessUtils.Unix.cs (1)
157if (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 (1)
System\Diagnostics\TraceListeners.cs (1)
90for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
System.DirectoryServices (75)
Interop\AdsValueHelper2.cs (2)
141for (int i = 0; i < bytes.Length; i++) 273adsvalue.octetString.length = bytes.Length;
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchedule.cs (3)
130for (int i = 0; i < days.Length; i++) 136for (int i = 0; i < days.Length; i++) 156if (array.Length != 672)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchemaClassCollection.cs (1)
108for (int i = 0; ((i) < (schemaClasses.Length)); i = ((i) + (1)))
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchemaProperty.cs (2)
1375for (int i = 0; i < s_syntaxes.Length; i++) 1387if ((((int)syntax) < 0) || (((int)syntax) > (s_syntaxes.Length - 1)))
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchemaPropertyCollection.cs (1)
109for (int i = 0; ((i) < (properties.Length)); i = ((i) + (1)))
System\DirectoryServices\ActiveDirectory\ActiveDirectorySite.cs (1)
600Debug.Assert(tmpSchedule != null && tmpSchedule.Length == 188);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySiteCollection.cs (1)
60for (int i = 0; ((i) < (sites.Length)); i = ((i) + (1)))
System\DirectoryServices\ActiveDirectory\ActiveDirectorySiteLink.cs (1)
541Debug.Assert(tmpSchedule != null && tmpSchedule.Length == 188);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySiteLinkCollection.cs (1)
56for (int i = 0; i < links.Length; i++)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySubnetCollection.cs (1)
74for (int i = 0; ((i) < (subnets.Length)); i = ((i) + (1)))
System\DirectoryServices\ActiveDirectory\ActiveDirectorySyntax.cs (3)
40if (Data.Length == OMObjectClass.Data.Length) 42for (int i = 0; i < Data.Length; i++)
System\DirectoryServices\ActiveDirectory\ApplicationPartition.cs (1)
881if (components.Length == 1)
System\DirectoryServices\ActiveDirectory\DirectoryServerCollection.cs (1)
122for (int i = 0; ((i) < (servers.Length)); i = ((i) + (1)))
System\DirectoryServices\ActiveDirectory\Exception.cs (2)
234SyncFromAllServersErrorInformation[] tempError = new SyncFromAllServersErrorInformation[_errors.Length]; 235for (int i = 0; i < _errors.Length; i++)
System\DirectoryServices\ActiveDirectory\ForestTrustRelationshipInformation.cs (1)
213record.Data.Length = ((byte[])_binaryData[i]!).Length;
System\DirectoryServices\ActiveDirectory\ReplicationConnection.cs (1)
790Debug.Assert(tmpSchedule != null && tmpSchedule.Length == 188);
System\DirectoryServices\ActiveDirectory\Utils.cs (4)
827Debug.Assert(component.Length == 1); 873int hr = Interop.Activeds.ADsEncodeBinaryData(byteGuid, byteGuid.Length, ref ptr); 2306pBytes = Marshal.AllocHGlobal(bytes.Length); 2310Marshal.Copy(bytes, 0, pBytes, bytes.Length);
System\DirectoryServices\DirectoryEntry.cs (7)
958object[] names = new object[propertyNames.Length]; 959for (int i = 0; i < propertyNames.Length; i++) 975for (int i = 0; i < propertyNames.Length; i++) 984if (results.Length != 1) 987for (int count = 0; count < results.Length; count++) 1099if (values.Length < 1) 1108if (values.Length > 1)
System\DirectoryServices\DirectorySearcher.cs (8)
646adsSearch.ExecuteSearch(Filter, properties, properties.Length, out resultsHandle); 815Marshal.Copy((INTPTR_INTPTRCAST)(&sortKey), sortKeyBytes, 0, sortKeyBytes.Length); 842vlvValue.contextIDlength = _vlv.DirectoryVirtualListViewContext._context.Length; 852Marshal.Copy(vlvPtr, vlvBytes, 0, vlvBytes.Length); 898IntPtr ptr = Marshal.AllocHGlobal(structSize * prefs.Length); 902for (int i = 0; i < prefs.Length; i++) 908adsSearch.SetSearchPreference(ptr, prefs.Length); 912for (int i = 0; i < prefs.Length; i++)
System\DirectoryServices\DirectoryServicesCOMException.cs (2)
63Interop.Activeds.ADsGetLastError(out error, errorBuffer, errorBuffer.Length, nameBuffer, nameBuffer.Length);
System\DirectoryServices\DirectorySynchronization.cs (4)
59byte[] tempcookie = new byte[_cookie.Length]; 60for (int i = 0; i < _cookie.Length; i++) 78_cookie = new byte[cookie.Length]; 79for (int i = 0; i < cookie.Length; i++)
System\DirectoryServices\DirectoryVirtualListViewContext.cs (2)
22_context = new byte[context.Length]; 23for (int i = 0; i < context.Length; i++)
System\DirectoryServices\PropertyCollection.cs (1)
163if (((index + Count) > array.Length) || ((index + Count) < index))
System\DirectoryServices\PropertyValueCollection.cs (2)
110object[] objArray = new object[((Array)value).Length]; 140for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
System\DirectoryServices\SchemaNameCollection.cs (20)
48return values.Length; 58object?[] newValues = new object[oldValues.Length + 1]; 59for (int i = 0; i < oldValues.Length; i++) 61newValues[newValues.Length - 1] = value; 63return newValues.Length - 1; 73object?[] newValues = new object[oldValues.Length + value.Length]; 74for (int i = 0; i < oldValues.Length; i++) 76for (int i = oldValues.Length; i < newValues.Length; i++) 77newValues[i] = value[i - oldValues.Length]; 85object?[] newValues = new object?[oldValues.Length + value.Count]; 86for (int i = 0; i < oldValues.Length; i++) 88for (int i = oldValues.Length; i < newValues.Length; i++) 89newValues[i] = value[i - oldValues.Length]; 133for (int i = 0; i < values.Length; i++) 167if (index >= oldValues.Length || index < 0) 170object?[] newValues = new object[oldValues.Length - 1]; 173for (int i = index + 1; i < oldValues.Length; i++)
System\DirectoryServices\SearchResultCollection.cs (2)
454return Interop.Activeds.ADsGetLastError(out errorCode, errorBuffer, errorBuffer.Length, nameBuffer, nameBuffer.Length);
System.DirectoryServices.AccountManagement (42)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (4)
144string[] props = new string[ldapAttributes.Length + 1]; 146props[ldapAttributes.Length] = ldapAttribute; 751for (int i = 0; i < MyAttribute.Length; i++) 1025Debug.Assert(ldapAttributes.Length > 0);
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (8)
86for (int i = 0; i < MyAttribute.Length; i++) 908List<string> list = new List<string>(individualValues.Length); 1190if (value != null && value.Length != 0) 1329if (!kvp.Value.Filter && null != kvp.Value.Value && kvp.Value.Value.Length != 0) 1336if ((kvp.Value.Value.Length == 1 && kvp.Value.Value[0] is ICollection) || (kvp.Value.Value.Length > 1)) 1338if (kvp.Value.Value.Length > 1 && (kvp.Value.Value[0] is ICollection)) 1346if (kvp.Value.Value.Length == 1 && kvp.Value.Value[0] is ICollection && !(kvp.Value.Value[0] is byte[]))
System\DirectoryServices\AccountManagement\AD\ADStoreKey.cs (3)
37Debug.Assert(sid != null && sid.Length != 0); 40_sid = new byte[sid.Length]; 41Array.Copy(sid, _sid, sid.Length);
System\DirectoryServices\AccountManagement\AD\ADUtils.cs (1)
283StringBuilder sb = new StringBuilder(bytes.Length * 3);
System\DirectoryServices\AccountManagement\AD\SidList.cs (9)
51GlobalDebug.WriteLineIf(GlobalDebug.Info, "SidList", "SidList: processing {0} Sid+Attr SIDs", sidAndAttr.Length); 54int sidCount = sidAndAttr.Length; 67GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthZSet", "SidList: processing {0} SIDs", pSids.Length); 70if (pSids.Length == 0) 76int sidCount = pSids.Length; 139namesHandle.ReadArray(0, names, 0, names.Length); 169Debug.Assert(names.Length == sidCount); 171for (int i = 0; i < names.Length; i++) 183Debug.Assert(name.DomainIndex < domains.Length);
System\DirectoryServices\AccountManagement\ExtensionHelper.cs (3)
31for (int i = 0; i < MyAttribute.Length; i++) 57for (int i = 0; i < MyAttribute.Length; i++) 86for (int i = 0; i < MyAttribute.Length; i++)
System\DirectoryServices\AccountManagement\Principal.cs (2)
661if (((object[])value).Length == 0) 672if (((byte[])value).Length == 0)
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (1)
811Debug.Assert(memberSidToMatch.Length != 0);
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_LoadStore.cs (1)
935if (value != null && value.Length != 0)
System\DirectoryServices\AccountManagement\SAM\SAMStoreKey.cs (3)
18Debug.Assert(sid != null && sid.Length > 0); 23_sid = new byte[sid.Length]; 24Array.Copy(sid, _sid, sid.Length);
System\DirectoryServices\AccountManagement\SAM\SAMUtils.cs (2)
63Debug.Assert(versionComponents.Length >= 1); // since version was a non-empty string 69if (versionComponents.Length > 1)
System\DirectoryServices\AccountManagement\Utils.cs (5)
27if (src.Length != tgt.Length) 30for (int i = 0; i < src.Length; i++) 153pBytes = Marshal.AllocHGlobal(bytes.Length); 157Marshal.Copy(bytes, 0, pBytes, bytes.Length);
System.DirectoryServices.Protocols (89)
System\DirectoryServices\Protocols\common\BerConverter.cs (24)
55if (valueCount >= value.Length) 77if (valueCount >= value.Length) 99if (valueCount >= value.Length) 128if (valueCount >= value.Length) 151if (valueCount >= value.Length) 170tempValues = new byte[stringValues.Length][]; 171for (int i = 0; i < stringValues.Length; i++) 192if (valueCount >= value.Length) 215if (valueCount >= value.Length) 323berValue.bv_len = new CLong(value.Length); 324berValue.bv_val = Marshal.AllocHGlobal(value.Length); 325Marshal.Copy(value, 0, berValue.bv_val, value.Length); 405stringArray = new string[byteArrayresult.Length]; 406for (int i = 0; i < byteArrayresult.Length; i++) 469IntPtr tmp = Marshal.AllocHGlobal(tempValue.Length); 470Marshal.Copy(tempValue, 0, tmp, tempValue.Length); 472error = BerPal.PrintByteArray(berElement, new string(fmt, 1), memHandle, (uint)tempValue.Length, tag); 528berValArray = Utility.AllocHGlobalIntPtrArray(tempValue.Length + 1); 530managedBervalArray = new BerVal[tempValue.Length]; 533for (i = 0; i < tempValue.Length; i++) 542managedBervalArray[i].bv_len = new CLong(byteArray.Length); 543managedBervalArray[i].bv_val = Marshal.AllocHGlobal(byteArray.Length); 544Marshal.Copy(byteArray, 0, managedBervalArray[i].bv_val, byteArray.Length); 563for (int i = 0; i < tempValue.Length; i++)
System\DirectoryServices\Protocols\common\DirectoryAttribute.cs (2)
52for (int i = 0; i < values.Length; i++) 181for (int i = 0; i < values.Length; i++)
System\DirectoryServices\Protocols\common\DirectoryControl.cs (12)
155for (int i = 0; i < controls.Length; i++) 805for (int i = 0; i < sortKeys.Length; i++) 813_keys = new SortKey[sortKeys.Length]; 814for (int i = 0; i < sortKeys.Length; i++) 839SortKey[] tempKeys = new SortKey[_keys.Length]; 840for (int i = 0; i < _keys.Length; i++) 850for (int i = 0; i < value.Length; i++) 858_keys = new SortKey[value.Length]; 859for (int i = 0; i < value.Length; i++) 878for (int i = 0; i < _keys.Length; i++) 1063if (_target != null && _target.Length > 0) 1077if (_context != null && _context.Length > 0)
System\DirectoryServices\Protocols\common\DirectoryRequest.cs (5)
46for (int i = 0; i < attributes.Length; i++) 94for (int i = 0; i < values.Length; i++) 201byte[] tempValue = new byte[_requestValue.Length]; 202for (int i = 0; i < _requestValue.Length; i++) 222for (int i = 0; i < attributeList.Length; i++)
System\DirectoryServices\Protocols\common\DirectoryResponse.cs (6)
33DirectoryControl[] tempControls = new DirectoryControl[_directoryControls.Length]; 34for (int i = 0; i < _directoryControls.Length; i++) 56Uri[] tempReferral = new Uri[_directoryReferral.Length]; 57for (int i = 0; i < _directoryReferral.Length; i++) 108byte[] tmpValue = new byte[_value.Length]; 109for (int i = 0; i < _value.Length; i++)
System\DirectoryServices\Protocols\common\SearchResults.cs (2)
23Uri[] tempUri = new Uri[_resultReferences.Length]; 24for (int i = 0; i < _resultReferences.Length; i++)
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (23)
530serverControlArray = Utility.AllocHGlobalIntPtrArray(managedServerControls.Length + 1); 532for (int i = 0; i < managedServerControls.Length; i++) 539pServerControlArray[managedServerControls.Length] = null; 546clientControlArray = Utility.AllocHGlobalIntPtrArray(managedClientControls.Length + 1); 548for (int i = 0; i < managedClientControls.Length; i++) 555pClientControlArray[managedClientControls.Length] = null; 611bv_len = new CLong(byteArray.Length), 612bv_val = Marshal.AllocHGlobal(byteArray.Length) 614Marshal.Copy(byteArray, 0, berValuePtr.bv_val, byteArray.Length); 637addModCount = (modifications == null ? 1 : modifications.Length + 1); 673if (val != null && val.Length != 0) 677bv_len = new CLong(val.Length), 678bv_val = Marshal.AllocHGlobal(val.Length) 680Marshal.Copy(val, 0, berValuePtr.bv_val, val.Length); 774for (int i = 0; i < managedServerControls.Length; i++) 787for (int i = 0; i < managedServerControls.Length; i++) 807for (int i = 0; i < managedClientControls.Length; i++) 821for (int i = 0; i < managedClientControls.Length; i++) 1211if (byteControlValue == null || byteControlValue.Length == 0) 1224bv_len = new CLong(byteControlValue.Length), 1225bv_val = Marshal.AllocHGlobal(sizeof(byte) * byteControlValue.Length) 1312bv_len = new CLong(byteArray.Length), 1313bv_val = Marshal.AllocHGlobal(byteArray.Length)
System\DirectoryServices\Protocols\ldap\LdapConnection.Linux.cs (2)
52if (servers != null && servers.Length != 0) 55for (int i = 0; i < servers.Length; i++)
System\DirectoryServices\Protocols\ldap\LdapDirectoryIdentifier.cs (3)
31_servers = new string[servers.Length]; 32for (int i = 0; i < servers.Length; i++) 38if (result.Length > 1)
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (10)
577serverControlArray = Utility.AllocHGlobalIntPtrArray(managedServerControls.Length + 1); 579for (int i = 0; i < managedServerControls.Length; i++) 586pServerControlArray[managedServerControls.Length] = null; 593clientControlArray = Utility.AllocHGlobalIntPtrArray(managedClientControls.Length + 1); 595for (int i = 0; i < managedClientControls.Length; i++) 602pClientControlArray[managedClientControls.Length] = null; 674for (int i = 0; i < managedServerControls.Length; i++) 687for (int i = 0; i < managedServerControls.Length; i++) 707for (int i = 0; i < managedClientControls.Length; i++) 721for (int i = 0; i < managedClientControls.Length; i++)
System.Drawing.Common (105)
System\Drawing\Drawing2D\GraphicsPath.cs (2)
472points.Length, 520points.Length,
System\Drawing\Drawing2D\LinearGradientBrush.cs (6)
184if (value.Positions is null || value.Positions.Length != value.Factors.Length) 190PInvokeGdiPlus.GdipSetLineBlend(NativeLineGradient, f, p, value.Factors.Length).ThrowIfFailed(); 246int count = value.Colors.Length; 250if (value.Colors.Length != value.Positions.Length)
System\Drawing\Drawing2D\Matrix.cs (2)
54if (plgpts.Length != 3) 68if (plgpts.Length != 3)
System\Drawing\Drawing2D\PathGradientBrush.cs (8)
158int count = value.Length; 217Blend blend = new(factors.Length) 231if (value.Positions is null || value.Positions.Length != value.Factors.Length) 234int count = value.Factors.Length; 294int count = value.Colors.Length; 296if (value.Positions is null || value.Colors.Length != value.Positions.Length)
System\Drawing\FontConverter.cs (3)
234for (int tokenCount = 0; tokenCount < styleTokens.Length; tokenCount++) 425string[] values = new string[_fonts.Length]; 426for (int i = 0; i < _fonts.Length; i++)
System\Drawing\Graphics.cs (18)
2060int count = destPoints.Length; 2077int count = destPoints.Length; 2133int count = destPoints.Length; 2142(GdiPlus.PointF*)p, destPoints.Length, 2178int count = destPoints.Length; 2187(GdiPlus.PointF*)p, destPoints.Length, 2231int count = destPoints.Length; 2240(GdiPlus.Point*)p, destPoints.Length, 2406CheckErrorStatus(PInvokeGdiPlus.GdipDrawLinesI(NativeGraphics, pen.NativePen, (GdiPlus.Point*)p, points.Length)); 3005if (destPoints.Length != 3) 3014(GdiPlus.PointF*)p, destPoints.Length, 3034if (destPoints.Length != 3) 3043(GdiPlus.Point*)p, destPoints.Length, 3140if (destPoints.Length != 3) 3149(GdiPlus.PointF*)p, destPoints.Length, 3173if (destPoints.Length != 3) 3182(GdiPlus.Point*)p, destPoints.Length, 3518CheckStatus(PInvokeGdiPlus.GdipComment(NativeGraphics, (uint)data.Length, b));
System\Drawing\Icon.cs (4)
534if (endOffset > _iconData.Length) 633Debug.Assert(_bestImageOffset >= 0 && (_bestImageOffset + _bestBytesInRes) <= _iconData.Length, "Illegal offset/length for the Icon data"); 770if (_iconData is not null && _iconData.Length >= _bestImageOffset + 8) 798outputStream.Write(_iconData, 0, _iconData.Length);
System\Drawing\Image.cs (1)
269fs.Write(_animatedGifRawData, 0, _animatedGifRawData.Length);
System\Drawing\ImageInfo.cs (4)
53Debug.Assert(values.Length % 4 == 0, "PropertyItem has an invalid value byte array. It should have a length evenly divisible by 4 to represent ints."); 54Debug.Assert(_frameCount % (values.Length / 4) == 0, "PropertyItem has invalid value byte array. The FrameCount should be evenly divisible by a quarter of the byte array's length."); 61if (i >= values.Length) 93Debug.Assert(values.Length == sizeof(short), "PropertyItem has an invalid byte array. It should represent a single short value.");
System\Drawing\Imaging\ColorPalette.cs (3)
74BufferScope<uint> buffer = new(Entries.Length + 2); 76buffer[1] = (uint)Entries.Length; 78for (int i = 0; i < Entries.Length; i++)
System\Drawing\Imaging\EncoderParameter.cs (18)
175_numberOfValues = value.Length; 189_numberOfValues = value.Length; 201_numberOfValues = value.Length; 213_numberOfValues = value.Length; 217for (int i = 0; i < value.Length; i++) 229if (numerator.Length != denominator.Length) 233_numberOfValues = numerator.Length; 249if (rangebegin.Length != rangeend.Length) 253_numberOfValues = rangebegin.Length; 274if (numerator1.Length != denominator1.Length || 275numerator1.Length != denominator2.Length || 276denominator1.Length != denominator2.Length) 280_numberOfValues = numerator1.Length;
System\Drawing\Imaging\EncoderParameters.cs (1)
18int length = Param.Length;
System\Drawing\Internal\SystemColorTracker.cs (10)
29Debug.Assert(s_list.Length > 0, "INITIAL_SIZE was initialized after list"); 31if (s_list.Length == s_count) 55Debug.Assert(!reference.TryGetTarget(out _), $"Trying to reuse a weak reference that isn't broken yet: list[{index}], length = {s_list.Length}"); 68int right = s_list.Length - 1; 71int length = s_list.Length; 94Debug.Assert(s_count >= 0 && s_count <= s_list.Length, "count not a legal index into list"); 107for (int i = s_count; i < s_list.Length; i++) 118if (s_count / (float)s_list.Length > EXPAND_THRESHOLD) 120Array.Resize(ref s_list, s_list.Length * EXPAND_FACTOR); 122Debug.Assert(s_list.Length < WARNING_SIZE, "SystemColorTracker is using way more memory than expected.");
System\Drawing\Pen.cs (3)
777if (value is null || value.Length == 0) 784PInvokeGdiPlus.GdipSetPenDashArray(NativePen, f, value.Length).ThrowIfFailed(); 823PInvokeGdiPlus.GdipSetPenCompoundArray(NativePen, f, value.Length).ThrowIfFailed();
System\Drawing\Printing\MarginsConverter.cs (3)
41int[] values = new int[tokens.Length]; 44for (int i = 0; i < values.Length; i++) 50if (values.Length != 4)
System\Drawing\Printing\PageSettings.cs (3)
404for (int i = 0; i < sizes.Length; i++) 425for (int i = 0; i < sources.Length; i++) 442for (int i = 0; i < resolutions.Length; i++)
System\Drawing\Printing\PrinterSettings.cs (1)
397pvImage.Length,
System\Drawing\Printing\PrinterSettings.PaperSizeCollection.cs (3)
26public int Count => _array.Length; 41void ICollection.CopyTo(Array array, int index) => Array.Copy(_array, index, array, 0, _array.Length); 43public void CopyTo(PaperSize[] paperSizes, int index) => Array.Copy(_array, index, paperSizes, 0, _array.Length);
System\Drawing\Printing\PrinterSettings.PaperSourceCollection.cs (3)
26public int Count => _array.Length; 41void ICollection.CopyTo(Array array, int index) => Array.Copy(_array, index, array, 0, _array.Length); 43public void CopyTo(PaperSource[] paperSources, int index) => Array.Copy(_array, index, paperSources, 0, _array.Length);
System\Drawing\Printing\PrinterSettings.PrinterResolutionCollection.cs (3)
23public int Count => _array.Length; 38void ICollection.CopyTo(Array array, int index) => Array.Copy(_array, index, array, 0, _array.Length); 40public void CopyTo(PrinterResolution[] printerResolutions, int index) => Array.Copy(_array, index, printerResolutions, 0, _array.Length);
System\Drawing\Region.cs (1)
50CheckStatus(PInvokeGdiPlus.GdipCreateRegionRgnData(data, rgnData.Data.Length, &region));
System\Drawing\StringFormat.cs (2)
134ranges.Length, 233tabStops.Length,
System\Drawing\SystemBrushes.cs (1)
74Debug.Assert(idx >= 0 && idx < systemBrushes.Length, "System colors have been added but our system color array has not been expanded.");
System\Drawing\SystemPens.cs (1)
74Debug.Assert(idx >= 0 && idx < systemPens.Length, "System colors have been added but our system color array has not been expanded.");
System\Drawing\Text\FontCollection.cs (1)
50Debug.Assert(gpFamilies.Length == numFound, "GDI+ can't give a straight answer about how many fonts there are");
System.Formats.Asn1 (11)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
System\Formats\Asn1\AsnCharacterStringEncodings.cs (5)
72new Span<byte>(bytes, byteIndex, bytes.Length - byteIndex), 107new Span<char>(chars, charIndex, chars.Length - charIndex), 189if (c >= isAllowed.Length) 222if ((uint)c >= (uint)_isAllowed.Length || !_isAllowed[c]) 250if ((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\Asn1\AsnWriter.cs (1)
400if (_buffer == null || _buffer.Length - _offset < pendingCount)
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.cs (1)
239int currentCapacity = _buffer.Length;
System.Formats.Nrbf (16)
System\Formats\Nrbf\ArrayRecord.cs (2)
119int[] indices = new int[lengths.Length]; 140int dimension = indices.Length - 1;
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (2)
51int[] indices = new int[_lengths.Length]; 59int dimension = indices.Length - 1;
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
67Debug.Assert(valueIndex == values.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (2)
205for (int i = 0; i < booleans.Length; i++) 231for (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\JaggedArrayRecord.cs (1)
49Array array = _lengths.Length switch
System\Formats\Nrbf\NrbfDecoder.cs (3)
73while (offset < buffer.Length) 75int read = stream.Read(buffer, offset, buffer.Length - offset); 350for (int i = 0; i < lengths.Length; i++)
System\Formats\Nrbf\SerializationRecord.cs (2)
126if (genericNames.Length != genericTypes.Length) 131for (int i = 0; i < genericTypes.Length; i++)
System\Formats\Nrbf\SZArrayOfRecords.cs (1)
72Debug.Assert(resultIndex == result.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\Utils\BinaryReaderExtensions.cs (1)
142if (result.Length != count)
System.Formats.Tar (19)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
53if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\runtime\src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
17if (buffer.Length < min) 19int newCapacity = buffer.Length * 2;
System\Formats\Tar\GnuSparseStream.cs (16)
81_packedStartOffsets = new long[segments.Length]; 84for (int i = 0; i < segments.Length; i++) 199long nextSegStart = ~segIdx < _segments.Length ? _segments[~segIdx].Offset : _realSize; 263long nextSegStart = ~segIdx < _segments.Length ? _segments[~segIdx].Offset : _realSize; 307for (int i = 0; i < _segments.Length; i++) 319int toRead = (int)Math.Min(segmentLength - written, buffer.Length); 355for (int i = 0; i < _segments.Length; i++) 367int toRead = (int)Math.Min(segmentLength - written, buffer.Length); 436if (_segments.Length == 0) 442if (_currentSegmentIndex >= _segments.Length) 444long lastEnd = _segments[_segments.Length - 1].Offset + _segments[_segments.Length - 1].Length; 448return ~_segments.Length; 451int result = BinarySearchSegment(virtualPosition, 0, _segments.Length - 1); 465while (_currentSegmentIndex < _segments.Length) 481return ~_segments.Length; // Past all segments.
System.IO.Compression (74)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
52Debug.Assert(buffer.Length > 0); 93public int AvailableLength => _bytes.Length - _availableStart; 98public int Capacity => _bytes.Length; 135if (_bytes.Length == 0) 161int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length)); 191if (_usePool && buffer.Length > 0)
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 (10)
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++) 250if (index >= array.Length)
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)
113Debug.Assert(outputBuffer?.Length > 0); 120_zlibStream.AvailOut = (uint)outputBuffer.Length; 123bytesRead = outputBuffer.Length - (int)_zlibStream.AvailOut; 133Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 145Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!");
System\IO\Compression\DeflateZLib\DeflateStream.cs (10)
327int n = _stream.Read(_buffer, 0, _buffer.Length); 341else if (n > _buffer.Length) 479int n = await _stream.ReadAsync(new Memory<byte>(_buffer, 0, _buffer.Length), cancellationToken).ConfigureAwait(false); 493else if (n > _buffer.Length) 950int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length); 963await _deflateStream._stream.CopyToAsync(this, _arrayPoolBuffer.Length, _cancellationToken).ConfigureAwait(false); 993int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length); 1006_deflateStream._stream.CopyTo(this, _arrayPoolBuffer.Length); 1034else if (count > buffer.Length - offset) 1083else if (count > buffer.Length - offset)
System\IO\Compression\DeflateZLib\Inflater.cs (1)
176Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length);
System\IO\Compression\ZipArchive.Async.cs (1)
466_archiveStream.Seek(ZipEndOfCentralDirectoryBlock.TotalSize + _archiveComment.Length, SeekOrigin.Current);
System\IO\Compression\ZipArchive.cs (1)
947_archiveStream.Seek(ZipEndOfCentralDirectoryBlock.TotalSize + _archiveComment.Length, SeekOrigin.Current);
System\IO\Compression\ZipArchiveEntry.Async.cs (3)
190if (_fileComment.Length > 0) 223for (int i = 0; i < _compressedBytes.Length - 1; i++) 227await _archive.ArchiveStream.ReadAtLeastAsync(_compressedBytes[_compressedBytes.Length - 1], (int)(_compressedSize % maxSingleBufferSize), throwOnEndOfStream: true, cancellationToken).ConfigureAwait(false);
System\IO\Compression\ZipArchiveEntry.cs (19)
152if (_storedEntryNameBytes.Length > ushort.MaxValue) 545Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 546Debug.Assert(_fileComment.Length <= ushort.MaxValue); 599int currExtraFieldDataLength = ZipGenericExtraField.TotalSize(_cdUnknownExtraFields, _cdTrailingExtraFieldData?.Length ?? 0); 616+ _storedEntryNameBytes.Length 619+ _fileComment.Length; 660BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.FilenameLength..], (ushort)_storedEntryNameBytes.Length); 662BinaryPrimitives.WriteUInt16LittleEndian(cdStaticHeader[ZipCentralDirectoryFileHeader.FieldLocations.FileCommentLength..], (ushort)_fileComment.Length); 686if (_fileComment.Length > 0) 714for (int i = 0; i < compressedBytes.Length - 1; i++) 718compressedBytes[compressedBytes.Length - 1] = new byte[_compressedSize % maxSingleBufferSize]; 736for (int i = 0; i < _compressedBytes.Length - 1; i++) 740_archive.ArchiveStream.ReadAtLeast(_compressedBytes[_compressedBytes.Length - 1], (int)(_compressedSize % maxSingleBufferSize), throwOnEndOfStream: true); 1073Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 1134int currExtraFieldDataLength = ZipGenericExtraField.TotalSize(_lhUnknownExtraFields, _lhTrailingExtraFieldData?.Length ?? 0); 1154_archive.ArchiveStream.Seek(ZipLocalFileHeader.SizeOfLocalHeader + _storedEntryNameBytes.Length, SeekOrigin.Current); 1202BinaryPrimitives.WriteUInt16LittleEndian(lfStaticHeader[ZipLocalFileHeader.FieldLocations.FilenameLength..], (ushort)_storedEntryNameBytes.Length); 1276_archive.ArchiveStream.Write(compressedBytes, 0, compressedBytes.Length); 1413+ _storedEntryNameBytes.Length + Zip64ExtraField.OffsetToFirstField,
System\IO\Compression\ZipBlocks.Async.cs (6)
63int bytesRead = await stream.ReadAtLeastAsync(blockContents, blockContents.Length, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false); 88int bytesRead = await stream.ReadAtLeastAsync(blockContents, blockContents.Length, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false); 151int bytesRead = await stream.ReadAtLeastAsync(blockBytes, blockBytes.Length, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false); 156bytesRead = await stream.ReadAtLeastAsync(blockBytes, blockBytes.Length, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false); 234if (archiveComment.Length > 0) 245int bytesRead = await stream.ReadAtLeastAsync(blockContents, blockContents.Length, throwOnEndOfStream: false, cancellationToken).ConfigureAwait(false);
System\IO\Compression\ZipBlocks.cs (3)
894Debug.Assert(archiveComment.Length <= ZipFileCommentMaxLength); 897BinaryPrimitives.WriteUInt16LittleEndian(blockContents[FieldLocations.ArchiveCommentLength..], (ushort)archiveComment.Length); 907if (archiveComment.Length > 0)
System\IO\Compression\ZipHelper.cs (1)
210if (maxBytes < bytes.Length)
System\IO\Compression\Zstandard\ZstandardDictionary.cs (2)
55SafeZstdCDictHandle compressionDict = Interop.Zstd.ZSTD_createCDict_byReference(dictPtr, (nuint)data.Length, quality); 63SafeZstdDDictHandle decompressionDict = Interop.Zstd.ZSTD_createDDict_byReference(dictPtr, (nuint)data.Length);
System.IO.Compression.Brotli (3)
System\IO\Compression\dec\BrotliStream.Decompress.cs (3)
69int bytesRead = _stream.Read(_buffer, _bufferCount, _buffer.Length - _bufferCount); 80if (_bufferCount > _buffer.Length) 177if (_bufferCount > _buffer.Length)
System.IO.Compression.ZipFile (2)
src\runtime\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)
381if (filters.Length == 0) 715ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)index, (uint)items.Length, nameof(index)); 726public int Count => Items.Length; 749string[] newItems = new string[items.Length + 1]; 765string[] newItems = new string[items.Length - 1];
System\IO\FileSystemWatcher.Linux.cs (6)
744if (lengthNeeded > buffer.Length) 840Debug.Assert(_buffer.Length > 0); 841Debug.Assert(_bufferAvailable >= 0 && _bufferAvailable <= _buffer.Length); 855_bufferAvailable = Interop.CheckIo(Interop.Sys.Read(_inotifyHandle, buf, this._buffer.Length)); 856Debug.Assert(_bufferAvailable <= this._buffer.Length); 907Debug.Assert(nameLength >= 0 && (position + nameLength) <= _buffer.Length);
System.IO.Hashing (3)
System\IO\Hashing\Crc32ParameterSet.Table.cs (2)
77Debug.Assert(lookupTable.Length == 256); 104Debug.Assert(lookupTable.Length == 256);
System\IO\Hashing\Crc64ParameterSet.Table.cs (1)
77Debug.Assert(lookupTable.Length == 256);
System.IO.IsolatedStorage (9)
src\runtime\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)
554int 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++) 1069for (int i = 0; i < partKeys.Length; i++)
System\IO\Packaging\PackUriHelper.cs (8)
797Debug.Assert(segments.Length > 0 && segments[0].Length == 0); 800Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension); 804if ((segments.Length >= 3) && 805(segments[segments.Length - 1].Length > RelationshipPartExtensionName.Length)) 808result = segments[segments.Length - 2] == RelationshipPartUpperCaseSegmentName; 813if (segments.Length > 3 && result) 815if ((segments[segments.Length - 1]).EndsWith(RelsrelsUpperCaseExtension, StringComparison.Ordinal)) 818if (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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
53if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
System.IO.Ports (26)
System\IO\Ports\SerialPort.cs (25)
668if (buffer.Length - offset < count) 809if (buffer.Length - offset < count) 821Debug.Assert(buffer.Length - offset >= count, "invalid offset/count!"); 951Debug.Assert((buffer.Length - offset - totalCharsFound) >= currentCharsFound, "internal buffer to read one full unicode char sequence is not sufficient!"); 1004_internalSerialStream.ReadExactly(bytesReceived, CachedBytesToRead, bytesReceived.Length - CachedBytesToRead); // get everything 1026int numCharsReceived = localDecoder.GetCharCount(bytesReceived, 0, bytesReceived.Length); 1027int lastFullCharIndex = bytesReceived.Length; 1031Buffer.BlockCopy(bytesReceived, 0, _inBuffer, 0, bytesReceived.Length); // put it all back! 1034_readLen = bytesReceived.Length; 1045_readLen = bytesReceived.Length - (lastFullCharIndex + 1); 1047Buffer.BlockCopy(bytesReceived, lastFullCharIndex + 1, _inBuffer, 0, bytesReceived.Length - (lastFullCharIndex + 1)); 1146if (readBuffer.Length > 0) 1157MaybeResizeBuffer(readBuffer.Length + bytesToSave); 1159Buffer.BlockCopy(readBuffer, 0, _inBuffer, _readLen, readBuffer.Length); 1160_readLen += readBuffer.Length; 1185_internalSerialStream.Write(bytesToWrite, 0, bytesToWrite.Length, _writeTimeout); 1200if (buffer.Length - offset < count) 1203if (buffer.Length == 0) return; 1206Write(byteArray, 0, byteArray.Length); 1220if (buffer.Length - offset < count) 1222if (buffer.Length == 0) return; 1321if (additionalByteLength + _readLen <= _inBuffer.Length) 1325if (CachedBytesToRead + additionalByteLength <= _inBuffer.Length / 2) 1330int newLength = Math.Max(CachedBytesToRead + additionalByteLength, _inBuffer.Length * 2); 1332Debug.Assert(_inBuffer.Length >= _readLen, "ResizeBuffer - readLen > inBuffer.Length");
System\IO\Ports\SerialStream.cs (1)
99if (array.Length - offset < count)
System.Linq (85)
System\Linq\AppendPrepend.SpeedOpt.cs (1)
251index = 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); 240int 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)
17return array.Length == 0 ? [_default] : array;
System\Linq\Enumerable.cs (1)
29source 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); 130Debug.Assert(_map.Length == _buffer.Length); 134if ((uint)i < (uint)map.Length) 144if (buffer.Length != 0) 205if ((uint)i < (uint)buffer.Length) 215if (buffer.Length != 0) 403for (int i = 0; i < keys.Length; i++) 514while (i < map.Length && CompareKeys(x, map[i]) > 0) 584while (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); 218if (minIdx < buffer.Length) 221return (maxIdx < buffer.Length - 1) ? 222GetEnumerableSorter().ElementAt(buffer, buffer.Length, maxIdx) : 240for (int i = 1; i < items.Length; ++i) 482int count = buffer.Length;
System\Linq\Reverse.cs (2)
45if (source.Length == 0) 91_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)
54if (array.Length == 0) 182Debug.Assert(source.Length > 0); // Caller should check this beforehand and return a cached result 187private int CountForDebugger => _source.Length; 195if ((uint)index < (uint)source.Length)
System\Linq\Select.SizeOpt.cs (1)
90for (int i = 0; i < array.Length; i++)
System\Linq\Select.SpeedOpt.cs (11)
145Debug.Assert(source.Length > 0); 147var results = new TResult[source.Length]; 156Debug.Assert(source.Length > 0); 158var results = new List<TResult>(source.Length); 159Fill(source, SetCountAndGetSpan(results, source.Length), _selector); 185return _source.Length; 191if (count >= _source.Length) 202return count >= _source.Length ? 210if ((uint)index < (uint)source.Length) 222Debug.Assert(_source.Length > 0); // See assert in constructor 230Debug.Assert(_source.Length > 0); // See assert in constructor
System\Linq\Shuffle.cs (2)
55if ((uint)i < (uint)buffer.Length) 65if (buffer.Length != 0)
System\Linq\Where.cs (5)
37if (array.Length == 0) 166Debug.Assert(source is not null && source.Length > 0); 180while ((uint)index < (uint)source.Length) 269Debug.Assert(source is not null && source.Length > 0); 285while ((uint)index < (uint)source.Length)
System\Linq\Where.SpeedOpt.cs (1)
260for (int i = source.Length - 1; i >= 0; i--)
System.Linq.AsyncEnumerable (23)
System\Linq\Append.cs (1)
226if (_appendedIndex < _appendedArray!.Length)
System\Linq\Chunk.cs (6)
60if (size != array.Length) 65if (i >= array.Length) 67arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 79Debug.Assert(local.Length == size); 80for (; (uint)i < (uint)local.Length && await e.MoveNextAsync(); i++) 86if (i != array.Length)
System\Linq\GroupBy.cs (2)
407if (_elements.Length == _count) 418if (_elements.Length != _count)
System\Linq\OrderBy.cs (6)
206GetEnumerableSorter().SortAsync(buffer, buffer.Length, cancellationToken); 260if (buffer.Length > 0) 263for (int i = 0; i < map.Length; i++) 289for (int i = 0; i < map.Length; i++) 335for (int i = 0; i < keys.Length; i++) 343for (int i = 0; i < keys.Length; i++)
System\Linq\Reverse.cs (1)
31for (int i = array.Length - 1; i >= 0; i--)
System\Linq\Shuffle.cs (1)
54for (int i = 0; i < array.Length; i++)
System\Linq\ToAsyncEnumerable.cs (2)
27TSource[] array => array.Length == 0 ? Empty<TSource>() : FromArray(array), 40if ((uint)localI >= (uint)localSource.Length)
System\Linq\ToLookupAsync.cs (4)
241if ((uint)arrayIndex > (uint)array.Length) 351for (Grouping<TKey, TElement>? g = _groupings[(uint)hashCode % _groupings.Length]; g is not null; g = g._hashNext) 361if (_count == _groupings.Length) 366int index = hashCode % _groupings.Length;
System.Linq.Expressions (301)
src\runtime\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)
103if (parameters.Length > 2) 122int thunkTypeArgCount = parameters.Length; 127for (int i = 0; i < parameters.Length; i++) 136thunkTypeArgs[thunkTypeArgs.Length - 1] = returnType; 137uninstantiatedMethod = s_FuncThunks[parameters.Length]; 141uninstantiatedMethod = s_ActionThunks[parameters.Length]; 144return (thunkTypeArgs.Length > 0) ? 207Type[] paramTypes = new Type[parameters.Length + 1]; 219for (int i = 0; i < parameters.Length; i++) 234if (parameters.Length == 0) 240ilgen.Emit(OpCodes.Ldc_I4, parameters.Length); 247for (int i = 0; i < parameters.Length; i++) 288for (int i = 0; i < parameters.Length; i++)
System\Dynamic\Utils\ExpressionUtils.cs (2)
109for (int i = 0, n = pis.Length; i < n; i++) 133if (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)
63var @params = new ParameterExpression[pis.Length - 1]; 64for (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)
79for (int i = buckets[(uint)hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) 98if (count == slots.Length) Resize(); 103int 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.Management (36)
System\Management\ManagementObject.cs (2)
2682if ((null != args) && (0 < args.Length)) 2766if ((null != args) && (0 < args.Length))
System\Management\ManagementObjectCollection.cs (1)
214int capacity = array.Length - index;
System\Management\ManagementOperationWatcher.cs (1)
244result = ((Progress.GetInvocationList()).Length > 0);
System\Management\Property.cs (10)
284int length = wmiValueArray.Length; 376int length = valArray.Length; 610int length = arrayValue.Length; 620int length = arrayValue.Length; 635int length = arrayValue.Length; 655int length = arrayValue.Length; 665int length = arrayValue.Length; 675int length = arrayValue.Length; 695int length = arrayValue.Length; 717int length = valArray.Length;
System\Management\PropertySet.cs (6)
94return propertyNames.Length; 153if ((index + nameArray.Length) > array.Length) 289if ((index == -1) || (index == propertyNames.Length)) 306if (index == propertyNames.Length) //passed the end of the array 310return (index == propertyNames.Length) ? false : true;
System\Management\Qualifier.cs (1)
104int length = valArray.Length;
System\Management\QualifierSet.cs (6)
143return qualifierNames.Length; 211if ((index + qualifierNames.Length) > array.Length) 362if ((index == -1) || (index == qualifierNames.Length)) 380if (index == qualifierNames.Length) //passed the end of the array 384return (index == qualifierNames.Length) ? false : true;
System\Management\WMIGenerator.cs (9)
557if (arrString.Length >= 2 && arrString[0] == '\\' && arrString[1] == '\\') 1126for (i = 0; i < strPropTemp.Length; i++) 1133if (i == strPropTemp.Length) 1137strPropName = new char[strPropTemp.Length - i]; 1138for (int j = i; j < strPropTemp.Length; j++) 1647for (int i = 0; i < strArray.Length; i++) 1683for (int i = 0; i < strArray.Length; i++) 1715for (int i = 0; i < strArray.Length; i++) 1745for (int i = 0; i < strArray.Length; i++)
System.Memory (12)
src\runtime\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 (124)
src\runtime\src\libraries\Common\src\System\CharArrayHelpers.cs (2)
16Debug.Assert(startIndex <= array.Length - length, $"Expected {startIndex} to be <= {array.Length} - {length}, got {startIndex}");
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
52Debug.Assert(buffer.Length > 0); 93public int AvailableLength => _bytes.Length - _availableStart; 98public int Capacity => _bytes.Length; 135if (_bytes.Length == 0) 161int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length)); 191if (_usePool && buffer.Length > 0)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs (6)
46index += _buffer.Length; 73if (_count == _buffer.Length) 79int newBufferSize = Math.Min(Math.Max(16, _buffer.Length * 2), maxCapacity); 84int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 98if (++_insertIndex == _buffer.Length) 128if (++_removeIndex == _buffer.Length)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (5)
571_headerNameLength = _headerName.Length; 578if (length > _stringOctets.Length) 585_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 638if (dst.Length < stringLength) 640dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\runtime\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\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.Http3.cs (1)
34public static int Count => s_staticTable.Length;
src\runtime\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\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (1)
680else if (buffer.Length < requiredLength)
src\runtime\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\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
src\runtime\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\runtime\src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (1)
43Debug.Assert(properties.Length == 15);
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)
75Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError."); 106return (uint)value < (uint)boxes.Length 118return (uint)index < (uint)strings.Length
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (1)
475output = encoding.GetString(bytes, 0, bytes.Length);
System\Net\Http\Headers\HeaderDescriptor.cs (3)
110Debug.Assert(qpackStaticTable.Length == 99); 114if (uindex < (uint)qpackStaticTable.Length) 146for (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\HttpHeaders.cs (16)
353Debug.Assert(multiValue is not null && multiValue.Length > 0); 355for (int i = 1; i < multiValue.Length; i++) 650if (_headerStore is not HeaderEntry[] entries || entries.Length < _count) 652entries = new HeaderEntry[sourceEntries.Length]; 656for (int i = 0; i < _count && i < sourceEntries.Length; i++) 1268if (values.Length == 0) 1282if (values.Length < length) 1500for (int i = 0; i < _count && i < entries.Length; i++) 1522for (int i = 0; i < _count && i < entries.Length; i++) 1532if ((uint)count < (uint)entries.Length) 1556if (entries.Length == ArrayThreshold) 1562Array.Resize(ref entries, entries.Length << 1); 1564ref HeaderEntry firstNewEntry = ref entries[entries.Length >> 1]; 1602if ((uint)count < (uint)entries.Length) 1638for (int i = 0; i < _count && i < entries.Length; i++) 1642while (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)
30asciiBytesWithColonSpace[asciiBytesWithColonSpace.Length - 2] = (byte)':'; 31asciiBytesWithColonSpace[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 (13)
731return preamble is not null && data.StartsWith(preamble) ? preamble.Length : 0; 858if (!_lastBufferIsPooled && _totalLength == _lastBuffer.Length) 895Debug.Assert(_lastBufferOffset <= _lastBuffer.Length); 910_lastBufferOffset = newBuffer.Length; 924if (lastBuffer.Length - offset >= buffer.Length) 940int lastBufferCapacity = _lastBuffer.Length; 998Debug.Assert(_shouldPoolFinalSize || newBuffer.Length != _expectedFinalSize); 1032while (bufferCount < buffers.Length && buffers[bufferCount] is not null) 1037if (bufferCount == buffers.Length) 1059Debug.Assert(buffers.Length > 0 && buffers[0] is not null); 1068Debug.Assert(destination.Length >= buffer.Length); 1071destination = destination.Slice(buffer.Length); 1075Debug.Assert(_lastBufferOffset <= _lastBuffer.Length);
System\Net\Http\MultipartContent.cs (12)
351long currentLength = _startBoundaryBytes.Length; 356currentLength += (_nestedContent.Count - 1) * (CrLfBytes.Length + _startBoundaryBytes.Length); 380currentLength += CrLfBytes.Length; 383currentLength += CrLfBytes.Length; 395currentLength += _endBoundaryBytes.Length; 465if (_next >= _streams.Length) 501if (_next >= _streams.Length) 546if (_next >= _streams.Length) 563for (int i = 0; i < _streams.Length; i++) 575for (; i < _streams.Length; i++) 588_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\DecompressionHandler.cs (2)
103Debug.Assert(contentEncodings is string[] { Length: > 0 }); 156if (contentEncodings.Length > 1)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
1986Debug.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)
261if (addresses.Length == 0)
System.Net.Http.WinHttpHandler (14)
src\runtime\src\libraries\Common\src\System\CharArrayHelpers.cs (2)
16Debug.Assert(startIndex <= array.Length - length, $"Expected {startIndex} to be <= {array.Length} - {length}, got {startIndex}");
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
System\Net\Http\WinHttpRequestStream.cs (4)
112if (count > buffer.Length - offset) 169await InternalWriteDataAsync(s_endChunk, 0, s_endChunk.Length).ConfigureAwait(false); 214await InternalWriteDataAsync(chunkSize, 0, chunkSize.Length).ConfigureAwait(false); 217await InternalWriteDataAsync(s_crLfTerminator, 0, s_crLfTerminator.Length).ConfigureAwait(false);
System\Net\Http\WinHttpResponseParser.cs (4)
113Debug.Assert(buffer == null || (buffer != null && buffer.Length > StackLimit)); 130bufferLength = buffer.Length; 178Debug.Assert(buffer.Length > 0, "buffer must not be empty."); 180int bufferLength = buffer.Length;
System\Net\Http\WinHttpResponseStream.cs (2)
141if (!Interop.WinHttp.WinHttpReadData(_requestHandle, Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0), (uint)Math.Min(bytesAvailable, buffer.Length), IntPtr.Zero)) 186if (count > buffer.Length - offset)
System.Net.HttpListener (43)
src\runtime\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\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\runtime\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 (31)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (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)
99if (_storedBuffer == null || _storedBuffer.Length < count) 114else 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)
425for (int j = 0; j < values.Length; j++)
System\Net\Mail\SmtpCommands.cs (5)
56if (lines == null || lines.Length == 0) 60System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command"); 180if (lines == null || lines.Length == 0) 193string[] extensions = new string[lines.Length - 1]; 194for (int i = 1; i < lines.Length; i++)
System\Net\Mail\SmtpConnection.cs (1)
195for (int i = 0; i < _authenticationModules.Length; i++)
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 (1)
323return lines.Length > 0 ? lines[0] : default;
System\Net\Mime\MimeBasePart.cs (1)
69if ((subStrings.Length != 5 || subStrings[0] != "=" || subStrings[4] != "="))
System\Net\Mime\QuotedPrintableStream.cs (5)
214if (WriteState.Buffer.Length - WriteState.Length < SizeOfSoftCRLF) 229if (WriteState.Buffer.Length - WriteState.Length < (_encodeCRLF ? SizeOfEncodedCRLF : SizeOfNonEncodedCRLF)) 250if (WriteState.Buffer.Length - WriteState.Length < SizeOfSoftCRLF) 264if (WriteState.Buffer.Length - WriteState.Length < 1) 273if (WriteState.Buffer.Length - WriteState.Length < SizeOfEncodedChar)
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 (12)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
System\Net\Dns.cs (7)
54if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries"); 90if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostNameOrAddress, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries"); 130NetEventSource.Info(hostNameOrAddress, $"{t.Result} with {t.Result.AddressList.Length} entries"); 168if (NetEventSource.Log.IsEnabled()) NetEventSource.Info((IPAddress)s, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries"); 529else if (addresses.Length == 0 && IsLocalhostSubdomain(hostName)) 805if (isLocalhostSubdomain && result is IPAddress[] addresses && addresses.Length == 0) 814if (isLocalhostSubdomain && result is IPHostEntry entry && entry.AddressList.Length == 0)
System\Net\NameResolutionPal.Unix.cs (1)
115for (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 (27)
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)
40totalLength = 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 (16)
src\runtime\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\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
src\runtime\src\libraries\Common\src\System\Net\SocketAddress.cs (1)
42ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _buffer.Length);
System\Net\Cookie.cs (2)
519int[] parsedPorts = new int[ports.Length]; 521for (int i = 0; i < ports.Length; ++i)
System\Net\CookieContainer.cs (2)
405for (int i = 0; i < cookies.Length; ++i) 581for (int i = 0; i < s_headerInfo.Length; ++i)
System\Net\IPAddress.cs (7)
166Debug.Assert(numbers.Length == NumberOfLabels); 211for (int i = 0; i < numbers.Length; i++) 354Debug.Assert(numbers is { Length: NumberOfLabels }); 366for (int i = 0; i < numbers.Length; i++) 394Debug.Assert(_numbers is { Length: NumberOfLabels }); 702Debug.Assert(_numbers.Length == IPAddressParserStatics.IPv6AddressShorts); 703Debug.Assert(comparand._numbers!.Length == IPAddressParserStatics.IPv6AddressShorts);
System.Net.Quic (25)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
81bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (2)
186int ret = method(handle, bytes, bytes.Length); 214int ret = method(handle, bytes, bytes.Length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
40ErrErrorStringN(error, buf, buffer.Length);
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
52Debug.Assert(buffer.Length > 0); 93public int AvailableLength => _bytes.Length - _availableStart; 98public int Capacity => _bytes.Length; 135if (_bytes.Length == 0) 161int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length)); 191if (_usePool && buffer.Length > 0)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
src\runtime\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\runtime\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)
276Asn1BlobLength = (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)
399if (addresses.Length == 0)
System.Net.Requests (19)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (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 (74)
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
81bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (2)
186int ret = method(handle, bytes, bytes.Length); 214int ret = method(handle, bytes, bytes.Length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
40ErrErrorStringN(error, buf, buffer.Length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (4)
247Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0)); 653if (buffer.Length < size) 659buffer = ArrayPool<byte>.Shared.Rent(buffer.Length * 2);
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
52Debug.Assert(buffer.Length > 0); 93public int AvailableLength => _bytes.Length - _availableStart; 98public int Capacity => _bytes.Length; 135if (_bytes.Length == 0) 161int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length)); 191if (_usePool && buffer.Length > 0)
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
78ReportDownloadStop(ret?.Length ?? 0);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
43hostNameMatch = Interop.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\runtime\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)
609if (targetInfoOffset == targetInfoBuffer.Length) 689targetInfoBuffer.Length + 692s_workstation.Length + 726Debug.Assert(payloadOffset == sizeof(AuthenticateMessage) + ChallengeResponseLength + sizeof(NtChallengeResponse) + targetInfoBuffer.Length); 773Debug.Assert(payloadOffset == responseBytes.Length);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (2)
321if (blob?.Length > 0) 332if (response?.Length > 0)
System\Net\NegotiateAuthenticationPal.Unix.cs (3)
308_tokenBuffer.Length == resultBlobLength ? _tokenBuffer : 633resultBlobLength = resultBlob?.Length ?? 0; 709resultBlobLength = resultBlob.Length;
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (6)
95policy.Pal._tls13CipherSuites.Length != 0 && 96policy.Pal._tls13CipherSuites[policy.Pal._tls13CipherSuites.Length - 1] == 0, 100return policy.Pal._tls13CipherSuites.Length == 1; 112policy.Pal._cipherSuites.Length != 0 && 113policy.Pal._cipherSuites[policy.Pal._cipherSuites.Length - 1] == 0, 117return policy.Pal._cipherSuites.Length == 1;
System\Net\Security\NegotiateAuthentication.cs (1)
275if (decodedOutgoingBlob != null && decodedOutgoingBlob.Length > 0)
System\Net\Security\NegotiateStream.cs (3)
384if (_readBuffer.Length < readBytes) 882if (message.Length >= sizeof(long)) 894if (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 (3)
87thumbPrint.Length == otherThumbPrint.Length && 222for (int i = 0; i < toRemoveAttempt.Length; ++i)
System\Net\Security\SslStream.cs (1)
840public void Write(byte[] buffer) => Write(buffer, 0, buffer.Length);
System\Net\Security\SslStream.IO.cs (1)
308Debug.Assert(consumed == (reAuthenticationData?.Length ?? 0));
System\Net\Security\SslStream.Protocol.cs (4)
370if (issuers == null || issuers.Length == 0) 376NetEventSource.Log.LookForMatchingCerts(issuers.Length, this); 386if (issuers != null && issuers.Length != 0) 1501internal int Available => Payload == null ? 0 : Payload.Length - Size;
System\Net\Security\SslStreamCertificateContext.Linux.cs (6)
272X509Certificate2? caCert = _privateIntermediateCertificates.Length > 0 ? _privateIntermediateCertificates[0] : _rootCertificate; 292IntPtr[] issuerHandles = ArrayPool<IntPtr>.Shared.Rent(_privateIntermediateCertificates.Length + 1); 293for (int i = 0; i < _privateIntermediateCertificates.Length; i++) 297issuerHandles[_privateIntermediateCertificates.Length] = _rootCertificate.Handle; 324if (!Interop.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration)) 346NetEventSource.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 (13)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
52Debug.Assert(buffer.Length > 0); 93public int AvailableLength => _bytes.Length - _availableStart; 98public int Capacity => _bytes.Length; 135if (_bytes.Length == 0) 161int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length)); 191if (_usePool && buffer.Length > 0)
System\Net\ServerSentEvents\SseParser_1.cs (7)
271Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}"); 296if (_lineOffset + _lineLength == _lineBuffer.Length) 307else if (_lineLength == _lineBuffer.Length) 312newLength = checked(_lineBuffer.Length * 2); 413if (_dataBuffer is null || newLength > _dataBuffer.Length) 568Array.Copy(toReturn, buffer, toReturn.Length);
System.Net.Sockets (47)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\runtime\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)
67this(buffer, 0, (buffer != null ? buffer.Length : 0), false) 78ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 79ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)count, (uint)(buffer.Length - offset), nameof(count));
System\Net\Sockets\Socket.cs (10)
938if (addresses.Length == 0) 1108return Send(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags); 1115return Send(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None); 1398return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, remoteEP); 1405return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, remoteEP); 1517return Receive(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags); 1524return Receive(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None); 1904return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, ref remoteEP); 1911return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, ref remoteEP); 2231int optionLength = optionValue != null ? optionValue.Length : 0;
System\Net\Sockets\Socket.Tasks.cs (6)
145if (addresses.Length == 0) 763SendPacketsElement[] sendPacketsElements = saea.SendPacketsElements?.Length == packetsCount 794ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 795ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)size, (uint)(buffer.Length - offset), nameof(size)); 802if ((uint)buffer.Offset > (uint)buffer.Array.Length) 806if ((uint)buffer.Count > (uint)(buffer.Array.Length - buffer.Offset))
System\Net\Sockets\SocketAsyncEngine.Unix.cs (3)
112int engineIndex = Math.Abs(Interlocked.Increment(ref s_allocateFromEngine) % s_engines.Length); 127int previousLength = s_registeredContexts.Length; 331Debug.Assert((uint)socketEvent.Data < (uint)s_registeredContexts.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)); 599if (_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)
325ArgumentOutOfRangeException.ThrowIfGreaterThan(bytes, datagram.Length); 348for (; i < addresses.Length && !IsAddressFamilyCompatible(addresses[i].AddressFamily); i++) 352if (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\runtime\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)
222for (int i = 0; i < values.Length; i++) 239valueList.RemoveRange(i, values.Length - i);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
339for (int i = 0; i < regexBypassList.Length; i++)
System.Net.WebSockets (13)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
131return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 175for (int i = 0; i < formattedArgs.Length; i++)
src\runtime\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)
715Debug.Assert(sendBuffer.Length >= MaxMessageHeaderLength, $"Expected {nameof(sendBuffer)} to be at least {MaxMessageHeaderLength}, got {sendBuffer.Length}"); 1671Debug.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 (4)
src\runtime\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.Numerics.Tensors (13)
System\Numerics\Tensors\netcore\Tensor.cs (8)
1427strides = new nint[newLengths.Length]; 1434for (int i = 0; i < newLengths.Length; i++) 1500strides = new nint[newLengths.Length]; 1507for (int i = 0; i < newLengths.Length; i++) 1577strides = new nint[newLengths.Length]; 1584for (int i = 0; i < newLengths.Length; i++) 1623ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref tensor.AsTensorSpan()._reference, tensor._start), tensor._values.Length - tensor._start); 1897for (int i = 0; i < outputs.Length; i++)
System\Numerics\Tensors\netcore\TensorShape.cs (5)
339int rank = metadata.Length / InlineBufferCount; 358int rank = metadata.Length / InlineBufferCount; 855int linearLength = array.Length; 881return new TensorShape(array.Length, lengths, strides, TensorFlags.None); 895int linearLength = array.Length;
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 (1648)
Internal\Reflection\Augments\ReflectionAugments.cs (3)
403if (flds.Length == 0) 408for (int i = 0; i < flds.Length; i++) 422if (i < (flds.Length - 1) && !fieldType.IsValueType)
Internal\Reflection\Core\Execution\ExecutionDomain.cs (4)
78RuntimeTypeInfo[] genericTypeArguments = new RuntimeTypeInfo[genericMethodTypeArgumentHandles.Length]; 79for (int i = 0; i < genericMethodTypeArgumentHandles.Length; i++) 162for (int i = 0; i < genericTypeArguments.Length; i++) 186for (int i = 0; i < parameterTypes.Length; i++)
Internal\Reflection\Core\Execution\ExecutionEnvironment.cs (3)
99for (int i = 0; i < genericMethodTypeArguments.Length; i++) 106RuntimeTypeHandle[] genericMethodTypeArgumentHandles = new RuntimeTypeHandle[genericMethodTypeArguments.Length]; 108for (int i = 0; i < genericMethodTypeArguments.Length; i++)
Internal\Runtime\Augments\RuntimeAugments.cs (8)
116Debug.Assert(lowerBounds == null || lowerBounds.Length == lengths.Length); 127if (lengths.Length == 1) 136int* pImmutableLengths = stackalloc int[lengths.Length]; 137for (int i = 0; i < lengths.Length; i++) 140return Array.NewMultiDimArray(typeHandleForArrayType.ToMethodTable(), pImmutableLengths, lengths.Length); 506for (int i = 0; i < genericTypeArgumentHandles.Length; i++) 581for (int i = 0; i < result.Length; i++)
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (1)
119return (byte*)CoTaskMemAllocAndZeroMemory(checked((chArray.Length + 2) * Marshal.SystemMaxDBCSCharSize));
Internal\Runtime\CompilerHelpers\ReachabilityInstrumentationSupport.cs (1)
28&& bytes.Length == size)
Internal\Runtime\CompilerHelpers\StartupCode\StartupCodeHelpers.Extensions.cs (3)
50Debug.Assert(args.Length > 0); 52string[] mainArgs = new string[args.Length - 1]; 53Array.Copy(args, 1, mainArgs, 0, mainArgs.Length);
Internal\Runtime\ThreadStatics.cs (5)
60if (perThreadStorage != null && perThreadStorage.Length > moduleIndex) 63if (perModuleStorage != null && perModuleStorage.Length > typeTlsIndex) 90else if (moduleIndex >= threadStorage.Length) 101else if (typeTlsIndex >= moduleStorage.Length) 105int newSize = Math.Max(typeTlsIndex + 1, moduleStorage.Length * 2);
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\CompilerHelpers\StartupCodeHelpers.cs (7)
37for (int i = 0; i < modules.Length; i++) 47s_moduleCount = modules.Length; 51for (int i = 0; i < modules.Length; i++) 65int copyLimit = (s_moduleCount < outputModules.Length ? s_moduleCount : outputModules.Length); 140Debug.Assert((uint)moduleIndex < (uint)gcStaticBaseSpines.Length); 231Debug.Assert(currentBase < spine.Length);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifier.cs (9)
156int bucket = ComputeBucket(hashCode, _buckets.Length); 176int bucket = ComputeBucket(hashCode, _buckets.Length); 198return _nextFreeEntry != _entries.Length; 206int newSize = HashHelpers.GetPrime(_buckets.Length * 2); 208newSize = _buckets.Length + 3; 222for (int bucket = 0; bucket < _buckets.Length; bucket++) 261Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 263for (int bucket = 0; bucket < _buckets.Length; bucket++) 275int storedBucket = ComputeBucket(_entries[walk1]._hashCode, _buckets.Length);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierW.cs (13)
183int bucket = ComputeBucket(hashCode, _buckets.Length); 206int bucket = ComputeBucket(hashCode, _buckets.Length); 255return _nextFreeEntry != _entries.Length; 266for (int bucket = 0; bucket < _buckets.Length; bucket++) 276double estimatedLivePercentage = ((double)estimatedNumLiveEntries) / ((double)(_entries.Length)); 278if (estimatedLivePercentage < _growThreshold && (_entries.Length - estimatedNumLiveEntries) > _initialCapacity) 280newSize = _buckets.Length; 284newSize = HashHelpers.GetPrime(_buckets.Length * 2); 286newSize = _buckets.Length + 3; 300for (int bucket = 0; bucket < _buckets.Length; bucket++) 345Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 347for (int bucket = 0; bucket < _buckets.Length; bucket++) 360int storedBucket = ComputeBucket(_entries[walk1]._hashCode, _buckets.Length);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierWKeyed.cs (13)
192int bucket = ComputeBucket(hashCode, _buckets.Length); 217int bucket = ComputeBucket(hashCode, _buckets.Length); 237return _nextFreeEntry != _entries.Length; 248for (int bucket = 0; bucket < _buckets.Length; bucket++) 258double estimatedLivePercentage = ((double)estimatedNumLiveEntries) / ((double)(_entries.Length)); 260if (estimatedLivePercentage < _growThreshold && (_entries.Length - estimatedNumLiveEntries) > _initialCapacity) 262newSize = _buckets.Length; 266newSize = HashHelpers.GetPrime(_buckets.Length * 2); 268newSize = _buckets.Length + 3; 282for (int bucket = 0; bucket < _buckets.Length; bucket++) 326Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 328for (int bucket = 0; bucket < _buckets.Length; bucket++) 347int storedBucket = ComputeBucket(_entries[walk1]._hashCode, _buckets.Length);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Generic\LowLevelDictionary.cs (8)
165if (_numEntries > (_buckets.Length * 2)) 176int newNumBuckets = _buckets.Length * 2 + 1; 178for (int i = 0; i < _buckets.Length; i++) 203return (h % (numBuckets == 0 ? _buckets.Length : numBuckets)); 225for (int bucket = 0; bucket < _dict._buckets.Length; bucket++) 244if (_curPosition == -1 || _curPosition == _entries.Length) 259if (_curPosition != _entries.Length) 261bool anyMore = (_curPosition != _entries.Length);
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\RuntimeExports.cs (1)
298return RhpGetCurrentThreadStackTrace(pOutputBuffer, (uint)((outputBuffer != null) ? outputBuffer.Length : 0), new UIntPtr(&pOutputBuffer));
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\TypeCast.cs (2)
760if ((nuint)index >= (uint)array.Length) 791if ((nuint)index >= (uint)array.Length)
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.CoreCLR.cs (3)
447if (index > buffer.Length || state.Continuation == null) 452byte maxAsyncCallstackFrames = (byte)Math.Min(byte.MaxValue, (buffer.Length - index) / MaxAsyncMethodFrameSize); 533eventBuffer.Data.Length);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeHashingAlgorithms.cs (1)
80for (int i = 0; i < parameters.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtable.cs (11)
185Debug.Assert(hashTableLocal.Length > 0); 187int mask = hashTableLocal.Length - 1; 273int newSize = checked(oldHashtable.Length * 2); 290int mask = newHashTable.Length - 1; 293for (int iEntry = 0; iEntry < oldHashtable.Length; iEntry++) 440int mask = hashTableLocal.Length - 1; 472if (Interlocked.Increment(ref _reserve) >= hashTableLocal.Length - 1) 607Debug.Assert(hashTableLocal.Length > 0); 609int mask = hashTableLocal.Length - 1; 694for (; _index < _hashtableContentsToEnumerate.Length; _index++) 704if (_index == _hashtableContentsToEnumerate.Length)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtableOfPointers.cs (11)
172Debug.Assert(hashTableLocal.Length > 0); 173int mask = hashTableLocal.Length - 1; 244int newSize = checked(oldHashtable.Length * 2); 254int mask = newHashTable.Length - 1; 255for (int iEntry = 0; iEntry < _hashtable.Length; iEntry++) 387int mask = hashTableLocal.Length - 1; 423if (Interlocked.Increment(ref _reserve) >= hashTableLocal.Length - 1) 543Debug.Assert(hashTableLocal.Length > 0); 544int mask = hashTableLocal.Length - 1; 615if ((_hashtableContentsToEnumerate != null) && (_index < _hashtableContentsToEnumerate.Length)) 617for (; _index < _hashtableContentsToEnumerate.Length; _index++)
src\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs (1)
36result = GetCwdHelper(ptr, buf.Length);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
53if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
28if (capacity > version.Length)
src\runtime\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\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
65if (count == arr.Length)
src\runtime\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\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (3)
71if (pkt.Length > PUBLIC_KEY_TOKEN_LEN) 81if (keyOrToken.Length == 0) 87HexConverter.EncodeToUtf16(keyOrToken, vsb.AppendSpan(keyOrToken.Length * 2), HexConverter.Casing.Lower);
src\runtime\src\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (1)
157for (int i = 80; i < _w.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\Internal\Console.Unix.cs (2)
18Interop.Sys.Log(pBytes, bytes.Length); 30Interop.Sys.LogError(pBytes, bytes.Length);
src\runtime\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++) 267for (int i = 0; i < _innerExceptions.Length; i++) 343if (_innerExceptions.Length == 0) 351for (int i = 0; i < _innerExceptions.Length; i++) 371for (int i = 0; i < _innerExceptions.Length; i++) 395internal int InnerExceptionCount => _innerExceptions.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\ApplicationId.cs (1)
57HexConverter.EncodeToUtf16(_publicKeyToken, sb.AppendSpan(2 * _publicKeyToken.Length), HexConverter.Casing.Upper);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (106)
37return array.Length == 0 ? 54if (larray.Length != newSize) 66(uint)Math.Min(newSize, larray.Length)); 125if (lengths.Length == 0) 136for (int i = 0; i < lengths.Length; i++) 141return InternalCreate(t, lengths.Length, pLengths, null); 151if (lengths.Length != lowerBounds.Length) 153if (lengths.Length == 0) 164for (int i = 0; i < lengths.Length; i++) 170return InternalCreate(t, lengths.Length, pLengths, pLowerBounds); 178int[] intLengths = new int[lengths.Length]; 180for (int i = 0; i < lengths.Length; ++i) 255if (t.GetArrayRank() != lengths.Length) 262for (int i = 0; i < lengths.Length; i++) 267return InternalCreateFromArrayType(t, lengths.Length, pLengths, null); 301if (lengths.Length != lowerBounds.Length) 311if (t.GetArrayRank() != lengths.Length) 321for (int i = 0; i < lengths.Length; i++) 327return InternalCreateFromArrayType(t, lengths.Length, pLengths, pLowerBounds); 773return Length; 786return Length - 1; 818if (Rank != indices.Length) 876if (Rank != indices.Length) 924if (Rank != indices.Length) 927int[] intIndices = new int[indices.Length]; 929for (int i = 0; i < indices.Length; ++i) 984if (Rank != indices.Length) 987int[] intIndices = new int[indices.Length]; 989for (int i = 0; i < indices.Length; ++i) 1016int ICollection.Count => Length; 1092if (o == null || this.Length != o.Length) 1100while (i < o.Length && c == 0) 1124if (other is not Array o || o.Length != this.Length) 1130while (i < o.Length) 1152for (int i = (this.Length >= 8 ? this.Length - 8 : 0); i < this.Length; i++) 1177return BinarySearch(array, array.GetLowerBound(0), array.Length, value, null); 1216return BinarySearch(array, array.GetLowerBound(0), array.Length, value, comparer); 1243if (array.Length - (index - lb) < length) 1380return BinarySearch(array, 0, array.Length, value, null); 1387return BinarySearch(array, 0, array.Length, value, comparer); 1404if (array.Length - index < length) 1422TOutput[] newArray = new TOutput[array.Length]; 1423for (int i = 0; i < array.Length; i++) 1442Copy(this, GetLowerBound(0), array!, index, Length); 1480for (int i = 0; i < array.Length; i++) 1498if ((uint)startIndex > (uint)array.Length) 1503if ((uint)count > (uint)(array.Length - startIndex)) 1534for (int i = 0; i < array.Length; i++) 1567values = new T[Math.Min((uint)span.Length * 2, (uint)array.Length)]; 1576return values?.Length == foundCount ? values : span[..foundCount].ToArray(); 1586return FindIndex(array, 0, array.Length, match); 1596return FindIndex(array, startIndex, array.Length - startIndex, match); 1606if (startIndex < 0 || startIndex > array.Length) 1611if (count < 0 || startIndex > array.Length - count) 1642for (int i = array.Length - 1; i >= 0; i--) 1659return FindLastIndex(array, array.Length - 1, array.Length, match); 1684if (array.Length == 0) 1695if (startIndex < 0 || startIndex >= array.Length) 1730for (int i = 0; i < array.Length; i++) 1744return IndexOf(array, value, array.GetLowerBound(0), array.Length); 1758return IndexOf(array, value, startIndex, array.Length - startIndex + lb); 1775if (startIndex < lb || startIndex > array.Length + lb) 1777if (count < 0 || count > array.Length - startIndex + lb) 1884return IndexOf(array, value, 0, array.Length); 1894return IndexOf(array, value, startIndex, array.Length - startIndex); 1904if ((uint)startIndex > (uint)array.Length) 1909if ((uint)count > (uint)(array.Length - startIndex)) 1966return LastIndexOf(array, value, array.Length - 1 + lb, array.Length); 1993if (array.Length == 0) 1998if (startIndex < lb || startIndex >= array.Length + lb) 2107return LastIndexOf(array, value, array.Length - 1, array.Length); 2117return LastIndexOf(array, value, startIndex, (array.Length == 0) ? 0 : (startIndex + 1)); 2127if (array.Length == 0) 2147if ((uint)startIndex >= (uint)array.Length) 2218Reverse(array, array.GetLowerBound(0), array.Length); 2237if (array.Length - (index - lowerBound) < length) 2296if (array.Length > 1) 2297SpanHelpers.Reverse(ref MemoryMarshal.GetArrayDataReference(array), (nuint)array.Length); 2308if (array.Length - index < length) 2325Sort(array, null, array.GetLowerBound(0), array.Length, null); 2338Sort(keys, items, keys.GetLowerBound(0), keys.Length, null); 2371Sort(array, null, array.GetLowerBound(0), array.Length, comparer); 2386Sort(keys, items, keys.GetLowerBound(0), keys.Length, comparer); 2422if (keys.Length - (index - keysLowerBound) < length || (items != null && (index - keysLowerBound) > items.Length - length)) 2513if (array.Length > 1) 2515var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2524Sort(keys, items, 0, keys.Length, null); 2541Sort(array, 0, array.Length, comparer); 2548Sort(keys, items, 0, keys.Length, comparer); 2559if (array.Length - index < length) 2577if (keys.Length - index < length || (items != null && index > items.Length - length)) 2606var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2622for (int i = 0; i < array.Length; i++) 2639/// <see cref="Length"/> property may return larger value than this property for multi-dimensional arrays.</para> 3073new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (1)
117Debug.Assert(array == null || endIndex == array.Length);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Attribute.cs (3)
109if (thisValueArray.Length != thatValueArray.Length) 117for (int j = 0; j < thisValueArray.Length; j++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (15)
461if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 463if (startIndex > value.Length - sizeof(short)) 499if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 501if (startIndex > value.Length - sizeof(int)) 537if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 539if (startIndex > value.Length - sizeof(long)) 575if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 577if (startIndex > value.Length - Int128.Size) 701if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 703if (startIndex > value.Length - UInt128.Size) 854if (startIndex < 0 || startIndex >= value.Length && startIndex > 0) 857if (startIndex > value.Length - length) 901return ToString(value, 0, value.Length); 919return ToString(value, startIndex, value.Length - startIndex); 936if (startIndex >= value.Length)
src\runtime\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\runtime\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); 120log.BufferRented(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId); 121log.BufferAllocated(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId, bucketIndex >= _buckets.Length ? 136int bucketIndex = Utilities.SelectBucketIndex(array.Length); 146if ((uint)bucketIndex < (uint)tlsBuckets.Length) 157if (array.Length != Utilities.GetMaxSizeForBucket(bucketIndex)) 177if (log.IsEnabled() && array.Length != 0) 179log.BufferReturned(array.GetHashCode(), array.Length, Id); 182log.BufferDropped(array.GetHashCode(), array.Length, Id, 203for (int i = 0; i < perCoreBuckets.Length; i++) 228for (int i = 0; i < buckets.Length; i++) 232log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id); 253for (int i = 0; i < buckets.Length; i++) 274log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id); 333for (int i = 0; i < partitions.Length; i++) 351for (int i = 0; i < partitions.Length; i++) 354if (++index == partitions.Length) index = 0; 371for (int i = 0; i < partitions.Length; i++) 374if (++index == partitions.Length) index = 0; 382for (int i = 0; i < partitions.Length; i++) 405if ((uint)count < (uint)arrays.Length) 429if ((uint)count < (uint)arrays.Length) 488log.BufferTrimmed(array.GetHashCode(), array.Length, id);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Encoder.cs (2)
96Debug.Assert(destination.Length == bytesWritten); 193Debug.Assert(destination.Length == charsWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (2)
91Debug.Assert(destination.Length == bytesWritten); 142Debug.Assert(destination.Length == charsWritten);
src\runtime\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); 824if (array.Length - arrayIndex < count) 2283if (array.Length - index < _baseSize) 2298if (array.Length - arrayIndex < count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (18)
87if (array is null || (uint)_bitLength > checked((uint)array.Length * BitsPerInt32)) 137if (bytes.Length > int.MaxValue / BitsPerByte) 142_bitLength = bytes.Length * BitsPerByte; 145Array.Copy(bytes, _array, bytes.Length); 158_array = AllocateByteArray(values.Length); 159_bitLength = values.Length; 163if (!BitConverter.IsLittleEndian || values.Length < Vector256<byte>.Count) 221for (; i < (uint)values.Length; i++) 247if (values.Length > int.MaxValue / BitsPerInt32) 252_bitLength = values.Length * BitsPerInt32; 277Array.Copy(bits._array, _array, _array.Length); 424(uint)count > (uint)thisArray.Length || 425(uint)count > (uint)valueArray.Length) 640if (newByteLength > _array.Length) 655if (newByteLength < _array.Length - ShrinkThreshold) 684if (array.Length - index < intLength) 712if ((array.Length - index) < byteLength) 731if (boolArray.Length - index < _bitLength)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (34)
187for (int i = 1; i < locks.Length; i++) 192var countPerLock = new int[locks.Length]; 229_budget = buckets.Length / locks.Length; 352_budget = tables._buckets.Length / tables._locks.Length; 725var newTables = new Tables(new VolatileNode[HashHelpers.GetPrime(_initialCapacity)], tables._locks, new int[tables._countPerLock.Length], tables._comparer); 727_budget = Math.Max(1, newTables._buckets.Length / newTables._locks.Length); 763if (array.Length - count < index) 905if ((uint)i >= (uint)buckets.Length) 1876if (array.Length - count < index) 1958int newLength = tables._buckets.Length; 1973if (upgradeComparer is null && GetCountNoLocks() < tables._buckets.Length / 4) 1985if ((newLength = tables._buckets.Length * 2) < 0 || 2002if (_growLockArray && tables._locks.Length < MaxLockNumber) 2004newLocks = new object[tables._locks.Length * 2]; 2005Array.Copy(tables._locks, newLocks, tables._locks.Length); 2006for (int i = tables._locks.Length; i < newLocks.Length; i++) 2013var newCountPerLock = new int[newLocks.Length]; 2042_budget = Math.Max(1, newBuckets.Length / newLocks.Length); 2066Debug.Assert(locksAcquired == _tables._locks.Length); 2099for (int i = 1; i < locks.Length; i++) 2105Debug.Assert(locksAcquired == locks.Length); 2229return buckets[HashHelpers.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier)]._node; 2233return buckets[(uint)hashcode % (uint)buckets.Length]._node; 2246bucketNo = HashHelpers.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier); 2250bucketNo = (uint)hashcode % (uint)buckets.Length; 2252lockNo = bucketNo % (uint)tables._locks.Length; // doesn't use FastMod, as it would require maintaining a different multiplier 2281_fastModBucketsMultiplier = HashHelpers.GetFastModMultiplier((uint)buckets.Length); 2715var items = new DebugViewDictionaryItem<TKey, TValue>[keyValuePairs.Length]; 2716for (int i = 0; i < items.Length; i++)
src\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (2)
105if (list._items.Length - list._size < source.Length) 137if (list._items.Length - list._size < source.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (52)
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 423if ((uint)i >= (uint)entries.Length) 437} while (collisionCount <= (uint)entries.Length); 454if ((uint)i >= (uint)entries.Length) 468} while (collisionCount <= (uint)entries.Length); 537while ((uint)i < (uint)entries.Length) 558if (collisionCount > (uint)entries.Length) 569while ((uint)i < (uint)entries.Length) 590if (collisionCount > (uint)entries.Length) 610if (count == entries.Length) 633Resize(entries.Length, true); 820if ((uint)i >= (uint)entries.Length) 834} while (collisionCount <= (uint)entries.Length); 888while ((uint)i < (uint)entries.Length) 928if (collisionCount > (uint)entries.Length) 983while ((uint)i < (uint)entries.Length) 995if (collisionCount > (uint)entries.Length) 1020if (count == entries.Length) 1043dictionary.Resize(entries.Length, true); 1102while ((uint)i < (uint)entries.Length) 1114if (collisionCount > (uint)entries.Length) 1125while ((uint)i < (uint)entries.Length) 1137if (collisionCount > (uint)entries.Length) 1157if (count == entries.Length) 1180dictionary.Resize(entries.Length, true); 1227for (int i = 0; i < array.Length; i++) 1253Debug.Assert(newSize >= _entries.Length); 1321while ((uint)i < (uint)entries.Length) 1358if (collisionCount > (uint)entries.Length) 1369while ((uint)i < (uint)entries.Length) 1406if (collisionCount > (uint)entries.Length) 1447while ((uint)i < (uint)entries.Length) 1486if (collisionCount > (uint)entries.Length) 1497while ((uint)i < (uint)entries.Length) 1536if (collisionCount > (uint)entries.Length) 1588if ((uint)index > (uint)array.Length) 1593if (array.Length - index < Count) 1652int currentCapacity = _entries == null ? 0 : _entries.Length; 1701int currentCapacity = oldEntries == null ? 0 : oldEntries.Length; 1855return ref buckets[HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)]; 2017if (index < 0 || index > array.Length) 2022if (array.Length - index < _dictionary.Count) 2077if ((uint)index > (uint)array.Length) 2082if (array.Length - index < _dictionary.Count) 2212if ((uint)index > array.Length) 2217if (array.Length - index < _dictionary.Count) 2271if ((uint)index > (uint)array.Length) 2276if (array.Length - index < _dictionary.Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (31)
114if (_count > 0 && _entries!.Length / _count > ShrinkThreshold) 158int capacity = source._buckets!.Length; 236while ((uint)i < (uint)entries.Length) 246if (collisionCount > (uint)entries.Length) 258while ((uint)i < (uint)entries.Length) 268if (collisionCount > (uint)entries.Length) 286return ref buckets[HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 312while ((uint)i < (uint)entries.Length) 344if (collisionCount > (uint)entries.Length) 362public int Capacity => _entries?.Length ?? 0; 476while ((uint)i < (uint)entries.Length) 486if (collisionCount > (uint)entries.Length) 508if (count == entries.Length) 532set.Resize(entries.Length, forceNewHashCodes: true); 559while ((uint)i < (uint)entries.Length) 591if (collisionCount > (uint)entries.Length) 645if ((uint)i >= (uint)entries.Length) 659} while (collisionCount <= (uint)entries.Length); 706info.AddValue(CapacityName, _buckets == null ? 0 : _buckets.Length); 751for (int i = 0; i < array.Length; i++) 1198if (arrayIndex > array.Length || count > array.Length - arrayIndex) 1276int currentCapacity = _entries == null ? 0 : _entries.Length; 1299Debug.Assert(newSize >= _entries.Length); 1358int currentCapacity = oldEntries == null ? 0 : oldEntries.Length; 1444while ((uint)i < (uint)entries.Length) 1455if (collisionCount > (uint)entries.Length) 1468while ((uint)i < (uint)entries.Length) 1479if (collisionCount > (uint)entries.Length) 1498if (count == entries.Length) 1523Resize(entries.Length, forceNewHashCodes: true);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (27)
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); 460if ((uint)index < (uint)array.Length) 470index -= array.Length;
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ListDictionaryInternal.cs (2)
157if (array.Length - index < this.Count) 310if (array.Length - index < list.Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (1)
192if (array.Length - index < Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (2)
26ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length); 34if (array.Length - index < sourceCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
123if (array.Length - index < Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (6)
2337ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 2386int inArrayLength = inArray.Length; 2394int outArrayLength = outArray.Length; 2558ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 2788ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 2883ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (3)
363for (int i = 0; i < formats.Length; i++) 606for (int i = 0; i < formats.Length; i++) 621for (int i = 0; i < formats!.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (60)
37if (match == null || match.Length == 0) 53int[][] paramOrder = new int[candidates.Length][]; 55for (i = 0; i < candidates.Length; i++) 60paramOrder[i] = new int[(par.Length > args.Length) ? par.Length : args.Length]; 78Type[] paramArrayTypes = new Type[candidates.Length]; 80Type[] argTypes = new Type[args.Length]; 85for (i = 0; i < args.Length; i++) 101for (i = 0; i < candidates.Length; i++) 115if (args.Length != 0) 128else if (par.Length > args.Length) 133for (j = args.Length; j < par.Length - 1; j++) 154else if (par.Length < args.Length) 189int argsToCheck = (paramArrayType != null) ? par.Length - 1 : args.Length; 202if (index < args.Length) 257for (; j < args.Length; j++) 285if (j == args.Length) 305state = new BinderState((int[])paramOrder[0].Clone(), args.Length, paramArrayTypes[0] != null); 313if (parms.Length == args.Length) 325else if (parms.Length > args.Length) 332if (k < args.Length) 358objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[0], args.Length - paramArrayPos); 359Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 396state = new BinderState((int[])paramOrder[currentMin].Clone(), args.Length, paramArrayTypes[currentMin] != null); 403if (parameters.Length == args.Length) 415else if (parameters.Length > args.Length) 419for (i = 0; i < args.Length; i++) 443objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[currentMin], args.Length - paramArrayPos); 444Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 471for (i = 0; i < candidates.Length; i++) 547Type[] realTypes = new Type[types.Length]; 548for (i = 0; i < types.Length; i++) 557if (match == null || match.Length == 0) 565for (i = 0; i < candidates.Length; i++) 568if (par.Length != types.Length) 570for (j = 0; j < types.Length; j++) 600if (j == types.Length) 611int[] paramOrder = new int[types.Length]; 612for (i = 0; i < types.Length; i++) 647if (match == null || match.Length == 0) 656int indexesLength = (indexes != null) ? indexes.Length : 0; 657for (i = 0; i < candidates.Length; i++) 662if (par.Length != indexesLength) 763int paramArrayPos = args.Length - 1; 764if (args.Length == binderState._originalSize) 771object[] newArgs = new object[args.Length]; 773for (int i = paramArrayPos, j = 0; i < newArgs.Length; i++, j++) 782if (args.Length > binderState._originalSize) 797MethodBase[] aExactMatches = new MethodBase[match.Length]; 800for (int i = 0; i < match.Length; i++) 808for (j = 0; j < types.Length; j++) 816if (j < types.Length) 840int typesLength = (types != null) ? types.Length : 0; 841for (int i = 0; i < match.Length; i++) 879for (int i = 0; i < types.Length; i++) 1164object?[] varsCopy = new object[vars.Length]; 1165for (int i = 0; i < vars.Length; i++) 1170for (int i = 0, j = 0; i < vars.Length; j++) 1172if (paramOrder[j] < vars.Length) 1194for (int i = 0; i < names.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackFrame.cs (1)
218while (k < typars.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (3)
117else if (eventSourceIndex >= s_counterGroups.Length) 120Array.Copy(s_counterGroups, newCounterGroups, s_counterGroups.Length); 248if (_onTimerCounters.Length < counterCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (3)
37for (int i = 0; i < bufferedValues.Length; i++) 154if (_bufferedValues.Length <= i) 175for (int i = 0; i < _bufferedValues.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventListener.cs (1)
576for (int i = 0; i < eventSourcesSnapshot.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (4)
121Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length); 126for (int i = 0; i < providers.Length; i++) 139for (int i = 0; i < providers.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
24EventParameterInfo[] eventParams = new EventParameterInfo[parameters.Length]; 25for (int i = 0; i < parameters.Length; i++) 52EventParameterInfo[] eventParams = new EventParameterInfo[typeInfos.Length]; 53for (int i = 0; i < typeInfos.Length; i++) 92if ((parameters.Length == 1) && (parameters[0].ParameterType == typeof(EmptyStruct))) 167WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length); 196WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length); 277EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length); 330EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length); 423EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (9)
276*(int*)dataBuffer = blobRet.Length; 284dataDescriptor->Size = (uint)blobRet.Length; 471int argCount = eventPayload.Length; 503for (index = 0; index < eventPayload.Length; index++) 515if (eventPayload.Length + idx + 1 - index > EtwMaxNumberArguments) 1298while (idx < buffer.Length && buffer[idx] != 0) 1315while (dataStart < data.Length) 1320if (valueEnd < data.Length) 1344Marshal.Copy((IntPtr)(void*)filterData->Ptr, data, 0, data.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (39)
446return (manifestBytes == null) ? null : Encoding.UTF8.GetString(manifestBytes, 0, manifestBytes.Length); 526for (int i = 0; i < m_traits.Length - 1; i += 2) 784uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0; 1116if (arg1 == null || arg1.Length == 0) 1129int blobSize = arg1.Length; 1154if (arg2 == null || arg2.Length == 0) 1167int blobSize = arg2.Length; 1453var argValues = new object?[args.Length]; 1454for (int i = 0; i < args.Length; i++) 1658if (m_traits != null && m_traits.Length % 2 != 0) 1792for (int i = 0; i < decodedObjects.Length; i++, data++) 1942Marshal.Copy(data->DataPointer, blob, 0, blob.Length); 2106int paramCount = Math.Min(eventTypes.typeInfos.Length, args.Length); // parameter count mismatch get logged in LogEventArgsMismatches 2107var eventData = new object?[eventTypes.typeInfos.Length]; 2127if (args.Length != infos.Length) 2129ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventId, args.Length, infos.Length)); 2133for (int i = 0; i < args.Length; i++) 2158ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventCallbackArgs.EventId, eventDataCount, metadata.Parameters.Length)); 2168args = new object?[Math.Min(eventDataCount, metadata.Parameters.Length)]; 2172for (int i = 0; i < args.Length; i++, data++) 2181for (int i = 0; i < args.Length; i++, data++) 2302uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0; 2404if (eventChannel != EventChannel.None && this.m_channelData != null && this.m_channelData.Length > (int)eventChannel) 2564var names = new string[parameters.Length]; 2565for (int i = 0; i < names.Length; i++) 2584var types = new Type[parameters.Length]; 2585for (int i = 0; i < types.Length; i++) 2955int dataLeft = rawManifest.Length; 3139for (int i = 0; i < methods.Length; i++) 3264for (int fieldIdx = 0; fieldIdx < args.Length; fieldIdx++) 3315bNeedsManifest = (flags & EventManifestOptions.OnlyIfNeededForRegistration) == 0 || manifest.GetChannelData().Length > 0; 3322res = (res.Length > 0) ? res : null; 3476if (args.Length > 0 && args[0].ParameterType == typeof(Guid) && 3479var newargs = new ParameterInfo[args.Length - 1]; 3480Array.Copy(args, 1, newargs, 0, args.Length - 1); 3549int eventListenerParameterCount = eventParameters.Length;
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (3)
282if (this.buffer == null || this.buffer.Length < required) 291if (this.buffer == null || this.buffer.Length < required) 299int newSize = this.buffer == null ? 64 : this.buffer.Length;
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (2)
87checked((ushort)(custom == null ? 0 : custom.Length)), 209Debug.Assert(pos >= 0 && this.fixedCount >= 0 && pos <= metadata.Length - this.fixedCount);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\NameInfo.cs (1)
91uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (2)
336if (attributes.Length != 0) 348if (attributes.Length != 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingDataCollector.cs (1)
95DataCollector.ThreadInstance.AddArray(array, array == null ? 0 : array.Length, elementSize);
src\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TypeAnalysis.cs (1)
38propertyInfo.GetIndexParameters().Length != 0)
src\runtime\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++) 1934Debug.Assert(names.Length == values.Length); 1969Debug.Assert(names.Length == values.Length); 2033return values.Length > 0 && values[0] == TStorage.Zero ? 2042for (i = values.Length - 1; (uint)i < (uint)values.Length; i--) 2072if ((uint)index >= (uint)values.Length) 2270for (int i = 0; i < values.Length; i++) 2283for (int i = 1; i < values.Length; i++)
src\runtime\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; 258this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0]); 270if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevEraNames[0])) 311if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevEraNames[0]))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (4)
65Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13); 102count = Interop.Globalization.GetCalendars(localeName, calendars, calendars.Length); 106if (count == 0 && calendars.Length > 0) 407if (calendarId != CalendarId.JAPAN && calendarId != CalendarId.JAPANESELUNISOLAR && eraNames?.Length > 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
400pBytes, keyData.Length,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (6)
1363_saLongTimes = longTimes != null && longTimes.Length != 0 ? longTimes : Invariant._saLongTimes!; 1384_saShortTimes = shortTimes != null && shortTimes.Length != 0 ? shortTimes : DeriveShortTimesFromLong(); 1398string[] shortTimes = new string[longTimes.Length]; 1400for (int i = 0; i < longTimes.Length; i++) 2154if (digits.Length < NumberFormatInfo.s_asciiDigits.Length) 2175for (int i = 0; i < result.Length; i++)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (2)
850Calendar[] cals = new Calendar[calID.Length]; 851for (int i = 0; i < cals.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (4)
1740results = new string[allFormats.Length]; 1741for (int i = 0; i < allFormats.Length; i++) 1749results = new string[allFormats.Length]; 1750for (int i = 0; i < allFormats.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (65)
166Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 180Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week"); 194Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 208Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13, 223Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13, 266Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 269Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 272Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 275Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 278Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 391for (int i = 0; i < OptionalCalendars.Length; i++) 487for (int i = 0; i < EraNames.Length; i++) 498for (int i = 0; i < AbbreviatedEraNames.Length; i++) 506for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++) 535if ((uint)era >= names.Length) 550if (AbbreviatedEraNames.Length == 0) 564if ((uint)era >= (uint)names.Length) 1043Debug.Assert(values.Length >= length); 1063if (value.Length != 7) 1068CheckNullValue(value, value.Length); 1088if (value.Length != 7) 1093CheckNullValue(value, value.Length); 1108if (value.Length != 7) 1113CheckNullValue(value, value.Length); 1130if (value.Length != 13) 1135CheckNullValue(value, value.Length - 1); 1151if (value.Length != 13) 1156CheckNullValue(value, value.Length - 1); 1182if ((uint)month >= (uint)monthNamesArray.Length) 1184ThrowHelper.ThrowArgumentOutOfRange_Range(nameof(month), month + 1, 1, monthNamesArray.Length); 1201Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13, 1211Debug.Assert(genitiveMonthNames.Length == 13, 1229Debug.Assert(leapYearMonthNames.Length == 13, 1240if ((uint)dow >= (uint)names.Length) 1255if ((uint)dow >= (uint)names.Length) 1272string[] result = new string[patterns1.Length * patterns2.Length]; 1276for (int i = 0; i < patterns1.Length; i++) 1278for (int j = 0; j < patterns2.Length; j++) 1328if ((uint)dow >= (uint)names.Length) 1340if ((uint)month >= (uint)names.Length) 1352if ((uint)month >= (uint)names.Length) 1371Debug.Assert(patterns != null && patterns.Length > 0, 1384for (i = 0; i < patterns.Length; i++) 1395if (i < patterns.Length) 1407newPatterns = new string[patterns.Length + 1]; 1410Array.Copy(patterns, 0, newPatterns, 1, patterns.Length); 1451Debug.Assert(allYearMonthPatterns.Length > 0, 1472Debug.Assert(allShortDatePatterns.Length > 0, 1493Debug.Assert(allLongDatePatterns.Length > 0, 1513Debug.Assert(allShortTimePatterns.Length > 0, 1533Debug.Assert(allLongTimePatterns.Length > 0, 1595if (patterns.Length == 0) 1600for (int i = 0; i < patterns.Length; i++) 1657if (value.Length != 13) 1662CheckNullValue(value, value.Length - 1); 1678if (value.Length != 13) 1683CheckNullValue(value, value.Length - 1); 2019for (int i = 0; i < dateWords.Length; i++) 2098for (int i = 1; i <= eras.Length; i++) 2119for (int i = 1; i <= jaDtfi.Calendar.Eras.Length; i++) 2132for (int i = 1; i <= twDtfi.Calendar.Eras.Length; i++) 2167for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (6)
476for (i = 0; i < datePatterns.Length; i++) 483for (i = 0; i < datePatterns.Length; i++) 489for (i = 0; i < datePatterns.Length; i++) 499for (i = 0; i < datePatterns.Length; i++) 506for (i = 0; i < datePatterns.Length; i++) 587for (int i = 0; i < array.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (4)
185if (formats.Length == 0) 197for (int i = 0; i < formats.Length; i++) 3756for (int i = 0; i < eras.Length; i++) 5831for (int i = 0; i < words.Length; i++)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\GregorianCalendarHelper.cs (3)
96for (int i = 0; i < eras.Length; i++) 334var eras = new int[eraInfo.Length]; 335for (int i = 0; i < eraInfo.Length; i++)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (1)
44if (actualLength == 0 || actualLength > outputHeap.Length)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (3)
120int startIndex = abbrevEnglishEraNames == s_abbreviatedEnglishEraNames ? eras.Count - 1 : abbrevEnglishEraNames.Length - 1; 122Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 128if (startIndex < abbrevEnglishEraNames.Length)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (4)
107if (nativeDig.Length != 10) 112for (int i = 0; i < nativeDig.Length; i++) 284for (int i = 0; i < groupSize.Length; i++) 288if (i == groupSize.Length - 1 && groupSize[i] == 0)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (1)
503for (int i = 0; i < _literals.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (2)
1674if (formats.Length == 0) 1681for (int i = 0; i < formats.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (1)
231for (int i = 0; i < mapping.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (1)
127if (d.Length != 8)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (2)
160OutStream.Write(buffer, 0, buffer.Length); 235if (index > chars.Length - count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (1)
121if (_buffer.Length != _bufferSize || _bufferSize >= MaxShadowBufferSize)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (4)
1252if (bytesRead == rentedArray.Length) 1254uint newLength = (uint)rentedArray.Length * 2; 1257newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1); 1269Debug.Assert(bytesRead < rentedArray.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (2)
64_length = _capacity = buffer.Length; 85if (buffer.Length - index < count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
86if (TryGetHomeDirectoryFromPasswd(buf, heapBuf.Length, out userHomeDirectory))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
25int len = array.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (2)
68while ((bytesRead = Read(buffer, 0, buffer.Length)) != 0) 962if ((uint)count > buffer.Length - offset)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (16)
355if (buffer.Length - index < count) 434if (buffer.Length - index < count) 466_ = byteBuffer.Length; // allow JIT to prove object is not null 527int newMaxCharsPerBuffer = _encoding.GetMaxCharCount(byteBuffer.Length); 600int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos); 614_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length); 627_isBlocked = (_byteLen < _byteBuffer.Length); 704int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos); 718_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length); 731_isBlocked = (_byteLen < _byteBuffer.Length); 965else if ((arrayPoolBuffer.Length - arrayPoolBufferPos) < (charLen - charPos)) 1056if (buffer.Length - index < count) 1143int len = await tmpStream.ReadAsync(new Memory<byte>(tmpByteBuffer, tmpBytePos, tmpByteBuffer.Length - tmpBytePos), cancellationToken).ConfigureAwait(false); 1193_isBlocked = (_byteLen < tmpByteBuffer.Length); 1267if (buffer.Length - index < count) 1365_isBlocked = (_byteLen < tmpByteBuffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (11)
313(_byteBuffer = new byte[_encoding.GetMaxByteCount(_charBuffer.Length)]); 378if (buffer.Length - index < count) 435if (dstPos == charBuffer.Length) 441int n = Math.Min(charBuffer.Length - dstPos, count); 457for (int i = 0; i < coreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 684for (int i = 0; i < CoreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 734if (buffer.Length - index < count) 798for (int i = 0; i < CoreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 886if (buffer.Length - index < count) 983if (preamble.Length > 0) 989byte[] byteBuffer = _byteBuffer ??= new byte[_encoding.GetMaxByteCount(_charBuffer.Length)];
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringWriter.cs (1)
92if (buffer.Length - index < count)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (2)
38return writers.Length != 0 ? 49Debug.Assert(writers is { Length: > 0 });
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (4)
166Write(buffer, 0, buffer.Length); 180if (buffer.Length - index < count) 662return WriteAsync(buffer, 0, buffer.Length); 757return WriteLineAsync(buffer, 0, buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (2)
319if (array.Length - offset < count) 545if (array.Length - offset < count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (1)
119stream.Write(buffer, 0, buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Memory.cs (5)
49_length = array.Length; 64if ((uint)start > (uint)array.Length) 69_length = array.Length - start; 98if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) 305lengthOfUnderlyingSpan = Unsafe.As<T[]>(tmpObject).Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (8)
36if ((uint)start > (uint)array.Length) 39return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), array.Length - start); 59int actualIndex = startIndex.GetOffset(array.Length); 60if ((uint)actualIndex > (uint)array.Length) 63return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)actualIndex /* force zero-extension */), array.Length - actualIndex); 86(int start, int length) = range.GetOffsetAndLength(array.Length); 3859int actualIndex = startIndex.GetOffset(array.Length); 3893(int start, int length) = range.GetOffsetAndLength(array.Length);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (5)
56if (values.Length < Count) 75if ((index < 0) || ((values.Length - index) < Count)) 620if (destination.Length < Count) 639if ((uint)startIndex >= (uint)destination.Length) 644if ((destination.Length - startIndex) < Count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (3)
969if (array.Length < ElementCount) 992if ((uint)index >= (uint)array.Length) 997if ((array.Length - index) < ElementCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (3)
979if (array.Length < ElementCount) 1002if ((uint)index >= (uint)array.Length) 1007if ((array.Length - index) < ElementCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
646Shuffle(new Span<T>(ref MemoryMarshal.GetArrayDataReference(values), values.Length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (3)
49_length = array.Length; 76if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) 227lengthOfUnderlyingSpan = Unsafe.As<T[]>(tmpObject).Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (2)
51_length = array.Length; 77if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (3)
16if (publicKey.Length == 0) 26for (int i = 0; i < publicKeyToken.Length; i++) 36uint publicKeyLength = (uint)(publicKey.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilder.cs (1)
26if (names.Length == 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
70for (int i = 0; i < _inst.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
86for (int i = 0; i < args.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
235if (_iaLowerBound.Length <= _rank)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs (5)
91if (names.Length == 0) 129if (parameterTypeOptionalCustomModifiers != null && parameterTypeOptionalCustomModifiers.Length != parameterTypes.Length) 132if (parameterTypeRequiredCustomModifiers != null && parameterTypeRequiredCustomModifiers.Length != parameterTypes.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (3)
117Type[] instSubstituted = new Type[inst.Length]; 119for (int i = 0; i < instSubstituted.Length; i++) 241for (int i = 0; i < _typeArguments.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (1)
295for (int i = 0; i < genericArguments.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBase.cs (1)
95for (int i = 0; i < parameterTypes.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInfo.Internal.cs (1)
8internal virtual int GenericParameterCount => GetGenericArguments().Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (1)
40for (int i = 0; i < parameterTypes.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
26for (int i = 0; i < genericArguments.Length; i++)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (5)
384genericArgumentsState = new NullabilityInfo[genericArguments.Length]; 386for (int i = 0; i < genericArguments.Length; i++) 461if (nullability.GenericTypeArguments.Length > 0) 465for (int i = 0; i < genericArguments.Length; i++) 605if (nullability.GenericTypeArguments.Length > 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ReflectionTypeLoadException.cs (1)
58if (exceptions.Length == 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureConstructedGenericType.cs (3)
20for (int i = 0; i < typeArguments.Length; i++) 47for (int i = 0; i < _genericTypeArguments.Length; i++) 72for (int i = 0; i < _genericTypeArguments.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureFunctionPointerType.cs (3)
49for (int i = 0; i < _parameterTypes.Length; i++) 82for (int i = 0; i < _parameterTypes.Length; i++) 85if (i < _parameterTypes.Length - 1)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\TypeInfo.cs (1)
127for (int i = 0; i < constraints.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (1)
76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (1)
441int length = resourceSetNames.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (2)
171if (typeCode < 0 || typeCode >= ResourceTypeCode.StartOfUserTypes + _typeTable.Length) 181if (bytes.Length != len)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (3)
405for (int i = 0; i < arr.Length; i++) 969if (typeIndex < 0 || typeIndex >= _typeTable.Length) 1037Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (5)
400if ((index + MaxAsyncEventHeaderSize + maxEventPayloadSize) <= buffer.Length && delta >= 0) 407if (MaxAsyncEventHeaderSize + maxEventPayloadSize > buffer.Length) 445if ((index + MaxAsyncEventHeaderSize + maxEventPayloadSize) <= buffer.Length && delta >= 0) 452if (MaxAsyncEventHeaderSize + maxEventPayloadSize > buffer.Length) 517if (_eventBuffer.Data.Length == 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (18)
574for (int i = 0; i < _buckets.Length; i++) 592Debug.Assert(buckets.Length == entries.Length); 593Debug.Assert(BitOperations.IsPow2(buckets.Length)); 601internal bool HasCapacity => _firstFreeEntry < _entries.Length; 619int bucket = hashCode & (_buckets.Length - 1); 659int bucket = hashCode & (_buckets.Length - 1); 678if (index < _entries.Length) 759int newSize = _buckets.Length; 766for (int entriesIndex = 0; entriesIndex < _entries.Length; entriesIndex++) 789newSize = _buckets.Length * 2; 797Debug.Assert(newSize >= _buckets.Length); 803for (int bucketIndex = 0; bucketIndex < newBuckets.Length; bucketIndex++) 821for (; newEntriesIndex < _entries.Length; newEntriesIndex++) 829int bucket = hashCode & (newBuckets.Length - 1); 840for (int entriesIndex = 0; entriesIndex < _entries.Length; entriesIndex++) 856int bucket = hashCode & (newBuckets.Length - 1); 942for (int entriesIndex = 0; entriesIndex < entries.Length; entriesIndex++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\FormattableStringFactory.cs (1)
38public override int ArgumentCount => _arguments.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (4)
131return table.Length - 2; 249if (table.Length == 2) 325if (table.Length == 2) 370return table.Length - 1;
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (1)
34(int offset, int length) = range.GetOffsetAndLength(array.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
32if ((uint)size > (uint)items.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (6)
1693int bucket = GetBucket(handle, _buckets.Length); 1727if (_numEntries > (_buckets.Length * 2)) 1736int newNumBuckets = _buckets.Length * 2 + 1; 1738for (int i = 0; i < _buckets.Length; i++) 1767int bucket = GetBucket(handle, _buckets.Length); 1855while (++_currentIdx != _buckets.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (1)
533for (int i = 0; i < mi.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (5)
40numElements = managed.Length; 152if (array.Length <= buffer.Length) 154_span = buffer[0..array.Length]; 158int bufferSize = checked(array.Length * sizeof(TUnmanagedElement)); 161_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (5)
41numElements = managed.Length; 153if (array.Length <= buffer.Length) 155_span = buffer[0..array.Length]; 159int bufferSize = checked(array.Length * sizeof(TUnmanagedElement)); 162_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (3)
415return index == 0 && length == array.Length ? 614if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (2)
96Debug.Assert(tokens.Length != 0); 128for (int i = tokens.Length - 1; i >= 0; i--)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (2)
219if (array.Length - index < count) 307if (array.Length - index < count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (5)
741if (destination.Length < Vector128<T>.Count) 763if ((uint)startIndex >= (uint)destination.Length) 768if ((destination.Length - startIndex) < Vector128<T>.Count) 1016if (values.Length < Vector128<T>.Count) 1037if ((index < 0) || ((values.Length - index) < Vector128<T>.Count))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (5)
748if (destination.Length < Vector256<T>.Count) 770if ((uint)startIndex >= (uint)destination.Length) 775if ((destination.Length - startIndex) < Vector256<T>.Count) 1017if (values.Length < Vector256<T>.Count) 1038if ((index < 0) || ((values.Length - index) < Vector256<T>.Count))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (5)
661if (destination.Length < Vector512<T>.Count) 682if ((uint)startIndex >= (uint)destination.Length) 687if ((destination.Length - startIndex) < Vector512<T>.Count) 913if (values.Length < Vector512<T>.Count) 933if ((index < 0) || ((values.Length - index) < Vector512<T>.Count))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (5)
700if (destination.Length < Vector64<T>.Count) 722if ((uint)startIndex >= (uint)destination.Length) 727if ((destination.Length - startIndex) < Vector64<T>.Count) 992if (values.Length < Vector64<T>.Count) 1013if ((index < 0) || ((values.Length - index) < Vector64<T>.Count))
src\runtime\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\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeByteSearchValues.cs (1)
25for (int i = 0; i < values.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeCharSearchValues.cs (1)
28for (int i = 0; i < values.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.T.cs (2)
54string display = $"{GetType().Name}, Count = {values.Length}"; 55if (values.Length > 0)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (1)
45if (c < (uint)table.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
86newBucket = new string[existingBucket.Length + 1];
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
374Debug.Assert(newValuesCount == newValues.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (2)
305int iMax = s_escapeStringPairs.Length; 343int iMax = s_escapeStringPairs.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Span.cs (2)
53_length = array.Length; 82if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (1)
62for (int i = 0; i < startupHooks.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.cs (4)
78if (value == null || value.Length == 0) 81string result = FastAllocateString(value.Length); 102ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, value.Length - length); 423ArgumentOutOfRangeException.ThrowIfGreaterThan(destinationIndex, destination.Length - count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (9)
134for (int i = 0; i < strings.Length; i++) 778ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, value.Length - count); 1826if (!singleSeparator && (separators == null || separators.Length == 0)) 2447if (trimChars == null || trimChars.Length == 0) 2453return TrimHelper(pTrimChars, trimChars.Length, TrimType.Both); 2514if (trimChars == null || trimChars.Length == 0) 2520return TrimHelper(pTrimChars, trimChars.Length, TrimType.Head); 2581if (trimChars == null || trimChars.Length == 0) 2587return TrimHelper(pTrimChars, trimChars.Length, TrimType.Tail);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (11)
92if (chars.Length - index < count) 231if ((uint)byteIndex > bytes.Length) 239return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 274if (chars.Length - charIndex < charCount) 279if ((uint)byteIndex > bytes.Length) 287return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 452if (bytes.Length - index < count) 565if (bytes.Length - byteIndex < byteCount) 570if ((uint)charIndex > (uint)chars.Length) 578return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 742if (bytes.Length - byteIndex < byteCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (2)
231if (bytes.Length - byteIndex < byteCount) 235if (chars.Length - charIndex < charCount)
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (6)
57if (bytes.Length - index < count) 96if (bytes.Length - byteIndex < byteCount) 100if (charIndex < 0 || charIndex > chars.Length) 104int charCount = chars.Length - charIndex; 149if (bytes.Length - byteIndex < byteCount) 153if (chars.Length - charIndex < charCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (2)
229if (chars.Length - charIndex < charCount) 233if (bytes.Length - byteIndex < byteCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (6)
52if (chars.Length - index < count) 86if (chars.Length - charIndex < charCount) 90if (byteIndex < 0 || byteIndex > bytes.Length) 94int byteCount = bytes.Length - byteIndex; 135if (chars.Length - charIndex < charCount) 139if (bytes.Length - byteIndex < byteCount)
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (1)
120Debug.Assert(arrayEncodingInfoIdx == arrayEncodingInfo.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (20)
69if (chars.Length - index < count) 210if (chars.Length - charIndex < charCount) 215if ((uint)byteIndex > bytes.Length) 223return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 277if ((uint)byteIndex > bytes.Length) 285return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 356return bytes.Length; 371if (bytes.Length - index < count) 437if (bytes.Length == 0) 444char[] chars = new char[bytes.Length]; 449GetCharsCommon(pBytes, bytes.Length, pChars, chars.Length); 471if (bytes.Length - byteIndex < byteCount) 476if ((uint)charIndex > (uint)chars.Length) 484return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 504if (bytes.Length - index < count) 516GetCharsCommon(pBytes + index, count, pChars, chars.Length); 557string result = string.FastAllocateString(bytes.Length); 561GetCharsCommon(pBytes, bytes.Length, pChars, result.Length); 582if (bytes.Length - index < count)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (25)
240Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 250Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 268get => m_ChunkChars.Length + m_ChunkOffset; 336if ((uint)(chunkLength + chunkOffset) > (uint)result.Length || (uint)chunkLength > (uint)sourceArray.Length) 457int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length)); 459if (newLen > chunk.m_ChunkChars.Length) 471Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing."); 665if (_chunks.Length <= pos) 716if (((nuint)(uint)chunkLength + (nuint)(uint)repeatCount) <= (nuint)(uint)chunkChars.Length) 744int firstLength = chunkChars.Length - chunkLength; 748m_ChunkLength = chunkChars.Length; 781if (charCount > value.Length - startIndex) 893int length = Math.Min(m_ChunkChars.Length - m_ChunkLength, count); 897Debug.Assert(m_ChunkLength == 0 && m_ChunkChars.Length >= count); 924if (destinationIndex > destination.Length - count) 1056if ((uint)chars.Length > (uint)nextCharIndex) 1150Append(ref MemoryMarshal.GetArrayDataReference(value), value.Length); 1416Insert(index, ref MemoryMarshal.GetArrayDataReference(value), value.Length); 1440if (startIndex > value.Length - charCount) 2382if (((uint)chunkLength + (uint)valueCount) <= (uint)chunkChars.Length) 2418int firstLength = m_ChunkChars.Length - m_ChunkLength; 2422m_ChunkLength = m_ChunkChars.Length; 2499Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 2630get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength); 2765if (!doNotMoveFollowingChars && chunk.m_ChunkLength <= DefaultCapacity * 2 && chunk.m_ChunkChars.Length - chunk.m_ChunkLength >= count)
src\runtime\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\runtime\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\runtime\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\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (1)
970for (int i = 0; i < linkingRegistrations.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (1)
539int newNotificationIndex = newChangeNotifications.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
142handleCount += (nuint)((object[])userData).Length; 169for (int i = 0; i < objArray.Length; i++)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (2)
296Debug.Assert(_numPendingRemoves <= _pendingRemoves.Length); 298Debug.Assert(_numUserWaits <= _registeredWaits.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (7)
5341Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5493for (int taskIndex = 0; taskIndex < tasks.Length; taskIndex++) 5510if (signaledTaskIndex == -1 && tasks.Length != 0) 6568Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6571m_count = tasks.Length; 6595T[] results = new T[m_tasks.Length]; 6603for (int i = 0; i < m_tasks.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCache.cs (1)
36for (int i = 0; i < tasks.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (1)
269for (int i = 0; i < combinedExceptions.Length - 1; i++)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory_T.cs (2)
1979if (tasks.Length == 0) ThrowHelper.ThrowArgumentException(ExceptionResource.Task_MultiTaskContinuation_EmptyTaskList, ExceptionArgument.tasks); 2030if (tasks.Length == 0) ThrowHelper.ThrowArgumentException(ExceptionResource.Task_MultiTaskContinuation_EmptyTaskList, ExceptionArgument.tasks);
src\runtime\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) 486return slotArray != null && id < slotArray.Length && slotArray[id].Value != null; 501if (slotArray == null || id >= slotArray.Length || (slot = slotArray[id].Value) == null || !_initialized) 516Debug.Assert(table.Length < minLength); 530for (int i = 0; i < table.Length; i++) 712for (int i = 0; i < slotArray.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (13)
48var newQueues = new WorkStealingQueue[oldQueues.Length + 1]; 49Array.Copy(oldQueues, newQueues, oldQueues.Length); 64if (oldQueues.Length == 0) 76var newQueues = new WorkStealingQueue[oldQueues.Length - 1]; 79Array.Copy(oldQueues, 1, newQueues, 0, newQueues.Length); 81else if (pos == oldQueues.Length - 1) 83Array.Copy(oldQueues, newQueues, newQueues.Length); 88Array.Copy(oldQueues, pos + 1, newQueues, pos, newQueues.Length - pos); 152var newArray = new object?[m_array.Length << 1]; 153for (int i = 0; i < m_array.Length; i++) 475queueIndex = _assignedWorkItemQueueThreadCounts.Length - 1; 774int c = queues.Length; 1772for (int i = 0; i < items.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (2)
52for (int i = 0; i < queues.Length; i++) 505_associatedTimerQueue = TimerQueue.Instances[(uint)Thread.GetCurrentProcessorId() % TimerQueue.Instances.Length];
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (1)
218int currentLength = (safeWaitHandles != null) ? safeWaitHandles.Length : 0;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.ThreadWaitInfo.Unix.cs (6)
139for (int i = 0; i < _waitedObjects.Length; ++i) 145int currentLength = _waitedObjects.Length; 158int currentLength = _waitedListNodes.Length; 165for (int i = currentLength; i < newItems.Length; i++) 183Debug.Assert(waitedCount <= _waitedObjects.Length); 193for (int i = waitedCount; i < waitedObjects.Length; ++i)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.WaitableObject.Unix.cs (3)
366Debug.Assert(waitableObjects.Length >= count); 513Debug.Assert(waitedObjects.Length >= waitedCount); 568Debug.Assert(waitedObjects.Length >= waitedCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
720Debug.Assert(array.Length - offset < count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (3)
531for (int i = 0; i < formats.Length; i++) 775for (int i = 0; i < formats.Length; i++) 790for (int i = 0; i < formats!.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (14)
91if (!_supportsDaylightSavingTime || _adjustmentRules is null || _adjustmentRules.Length == 0) 432if (_supportsDaylightSavingTime && _adjustmentRules is AdjustmentRule[] { Length: > 0 }) 461Debug.Assert(_adjustmentRules is not null && _adjustmentRules.Length > 0); 466int bottom = _adjustmentRules.Length - 1; 506T[] tmp = ArrayPool<T>.Shared.Rent(Math.Max(arrayPoolArray.Length * 2, requiredCapacity)); 528if (count >= transitions.Length) 637Debug.Assert(_adjustmentRules is not null && _adjustmentRules.Length > 0); 648Debug.Assert(ruleIndex < _adjustmentRules.Length); 784if (ruleIndex < _adjustmentRules.Length && _adjustmentRules[ruleIndex].DateStart.Year <= allTransitions[transitionCount - 1].DateEnd.Year) // ensure the year is included in the rule 1052rule : ruleIndex < _adjustmentRules.Length - 1 && 1246ruleIndex < _adjustmentRules.Length - 1 && _adjustmentRules[ruleIndex + 1].DateStart.Year <= year + 1 && _adjustmentRules[ruleIndex + 1].DateEnd.Year >= year + 1 ? 1341Debug.Assert(count > 0 && allTransitions is not null && count < allTransitions.Length); 1347if (count + _yearsTransitionsCount > _yearsTransitions.Length) 1349Array.Resize(ref _yearsTransitions, Math.Max(_yearsTransitions.Length * 2, count + _yearsTransitionsCount));
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (3)
958if (!disableDaylightSavingTime && adjustmentRules?.Length > 0) 1336if (adjustmentRules != null && adjustmentRules.Length != 0) 1340for (int i = 0; i < adjustmentRules.Length; i++)
src\runtime\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++) 505if (dts.Length > 0) 510while (index <= dts.Length) 516if (rules != null && rules.Length == 0) 543while (index < dts.Length && dts[index] == DateTime.MinValue) 548if (rulesList.Count == 0 && index < dts.Length) 573else if (index < dts.Length) 692if (transitionTypes.Length > 0) 1240if (data[index++] == '\n' && data[data.Length - 1] == '\n') 1242futureTransitionsPosixFormat = enc.GetString(data, index, data.Length - index - 1); 1309if (data == null || data.Length < index + Length) 1335if (data == null || data.Length < Length)
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (4)
49fs.ReadExactly(bytes, 0, bytes.Length); 271if (fileLength == rawData.Length) 274int count = rawData.Length; 316byte[] buffer = new byte[rawData.Length];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Type.cs (12)
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++) 626if (fields == null || fields.Length != 1) 682for (int i = 0; i < callingConventions.Length; i++) 696if (i == 0 && callingConventions.Length == 1) 706if (!isUnmanaged && callingConventions.Length >= 1) 721if (callConvIndex >= callingConventions.Length || modopt != callingConventions[callConvIndex]) 729if (callConvIndex > 0 && callConvIndex != callingConventions.Length) 732if (callConvIndex <= 0 && isUnmanaged && !builtInCallConv && callingConventions.Length > 0)
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (24)
70for (int i = 0; i < genericArguments.Length; i++) 153for (int i = 0; i < c.Length; i++) 160if (cnt == c.Length) 165for (int i = 0; i < c.Length; i++) 193for (i = 0; i < m.Length; i++) 201cnt += m.Length; 211for (i = 0; i < c.Length; i++) 219cnt += c.Length; 229for (i = 0; i < f.Length; i++) 237cnt += f.Length; 247for (i = 0; i < p.Length; i++) 255cnt += p.Length; 265for (i = 0; i < e.Length; i++) 273cnt += e.Length; 283for (i = 0; i < t.Length; i++) 291cnt += t.Length; 302for (i = 0; i < m.Length; i++) 310for (i = 0; i < c.Length; i++) 318for (i = 0; i < f.Length; i++) 326for (i = 0; i < p.Length; i++) 334for (i = 0; i < e.Length; i++) 342for (i = 0; i < t.Length; i++) 390for (int i = 0; i < constraints.Length; i++) 420for (int i = 0; i < interfaces.Length; i++)
System\ActivatorImplementation.cs (5)
62if (activationAttributes != null && activationAttributes.Length > 0) 69int numArgs = args.Length; 78ListBuilder<MethodBase> matches = new ListBuilder<MethodBase>(candidates.Length); 79for (int i = 0; i < candidates.Length; i++) 122if (args.Length != 0)
System\Array.NativeAot.cs (6)
229for (int i = 0; i < arrayOfArrays.Length; i++) 527int length = @this.Length; 535return Unsafe.As<T[]>(this).Length; 566return Array.IndexOf(@this, item, 0, @this.Length) >= 0; 572Array.Copy(@this, 0, array, arrayIndex, @this.Length); 611return Array.IndexOf(@this, item, 0, @this.Length);
System\CrashInfo.cs (1)
188if (stackFrames.Length > 0)
System\Delegate.cs (4)
529if (resultCount <= invocationList.Length) 552int allocCount = invocationList.Length; 577int allocCount = invocationList.Length; 685for (int i = 0; i < del.Length; i++)
System\Diagnostics\StackFrame.NativeAot.cs (1)
159int realFrameCount = (returnedFrameCount >= 0 ? returnedFrameCount : frameArray.Length);
System\Diagnostics\StackTrace.NativeAot.cs (1)
36InitializeForIpAddressArray(stackIPs, skipFrames, stackIPs.Length, needFileInfo);
System\Enum.NativeAot.cs (2)
55var values = new TStorage[valuesAsObject.Length]; 56for (int i = 0; i < valuesAsObject.Length; i++)
System\Exception.NativeAot.cs (8)
51Array.Copy(_corDbgStackTrace, ips, ips.Length); 67if (_idxFirstFreeStackTraceEntry >= _corDbgStackTrace.Length) 75IntPtr[] newArray = new IntPtr[_corDbgStackTrace.Length * 2]; 76for (int i = 0; i < _corDbgStackTrace.Length; i++) 157IntPtr[] newStackTrace = new IntPtr[stackTrace.Length]; 158Array.Copy(stackTrace, 0, newStackTrace, 0, stackTrace.Length); 170IntPtr[] newStackTrace = new IntPtr[stackTrace.Length + 1]; 171Array.Copy(stackTrace, 0, newStackTrace, 0, stackTrace.Length);
System\Object.NativeAot.cs (1)
32RuntimeImports.RhNewVariableSizeObject(this.GetMethodTable(), Unsafe.As<Array>(this).Length) :
System\Reflection\AssemblyRuntimeNameHelpers.cs (2)
39pkCopy = new byte[pkOriginal.Length]; 40Array.Copy(pkOriginal, pkCopy, pkOriginal.Length);
System\Reflection\DynamicInvokeInfo.cs (4)
191int argCount = parameters?.Length ?? 0; 594for (int i = 0; i < parameters.Length; i++) 741for (int i = 0; i < arguments.Length; i++) 776for (int i = 0; i < arguments.Length; i++)
System\Reflection\EnumInfo.cs (2)
34Debug.Assert(values.Length == names.Length);
System\Reflection\Runtime\Assemblies\NativeFormat\NativeFormatRuntimeAssembly.GetTypeCore.CaseSensitive.cs (2)
18int numNamespaceParts = parts.Length - 1; 62int idx = namespaceParts.Length;
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (5)
114if (method1.GetGenericArguments().Length != method2.GetGenericArguments().Length) 168if (ga1.Length != ga2.Length) 171for (int i = 0; i < ga1.Length; i++)
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (1)
169if (count == _members.Length)
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (4)
45if (argumentTypes.Length != parameterInfos.Length) 54bool excessSuppliedArguments = argumentTypes.Length > parameterInfos.Length; 85if (!parameterInfos[argumentTypes.Length].IsOptional) 98bool shortByMoreThanOneSuppliedArgument = argumentTypes.Length < parameterInfos.Length - 1;
System\Reflection\Runtime\CustomAttributes\RuntimeCustomAttributeData.cs (1)
73int parameterCount = parameterTypes.Length;
System\Reflection\Runtime\General\Assignability.cs (2)
202for (int i = 0; i < genericTypeParameters.Length; i++) 354if (toTypeGenericTypeArguments.Length != 1)
System\Reflection\Runtime\General\Helpers.cs (1)
41int count = typeInfos.Length;
System\Reflection\Runtime\General\TypeUnifier.cs (2)
304int count = parameterTypes.Length; 368int count = genericTypeArguments.Length;
System\Reflection\Runtime\MethodInfos\CustomMethodInvoker.cs (5)
40if (argCount != _parameterTypes.Length) 44for (int i = 0; i < convertedArguments.Length; i++) 91if (args.Length > 1) 93arguments = new object[args.Length - 1]; 94Array.Copy(args, 1, arguments, 0, args.Length - 1);
System\Reflection\Runtime\MethodInfos\NativeFormat\NativeFormatMethodCommon.cs (3)
190Debug.Assert(genericArgs == null || genericArgs.Length > 0); 195genericArgHandles = new RuntimeTypeHandle[genericArgs.Length]; 196for (int i = 0; i < genericArgHandles.Length; i++)
System\Reflection\Runtime\MethodInfos\RuntimeConstructedGenericMethodInfo.cs (5)
63if (_genericTypeArguments.Length != other._genericTypeArguments.Length) 65for (int i = 0; i < _genericTypeArguments.Length; i++) 78hashcode.Add(_genericTypeArguments.Length); 80for (int i = 0; i < _genericTypeArguments.Length; i++)
System\Reflection\Runtime\MethodInfos\RuntimeConstructorInfo.cs (3)
44if (parameters.Length == 0) 46ParameterInfo[] result = new ParameterInfo[parameters.Length]; 47for (int i = 0; i < result.Length; i++)
System\Reflection\Runtime\MethodInfos\RuntimeMethodHelpers.cs (3)
36int count = typeSignatures.Length; 72for (int i = 0; i < parameters.Length; i++) 100if (methodTypeArguments.Length != 0)
System\Reflection\Runtime\MethodInfos\RuntimeMethodInfo.cs (4)
47for (int i = 0; i < pis.Length; i++) 145if (runtimeParameterInfos.Length == 0) 147ParameterInfo[] result = new ParameterInfo[runtimeParameterInfos.Length]; 148for (int i = 0; i < result.Length; i++)
System\Reflection\Runtime\MethodInfos\RuntimeNamedMethodInfo.cs (7)
127if (GenericTypeParameters.Length == 0) 129RuntimeTypeInfo[] genericTypeArguments = new RuntimeTypeInfo[typeArguments.Length]; 130for (int i = 0; i < typeArguments.Length; i++) 144if (typeArguments.Length != GenericTypeParameters.Length) 145throw new ArgumentException(SR.Format(SR.Argument_NotEnoughGenArguments, typeArguments.Length, GenericTypeParameters.Length));
System\Reflection\Runtime\MethodInfos\RuntimeSyntheticConstructorInfo.cs (2)
150parameters = new RuntimeParameterInfo[runtimeParameterTypes.Length]; 151for (int i = 0; i < parameters.Length; i++)
System\Reflection\Runtime\MethodInfos\RuntimeSyntheticMethodInfo.cs (2)
203RuntimeParameterInfo[] parameters = new RuntimeParameterInfo[runtimeParameterTypes.Length]; 204for (int i = 0; i < parameters.Length; i++)
System\Reflection\Runtime\Modules\NativeFormat\NativeFormatRuntimeModule.cs (1)
48if (mvid.Length == 0)
System\Reflection\Runtime\PropertyInfos\RuntimePropertyInfo.cs (8)
84int count = runtimeMethodParameterInfos.Length; 102int numParameters = indexParameters.Length; 203arguments = new object[index.Length + 1]; 204for (int i = 0; i < index.Length; i++) 208arguments[index.Length] = value; 221if (indexParameters.Length != 0) 223RuntimeParameterInfo[] indexRuntimeParameters = new RuntimeParameterInfo[indexParameters.Length]; 224for (int i = 0; i < indexParameters.Length; i++)
System\Reflection\Runtime\TypeInfos\RuntimeArrayTypeInfo.cs (3)
114int[] lengths = new int[args.Length]; 115for (int i = 0; i < args.Length; i++) 312if (index != lengths.Length - 1)
System\Reflection\Runtime\TypeInfos\RuntimeConstructedGenericTypeInfo.cs (2)
69for (int i = 0; i < genericTypeArguments.Length; i++) 158for (int i = 0; i < genericTypeArguments.Length; i++)
System\Reflection\Runtime\TypeInfos\RuntimeConstructedGenericTypeInfo.UnificationKey.cs (4)
50if (GenericTypeArguments.Length != other.GenericTypeArguments.Length) 52for (int i = 0; i < GenericTypeArguments.Length; i++) 67for (int i = 0; i < GenericTypeArguments.Length; i++)
System\Reflection\Runtime\TypeInfos\RuntimeFunctionPointerTypeInfo.cs (4)
68if (_key.ParameterTypes.Length == 0) 71Type[] result = new Type[_key.ParameterTypes.Length]; 72Array.Copy(_key.ParameterTypes, result, result.Length); 87for (int i = 0; i < parameters.Length; i++)
System\Reflection\Runtime\TypeInfos\RuntimeFunctionPointerTypeInfo.UnificationKey.cs (4)
54if (ParameterTypes.Length != other.ParameterTypes.Length) 56for (int i = 0; i < ParameterTypes.Length; i++) 71for (int i = 0; i < ParameterTypes.Length; i++)
System\Reflection\Runtime\TypeInfos\RuntimeGenericParameterTypeInfo.cs (6)
134for (int i = 0; i < constraints.Length; i++) 156ArrayBuilder<QTypeDefRefOrSpec> result = new ArrayBuilder<QTypeDefRefOrSpec>(constraints.Length); 158for (int i = 0; i < constraints.Length; i++) 174if (constraints.Length == 0) 176RuntimeTypeInfo[] constraintInfos = new RuntimeTypeInfo[constraints.Length]; 177for (int i = 0; i < constraints.Length; i++)
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.BindingFlags.cs (5)
30if (types.Length == 0 && candidates.Count == 1) 86if (types.Length == 0 && candidates.Count == 1) 120if (types == null || (candidate.GetIndexParameters().Length == types.Length)) 130if (types == null || types.Length == 0)
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.cs (5)
425RuntimeTypeInfo[] runtimeParameterTypes = new RuntimeTypeInfo[parameterTypes.Length]; 427for (int i = 0; i < parameterTypes.Length; i++) 466RuntimeTypeInfo?[] runtimeTypeArguments = new RuntimeTypeInfo[typeArguments.Length]; 467for (int i = 0; i < typeArguments.Length; i++) 493for (int i = 0; i < typeArguments.Length; i++)
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.InvokeMember.cs (8)
50if (namedParams.Length > providedArgs.Length) 56if (namedParams.Length != 0) 74int argCnt = (providedArgs != null) ? providedArgs.Length : 0; 143if (flds.Length == 1) 147else if (flds.Length > 0) 271for (int i = 0; i < semiFinalists.Length; i++) 311for (int i = 0; i < semiFinalists.Length; i++)
System\Reflection\RuntimeAssemblyName.cs (3)
94else if (thisPK.Length != otherPK.Length) 100for (int i = 0; i < thisPK.Length; i++)
System\Runtime\CompilerServices\ClassConstructorRunner.cs (7)
291for (int i = 0; i < segment.Length; i++) 310for (int i = 0; i < segment.Length; i++) 326if (s_cctorArraysCount == s_cctorArrays.Length) 329Array.Resize(ref s_cctorArrays, (s_cctorArrays.Length * 2) + 1); 427if (s_nextBlockingRecordIndex == s_blockingRecords.Length) 429BlockingRecord[] newBlockingRecords = new BlockingRecord[s_blockingRecords.Length + Grow]; 430for (int i = 0; i < s_blockingRecords.Length; i++)
System\Runtime\InteropServices\PInvokeMarshal.cs (2)
437int lenUnicode = managedArray.Length; 465int lenInBytes = managedArray.Length;
System\RuntimeType.NativeAot.cs (5)
189int count = values.Length; 198Array.Copy(values, result, values.Length); 368for (int i = 0; i < result.Length; i++) 447for (int i = 0; i < result.Length; i++) 586for (int i = 0; i < result.Length; i++)
System\Text\StringBuilder.NativeAot.cs (1)
52int len = chunkCharsCandidate.Length;
System\Threading\SyncTable.cs (3)
128if (s_unusedEntryIndex >= s_entries.Length) 135Debug.Assert(s_unusedEntryIndex < s_entries.Length); 177int oldSize = s_entries.Length;
System.Private.CoreLib.Generators (31)
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)
NativeRuntimeEventSourceGenerator.cs (3)
80if (tokens.Length == 0) 85if (tokens.Length > 2) 91if (tokens.Length == 2)
System.Private.DataContractSerialization (460)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (2)
100for (int i = 0; i < genericArgs.Length; i++) 275if (typeArguments != null && typeArguments.Length > 0)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs (1)
46for (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); 703baseMemberCount = BaseClassContract.MemberNames!.Length; 708baseContractCount = BaseClassContract.ContractNamespaces!.Length; 819for (int i = 0; i < memberInfos.Length; i++) 825if (memberAttributes != null && memberAttributes.Length > 0) 827if (memberAttributes.Length > 1) 849if (getMethod.GetParameters().Length > 0) 888if (memberAttributes != null && memberAttributes.Length > 0) 890if (memberAttributes.Length > 1) 899if (getMethod == null || IsMethodOverriding(getMethod) || getMethod.GetParameters().Length > 0) 936if (optionalFields == null || optionalFields.Length == 0) 1075for (int i = 0; i < methods.Length; i++) 1113if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != Globals.TypeOfExtensionDataObject) 1136if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != Globals.TypeOfStreamingContext) 1338Type[] underlyingParamTypes = new Type[paramContracts.Length]; 1339for (int i = 0; i < paramContracts.Length; i++) 1348genericParams = new object[paramTypes.Length]; 1349for (int i = 0; i < paramTypes.Length; i++)
System\Runtime\Serialization\CodeGenerator.cs (8)
124Type[] paramTypes = new Type[parameters.Length]; 125for (int i = 0; i < parameters.Length; i++) 146for (int i = 0; i < argTypes.Length; i++) 417if (methodInfo.GetParameters().Length != expectedCount) 418throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ParameterCountMismatch, methodInfo.Name, methodInfo.GetParameters().Length, expectedCount)); 1214for (int i = 0; i < caseLabels.Length; i++) 1293NewArray(typeof(object), values.Length); 1296for (int i = 0; i < values.Length; i++)
System\Runtime\Serialization\CollectionDataContract.cs (5)
994for (int i = 0; i < interfaces.Length; i++) 1055for (int i = 0; i < knownInterfaces.Length; i++) 1137for (int i = 0; i < knownInterfaces.Length; i++) 1293for (int i = 0; i < interfaces.Length; i++) 1393for (int i = 0; i < paramTypes.Length; i++)
System\Runtime\Serialization\ContextAware.cs (1)
19public int Length => _contracts.Length;
System\Runtime\Serialization\DataContract.cs (18)
1368if (dataContractAttributes != null && dataContractAttributes.Length > 0) 1371if (dataContractAttributes.Length > 1) 1393if (collectionContractAttributes != null && collectionContractAttributes.Length > 0) 1396if (collectionContractAttributes.Length > 1) 1513for (int i = 0; i < genParams.Length; i++) 1729for (int i = 0; i < nsAttributes.Length; i++) 1793int blocks = (namespaces.Length + 8) / 64 + 1; 1805if (offset + 64 > namespaces.Length) 1809for (int j = offset; j < namespaces.Length; j++) 1813if (offset <= namespaces.Length) 1815block[namespaces.Length - offset] = 0x80; 1821block[56] = (byte)(namespaces.Length << 3); 1822block[57] = (byte)(namespaces.Length >> 5); 1823block[58] = (byte)(namespaces.Length >> 13); 1824block[59] = (byte)(namespaces.Length >> 21); 1980for (int i = 0; i < knownTypeAttributes.Length; ++i) 2310_genericParams = new object[genericParams.Length]; 2319return _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)
185_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2); 262int 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 (7)
19m_objs = new object[m_ids.Length]; 37if (m_currentCount >= (m_objs.Length - 1)) 78if (i == (m_objs.Length - 1)) 90int cacheSize = m_objs.Length; 125return (RuntimeHelpers.GetHashCode(o) & 0x7FFFFFFF) % m_objs.Length; 130int size = GetPrime(m_objs.Length + 1); // The lookup does an inherent doubling 136for (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)
554for (int i = 0; i < schemaArray.Length; i++) 559for (int j = 0; j < itemArray.Length; j++) 608if (attrs == null || attrs.Length == 0) 812if (nodes == null || nodes.Length == 0) 815for (int i = 0; i < nodes.Length; i++)
System\Runtime\Serialization\SchemaImporter.cs (1)
1433for (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)
221for (int i = memberIndex + 1; i < memberNames.Length; i++) 227return memberNames.Length; 234for (int i = memberIndex + 1; i < memberNames.Length; i++) 244return memberNames.Length; 251if (requiredIndex == memberNames.Length) 451if (array.Length <= index) 461Array.Copy(array, newArray, array.Length); 469if (size != array.Length)
System\Runtime\Serialization\XmlReaderDelegator.cs (8)
105for (int i = 0; i < localNames.Length; i++) 907context.IncrementItemCount(array.Length); 937context.IncrementItemCount(array.Length); 967context.IncrementItemCount(array.Length); 997context.IncrementItemCount(array.Length); 1027context.IncrementItemCount(array.Length); 1057context.IncrementItemCount(array.Length); 1087context.IncrementItemCount(array.Length);
System\Runtime\Serialization\XmlSerializableServices.cs (1)
60for (int i = 0; i < nodes.Length; i++)
System\Runtime\Serialization\XmlWriterDelegator.cs (15)
564writer.WriteBase64(bytes, 0, bytes.Length); 712for (int i = 0; i < value.Length; i++) 719dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 727for (int i = 0; i < value.Length; i++) 734dictionaryWriter.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); 757for (int i = 0; i < value.Length; i++) 764dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 772for (int i = 0; i < value.Length; i++) 779dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 787for (int i = 0; i < value.Length; i++) 794dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 802for (int i = 0; i < value.Length; i++) 809dictionaryWriter.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)
71if (offset > guid.Length) 72throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, guid.Length)); 73if (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)
47else 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)); 1428while (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.Reflection.Execution (36)
Internal\Reflection\Execution\ExecutionEnvironmentImplementation.MappingTables.cs (4)
190Type[] typeArguments = new Type[genericTypeArgumentHandles.Length]; 191for (int i = 0; i < genericTypeArgumentHandles.Length; i++) 434if (binarySearchIndex >= Data.Length || Data[binarySearchIndex].FunctionPointer != functionPointer) 440while ((lastParserOffsetIndex < (Data.Length - 1)) && Data[lastParserOffsetIndex + 1].FunctionPointer == functionPointer)
Internal\Reflection\Execution\ExecutionEnvironmentImplementation.Runtime.cs (2)
30var tMethods = new MethodInfo[ifaceMethods.Length]; 31for (int i = 0; i < ifaceMethods.Length; i++)
Internal\Reflection\Execution\TypeLoader\ConstraintValidator.cs (4)
67if (typeParameters.Length != typeArguments.Length) 74for (int i = 0; i < typeParameters.Length; i++) 84for (int i = 0; i < typeParameters.Length; i++)
Internal\Reflection\Execution\TypeLoader\ConstraintValidatorSupport.cs (3)
62for (int i = 0; i < interfaces.Length; i++) 101for (int i = 0; i < arguments.Length; i++) 256Debug.Assert(arguments.Length == 1);
Internal\Reflection\Execution\TypeLoader\TypeCast.cs (10)
91Debug.Assert(pInterfaceInstantiation.Length == 1, "arity mismatch for array generic interface"); 92Debug.Assert(pTargetInstantiation.Length == 1, "arity mismatch for array generic interface"); 146Debug.Assert(pSourceInstantiation.Length == pTargetInstantiation.Length, "arity mismatch between generic instantiations"); 148Debug.Assert(fForceCovariance || pTargetInstantiation.Length == pVarianceInfo.Length, "arity mismatch between generic instantiations"); 152for (int i = 0; i < pTargetInstantiation.Length; i++) 392Debug.Assert(args1.Length == args2.Length); 394for (int i = 0; i < args1.Length; i++)
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Generic\LowLevelDictionary.cs (8)
165if (_numEntries > (_buckets.Length * 2)) 176int newNumBuckets = _buckets.Length * 2 + 1; 178for (int i = 0; i < _buckets.Length; i++) 203return (h % (numBuckets == 0 ? _buckets.Length : numBuckets)); 225for (int bucket = 0; bucket < _dict._buckets.Length; bucket++) 244if (_curPosition == -1 || _curPosition == _entries.Length) 259if (_curPosition != _entries.Length) 261bool anyMore = (_curPosition != _entries.Length);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
System.Private.StackTraceMetadata (1)
Internal\StackTraceMetadata\StackTraceMetadata.cs (1)
487Debug.Assert(current == _stacktraceDatas.Length);
System.Private.TypeLoader (102)
Internal\Reflection\Execution\AssemblyBinderImplementation.cs (2)
83List<AssemblyBindResult> loadedAssemblies = new List<AssemblyBindResult>(ScopeGroups.Length); 99return ScopeGroups.Length;
Internal\Runtime\TypeLoader\EETypeCreator.cs (7)
163runtimeInterfacesLength = checked((ushort)state.RuntimeInterfaces.Length); 455int count = bitfield.Length; 491while (i < bitfield.Length) 509while ((i < bitfield.Length) && (bitfield[i])) 527*ptr-- = (short)((first + bitfield.Length - last) * IntPtr.Size); 548Debug.Assert(state.HalfBakedRuntimeTypeHandle.ToEETypePtr()->NumFunctionPointerParameters == parameterHandles.Length); 550for (int i = 0; i < parameterHandles.Length; i++)
Internal\Runtime\TypeLoader\GenericDictionary.cs (5)
28Debug.Assert(_cells.Length == 0 || _addressOfFirstCellSlot != null); 31for (int i = 0; i < _cells.Length; i++) 48if (_cells.Length > 0) 51_addressOfFirstCellSlot = MemoryHelpers.AllocateMemory(checked((int)(_cells.Length * IntPtr.Size))); 71void* dictionaryWithHeader = MemoryHelpers.AllocateMemory(checked((int)((_cells.Length + 1) * IntPtr.Size)));
Internal\Runtime\TypeLoader\ModuleList.cs (4)
103for (int moduleIndex = 0; moduleIndex < Modules.Length; moduleIndex++) 201if (_iterationIndex + 1 >= _modules.Length) 260ModuleInfo[] updatedModules = new ModuleInfo[loadedModuleHandles.Length]; 262for (int newModuleIndex = 0; newModuleIndex < loadedModuleHandles.Length; newModuleIndex++)
Internal\Runtime\TypeLoader\NativeLayoutInfoLoadContext.cs (2)
161for (uint i = 0; i < parameters.Length; i++) 199Debug.Assert(typeArguments.Length > 0);
Internal\Runtime\TypeLoader\TypeBuilder.cs (3)
595for (int i = 0; i < interfaces.Length; i++) 901for (int i = 0; i < mdArrayNewTypesCount.Length; i++) 1123Debug.Assert(!genericTypeDefinitionHandle.IsNull() && genericTypeArgumentHandles != null && genericTypeArgumentHandles.Length > 0);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.ConstructedGenericMethodsLookup.cs (5)
63if (other._genericMethodArgumentHandles.Length != _genericMethodArgumentHandles.Length) 66for (int i = 0; i < _genericMethodArgumentHandles.Length; i++) 177if (parsedArgsHandles.Length != _methodToLookup.Instantiation.Length) 208if (entry._genericMethodArgumentHandles.Length != _methodToLookup.Instantiation.Length)
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.ConstructedGenericTypesLookup.cs (8)
53if (other._genericTypeArgumentHandles.Length != _genericTypeArgumentHandles.Length) 56for (int i = 0; i < _genericTypeArgumentHandles.Length; i++) 126int lookupArity = (_typeToLookup != null ? _typeToLookup.Instantiation.Length : _genericTypeArgumentHandles.Length); 151if (entry._genericTypeArgumentHandles.Length != expectedArity) 160if (entry._genericTypeArgumentHandles.Length != _genericTypeArgumentHandles.Length) 163for (int i = 0; i < _genericTypeArgumentHandles.Length; i++)
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.cs (3)
405if (genericArgHandles1.Length != genericArgHandles2.Length) 412for (int i = 0; i < genericArgHandles1.Length; i++)
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.LdTokenResultLookup.cs (5)
66Debug.Assert(genericArgs == null || genericArgs.Length > 0); 96if (_genericArgs.Length != other._genericArgs.Length) 99for (int i = 0; i < _genericArgs.Length; i++) 178int numGenericMethodArgs = genericMethodArgs == null ? 0 : genericMethodArgs.Length;
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.Metadata.cs (6)
68if (seq1.Length != seq2.Length) 70for (int i = 0; i < seq1.Length; i++) 305if (RuntimeAugments.GetFunctionPointerParameterCount(foundTypeHandle) != parameterHandles.Length) 314for (int i = 0; i < parameterHandles.Length; i++) 564Debug.Assert(isGenericVirtualMethod == ((genericArgs != null) && genericArgs.Length > 0));
Internal\TypeSystem\RuntimeMethodDesc.cs (2)
56for (int i = 0; i < genericParameters.Length; i++) 164for (int j = 0; j < clone.Length; j++)
Internal\TypeSystem\RuntimeNoMetadataType.cs (2)
48for (int i = 0; i < genericParameters.Length; i++) 287for (int j = 0; j < clone.Length; j++)
Internal\TypeSystem\TypeDesc.Runtime.cs (1)
133for (int i = 0; i < parameterHandles.Length; i++)
Internal\TypeSystem\TypeSystemContext.Runtime.cs (6)
87|| key.ParameterTypes.Length != RuntimeAugments.GetFunctionPointerParameterCount(value) 91for (int i = 0; i < key.ParameterTypes.Length; i++) 166TypeDesc[] TypeDescs = new TypeDesc[runtimeTypeHandles.Length]; 167for (int i = 0; i < runtimeTypeHandles.Length; i++) 198ReadOnlySpan<Runtime.GenericVariance> varianceData = new ReadOnlySpan<Runtime.GenericVariance>(runtimeVariance, runtimeVariance == null ? 0 : genericParameters.Length); 200returnedType = new NoMetadataType(this, rtth, genericParameters.Length, varianceData, rtth.GetHashCode());
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Generic\LowLevelDictionary.cs (8)
165if (_numEntries > (_buckets.Length * 2)) 176int newNumBuckets = _buckets.Length * 2 + 1; 178for (int i = 0; i < _buckets.Length; i++) 203return (h % (numBuckets == 0 ? _buckets.Length : numBuckets)); 225for (int bucket = 0; bucket < _dict._buckets.Length; bucket++) 244if (_curPosition == -1 || _curPosition == _entries.Length) 259if (_curPosition != _entries.Length) 261bool anyMore = (_curPosition != _entries.Length);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
27if (_buffer.Length == _size) 28Array.Resize(ref _buffer, 2 * _buffer.Length);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (5)
27if (_count != _items.Length) 43if (_items == null || _count == _items.Length) 65Append(newItems, 0, newItems.Length); 74Debug.Assert(newItems.Length >= offset + length); 99if (requestedCapacity > ((_items != null) ? _items.Length : 0))
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ArrayType.cs (2)
108for (int i = 0; i < methods.Length; i++) 291for (int i = 0; i < argTypes.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\InstantiatedType.cs (4)
254for (int j = 0; j < clone.Length; j++) 273for (int i = 0; i < uninstantiatedTypes.Length; i++) 281clone = new T[uninstantiatedTypes.Length]; 282for (int j = 0; j < clone.Length; j++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Instantiation.cs (6)
41return _genericParameters.Length; 66for (int i = 0; i < _genericParameters.Length; i++) 100if (_currentIndex >= _collection.Length) 110if (_genericParameters.Length != other._genericParameters.Length) 113for (int i = 0; i < _genericParameters.Length; i++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MethodDesc.cs (13)
93for (int i = 0; i < newParameters.Length; i++) 176return _parameters.Length; 184return _embeddedSignatureData != null && _embeddedSignatureData.Length != 0; 203if ((_embeddedSignatureData == null) || (_embeddedSignatureData.Length == 0)) 261if (this._parameters.Length != otherSignature._parameters.Length) 264for (int i = 0; i < this._parameters.Length; i++) 284if (this._embeddedSignatureData.Length != otherSignature._embeddedSignatureData.Length) 289for (int i = 0; i < this._embeddedSignatureData.Length; i++) 413TypeDesc[] parameters = new TypeDesc[_parameters.Length]; 414for (int i = 0; i < parameters.Length; i++) 748for (int j = 0; j < clone.Length; j++)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\VersionResilientHashCode.TypeSystem.cs (1)
31for (int i = 0; i < instantiation.Length; i++)
System.Private.Windows.Core (39)
System\Collections\Generic\ArrayBuilder.cs (6)
37if ((uint)count < (uint)_items.Length) 50if (_items.Length == _maxCount) 55Debug.Assert(_count == _items.Length); 58Debug.Assert(_items.Length > 0); 59int newCapacity = Math.Min(_maxCount, 2 * _items.Length); 69Debug.Assert(_count == _items.Length);
System\IO\BinaryReaderExtensions.cs (1)
122Span<byte> arrayData = new(a, array.Length * sizeof(T));
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
468for (int i = 0; i < keys.Length; i++)
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (1)
317if (files is null || files.Length == 0)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (2)
176index = s_serializedObjectID.Length; 179return new MemoryStream(bytes, index, bytes.Length - index);
System\Private\Windows\Ole\DataStore.cs (2)
146for (int i = 0; i < formats.Length; i++) 167int definedCount = definedFormats.Length;
System\Private\Windows\Ole\FormatEnumerator.cs (1)
41for (int i = 0; i < formats.Length; i++)
System\TypeExtensions.cs (2)
73if (genericNames.Length != genericTypes.Length) 78for (int i = 0; i < genericTypes.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)
292new Span<sbyte>(psa->pvData, array.Length) 296new Span<byte>(psa->pvData, array.Length) 300new Span<short>(psa->pvData, array.Length) 304new Span<ushort>(psa->pvData, array.Length) 309new Span<int>(psa->pvData, array.Length) 315new Span<uint>(psa->pvData, array.Length) 319new Span<long>(psa->pvData, array.Length) 323new Span<ulong>(psa->pvData, array.Length) 327new Span<float>(psa->pvData, array.Length) 331new Span<double>(psa->pvData, array.Length) 336Span<VARIANT_BOOL> data = new(psa->pvData, array.Length); 348Span<DECIMAL> data = new(psa->pvData, array.Length); 360Span<long> data = new(psa->pvData, array.Length); 372Span<double> data = new(psa->pvData, array.Length); 384Span<IntPtr> data = new(psa->pvData, array.Length); 397Span<IntPtr> data = new(psa->pvData, array.Length); 409Span<VARIANT> data = new(psa->pvData, array.Length); 423else if (array.Length != 0) 876=> MemoryMarshal.CreateSpan(ref Unsafe.AsRef<T>(Marshal.UnsafeAddrOfPinnedArrayElement(array, 0).ToPointer()), array.Length);
Windows\Win32\System\Variant\VARIANTVector.cs (2)
18var variants = new VARIANT[values.Length]; 21for (int i = 0; i < values.Length; ++i)
System.Private.Windows.Core.TestUtilities (8)
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)
ReflectionHelper.cs (1)
78if (nestedTypes.Length == 0)
System.Private.Xml (858)
_generated\0\RegexGenerator.g.cs (2)
2557if ((uint)p < (uint)s.Length) 2583if ((uint)(p + 1) < (uint)s.Length)
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) 3041if (_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); 854_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _); 857if (_bufBytesUsed >= (_bufBytes.Length - 16)) 877_encoder!.Convert(_bufChars, 1, 0, _bufBytes!, 0, _bufBytes!.Length, true, out _, out bEnc, out _); 1686if (_lastMarkPos + 1 == _textContentMarks!.Length) 1695Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length); 1696int[] newTextContentMarks = new int[_textContentMarks.Length * 2]; 1697Array.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); 686_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _); 689if (_bufBytesUsed >= (_bufBytes.Length - 16)) 709_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); 3363if (_ps.charsUsed == _ps.chars.Length - 1) 3371char[] newChars = new char[_ps.chars.Length * 2]; 3372BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3382if (_ps.bytes.Length - _ps.bytesUsed < MaxByteSequenceLen) 3384byte[] newBytes = new byte[_ps.bytes.Length * 2]; 3391charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3399int charsLen = _ps.chars.Length; 3422char[] newChars = new char[_ps.chars.Length * 2]; 3423BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3448charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3458if (_ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0) 3460int read = _ps.stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed); 3482charsRead = _ps.textReader.Read(_ps.chars, _ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1); 3494Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3507Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 5020if (_attrDuplSortingArray == null || _attrDuplSortingArray.Length < _attrCount) 7640Debug.Assert(nodeIndex < _nodes.Length); 7641Debug.Assert(_nodes[_nodes.Length - 1] == null); 7654Debug.Assert(nodeIndex < _nodes.Length); 7655if (nodeIndex >= _nodes.Length - 1) 7657NodeData[] newNodes = new NodeData[_nodes.Length * 2]; 7658Array.Copy(_nodes, newNodes, _nodes.Length); 7661Debug.Assert(nodeIndex < _nodes.Length); 8118else if (_parsingStatesStackTop + 1 == _parsingStatesStack.Length) 8120ParsingState[] newParsingStateStack = new ParsingState[_parsingStatesStack.Length * 2]; 8121Array.Copy(_parsingStatesStack, newParsingStateStack, _parsingStatesStack.Length); 8170if (array.Length - index < count) 9580Debug.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)
469if (top == _elemScopeStack.Length) 1063ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1089ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1141ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1749if (top == _nsStack.Length) 2095if (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); 284Add(uri, new ByteArrayChunk(value, 0, value.Length)); 294ArgumentOutOfRangeException.ThrowIfGreaterThan(count, value.Length - offset); 357for (int i = 0; i < dtdSet.Length; i++)
System\Xml\Schema\Asttree.cs (3)
555ArrayList AstArray = new ArrayList(xpath.Length); 556_fAxisArray = new ArrayList(xpath.Length); 562for (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)
1278baseTypeCount += union1.MemberTypes.Length; 1279for (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++) 1490for (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)
657ArgumentOutOfRangeException.ThrowIfGreaterThan(index, schemas.Length - 1); 845for (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)
1285for (int j = 0; j < locations.Length - 1; j += 2) 2011for (int i = 0; i < ss.Length; ++i) 2162_context.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length]; 2164for (int i = 0; i < currentElementDecl.Constraints.Length; ++i) 2171for (int i = 0; i < _context.Constr.Length; ++i) 2186for (int j = 0; j < constraintStructures.Length; ++j) 2236for (int j = 0; j < constraintStructures.Length; ++j) 2291for (int i = 0; i < constraintStructures.Length; ++i) 2337for (int i = 0; i < constraints.Length; ++i) 2455for (int i = 0; i < vcs.Length; ++i) 2747Debug.Assert(nsList.Length > 0); 2749for (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++) 1645Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 1646for (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)
54for (int i = 0; i < xmlMappings.Length; i++) 111for (int i = 0; i < xmlMappings.Length; i++) 148if (attrs.Length == 0) 270if (attrs.Length != 1) 283for (int i = 0; i < modules.Length; i++) 329for (int i = 0; i < types.Length; i++) 339if (assembly != null && types.Length > 0) 341for (int i = 0; i < types.Length; i++) 376if (types != null && types.Length == 1 && types[0] != null) 393string?[] writeMethodNames = new string[xmlMappings.Length]; 395for (int i = 0; i < xmlMappings.Length; i++) 407string?[] readMethodNames = new string[xmlMappings.Length]; 408for (int i = 0; i < xmlMappings.Length; i++) 417for (int i = 0; i < xmlMappings.Length; i++) 431stream.Write(info, 0, info.Length); 440var mainType = (types.Length > 0) ? types[0] : null; 452for (int i = 0; i < types.Length; i++) 489string[] writeMethodNames = new string[xmlMappings.Length]; 491for (int i = 0; i < xmlMappings.Length; i++) 505string[] readMethodNames = new string[xmlMappings.Length]; 506for (int i = 0; i < xmlMappings.Length; i++) 514for (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)
329for (int i = 0; i < memberTypes.Length; i++) 434for (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); 593for (int i = 0; i < _members.Length; i++) 646for (int i = 0; i < _members.Length; i++) 716get { return _text != null && (_elements == null || _elements.Length == 0); } 721get { return (_elements != null && _elements.Length > 0); } 773_sortedElements = new ElementAccessor[_elements.Length]; 774Array.Copy(_elements, _sortedElements, _elements.Length); 810if (_elements != null && _elements.Length > 0) return _elements[0]; 825if (a.Length != b.Length) 827for (int i = 0; i < a.Length; i++) 837if (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)
97object[] p = new object[mappings.Length]; 143for (int i = 0; i < mappings.Length; i++) 165for (int j = 0; j < mappings.Length; j++) 201for (int j = 0; j < mapping.Elements!.Length; j++) 225&& !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 242if (members.Length > 0 && members[0].Mapping.IsReturnValue) 291for (int i = 0; i < mappings.Length; i++) 318object?[] p = new object[mappings.Length]; 349Member[] members = new Member[mappings.Length]; 350for (int i = 0; i < mappings.Length; i++) 360for (int j = 0; j < mappings.Length; j++) 374if (members.Length > 0 && members[0].Mapping.IsReturnValue) 546if (collection is Array currentArray && currentArray.Length == collectionMember.Count) 760for (int i = 0; i < m.Mapping.Elements!.Length; i++) 825for (int i = 0; i < elements.Length; i++) 1300for (int i = 0; i < constants.Length; i++) 1354members = new Member[mappings.Length]; 1355for (int i = 0; i < mappings.Length; i++) 1406if (member.Mapping.Elements!.Length == 0) 1602var allMembersList = new List<Member>(mappings.Length); 1604for (int i = 0; i < mappings.Length; i++) 1627for (int j = 0; j < mapping.Elements!.Length; j++) 1644if (member.Source == null && mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1997Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.Type!.GetElementType()!, vals.Length); 1998for (int i = 0; i < vals.Length; i++) 2049length = currentArray.Length;
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (31)
120!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 132if (elements.Length == 0 && text == null) 144if (choiceSource == null || ((Array)choiceSource).Length < ((Array)o).Length) 187if (elements.Length == 0 && text == null) 190if (elements.Length == 1 && text == null) 205for (int i = 0; i < elements.Length; i++) 293if (elements.Length > 0 && o != null) 304for (int i = 0; i < choiceMapping.Constants!.Length; i++) 418if (mapping.Elements == null || mapping.Elements.Length != 1) 650for (int i = 0; i < members.Length; i++) 677for (int i = 0; i < members.Length; i++) 697bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 765if (constants.Length > 0) 769for (int i = 0; i < constants.Length; i++) 784string[] xmlNames = new string[constants.Length]; 785long[] valueIds = new long[constants.Length]; 787for (int i = 0; i < constants.Length; i++) 966for (int i = 0; i < members.Length; i++) 1276int pLength = p.Length; 1293for (int i = 0; i < mapping.Members!.Length; i++) 1303for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++) 1321for (int i = 0; i < mapping.Members!.Length; i++) 1334for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++) 1353for (int j = 0; j < mapping.Members.Length; j++) 1363if (isRpc && member.IsReturnValue && member.Elements!.Length > 0) 1384if (pLength > mapping.Members.Length) 1386for (int i = mapping.Members.Length; i < pLength; i++) 1418if (memberInfos == null || memberInfos.Length == 0) 1425if (memberInfos != null && memberInfos.Length != 0) 1447if (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)
433if (typeDescs.Length == 0) return null; 437for (int i = 0; i < typeDescs.Length; i++) 449for (i = 0; i < typeDescs.Length; i++) 453if (i == typeDescs.Length) break; 554for (int i = 0; i < s_unsupportedTypes.Length; i++) 605for (int i = 0; i < s_unsupportedTypes.Length; i++) 1054for (int i = 0; i < arguments.Length; i++) 1105for (int i = 0; i < mapping.Members!.Length; i++) 1194for (int i = 0; i < mappings.Length; ++i) 1229for (int i = 0; i < mappings.Length; i++) 1318if (attrs != null && attrs.Length > 0) 1410if (defaultMembers != null && defaultMembers.Length > 0) 1414for (int i = 0; i < defaultMembers.Length; i++) 1422if (parameters.Length == 1 && parameters[0].ParameterType == typeof(int))
System\Xml\Serialization\XmlAttributes.cs (2)
84for (int i = 0; i < attrs.Length; i++) 196if (attrs.Length == 0) return null;
System\Xml\Serialization\Xmlcustomformatter.cs (6)
175for (int i = 0; i < toks.Length; i++) 198if (value.Length == 0) 208if (ids.Length != vals.Length) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Invalid enum")); 215for (int i = 0; i < ids.Length; i++) 507for (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 (24)
98for (int i = 0; i < attrs.Length; i++) 236if (mapping.Elements != null && mapping.Elements.Length > 0) 526if (attrs.Length > 0) 891if (member.Elements != null && member.Elements.Length != 0) 983for (int i = 0; i < names.Length; i++) 1023if (mapping.Elements!.Length == 1) 1109for (int i = 0; i < mapping.Elements!.Length; i++) 1220for (int i = 0; i < model.Constants.Length; i++) 1256MemberMapping[] mappings = new MemberMapping[xmlReflectionMembers.Length]; 1262for (int i = 0; i < mappings.Length; i++) 1398if (xmlReflectionMember.OverrideIsNullable && member.Elements!.Length > 0) 1405for (int i = 0; i < reflectionMembers.Length; i++) 1459for (int i = 0; i < xmlReflectionMembers.Length; i++) 1476if (infos == null || infos.Length == 0) 1488else if (infos.Length > 1) 1982if (accessor.TypeDesc.IsArrayLike && accessor.Elements.Length > 0 && !(accessor.Elements[0].Mapping is ArrayMapping)) 1992accessor.ChoiceIdentifier.MemberIds = new string[accessor.Elements.Length]; 1993for (int i = 0; i < accessor.Elements.Length; i++) 1998for (int j = 0; j < choiceMapping.Constants!.Length; j++) 2133for (int i = 0; i < choiceMapping.Constants!.Length; i++) 2220else if (!isSequence && member.Elements != null && member.Elements.Length > 0) 2222for (int i = 0; i < member.Elements.Length; i++) 2250else if (!isSequence && member.Elements != null && member.Elements.Length > 0) 2252for (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) 646if (accessors.Length == 0) return; 647if (accessors.Length == 1) 656for (int i = 0; i < accessors.Length; i++) 879string[] names = new string[c.Length]; 880long[] ids = new long[c.Length]; 882for (int i = 0; i < c.Length; i++) 893for (int i = 0; i < c.Length; i++) 1037for (int i = 0; i < members.Length; i++) 1050if (member.Elements!.Length > 0) 1053!(member.Elements.Length == 1 && member.Elements[0].Mapping is ArrayMapping); 1108for (int i = 0; i < members.Length; i++) 1153for (int i = 0; i < mapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSchemaImporter.cs (17)
163if (mapping.Members!.Length != 1 || !mapping.Members[0].Accessor!.Any) 198MemberMapping[] members = new MemberMapping[names.Length]; 199for (int i = 0; i < names.Length; i++) 586for (int i = 0; i < structMapping.Members.Length; i++) 782Hashtable uniqueTypeDescs = new Hashtable(member.Elements.Length); 784for (int i = 0; i < member.Elements.Length; i++) 820for (int i = 0; i < typeDescs.Length; i++) 846member.ChoiceIdentifier.MemberIds = new string[member.Elements.Length]; 848for (int i = 0; i < member.Elements.Length; i++) 883if (arrayMapping.Elements!.Length != 1) 960for (int j = 0; j < elements.Length; j++) 1009for (int i = 0; i < elements.Length; i++) 1096if (elements.Length == 0) 1099for (int i = 0; i < elements.Length; i++) 1521if (nodes != null && nodes.Length > 0) 1774if (isList && enumMapping.Constants.Length > 63) 1812for (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)
42if (scopes.Length > 0) 133if (index < a.Length) return a; 134TypeMapping[] b = new TypeMapping[a.Length + 32]; 210if (methods != null && methods.Length != 0 && xmlMappings != null && xmlMappings.Length == methods.Length) 216for (int i = 0; i < methods.Length; i++) 240for (int i = 0; i < types.Length; i++) 444for (int i = 0; i < xmlMappings.Length; i++)
System\Xml\Serialization\XmlSerializationReader.cs (49)
484if (offset == buffer.Length) 493bytes = _r.ReadElementContentAsBase64(buffer, offset, buffer.Length - offset); 497bytes = _r.ReadElementContentAsBinHex(buffer, offset, buffer.Length - offset); 507currentSize = Math.Min(block.Length, total); 1070for (int i = 0; i < dimensions.Length; i++) 1380if (index < a.Length) return a; 1381Array b = Array.CreateInstance(elementType, a.Length * 2); 1394if (a.Length == length) return a; 1568for (int i = 0; i < array.Length; i++) 2496for (int j = 0; j < mappings.Length; j++) 2534Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture)); 2553for (int i = 0; i < mappings.Length; i++) 2570for (int j = 0; j < mappings.Length; j++) 2590for (int j = 0; j < mapping.Elements!.Length; j++) 2604else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 2619if (members.Length > 0 && members[0].Mapping.IsReturnValue) Writer.WriteLine("IsReturnValue = true;"); 2621WriteParamsRead(mappings.Length); 2676for (int i = 0; i < mappings.Length; i++) 2714Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture)); 2732Member[] members = new Member[mappings.Length]; 2733for (int i = 0; i < mappings.Length; i++) 2750for (int j = 0; j < mappings.Length; j++) 2764if (members.Length > 0 && members[0].Mapping.IsReturnValue) Writer.WriteLine("IsReturnValue = true;"); 2770WriteParamsRead(mappings.Length); 2978for (int i = 0; i < constants.Length; i++) 3078for (int i = 0; i < constants!.Length; i++) 3356var arraysToDeclareList = new List<Member>(mappings.Length); 3357var arraysToSetList = new List<Member>(mappings.Length); 3358var allMembersList = new List<Member>(mappings.Length); 3360for (int i = 0; i < mappings.Length; i++) 3378for (int j = 0; j < mapping.Elements!.Length; j++) 3393if (mapping.Attribute == null && mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping) 3407if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 3429WriteParamsRead(mappings.Length); 3499members = new Member[mappings.Length]; 3500for (int i = 0; i < mappings.Length; i++) 3518WriteParamsRead(mappings.Length); 3553for (int i = 0; i < members.Length; i++) 3729for (int i = 0; i < members.Length; i++) 3912for (int i = 0; i < members.Length; i++) 3915if (member.Mapping.Elements!.Length == 0) 3946for (int i = 0; i < members.Length; i++) 4024for (int i = 0; i < members.Length; i++) 4036for (int j = 0; j < elements.Length; j++) 4203for (int i = 0; i < elements.Length; i++) 4221for (int i = 0; i < members.Length; i++) 4241for (int i = 0; i < members.Length; i++) 4255for (int j = 0; j < elements.Length; j++) 4467for (int i = 0; i < members.Length; i++)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (29)
358for (int j = 0; j < mappings.Length; j++) 414ilg.NewArray(typeof(object), mappings.Length); 432for (int i = 0; i < mappings.Length; i++) 449for (int j = 0; j < mappings.Length; j++) 469for (int j = 0; j < mapping.Elements!.Length; j++) 483else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 498if (members.Length > 0 && members[0].Mapping.IsReturnValue) 510WriteParamsRead(mappings.Length); 613for (int i = 0; i < mappings.Length; i++) 988for (int i = 0; i < constants.Length; i++) 1077for (int i = 0; i < constants.Length; i++) 1532var arraysToDeclareList = new List<Member>(mappings.Length); 1533var arraysToSetList = new List<Member>(mappings.Length); 1534var allMembersList = new List<Member>(mappings.Length); 1536for (int i = 0; i < mappings.Length; i++) 1554for (int j = 0; j < mapping.Elements!.Length; j++) 1569if (mapping.Attribute == null && mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping) 1583if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1605WriteParamsRead(mappings.Length); 1819for (int i = 0; i < members.Length; i++) 2122for (int i = 0; i < members.Length; i++) 2199for (int i = 0; i < members.Length; i++) 2211for (int j = 0; j < elements.Length; j++) 2423for (int i = 0; i < elements.Length; i++) 2441for (int i = 0; i < members.Length; i++) 2456for (int i = 0; i < members.Length; i++) 2470for (int j = 0; j < elements.Length; j++) 2618for (int i = 0; i < members.Length; i++) 2818Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType)));
System\Xml\Serialization\XmlSerializationWriter.cs (41)
426for (int i = 0; i < xmlNodes.Length; i++) 455XmlCustomFormatter.WriteArrayBase64(_w, (byte[])o, 0, ((byte[])o).Length); 1054XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1070XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1089XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1175XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1312int arrayLength = a.Length; 1558for (int i = 0; i < parameterTypes.Length; i++) 1747for (int i = 0; i < structMapping.Members!.Length; i++) 1771for (int i = 0; i < enumFields.Length; i++) 1823for (int i = 0; i < memberInfos.Length; i++) 1870for (int i = 0; i < paramTypes.Length; i++) 1873if (i < (paramTypes.Length - 1)) 1935for (int i = 0; i < args.Length; i++) 2516for (int i = 0; i < values.Length; i++) 2693for (int i = 0; i < mapping.Members!.Length; i++) 2707for (int j = 0; j < mapping.Members.Length; j++) 2747for (int i = 0; i < mapping.Members!.Length; i++) 2761for (int j = 0; j < mapping.Members.Length; j++) 2792for (int j = 0; j < mapping.Members.Length; j++) 2810if (isRpc && member.IsReturnValue && member.Elements!.Length > 0) 2842Writer.Write(mapping.Members.Length.ToString(CultureInfo.InvariantCulture)); 2846WriteExtraMembers(mapping.Members.Length.ToString(CultureInfo.InvariantCulture), "pLength"); 2932if (constants.Length > 0) 2940for (int i = 0; i < constants.Length; i++) 2960for (int i = 0; i < constants.Length; i++) 2971for (int i = 0; i < constants.Length; i++) 3231for (int i = 0; i < members.Length; i++) 3270for (int i = 0; i < members.Length; i++) 3276bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 3534!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 3543if (elements.Length == 0 && text == null) return; 3661int count = elements.Length + (text == null ? 0 : 1); 3691if (elements.Length == 0 && text == null) return; 3692if (elements.Length == 1 && text == null) 3715for (int i = 0; i < elements.Length; i++) 3783if (elements.Length - anyCount > 0) Writer.Write("else "); 3879if (elements.Length > 0) 3901if (elements.Length > 0) 4459for (int i = 0; i < members.Length; i++) 4516for (int i = 0; i < choiceMapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (27)
209for (int i = 0; i < values.Length; i++) 405for (int i = 0; i < mapping.Members!.Length; i++) 418for (int j = 0; j < mapping.Members.Length; j++) 460for (int i = 0; i < mapping.Members!.Length; i++) 474for (int j = 0; j < mapping.Members.Length; j++) 508for (int j = 0; j < mapping.Members.Length; j++) 616if (constants.Length > 0) 627for (int i = 0; i < constants.Length; i++) 655ilg.NewArray(typeof(string), constants.Length); 657for (int i = 0; i < constants.Length; i++) 667ilg.NewArray(typeof(long), constants.Length); 670for (int i = 0; i < constants.Length; i++) 1068for (int i = 0; i < members.Length; i++) 1099for (int i = 0; i < members.Length; i++) 1105bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 1407!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 1416if (elements.Length == 0 && text == null) return; 1546int count = elements.Length + (text == null ? 0 : 1); 1566if (elements.Length == 0 && text == null) return; 1567if (elements.Length == 1 && text == null) 1590for (int i = 0; i < elements.Length; i++) 1653if (elements.Length - anyCount > 0) 1661if (elements.Length - anyCount > 0) ilg.InitElseIf(); 1804if (elements.Length > 0) 1818if (elements.Length > 0) 2206for (int i = 0; i < members.Length; i++) 2244for (int i = 0; i < choiceMapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSerializer.cs (14)
296for (int i = 0; i < extraTypes.Length; i++) 583if (mappings == null || mappings.Length == 0) return Array.Empty<XmlSerializer>(); 620XmlSerializer[] serializers = new XmlSerializer[mappings.Length]; 624for (int i = 0; i < serializers.Length; i++) 641XmlSerializer?[] serializers = new XmlSerializer?[mappings.Length]; 642for (int i = 0; i < serializers.Length; i++) 654var serializers = new XmlSerializer[mappings.Length]; 655for (int i = 0; i < serializers.Length; i++) 671if (types == null || types.Length == 0) 683for (int i = 0; i < types.Length; i++) 711XmlSerializer?[] serializers = new XmlSerializer?[mappings.Length]; 720for (int i = 0; i < mappings.Length; i++) 763XmlTypeMapping[] mappings = new XmlTypeMapping[types.Length]; 764for (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)
357else if (_numEntries >= _arrAttrs.Length) 360Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (1)
225if (pair.Length != 2)
System\Xml\Xsl\Runtime\XmlCollation.Windows.cs (1)
33if (UpperFirst && bytesKey.Length != 0)
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); 2666List<QilName> modes = new List<QilName>(list.Length); 2670if (list.Length == 0) 2832for (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)
360for (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\runtime\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)
99if (types != null && types.Length > 0) 205getPropertyGetter = (types == null || types.Length == 0) && name.StartsWith("get_", comparison); 208getPropertySetter = (types == null || types.Length == 1) && name.StartsWith("set_", comparison); 263Debug.Assert(types == null || types.Length == 0); 275Debug.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)
26int length = parameters.Length;
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (3)
121args = new object[index.Length + 1]; 123Array.Copy(index, args, index.Length); 125args[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 (15)
src\runtime\src\libraries\Common\src\System\Reflection\Emit\IgnoreAccessChecksToAttributeBuilder.cs (1)
79.Single(c => c.GetParameters().Length == 1 &&
System\Reflection\DispatchProxyGenerator.cs (14)
203for (int i = 0; i < interfacesOnInterfaceType.Length; i++) 292for (int i = 0; i < args.Length; i++) 308for (int i = 0; i < args.Length; i++) 425Type[] paramTypes = new Type[parameters.Length]; 426Type[][] paramReqMods = new Type[paramTypes.Length][]; 428for (int i = 0; i < parameters.Length; i++) 445string[] ss = new string[ts.Length]; 446for (int i = 0; i < ts.Length; i++) 451for (int i = 0; i < genericParameters.Length; i++) 474GenericArray<object> argsArr = new GenericArray<object>(il, parameters.Length); 476for (int i = 0; i < parameters.Length; i++) 503GenericArray<Type> typeArr = new GenericArray<Type>(il, genericTypes.Length); 504for (int i = 0; i < genericTypes.Length; ++i) 536for (int i = 0; i < parameters.Length; i++)
System.Reflection.Emit (105)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
70for (int i = 0; i < _inst.Length; i++)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
235if (_iaLowerBound.Length <= _rank)
src\runtime\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; 752stackChange -= parameterTypes.Length;
System\Reflection\Emit\MethodBuilderImpl.cs (14)
66_parameterTypes = new Type[parameterTypes.Length]; 67_parameterBuilders = new ParameterBuilderImpl[parameterTypes.Length + 1]; // parameter 0 reserved for return type 68for (int i = 0; i < parameterTypes.Length; i++) 83internal int ParameterCount => _parameterTypes == null ? 0 : _parameterTypes.Length; 103_returnType, ModuleBuilderImpl.GetSignatureConvention(_callingConventions), GetGenericArguments().Length, !IsStatic, optionalParameterTypes: null, 119var typeParameters = new GenericTypeParameterBuilderImpl[names.Length]; 120for (int i = 0; i < names.Length; i++) 134if (position > 0 && (_parameterTypes == null || position > _parameterTypes.Length)) 224_parameterTypes = new Type[parameterTypes.Length]; 225_parameterBuilders = new ParameterBuilderImpl[parameterTypes.Length + 1]; // parameter 0 reserved for return type 226for (int i = 0; i < parameterTypes.Length; i++) 292_parameterBuilders ??= new ParameterBuilderImpl[_parameterTypes.Length + 1]; // parameter 0 reserved for return type 293ParameterInfo[] parameters = new ParameterInfo[_parameterTypes.Length]; 295for (int i = 0; i < _parameterTypes.Length; i++)
System\Reflection\Emit\ModuleBuilderImpl.cs (7)
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++) 375for (int i = 0; i < gParams.Length; i++) 799GetSignatureConvention(method.CallingConvention), method.GetGenericArguments().Length, !method.IsStatic, optionalParameterTypes); 845if (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 (16)
46Parameters(parameters.Length, out ReturnTypeEncoder retType, out ParametersEncoder parameterEncoder); 66GenericTypeArgumentsEncoder encoder = new BlobEncoder(methodSpecSignature).MethodSpecificationSignature(genericArguments.Length); 82int paramsLength = ((parameters == null) ? 0 : parameters.Length) + ((optionalParameterTypes == null) ? 0 : optionalParameterTypes.Length); 92if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) 102if (parameterInfos.Length == 0) 107Type[] parameterTypes = new Type[parameterInfos.Length]; 109for (int i = 0; i < parameterInfos.Length; i++) 120for (int i = customModifiers.Length - 1; i >= 0; i--) 132for (int i = 0; i < parameters.Length; i++) 136Type[]? modreqs = (requiredModifiers != null && requiredModifiers.Length > i) ? requiredModifiers[i] : null; 137Type[]? modopts = (optionalModifiers != null && optionalModifiers.Length > i) ? optionalModifiers[i] : null; 150Parameters(property.ParameterTypes == null ? 0 : property.ParameterTypes.Length, out ReturnTypeEncoder retType, out ParametersEncoder paramEncoder); 191module.GetTypeHandle(type.GetGenericTypeDefinition()), genericArguments.Length, type.IsValueType); 238if (type.GetFunctionPointerCallingConventions() is Type[] conventions && conventions.Length == 1) 259sigEncoder.Parameters(paramTypes.Length, out ReturnTypeEncoder retTypeEncoder, out ParametersEncoder paramsEncoder);
System\Reflection\Emit\TypeBuilderImpl.cs (45)
74_interfaces = new List<Type>(interfaces.Length); 75for (int i = 0; i < interfaces.Length; i++) 266var typeParameters = new GenericTypeParameterBuilderImpl[names.Length]; 267for (int i = 0; i < names.Length; i++) 279if (data.Length <= 0 || data.Length >= 0x003f0000) 281throw new ArgumentException(SR.Argument_BadSizeForData, nameof(data.Length)); 287return DefineDataHelper(name, data, data.Length, attributes); 510for (int i = 0; i < attributeInfo._namedParamNames.Length; ++i) 662for (int i = 0; i < types.Length; i++) 714if (argumentTypes.Length != parameterTypes.Length) 719for (int i = 0; i < parameterTypes.Length; i++) 942for (int i = 0; i < interfaces.Length; ++i) 1050if (types == null || types.Length == 0) 1081List<PropertyInfo> candidates = new List<PropertyInfo>(properties.Length); 1082for (int i = 0; i < properties.Length; i++) 1086(types == null || (propertyInfo.GetIndexParameters().Length == types.Length))) 1184totalCount += methods.Length; 1193totalCount += constructors.Length; 1202totalCount += properties.Length; 1221totalCount += fields.Length; 1230totalCount += nestedTypes.Length; 1237methods.CopyTo(compressMembers, i); i += methods.Length; 1238constructors.CopyTo(compressMembers, i); i += constructors.Length; 1239properties.CopyTo(compressMembers, i); i += properties.Length; 1240events.CopyTo(compressMembers, i); i += events.Length; 1241fields.CopyTo(compressMembers, i); i += fields.Length; 1259InterfaceMethods = new MethodInfo[interfaceMethods.Length], 1260TargetMethods = new MethodInfo[interfaceMethods.Length] 1263for (int i = 0; i < interfaceMethods.Length; i++) 1281for (int i = 0; i < interfaceMethods.Length; i++) 1298Type[] parameterTypes = new Type[parameterInfos.Length]; 1299for (int i = 0; i < parameterInfos.Length; i++) 1339methods.Length + 1340constructors.Length + 1341properties.Length + 1343fields.Length + 1344nestedTypes.Length]; 1347methods.CopyTo(members, i); i += methods.Length; 1348constructors.CopyTo(members, i); i += constructors.Length; 1349properties.CopyTo(members, i); i += properties.Length; 1351fields.CopyTo(members, i); i += fields.Length; 1381for (int i = 0; i < interfaces.Length; i++)
System.Reflection.Metadata (51)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (3)
71if (pkt.Length > PUBLIC_KEY_TOKEN_LEN) 81if (keyOrToken.Length == 0) 87HexConverter.EncodeToUtf16(keyOrToken, vsb.AppendSpan(keyOrToken.Length * 2), HexConverter.Casing.Lower);
System\Reflection\Internal\Utilities\BlobUtilities.cs (1)
15Debug.Assert(buffer.Length > 0);
System\Reflection\Internal\Utilities\EncodingHelper.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\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; 608if (result > _buffer.Length - byteCount) 793BlobUtilities.ValidateRange(buffer.Length, start, byteCount, nameof(byteCount));
System\Reflection\Metadata\BlobWriter.cs (3)
30: this(buffer, 0, buffer.Length) 43Debug.Assert(count <= buffer.Length - start); 233BlobUtilities.ValidateRange(buffer.Length, start, byteCount, nameof(byteCount));
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (5)
120for (int i = 0; i < rowCounts.Length; i++) 125for (int i = 0; i < heapSizes.Length; i++) 184var immutable = new ImmutableArray<T>[array.Length]; 185for (int i = 0; i < array.Length; i++) 198for (int t = 0; t < rowCounts.Length; t++)
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)
99for (int i = bytes.Length; i > 0; --i)
System\Reflection\PortableExecutable\PEBuilder.cs (1)
496if (signature == null || signature.Length > strongNameSignatureFixup.Length)
System\Reflection\PortableExecutable\PEReader.cs (1)
664if (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) 278MethodBase[] aExactMatches = new MethodBase[match.Length]; 281for (int i = 0; i < match.Length; i++) 284if (par.Length == 0) 289for (j = 0; j < types.Length; j++) 297if (j < types.Length) 321int typesLength = (types != null) ? types.Length : 0; 322for (int i = 0; i < match.Length; i++) 360for (int i = 0; i < types.Length; i++) 377if (paramArrayType1 != null && paramOrder1[i] >= p1.Length - 1) 382if (paramArrayType2 != null && paramOrder2[i] >= p2.Length - 1) 406if (p1.Length > p2.Length) 410else if (p2.Length > p1.Length) 563if (params1.Length != params2.Length) 566int 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)
144AssemblyName[] result = new AssemblyName[data.Length]; 145for (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++) 89List<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)
23if (original.Length == 0) 28T[] copy = new T[original.Length]; 29Array.Copy(sourceArray: original, sourceIndex: 0, destinationArray: copy, destinationIndex: 0, length: original.Length); 42if (original.Length == 0) 45Type[] copy = new Type[original.Length]; 46for (int i = 0; i < original.Length; i++) 239int count = genericMethodArguments == null ? 0 : genericMethodArguments.Length; 253for (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; 108int count = typeArguments.Length; 122if (count != GetGenericTypeParametersNoCopy().Length)
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
78for (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)
137int 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)
97int 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)
359int numValues = enumFields.Length;
System.Resources.Extensions (18)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (5)
576writer.Write(bytes.Length); 577writer.Write(bytes, 0, bytes.Length); 590writer.Write(arr.Length); 591writer.Write(arr, 0, arr.Length); 604while ((read = s.Read(buffer, 0, buffer.Length)) != 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
25int len = array.Length;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (1)
76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (4)
405for (int i = 0; i < arr.Length; i++) 603for (int i = 0; i < bits.Length; i++) 969if (typeIndex < 0 || typeIndex >= _typeTable.Length) 1037Debug.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)
217writer.Write7BitEncodedInt(data.Length); 241writer.Write7BitEncodedInt(data.Length);
System.Resources.Writer (5)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (5)
576writer.Write(bytes.Length); 577writer.Write(bytes, 0, bytes.Length); 590writer.Write(arr.Length); 591writer.Write(arr, 0, arr.Length); 604while ((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)
105if (comEventInterfaces == null || comEventInterfaces.Length == 0) 112if (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.InteropServices.JavaScript (15)
System\Runtime\InteropServices\JavaScript\JSHostImplementation.cs (1)
223if (parameterInfos.Length > 0 && parameterInfos[0].ParameterType == typeof(string[]))
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Byte.cs (2)
110slot.Length = value.Length; 112slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(byte)));
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Double.cs (2)
117slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(double))); 118slot.Length = value.Length;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int32.cs (2)
111slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(int))); 112slot.Length = value.Length;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.JSObject.cs (2)
109slot.Length = value.Length; 110int bytes = value.Length * sizeof(JSMarshalerArgument);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Object.cs (2)
390slot.Length = value.Length; 391int bytes = value.Length * sizeof(JSMarshalerArgument);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Single.cs (2)
117slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(float))); 118slot.Length = value.Length;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.String.cs (2)
117slot.Length = value.Length; 118int bytes = value.Length * sizeof(JSMarshalerArgument);
System.Runtime.Numerics (104)
src\runtime\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 (7)
280if (bits.Length + 1 > BigInteger.MaxLength) 286bits = new nuint[bits.Length + 1]; 835int base1E9BufferLength = (int)(value._bits.Length * digitRatio) + 1; 1122if (cached is not null && cached.Length >= bufferLength) 1133if (buffer.Length > LeadingPowers1E9.Length && 1134(cached is null || buffer.Length > cached.Length))
System\Numerics\BigInteger.cs (93)
313if (_bits.Length is 1 && _bits[0] <= int.MaxValue) 493if (len != val.Length) 706_bits = new nuint[bits32.Length]; 707Buffer.BlockCopy(bits32, 0, _bits, 0, bits32.Length * sizeof(uint)); 711int nuintLen = (bits32.Length + 1) / 2; 713for (int i = 0; i < bits32.Length; i += 2) 716ulong hi = (i + 1 < bits32.Length) ? bits32[i + 1] : 0; 739bits32 = new uint[_bits.Length]; 740Buffer.BlockCopy(_bits, 0, bits32, 0, _bits.Length * sizeof(uint)); 744int len = _bits.Length * 2; 751for (int i = 0; i < _bits.Length; i++) 785int iu = _bits.Length - 1; 919int size = dividend._bits.Length; 932if (dividend._bits.Length < divisor._bits.Length) 939int size = dividend._bits.Length; 942size = dividend._bits.Length - divisor._bits.Length + 1; 997m = value._bits.Length > 1 ? value._bits[^2] : 0; 1000b = (long)value._bits.Length * 64 - c; 1008m = value._bits.Length > 1 ? (uint)value._bits[^2] : 0; 1009l = value._bits.Length > 2 ? (uint)value._bits[^3] : 0; 1013b = (long)value._bits.Length * 32 - c; 1129int size = (modulus._bits?.Length ?? 1) << 1; 1204int size = BigIntegerCalculator.PowBound(power, value._bits!.Length); 1242if ((_sign ^ other) < 0 || (cu = _bits.Length) > maxLimbs) 1274int cu = _bits.Length; 1307if ((_sign ^ other) < 0 || (cu = _bits.Length) > maxLimbs) 1342int cu = _bits.Length; 1571Debug.Assert(bits.Length > 0); 1576if (bits.Length - 1 == nonZeroLimbIndex) 1614length = checked(bytesPerLimb * (bits.Length - 1) + length); 1663for (int i = 0; i < bits.Length - 1; i++) 1728Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1740buffer = buffer.Slice(0, _bits.Length + 1); 1803if ((_bits is null) || (_bits.Length <= 4)) 1819lowBitsCount = _bits.Length - 1; 1824lowBitsCount = _bits.Length - 2; 2026int length = bits.Length; 2084if (value._bits.Length > 1) 2111int len = value._bits.Length; 2151int len = value._bits.Length; 2212return value._bits.Length <= 1 && value._sign >= 0 2226int len = value._bits.Length; 2254int len = value._bits.Length; 2515int xLen = left._bits?.Length ?? 1; 2516int yLen = right._bits?.Length ?? 1; 2534int xLen = left._bits?.Length ?? 1; 2535int yLen = right._bits?.Length ?? 1; 2544int xLen = left._bits?.Length ?? 1; 2545int yLen = right._bits?.Length ?? 1; 2742int size = value._bits.Length + 1; 2752Span<nuint> bits = RentedBuffer.Create(value._bits.Length, out RentedBuffer bitsBuffer); 2777int size = value._bits.Length + 1; 2786Span<nuint> bits = RentedBuffer.Create(value._bits.Length, out RentedBuffer bitsBuffer); 2807Span<nuint> bits = RentedBuffer.Create(value._bits.Length, out RentedBuffer bitsBuffer); 2815int size = value._bits.Length + 1; 2919int size = dividend._bits.Length; 2934if (dividend._bits.Length < divisor._bits.Length) 2940int size = dividend._bits.Length - divisor._bits.Length + 1; 2978if (dividend._bits.Length < divisor._bits.Length) 2983int size = dividend._bits.Length; 3085bitsArrayLength = bits.Length; 3117Debug.Assert(_bits.Length > 0); 3119Debug.Assert(_bits.Length > 1 || _bits[0] > int.MaxValue); 3123Debug.Assert(_bits.Length <= MaxLength); 3216for (int i = 0; i < value._bits.Length; i++) 3237while (i < value._bits.Length) 3570for (int i = 1; (part == 0) && (i < value._bits.Length); i++) 3607int result = (bits.Length - 1) * BigIntegerCalculator.BitsPerLimb; 3621if (bits.AsSpan(0, bits.Length - 1).ContainsAnyExcept(0u)) 3654for (int i = bits.Length - 1; i >= 0; i--) 3665bool needsSignExtension = byteCount > bits.Length * nint.Size; 3681for (int i = bits.Length - 1; i >= 0; i--) 3732for (int i = 0; i < bits.Length; i++) 3743bool needsSignExtension = byteCount > bits.Length * nint.Size; 3750for (int i = 0; i < bits.Length; i++) 3798int result = bits.Length * nint.Size; 3808if (bits.AsSpan(0, bits.Length - 1).ContainsAnyExcept(0u)) 3844: (BigInteger)(((long)value._bits.Length * BigIntegerCalculator.BitsPerLimb - 1) ^ BitOperations.LeadingZeroCount(value._bits[^1])); 4891if (value._bits.Length >= 2) 4928if (value._bits.Length >= 2) 4935if (value._bits.Length >= 4) 4941if (value._bits.Length >= 3) 4946if (value._bits.Length >= 2) 5085if (value._bits.Length >= 2) 5122if (value._bits.Length >= 2) 5129if (value._bits.Length >= 4) 5135if (value._bits.Length >= 3) 5140if (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)
424for (int i = 0; i < markup.Length; i++)
System.Security.AccessControl (20)
System\Security\AccessControl\ACE.cs (12)
118if (binaryForm.Length - offset < BinaryLength) 242if (binaryForm.Length - offset < HeaderLength) 252else if ((binaryForm[offset + 3] << 8) + (binaryForm[offset + 2] << 0) > binaryForm.Length - offset) 760return _opaque.Length; 796if (opaque.Length > MaxOpaqueLength) 802else if (opaque.Length % 4 != 0) 920if (binaryForm.Length - offset < HeaderLength + AccessMaskLength + AceTypeLength + SecurityIdentifier.MinBinaryLength) 1222return _opaque.Length; 1249if (opaque.Length > MaxOpaqueLengthInternal) 1255else if (opaque.Length % 4 != 0) 1391if (binaryForm.Length - offset < HeaderLength + AccessMaskLength + SecurityIdentifier.MinBinaryLength) 1809if (binaryForm.Length - offset < HeaderLength + AccessMaskLength + ObjectFlagsLength + SecurityIdentifier.MinBinaryLength)
System\Security\AccessControl\ACL.cs (6)
177if (array.Length - index < Count) 240if (binaryForm.Length - offset < HeaderLength) 253if (length > binaryForm.Length - offset) 279else if (binaryForm.Length - offset < BinaryLength) 599for (int i = 0; i < afToPm.Length; i++) 631for (int i = 0; i < pmToAf.Length; i++)
System\Security\AccessControl\SecurityDescriptor.cs (2)
266if (binaryForm.Length - offset < BinaryLength) 477if (binaryForm.Length - offset < HeaderLength)
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)
916if (userData != null && userData.Length > 0) 965writer.Write(userData!.Length);
System\Security\Claims\ClaimsPrincipal.cs (2)
516if (userData != null && userData.Length > 0) 535writer.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 (499)
src\runtime\src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (4)
150if (octets.Length < 2) 153int end = octets.Length; 324if (consumed != encodedUtcTime.Length) 382AttributeAsn[] decodedSet = new AttributeAsn[setItems.Length];
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptEncryptDecrypt.cs (2)
23NTSTATUS ntStatus = BCryptEncrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, iv == null ? 0 : iv.Length, pbOutput, output.Length, out cbResult, 0); 44NTSTATUS ntStatus = BCryptDecrypt(hKey, pbInput, input.Length, IntPtr.Zero, iv, iv == null ? 0 : iv.Length, pbOutput, output.Length, out cbResult, 0);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptExportKey.cs (1)
69if (numBytesNeeded != destination.Length)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.Blobs.cs (2)
24Buffer.BlockCopy(value, 0, blob, offset, value.Length); 25offset += value.Length;
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDeriveKeyMaterial.cs (7)
80hmacKeyBuffer.cbBuffer = hmacKey!.Length; 91secretPrependBuffer.cbBuffer = secretPrepend!.Length; 102secretAppendBuffer.cbBuffer = secretAppend!.Length; 166keyMaterial.Length, 176Array.Resize(ref keyMaterial, Math.Min(keySize, keyMaterial.Length)); 234labelBuffer.cbBuffer = label.Length; 239seedBuffer.cbBuffer = seed.Length;
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
78ReportDownloadStop(ret?.Length ?? 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\AttributeAsn.xml.cs (1)
37for (int i = 0; i < AttrValues.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\SafeBagAsn.xml.cs (1)
51for (int i = 0; i < BagAttributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\EncryptedDataAsn.xml.cs (1)
35for (int i = 0; i < UnprotectedAttributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\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++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\SignerInfoAsn.xml.cs (1)
64for (int i = 0; i < UnsignedAttributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml.cs (1)
37for (int i = 0; i < Attributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (3)
92propertyValue.Length, 128if (value.Length == 0) 162errorCode = Interop.NCrypt.NCryptExportKey(handle, IntPtr.Zero, blobType, IntPtr.Zero, buffer, buffer.Length, out numBytesNeeded, 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngPkcs8.cs (3)
311int size = rented.Length; 348int size = rented.Length; 398byte[] zero = new byte[ecParameters.D!.Length];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (7)
136if (context?.Length > MaxContextLength) 140context.Length, 151if (signature.Length != bytesWritten) 1511if (bytesWritten < publicKey.Length) 1633if (bytesWritten < privateKey.Length) 1890size = buffer.Length; 1896if ((uint)written > (uint)buffer.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.cs (4)
461metadata.Label.Length + // Label 477metadata.Label.AsSpan().CopyTo(M_prime.AsSpan(offset, metadata.Label.Length)); 478offset += metadata.Label.Length; 498Debug.Assert(offset == M_prime.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaManaged.ECDsa.cs (3)
189if (ecParameters.D.Length != _algorithm.KeySizeInBytes) 327if (x.Length != fieldWidth || y.Length != fieldWidth)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (4)
139if (index < 0 || index >= array.Length) 141if (index > array.Length - Count) 155if (index < 0 || index >= array.Length) 157if (index > array.Length - Count)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.ImportExport.cs (25)
30if (parameters.J != null && parameters.J.Length >= parameters.P.Length) 35int keySizeInBytes = parameters.P.Length; 38if (parameters.G.Length != keySizeInBytes || parameters.Y.Length != keySizeInBytes) 41if (hasPrivateKey && parameters.X!.Length != parameters.Q.Length) 196if (parameters.Seed.Length != Sha1HashOutputSize) 210if (parameters.Q!.Length != Sha1HashOutputSize) 243(parameters.Seed == null ? parameters.Q!.Length : parameters.Seed.Length) + // Use Q size if Seed is not present 244parameters.Q!.Length + 245parameters.P!.Length + 246parameters.G!.Length + 247parameters.Y!.Length + 248(includePrivateParameters ? parameters.X!.Length : 0); 266pBcryptBlob->hashAlgorithm = parameters.Q.Length switch 281pBcryptBlob->cbSeedLength = parameters.Seed.Length; 282pBcryptBlob->cbGroupSize = parameters.Q.Length; 291int defaultSeedLength = parameters.Q.Length; 293pBcryptBlob->cbGroupSize = parameters.Q.Length; 344if (dsaBlob.Length < sizeof(BCRYPT_DSA_KEY_BLOB)) 376if (dsaBlob.Length < sizeof(BCRYPT_DSA_KEY_BLOB_V2)) 415Debug.Assert(offset == dsaBlob.Length, $"Expected offset = dsaBlob.Length, got {offset} != {dsaBlob.Length}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.SignVerify.cs (1)
154if (blob.Length < sizeof(BCRYPT_DSA_KEY_BLOB_V2))
src\runtime\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\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.cs (28)
59curve.Prime!.Length + 60curve.A!.Length + 61curve.B!.Length + 62curve.G.X!.Length + 63curve.G.Y!.Length + 64curve.Order!.Length + 65curve.Cofactor!.Length + 66(curve.Seed == null ? 0 : curve.Seed.Length) + 67parameters.Q.X!.Length + 68parameters.Q.Y!.Length; 72blobSize += parameters.D!.Length; 84pBcryptBlob->cbCofactor = curve.Cofactor.Length; 85pBcryptBlob->cbFieldLength = parameters.Q.X.Length; 86pBcryptBlob->cbSeed = curve.Seed == null ? 0 : curve.Seed.Length; 87pBcryptBlob->cbSubgroupOrder = curve.Order.Length; 187if (ecBlob.Length < sizeof(BCRYPT_ECCFULLKEY_BLOB)) 244curve.Prime!.Length + 245curve.A!.Length + 246curve.B!.Length + 247curve.G.X!.Length + 248curve.G.Y!.Length + 249curve.Order!.Length + 250curve.Cofactor!.Length + 251(curve.Seed == null ? 0 : curve.Seed.Length); 259pBcryptBlob->cbCofactor = curve.Cofactor.Length; 260pBcryptBlob->cbFieldLength = curve.A.Length; // P, A, B, X, Y have the same length 261pBcryptBlob->cbSeed = curve.Seed == null ? 0 : curve.Seed.Length; 262pBcryptBlob->cbSubgroupOrder = curve.Order.Length;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.NamedCurve.cs (9)
31Debug.Assert(x.Length == y.Length); 38x.Length + 39y.Length; 42blobSize += d!.Length; 54pBcryptBlob->cbKey = x.Length; 63Debug.Assert(x.Length == d?.Length); 119Interop.BCrypt.Consume(ecBlob, ref offset, d.Length, d);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanCng.ImportExport.cs (2)
23byte[] zero = new byte[parameters.D!.Length]; 47byte[] zero = new byte[parameters.D!.Length];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDsaCng.ImportExport.cs (2)
39byte[] zero = new byte[parameters.D!.Length]; 60byte[] zero = new byte[parameters.D!.Length];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
76{ Length: 0 } => src,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeySizeHelpers.cs (1)
60for (int i = 0; i < legalSizes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (2)
2153size = buffer.Length; 2159if ((uint)written > buffer.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (4)
250if (ciphertext.Length != Algorithm.CiphertextSizeInBytes) 1778rented = CryptoPool.Rent(rented.Length * 2); 1807size = buffer.Length; 1813if (written < 0 || written > buffer.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (5)
406Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 413if (length != pwdTmpBytes!.Length) 421Debug.Assert(pwdTmpBytes!.Length == 0); 466return written + lastBlock.Length; 1004return writeOffset + tmpEnd.Length;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
192rentedMac = CryptoPool.Rent(macKey.Length); 193macSpan = rentedMac.AsSpan(0, macKey.Length); 197Debug.Assert(macKey.Length <= 128); 198salt = stackalloc byte[Math.Min(macKey.Length, 128)];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (1)
130for (int i = 0; i < contentsArray.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (4)
43if (!encrypt && data.Length != modulusSizeInBytes) 50data.Length > modulusSizeInBytes - Pkcs1PaddingOverhead) 58if (encrypt && data.Length == 0) 243if (numBytesNeeded != output.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.SignVerify.cs (2)
49if (hash.Length != GetHashSizeInBytes(hashAlgorithm)) 69var pssPaddingInfo = new BCRYPT_PSS_PADDING_INFO() { pszAlgId = namePtr, cbSalt = hash.Length };
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.Pkcs1.cs (2)
35int halfModulusLength = (n.Length + 1) / 2; 42D = new byte[n.Length],
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (2)
1962size = buffer.Length; 1968if ((uint)written > buffer.Length)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (12)
412if (attr.AttrValues?.Length > 0) 414for (int i = 0; i < attr.AttrValues.Length; i++) 425int oldCount = (bag.BagAttributes?.Length).GetValueOrDefault(0); 444if (!duplicateAttributeCheck.Add(attrSet.AttrType) || attrSet.AttrValues.Length > 1) 464for (int i = 0; i < bag.BagAttributes.Length; i++) 485if (attrLen < bag.BagAttributes.Length) 782if (attr.AttrType == Oids.MsPkcs12KeyProviderName && attr.AttrValues?.Length > 0) 979Debug.Assert(_decryptBuffer.Length >= upperBound); 989Debug.Assert(_decryptBuffer.Length - _decryptBufferOffset >= encryptedContent.Length); 993_decryptBufferOffset = _decryptBuffer.Length; 1073if (array.Length <= index) 1173Debug.Assert(_keyDecryptBuffer.Length - _keyDecryptBufferOffset >= decrypted.Count);
System\Security\Cryptography\Aes.cs (2)
88if (plaintext is null || plaintext.Length == 0) 160/// <paramref name="ciphertext"/> has a <see cref="Array.Length"/> that does not correspond
System\Security\Cryptography\AesCcm.cs (1)
31AesAEAD.CheckKeySize(key.Length);
System\Security\Cryptography\AesImplementation.cs (1)
264long ivSize = rgbIV.Length * (long)BitsPerByte;
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)
64fieldSizeBits = pars.Q!.Length * 8;
System\Security\Cryptography\Base64Transforms.cs (5)
45if (requiredOutputLength > outputBuffer.Length - outputOffset) 78Debug.Assert(written == output.Length); 301Debug.Assert(_inputIndex < _inputBuffer.Length); 378if ((uint)inputCount > inputBuffer.Length) 384if ((inputBuffer.Length - inputCount) < inputOffset)
System\Security\Cryptography\BasicSymmetricCipherCsp.cs (1)
38SetKeyParameter(_hKey, CryptGetKeyParamQueryType.KP_EFFECTIVE_KEYLEN, key.Length * 8);
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\CapiHelper.SymmetricKey.cs (1)
22bw.Write((int)rawKey.Length);
System\Security\Cryptography\CapiHelper.Windows.cs (4)
971bool isPublic = keyBlob.Length > 0 && keyBlob[0] == CapiHelper.PUBLICKEYBLOB; 1204ReverseDsaSignature(signature, signature.Length); 1218bool verified = Interop.Advapi32.CryptVerifySignature(hHash, signature, signature.Length, hKey, null, Interop.Advapi32.CryptSignAndVerifyHashFlags.None); 1395if (dwHashSize != hash.Length)
System\Security\Cryptography\ChaCha20Poly1305.cs (1)
38CheckKeySize(key.Length);
System\Security\Cryptography\CngAsnFormatter.cs (2)
30if (Interop.Crypt32.CryptFormatObject(X509_ASN_ENCODING, 0, dwFormatStrType, IntPtr.Zero, (byte*)oidValuePtr, rawData, rawData.Length, null, ref cbFormat)) 38if (Interop.Crypt32.CryptFormatObject(X509_ASN_ENCODING, 0, dwFormatStrType, IntPtr.Zero, (byte*)oidValuePtr, rawData, rawData.Length, bufferPtr, ref cbFormat))
System\Security\Cryptography\CngHelpers.cs (17)
145int halfModulusLength = (parameters.Modulus.Length + 1) / 2; 153if (parameters.D.Length != parameters.Modulus.Length || 154parameters.P.Length != halfModulusLength || 155parameters.Q.Length != halfModulusLength || 156parameters.DP.Length != halfModulusLength || 157parameters.DQ.Length != halfModulusLength || 158parameters.InverseQ.Length != halfModulusLength) 177parameters.Exponent.Length + 178parameters.Modulus.Length; 181blobSize += parameters.P!.Length + 182parameters.Q!.Length; 192pBcryptBlob->BitLength = parameters.Modulus.Length * 8; 193pBcryptBlob->cbPublicExp = parameters.Exponent.Length; 194pBcryptBlob->cbModulus = parameters.Modulus.Length; 198pBcryptBlob->cbPrime1 = parameters.P!.Length; 199pBcryptBlob->cbPrime2 = parameters.Q!.Length;
System\Security\Cryptography\CngKey.Create.cs (1)
118int valueLength = (value == null) ? 0 : value.Length;
System\Security\Cryptography\CngKey.cs (1)
49if (src != null && src.Length == 0)
System\Security\Cryptography\CngKey.Export.cs (1)
28errorCode = Interop.NCrypt.NCryptExportKey(_keyHandle, IntPtr.Zero, format.Format, IntPtr.Zero, buffer, buffer.Length, out numBytesNeeded, 0);
System\Security\Cryptography\CngKey.Properties.cs (2)
26if (value.Length == 0) 65ErrorCode errorCode = Interop.NCrypt.NCryptSetProperty(_keyHandle, property.Name, pinnedPropertyValue, propertyValue.Length, property.Options);
System\Security\Cryptography\CngKey.StandardProperties.cs (1)
362errorCode = Interop.NCrypt.NCryptGetProperty(_keyHandle, KeyPropertyName.UIPolicy, pNcryptUiPolicyAndStrings, ncryptUiPolicyAndStrings.Length, out numBytesNeeded, CngPropertyOptions.None);
System\Security\Cryptography\CngProperty.cs (1)
100for (int i = 0; i < _value.Length; i++)
System\Security\Cryptography\CngSymmetricAlgorithmCore.cs (1)
202if (rgbIV != null && rgbIV.Length != AsymmetricAlgorithmHelpers.BitsToBytes(_outer.BlockSize))
System\Security\Cryptography\CryptoConfig.cs (13)
318string[] algorithmNames = new string[names.Length]; 319Array.Copy(names, algorithmNames, algorithmNames.Length); 418(args == null || args.Length == 1) && 450for (int i = 0; i < cons.Length; i++) 453if (con.GetParameters().Length == args.Length) 525string[] oidNames = new string[names.Length]; 526Array.Copy(names, oidNames, oidNames.Length); 577uint[] oidNums = new uint[oidString.Length]; 578for (int i = 0; i < oidString.Length; i++) 584if (oidNums.Length < 2) 592for (int i = 2; i < oidNums.Length; i++) 603for (int i = 2; i < oidNums.Length; i++)
System\Security\Cryptography\CryptographicOperations.cs (1)
1049Debug.Assert(written == mac.Length);
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\DESCryptoServiceProvider.Windows.cs (2)
69long keySize = rgbKey.Length * (long)BitsPerByte; 92if (rgbIV.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.Windows.cs (3)
448Debug.Assert(offset >= 0 && offset <= data.Length); 449Debug.Assert(count >= 0 && count <= data.Length - offset); 489if (rgbHash.Length != SHA1.HashSizeInBytes)
System\Security\Cryptography\EccKeyFormatHelper.cs (13)
417curve.A = specifiedParameters.Curve.A.ToUnsignedIntegerBytes(primeOrPoly.Length); 418curve.B = specifiedParameters.Curve.B.ToUnsignedIntegerBytes(primeOrPoly.Length); 419curve.Order = specifiedParameters.Order.ToUnsignedIntegerBytes(primeOrPoly.Length); 424if (baseSpan[0] != 0x04 || baseSpan.Length != 2 * primeOrPoly.Length + 1) 429curve.G.X = baseSpan.Slice(1, primeOrPoly.Length).ToArray(); 430curve.G.Y = baseSpan.Slice(1 + primeOrPoly.Length).ToArray(); 636int lastIndex = polynomial.Length - 1; 656for (int inverseIndex = 0; inverseIndex < polynomial.Length; inverseIndex++) 736while (start < fieldElement.Length - 1 && fieldElement[start] == 0) 746int basePointLength = ecParameters.Curve.G.X!.Length * 2 + 1; 761ecParameters.Curve.G.Y.CopyTo(basePointBytes.Slice(1 + ecParameters.Curve.G.X.Length)); 774int publicKeyLength = ecParameters.Q.X!.Length * 2 + 1; 789ecParameters.Q.Y.CopyTo(publicKeyBytes.Slice(1 + ecParameters.Q.X!.Length));
System\Security\Cryptography\ECCng.ImportExport.cs (1)
177if (blob.Length > sizeof(BCRYPT_ECCKEY_BLOB))
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\HashProviderCng.cs (1)
159NTSTATUS ntStatus = Interop.BCrypt.BCryptCreateHash(_hAlgorithm, out hHash, IntPtr.Zero, 0, _key, _key == null ? 0 : _key.Length, Flags);
System\Security\Cryptography\HashStatic.cs (1)
36Debug.Assert(written == buffer.Length);
System\Security\Cryptography\Helpers.cs (5)
56byte[] oddParityKey = new byte[key.Length]; 57for (int index = 0; index < key.Length; index++) 78char[] chars = new char[bytes.Length * 2]; 153if (a2 == null || a1.Length != a2.Length)
System\Security\Cryptography\HKDF.cs (1)
90if (prk.Length < hashLength)
System\Security\Cryptography\HMACStatic.cs (1)
54Debug.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\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\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\PasswordDeriveBytes.Windows.cs (2)
32CapiHelper.DeriveKey(ProvHandle, algid, algidhash, _password, _password.Length, keySize << 16, rgbIV, rgbIV.Length, ref key);
System\Security\Cryptography\PemKeyHelpers.cs (2)
34bufferSize = buffer.Length; 70bufferSize = buffer.Length;
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (5)
40for (int ib = 0; ib < rgbT.Length;) 44hasher.TransformBlock(rgbSeed, 0, rgbSeed.Length, rgbSeed, 0); 49Buffer.BlockCopy(hash, 0, rgbT, ib, Math.Min(rgbT.Length - ib, hash.Length)); 51ib += hasher.Hash.Length;
System\Security\Cryptography\RandomNumberGenerator.cs (2)
41if (offset == 0 && count == data.Length) 444if (count > data.Length - offset)
System\Security\Cryptography\RC2CryptoServiceProvider.Windows.cs (2)
85long keySize = rgbKey.Length * (long)BitsPerByte; 102if (rgbIV.Length < 8)
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\RC2Implementation.Windows.cs (1)
21using (SafeAlgorithmHandle algorithm = RC2BCryptModes.GetHandle(cipherMode, key.Length * 8))
System\Security\Cryptography\Rfc2898DeriveBytes.cs (6)
144return _salt.AsSpan(0, _salt.Length - sizeof(uint)).ToArray(); 150_salt = new byte[value.Length + sizeof(uint)]; 222_endIndex = _buffer.Length; 289BinaryPrimitives.WriteUInt32BigEndian(_salt.AsSpan(_salt.Length - sizeof(uint)), _block + 1); 290Debug.Assert(_blockSize == _buffer.Length); 310for (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; 1413if (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\RSABCrypt.cs (2)
421if (array.Length != written) 424$"An array-filling operation wrote {written} when {array.Length} was expected.");
System\Security\Cryptography\RSACryptoServiceProvider.Windows.cs (4)
582if (rsaSize - OaepSha1Overhead < data.Length) 594CapiHelper.EncryptKey(SafeKeyHandle, data, data.Length, fOAEP, ref encryptedKey); 622if (data.Length != (keySize / 8)) 628CapiHelper.DecryptKey(SafeKeyHandle, data, data.Length, fOAEP, out decryptedKey);
System\Security\Cryptography\SymmetricAlgorithm.cs (4)
75if (value.Length != this.BlockSize / 8) 95long bitLength = value.Length * 8L; 525|| (uint)written > decryptBuffer.Length) 1127|| (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\TripleDESCng.Windows.cs (1)
245if (key.Length == 16)
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\X25519DiffieHellman.cs (3)
1464size = buffer.Length; 1470if (written < 0 || written > buffer.Length) 1531rented = CryptoPool.Rent(rented.Length * 2);
System\Security\Cryptography\X509Certificates\Asn1\CertificationRequestInfoAsn.xml.cs (1)
50for (int i = 0; i < Attributes.Length; i++)
System\Security\Cryptography\X509Certificates\Asn1\TbsCertificateAsn.xml.cs (1)
128for (int i = 0; i < Extensions.Length; i++)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
52if (bytesConsumed != currentCrl.Length)
System\Security\Cryptography\X509Certificates\ChainPal.Windows.GetChainStatusInformation.cs (3)
24Debug.Assert(index < chainStatus.Length); 38Debug.Assert(index < chainStatus.Length); 47Debug.Assert(index == chainStatus.Length);
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\FindPal.Windows.cs (1)
47Interop.Crypt32.DATA_BLOB blob = new Interop.Crypt32.DATA_BLOB(new IntPtr(pThumbPrint), (uint)thumbPrint.Length);
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (1)
63for (int i = 0; i < attributes.Length; i++)
System\Security\Cryptography\X509Certificates\StorePal.Windows.Export.cs (2)
42Marshal.Copy((IntPtr)(pCertContext.DangerousCertContext->pbCertEncoded), rawData, 0, rawData.Length); 270if (exportedData.Length != blob.cbData)
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (9)
34for (int i = 0; i < oidStrings.Length; i++) 41int allocationSize = checked(oidStrings.Length * sizeof(void*)); 52byte* pOidContents = (byte*)(pOidPointers + oidStrings.Length); 54for (int i = 0; i < oidStrings.Length; i++) 67numOids = oidStrings.Length; 89encoded.Length, 111encoded.Length, 135encoded.Length, 157encoded.Length,
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
181for (int i = 0; i < _decoded.Length; i++)
System\Security\Cryptography\X509Certificates\X509Certificate.cs (3)
94if (rawData == null || rawData.Length == 0) 110if (rawData == null || rawData.Length == 0) 511for (int i = 0; i < thumbPrint.Length && i < 4; ++i)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
394if (rawData == null || rawData.Length == 0)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
62for (; i < certificates.Length; i++) 349for (; i < certificates.Length; i++)
System\Security\Cryptography\X509Certificates\X509CertificateCollection.cs (1)
48for (int i = 0; i < value.Length; i++)
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\X509Pal.Windows.PublicKey.cs (9)
204if (!Interop.crypt32.CryptDecodeObject(CertEncodingType.All, lpszStructType, encodedKeyValue, encodedKeyValue.Length, CryptDecodeObjectFlags.None, null, ref cbDecoded)) 208if (!Interop.crypt32.CryptDecodeObject(CertEncodingType.All, lpszStructType, encodedKeyValue, encodedKeyValue.Length, CryptDecodeObjectFlags.None, keyBlob, ref cbDecoded)) 229int cbKey = p.Length; 254int cb = q.Length; 263cb = g.Length; 272cb = decodedKeyValue.Length; 322return (explicitParams != null && explicitParams.Length > 0); 334if (value == null || value.Length == 0) 360errorCode = Interop.BCrypt.BCryptGetProperty(cryptHandle, propertyName, pPropertyValue, propertyValue.Length, out numBytesNeeded, 0);
System\Security\Cryptography\X509Certificates\X509Pal.Windows.X500DistinguishedName.cs (4)
24nameBlob.cbData = (uint)encodedDistinguishedName.Length; 62if (encodedDistinguishedName == null || encodedDistinguishedName.Length == 0) 75encodedDistinguishedName.Length, 93encodedDistinguishedName.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)
130retVal += GetByteStringEncodedSize(content.Length);
System\Security\Cryptography\Cose\CoseMessage.cs (3)
268if (protectedHeaderAsBstr.Length == 0) 463while ((bytesRead = contentStream.Read(contentBuffer, 0, contentBuffer.Length)) > 0) 635Debug.Assert(bytesWritten == buffer.Length);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (6)
283Debug.Assert(buffer.Length == bytesWritten); 540int encodedLength = CoseHelpers.GetCoseSignEncodedLengthMinusSignature(_isTagged, MultiSignSizeOfCborTag, _protectedHeaderAsBstr.Length, UnprotectedHeaders, _content); 546encodedLength += CoseHelpers.GetByteStringEncodedSize(signature._encodedSignProtectedHeaders.Length); 548encodedLength += CoseHelpers.GetByteStringEncodedSize(signature._signature.Length); 773_protectedHeaderAsBstr.Length, 849_protectedHeaderAsBstr.Length,
System\Security\Cryptography\Cose\CoseSign1Message.cs (5)
226Debug.Assert(buffer.Length == bytesWritten); 791_protectedHeaderAsBstr.Length, 944_protectedHeaderAsBstr.Length, 990CoseHelpers.GetCoseSignEncodedLengthMinusSignature(_isTagged, Sign1SizeOfCborTag, _protectedHeaderAsBstr.Length, UnprotectedHeaders, _content) + 991CoseHelpers.GetByteStringEncodedSize(_signature.Length);
System\Security\Cryptography\Cose\CoseSignature.cs (2)
621_encodedSignProtectedHeaders.Length, 652_encodedSignProtectedHeaders.Length,
System.Security.Cryptography.Pkcs (127)
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (1)
128if (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)
49Array.Clear(cek, 0, cek.Length); 175if (contentInfo.ContentType.Value == Oids.Pkcs7Data || contentInfo.Content.Length == 0)
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.Decrypt.cs (1)
69Array.Clear(cek, 0, cek.Length);
Internal\Cryptography\Pal\Windows\HeapBlockRetainer.cs (2)
60IntPtr pData = Alloc(data.Length); 61Marshal.Copy(data, 0, pData, data.Length);
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (2)
111int length = oidBytes.Length; 451len = rented.Length;
Internal\Cryptography\Pal\Windows\PkcsPalWindows.Encrypt.cs (14)
32if (encodedContent.Length > 0) 40if (encodedContent.Length > 0) 47if (!Interop.Crypt32.CryptMsgUpdate(hCryptMsg, encodedContent, encodedContent.Length, fFinal: true)) 54Array.Clear(encodedContent, 0, encodedContent.Length); 71if (encodedContent.Length <= tagLength) 172pCertEncoded[i].cbData = (uint)(certEncoded.Length); 201pValues[j].cbData = (uint)(rawData.Length); 270if (parameters == null || parameters.Length == 0) 288pEncodeInfo->KeyEncryptionAlgorithm.Parameters.cbData = (uint)s_rsaPkcsParameters.Length; 294pEncodeInfo->KeyEncryptionAlgorithm.Parameters.cbData = (uint)s_rsaOaepSha1Parameters.Length; 300pEncodeInfo->KeyEncryptionAlgorithm.Parameters.cbData = (uint)s_rsaOaepSha256Parameters.Length; 306pEncodeInfo->KeyEncryptionAlgorithm.Parameters.cbData = (uint)s_rsaOaepSha384Parameters.Length; 312pEncodeInfo->KeyEncryptionAlgorithm.Parameters.cbData = (uint)s_rsaOaepSha512Parameters.Length; 416recipientId.u.KeyId.cbData = (uint)(ski.Length);
Internal\Cryptography\PkcsHelpers.cs (7)
90Debug.Assert(idx < arr.Length); 92if (arr.Length == 1) 98T[] tmp = new T[arr.Length - 1]; 105if (idx < tmp.Length) 107Array.Copy(arr, idx + 1, tmp, idx, tmp.Length - idx); 289for (int i = 0; i < ba.Length; i++) 316return OneShot(transform, data, 0, data.Length);
src\runtime\src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (4)
150if (octets.Length < 2) 153int end = octets.Length; 324if (consumed != encodedUtcTime.Length) 382AttributeAsn[] decodedSet = new AttributeAsn[setItems.Length];
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CryptEncodeDecodeWrappers.cs (1)
23return CryptDecodeObjectToMemory(lpszStructType, (IntPtr)pbEncodedPointer, pbEncoded.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\AttributeAsn.xml.cs (1)
37for (int i = 0; i < AttrValues.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\SafeBagAsn.xml.cs (1)
51for (int i = 0; i < BagAttributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\EncryptedDataAsn.xml.cs (1)
35for (int i = 0; i < UnprotectedAttributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\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++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\SignerInfoAsn.xml.cs (1)
64for (int i = 0; i < UnsignedAttributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml.cs (1)
37for (int i = 0; i < Attributes.Length; i++)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (4)
139if (index < 0 || index >= array.Length) 141if (index > array.Length - Count) 155if (index < 0 || index >= array.Length) 157if (index > array.Length - Count)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
76{ Length: 0 } => src,
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (5)
406Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 413if (length != pwdTmpBytes!.Length) 421Debug.Assert(pwdTmpBytes!.Length == 0); 466return written + lastBlock.Length; 1004return writeOffset + tmpEnd.Length;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (4)
192rentedMac = CryptoPool.Rent(macKey.Length); 193macSpan = rentedMac.AsSpan(0, macKey.Length); 197Debug.Assert(macKey.Length <= 128); 198salt = stackalloc byte[Math.Min(macKey.Length, 128)];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (1)
130for (int i = 0; i < contentsArray.Length; i++)
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)
87for (int i = 0; i < Extensions.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\Rfc3161TstInfo.xml.cs (1)
102for (int i = 0; i < Extensions.Length; i++)
System\Security\Cryptography\Pkcs\Asn1\SignedAttributesSet.xml.cs (1)
61for (int i = 0; i < SignedAttributes.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)
88if (index < 0 || index >= array.Length) 90if (index > array.Length - Count) 104if (index < 0 || index >= array.Length) 106if (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)
132if (signed && signature.Length == bytesWritten)
System\Security\Cryptography\Pkcs\RecipientInfoCollection.cs (5)
33if (index < 0 || index >= _recipientInfos.Length) 43return _recipientInfos.Length; 63if (index < 0 || index >= array.Length) 65if (index > array.Length - Count) 78if (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)
431if (issuerNames == null || issuerNames.Length != 1) 458if (issuerNames == null || issuerNames.Length != 1) 601if (signingCert.Certs.Length < 1) 628if (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)
296if (ContentInfo.Content.Length == 0) 360int newIdx = _signedData.SignerInfos.Length; 383if (index < 0 || index >= _signedData.SignerInfos.Length) 492int curLength = _signedData.DigestAlgorithms.Length; 512for (int i = 0; i < _signedData.SignerInfos.Length; i++) 528for (int i = 0; i < _signedData.DigestAlgorithms.Length; i++) 547int existingLength = _signedData.CertificateSet?.Length ?? 0; 579for (int i = existingLength; i < _signedData.CertificateSet.Length; i++) 660int existingLength = _signedData.CertificateSet?.Length ?? 0; 699int existingLength = _signedData.CertificateSet?.Length ?? 0;
System\Security\Cryptography\Pkcs\SignerInfo.cs (14)
84_unsignedAttributes.Length == 0) 143for (int i = 0; i < unsignedAttrs.Length; i++) 149for (int j = 0; j < attributeAsn.AttrValues.Length; j++) 208newAttributeIdx = mySigner.UnsignedAttributes.Length; 218int newIndex = modifiedAttr.AttrValues.Length; 336newExtensionIdx = mySigner.UnsignedAttributes.Length; 381for (var i = 0; i < unsignedAttrs.Length; i++) 387if (index < csIndex + attributeAsn.AttrValues.Length) 391if (removeValueIndex == 0 && attributeAsn.AttrValues.Length == 1) 398csIndex += attributeAsn.AttrValues.Length; 411if (unsignedAttrs.Length == 1) 965for (int i = startIndex; i < attributes.Length; i++) 981for (int i = 0; i < attributeValues.Length; i++) 986isOnlyValue = attributeValues.Length == 1;
System\Security\Cryptography\Pkcs\SignerInfoCollection.cs (7)
32_signerInfos = new SignerInfo[signedDataSignerInfos.Length]; 34for (int i = 0; i < signedDataSignerInfos.Length; i++) 44if (index < 0 || index >= _signerInfos.Length) 50public int Count => _signerInfos.Length; 61if (index < 0 || index >= array.Length) 63if (index + Count > array.Length) 84for (int i = 0; i < signerInfos.Length; i++)
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)
321Buffer.BlockCopy(cipherValue, 0, IV, 0, IV.Length); 710cipher = enc.TransformFinalBlock(plaintext, 0, plaintext.Length); 727output = new byte[cipher.Length + IV.Length]; 728Buffer.BlockCopy(IV, 0, output, 0, IV.Length); 729Buffer.BlockCopy(cipher, 0, output, IV.Length, cipher.Length); 770lengthIV = decryptionIV.Length; 776output = dec.TransformFinalBlock(cipherValue, lengthIV, cipherValue.Length - lengthIV);
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (3)
65if ((chain.ChainStatus.Length > 0) && 86if ((chain.ChainStatus.Length > 0) && 170Array.Resize(ref bytes, bytes.Length + 1);
System\Security\Cryptography\Xml\SignedXml.cs (5)
967if (a.Length != b.Length) 973int aLength = a.Length; 1058if (m_signature.SignatureValue.Length != signatureLength / 8) 1065return 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)
84while (!attrIsAllowed && expectedAttrNames != null && expectedInd < expectedAttrNames.Length) 593for (int i = 0; i < input.Length; i++) 603int index = hex.Length; 658for (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.Security.Principal.Windows (17)
System\Security\Principal\NTAccount.cs (1)
304SidsPtr.ReadArray(0, translatedSids, 0, translatedSids.Length);
System\Security\Principal\SID.cs (9)
362_binaryForm = new byte[1 + 1 + 6 + 4 * _subAuthorities.Length]; 369_binaryForm[1] = (byte)_subAuthorities.Length; 384for (int i = 0; i < _subAuthorities.Length; i++) 409if (binaryForm.Length - offset < SecurityIdentifier.MinBinaryLength) 442if (binaryForm.Length - offset < totalLength) 653internal int SubAuthorityCount => _subAuthorities.Length; 655public int BinaryLength => _binaryForm.Length; 725for (int index = 0; index < values.Length; index++) 1042NamesPtr.ReadArray(0, translatedNames, 0, translatedNames.Length);
System\Security\Principal\WindowsIdentity.cs (7)
155if (upnBytes.Length > ushort.MaxValue) 159Array.Resize(ref upnBytes, upnBytes.Length & ushort.MaxValue); 169int authenticationInfoLength = checked(sizeof(KERB_S4U_LOGON) + upnBytes.Length); 176pKerbS4uLogin->ClientUpn.Length = pKerbS4uLogin->ClientUpn.MaximumLength = checked((ushort)upnBytes.Length); 180Marshal.Copy(upnBytes, 0, pKerbS4uLogin->ClientUpn.Buffer, upnBytes.Length); 249LSA_STRING lsaPackageName = new LSA_STRING((IntPtr)pAsciiPackageName, checked((ushort)(asciiPackageName.Length))); 653groupDetails.Length);
System.ServiceModel.Http (15)
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\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)
103if (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)
905if (addresses.Length == 0) 934invalidAddressCount, addresses.Length, addressStringBuilder.ToString()), innerException)); 951for (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++) 246certificate = (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)
938object[] inArgs = new object[args.Length + 2]; 939Array.Copy(args, inArgs, args.Length); 940inArgs[inArgs.Length - 2] = callback; 941inArgs[inArgs.Length - 1] = state; 951object[] inArgs = new object[args.Length + 1]; 952Array.Copy(args, inArgs, args.Length); 953inArgs[inArgs.Length - 1] = result; 963Fx.Assert(retArgs.Length == inArgs.Length, "retArgs.Length should be equal to inArgs.Length"); 964Array.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++) 356if (a == null || b == null || a.Length != b.Length) 361for (int i = 0; i < a.Length; i++) 814byte[] copy = Fx.AllocateByteArray(buffer.Length); 815Buffer.BlockCopy(buffer, 0, copy, 0, buffer.Length); 955if (partsWithSlashDelimiter.Length == 2 && partsWithAtDelimiter.Length == 1) 962else if (enableLegacyUpnUsernameFix && partsWithSlashDelimiter.Length == 1 && partsWithAtDelimiter.Length == 2) 1021certificate = (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)
335uri = (Uri)args[args.Length - 1]; 361dateTimeOffset = (DateTimeOffset)args[args.Length - 1];
System\ServiceModel\XmlBuffer.cs (1)
53public int BufferSize => _buffer.Length;
System.ServiceProcess.ServiceController (11)
System\ServiceProcess\ServiceBase.cs (6)
581if (services == null || services.Length == 0) 584IntPtr entriesPointer = Marshal.AllocHGlobal(checked((services.Length + 1) * sizeof(SERVICE_TABLE_ENTRY))); 585Span<SERVICE_TABLE_ENTRY> entries = new Span<SERVICE_TABLE_ENTRY>((void*)entriesPointer, services.Length + 1); 589bool multipleServices = services.Length > 1; 593for (int index = 0; index < services.Length; ++index) 872for (int index = 0; index < args.Length; ++index)
System\ServiceProcess\ServiceController.cs (5)
874IntPtr[] argPtrs = new IntPtr[args.Length]; 878for (i = 0; i < args.Length; i++) 897bool result = Interop.Advapi32.StartService(serviceHandle, args.Length, argPtrsHandle.AddrOfPinnedObject()); 906for (i = 0; i < args.Length; i++) 945for (int i = 0; i < DependentServices.Length; i++)
System.Speech (143)
AudioFormat\SpeechAudioFormatInfo.cs (8)
55if (formatSpecificData != null && formatSpecificData.Length != 0) 119if (_formatSpecificData.Length != refObj._formatSpecificData.Length) 123for (int i = 0; i < _formatSpecificData.Length; i++) 151wfx.cbSize = (short)FormatSpecificData().Length; 156byte[] wfxTemp = new byte[abWfx.Length + wfx.cbSize]; 157Array.Copy(abWfx, wfxTemp, abWfx.Length); 158Array.Copy(FormatSpecificData(), 0, wfxTemp, abWfx.Length, wfx.cbSize);
Internal\AlphabetConverter.cs (5)
95for (i = 0; i < s_langIds.Length; i++) 102if (i == s_langIds.Length) 130if (_phoneMap == null || phonemes.Length == 0) 189if (lastConvert != null && endIndex == phonemes.Length - 1) 307for (i = 0; i < _convertTable.Length; i++)
Internal\AsyncSerializedWorker.cs (1)
58for (i = 0; i < evt.Length; i++)
Internal\GrammarBuilding\BuilderElements.cs (2)
71int index = keys.Length - 1; 78for (int i = 0; i < keys.Length && keys[i] >= 3; i++)
Internal\ObjectToken\ObjectToken.cs (1)
246for (int iAttribute = 0; iAttribute < sAttributes.Length; iAttribute++)
Internal\PhonemeConverter.cs (6)
141PhoneMap[] phoneMaps = new PhoneMap[pmComps.Length]; 144for (int i = 0; i < pmComps.Length; i++) 153for (int j = 0; j < pm._phoneIds.Length; j++) 184for (int l = 0; l < newPhoneId._cp.Length; l++) 193System.Diagnostics.Debug.Assert(posPhone == pmCompressed._phones.Length); 194System.Diagnostics.Debug.Assert(posCp == pmCompressed._cps.Length);
Internal\SapiAttributeParser.cs (1)
40for (int i = 0; i < strings.Length; i++)
Internal\SapiInterop\SapiRecoInterop.cs (6)
435RecognizedWordUnit[] wordUnits = new RecognizedWordUnit[words.Length]; 436for (int i = 0; i < wordUnits.Length; i++) 450SPPHRASEELEMENT[] elements = new SPPHRASEELEMENT[words.Length]; 456coMem = Marshal.AllocCoTaskMem(size * elements.Length); 459for (int i = 0; i < words.Length; i++) 512ulCountOfElements = (uint)words.Length
Internal\SapiInterop\SpAudioStreamWrapper.cs (6)
30wfx.cbSize = (short)audioFormat.FormatSpecificData().Length; 35byte[] wfxTemp = new byte[_wfx.Length + wfx.cbSize]; 36Array.Copy(_wfx, wfxTemp, _wfx.Length); 37Array.Copy(audioFormat.FormatSpecificData(), 0, wfxTemp, _wfx.Length, wfx.cbSize); 63format = Marshal.AllocCoTaskMem(_wfx.Length); 64Marshal.Copy(_wfx, 0, format, _wfx.Length);
Internal\SrgsCompiler\AppDomainGrammarProxy.cs (14)
33if (parameters != null && parameters.Length > 0) 35types = new Type[parameters.Length]; 36for (int i = 0; i < parameters.Length; i++) 159for (int iType = 0; iType < types.Length; iType++) 178object[] values = new object[pairs.Length]; 180for (int iCtor = 0; iCtor < mis.Length && !foundConstructor; iCtor++) 189if (paramInfo.Length > pairs.Length) 194for (int i = 0; i < pairs.Length && foundConstructor; i++) 206for (int j = 0; j < paramInfo.Length; j++) 248for (int iCtor = 0; iCtor < cis.Length; iCtor++) 254for (int i = 0; i < pis.Length; i++) 278NameValuePair[] pairs = new NameValuePair[parameters.Length]; 280for (int i = 0; i < parameters.Length; i++)
Internal\SrgsCompiler\BackEnd.cs (7)
746for (int i = 0; i < achSrc.Length;) 814State?[] apStateTable = new State[header.arcs.Length]; 828Arc[] apArcTable = new Arc[header.arcs.Length]; 842for (int k = 1; k < header.arcs.Length; k++) 927for (int k = 1, iCurTag = 0; k < header.arcs.Length; k++) 935while (iCurTag < header.tags.Length && header.tags[iCurTag].StartArcIndex == k) 1091for (int i = 0; i < header.rules.Length; i++)
Internal\SrgsCompiler\CFGGrammar.cs (5)
303streamHelper.Stream.Position = (int)cfgSerializedHeader.pRules + (header.rules.Length * Marshal.SizeOf<CfgRule>()); 341ScriptRef[] scripts = new ScriptRef[cfgScripts.Length]; 342for (int i = 0; i < cfgScripts.Length; i++) 447for (int i = 0; i < header.tags.Length; i++) 451int cArcs = header.arcs.Length;
Internal\SrgsCompiler\SRGSCompiler.cs (2)
31System.Diagnostics.Debug.Assert(!fOutputCfg || xmlReaders.Length == 1); 33int cReaders = xmlReaders.Length;
Internal\SrgsCompiler\SrgsElementCompilerFactory.cs (2)
329char[] achDest = new char[achSrc.Length * 2]; 333for (int i = 0; i < achSrc.Length;)
Internal\SrgsParser\XmlParser.cs (1)
129for (int i = 0; i < achToken.Length; i = iTokenEnd + 1)
Internal\StringBlob.cs (1)
18int cch = pszStringArray.Length;
Internal\Synthesis\AudioBase.cs (1)
56Play(gc.AddrOfPinnedObject(), buffer.Length);
Internal\Synthesis\AudioDeviceOut.cs (1)
140int bufferSize = buffer.Length;
Internal\Synthesis\AudioFileOut.cs (3)
129_stream.Write(abOut, 0, abOut.Length); 130_totalByteWrittens += abOut.Length; 131_bytesWritten += abOut.Length;
Internal\Synthesis\AudioFormatConverter.cs (2)
65return cnvDlgt(data, data.Length); 95return cnvDlgt!(data, data.Length);
Internal\Synthesis\EngineSiteSapi.cs (2)
32SpeechEventInfo[] events = new SpeechEventInfo[eventsSapi.Length]; 33for (int i = 0; i < eventsSapi.Length; i++)
Internal\Synthesis\PcmConverter.cs (14)
150float[] pdOut = new float[inSamples.Length]; 152for (int i = 0; i < inSamples.Length; i++) 165short[] outSamples = new short[inSamples.Length]; 168for (int i = 0; i < inSamples.Length; i++) 196short[] outSamples = new short[inSamples.Length * 2]; 198for (int i = 0, k = 0; i < inSamples.Length; i++, k += 2) 212short[] outSamples = new short[inSamples.Length / 2]; 214for (int i = 0, k = 0; i < inSamples.Length; i += 2, k++) 227short[] outSamples = new short[leftSamples.Length * 2]; 229for (int i = 0, k = 0; i < leftSamples.Length; i++, k += 2) 243int length = inSamples.Length / 2; 248for (int i = 0, k = 0; i < inSamples.Length; i += 2) 326for (i = 0; i < s_piPrimes.Length; i++) 344int cInSamples = inSamples.Length;
Internal\Synthesis\SSmlParser.cs (6)
1528while (start < achContour.Length) 1603while (start < ach.Length && (ach[start] == ' ' || ach[start] == '\t' || ach[start] == '\n' || ach[start] == '\r')) 1611while (start < ach.Length && ach[start] != expected && ((percent = ach[start] == '%') || char.IsDigit(ach[start]) || ach[start] == 'H' || ach[start] == 'z' || ach[start] == '.' || ach[start] == '+' || ach[start] == '-')) 1617while (start < ach.Length && (ach[start] == ' ' || ach[start] == '\t' || ach[start] == '\n' || ach[start] == '\r')) 1624if (!(start < ach.Length && ach[start] == expected)) 1627if (!skipDigit && start == ach.Length)
Internal\Synthesis\VoiceSynthesis.cs (1)
211for (int i = 0; i < _xmlEscapeStrings.Length; i++)
Internal\Synthesis\WaveHeader.cs (1)
19_dwBufferLength = buffer.Length;
Recognition\Grammar.cs (13)
760object?[] values = new object?[pairs.Length]; 762for (int iCtor = 0; iCtor < cis.Length && !foundConstructor; iCtor++) 767if (paramInfo.Length > pairs.Length) 772for (int i = 0; i < pairs.Length && foundConstructor; i++) 784for (int j = 0; j < paramInfo.Length; j++) 826for (int iCtor = 0; iCtor < cis.Length; iCtor++) 830for (int i = 0; i < pis.Length; i++) 858NameValuePair[] pairs = new NameValuePair[parameters.Length]; 860for (int i = 0; i < parameters.Length; i++) 1008Type[] types = new Type[_parameters.Length]; 1010for (int i = 0; i < _parameters.Length; i++) 1055string? rootRule = header.ulRootRuleIndex != 0xffffffff && header.ulRootRuleIndex < header.rules.Length ? symbols.FromOffset(header.rules[header.ulRootRuleIndex]._nameOffset) : null;
Recognition\RecognizerBase.cs (2)
1500System.Diagnostics.Debug.Assert(ids.Length == 2); 2732for (int i = 0; i < keysArray.Length; i++)
Recognition\SrgsGrammar\SrgsGrammarCompiler.cs (3)
63XmlTextReader[] readers = new XmlTextReader[inputPaths.Length]; 66for (int iFile = 0; iFile < inputPaths.Length; iFile++) 79for (int iReader = 0; iReader < readers.Length; iReader++)
Recognition\SrgsGrammar\SrgsItem.cs (1)
36for (int iElement = 0; iElement < elements.Length; iElement++)
Recognition\SrgsGrammar\SrgsOneOf.cs (2)
27for (int i = 0; i < items.Length; i++) 42for (int i = 0; i < items.Length; i++)
Recognition\SrgsGrammar\SrgsRule.cs (1)
37for (int iElement = 0; iElement < elements.Length; iElement++)
Recognition\SrgsGrammar\SrgsRulesCollection.cs (1)
16for (int iRule = 0; iRule < rules.Length; iRule++)
Result\RecognitionResult.cs (2)
154int audioLength = _sapiAudioBlob.Length; 487alternate.InitializeFromSerializedBuffer(this, _serializedPhrase, gc.AddrOfPinnedObject(), _phraseBuffer!.Length, _isSapi53Header, _hasIPAPronunciation);
Result\RecognizedAudio.cs (14)
56outputStream.Write(_rawAudioData, 0, _rawAudioData.Length); 67outputStream.Write(_rawAudioData, 0, _rawAudioData.Length); 96if (startPosition + length > _rawAudioData.Length) 98length = _rawAudioData.Length - startPosition; 113sm.WriteArray<char>(riff, riff.Length); 115sm.WriteStream((uint)(_rawAudioData.Length + 38 + formatSpecificData.Length)); // Must be four bytes 118sm.WriteArray(wave, wave.Length); 121sm.WriteArray(fmt, fmt.Length); 123sm.WriteStream(18 + formatSpecificData.Length); 131sm.WriteStream((ushort)formatSpecificData.Length); 134if (formatSpecificData.Length > 0) 140sm.WriteArray(data, data.Length); 141sm.WriteStream(_rawAudioData.Length);
Result\RecognizedPhrase.cs (4)
863for (int iScript = 0; iScript < scripts.Length; iScript++) 914for (int iScript = 0; iScript < scripts.Length; iScript++) 958for (int iScript = 0; iScript < scripts.Length; iScript++) 1010for (int iType = 0; iType < types.Length; iType++)
SR.cs (1)
20else if (args != null && args.Length != 0)
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); 392Debug.Assert((arrayTemp.Length / 2) < 20, 393$"[DBCSCodePageEncoding.ReadBestFitTable]Expected small best fit table < 20 for code page {CodePage}, not {arrayTemp.Length / 2}"); 395for (int i = 0; i < arrayTemp.Length - 2; i += 2) 400for (int j = i + 2; j < arrayTemp.Length; j += 2) 1054Debug.Assert(bytes >= byteStart + byteBuffer.Length, 1056bytes -= byteBuffer.Length; // didn't use these byte(s)
System\Text\DecoderBestFitFallback.cs (6)
137int highBound = _oFallback.arrayBestFit!.Length; 146if (bytesCheck.Length == 0 || bytesCheck.Length > 2) 149if (bytesCheck.Length == 1) 171Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 192Debug.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)
87if (bytes.Length - index < count) 128if (bytes.Length - byteIndex < byteCount) 131if (charIndex < 0 || charIndex > chars.Length) 134int charCount = chars.Length - charIndex; 180if (bytes.Length - byteIndex < byteCount) 183if (chars.Length - charIndex < charCount)
System\Text\EncoderBestFitFallback.cs (3)
160int highBound = _oFallback.arrayBestFit!.Length; 176Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 197Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderNLS.cs (6)
85if (chars.Length - index < count) 117if (chars.Length - charIndex < charCount) 120if (byteIndex < 0 || byteIndex > bytes.Length) 123int byteCount = bytes.Length - byteIndex; 165if (chars.Length - charIndex < charCount) 168if (bytes.Length - byteIndex < byteCount)
System\Text\EncodingCharBuffer.cs (1)
163_bytes -= byteBuffer.Length; // Didn't use how many ever bytes we're falling back
System\Text\EncodingNLS.cs (16)
56if (chars.Length - index < count) 60if (chars.Length == 0) 109if (byteIndex < 0 || byteIndex > bytes.Length) 112int byteCount = bytes.Length - byteIndex; 143if (chars.Length - charIndex < charCount) 146if (byteIndex < 0 || byteIndex > bytes.Length) 150if (chars.Length == 0) 154int byteCount = bytes.Length - byteIndex; 194if (bytes.Length - index < count) 198if (bytes.Length == 0) 231if (bytes.Length - byteIndex < byteCount) 234if (charIndex < 0 || charIndex > chars.Length) 238if (bytes.Length == 0) 242int charCount = chars.Length - charIndex; 282if (bytes.Length - index < count) 286if (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."); 155int bytesRead = s_codePagesEncodingDataStream.Read(buffer, 0, buffer.Length); 156Debug.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 (157)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
52Debug.Assert(buffer.Length > 0); 93public int AvailableLength => _bytes.Length - _availableStart; 98public int Capacity => _bytes.Length; 135if (_bytes.Length == 0) 161int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length)); 191if (_usePool && buffer.Length > 0)
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (3)
145if (index >= adjacencyRow.Length) 162int idx = sortedNodes.Length; 172if (adjacency[i] is { } childMap && nextIndex < childMap.Length && childMap[nextIndex])
src\runtime\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)
80Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}"); 83Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}"); 89if (elementIndex >= _array.Length) 92Debug.Assert(index >= 0 && index > (int)((uint)_array.Length * 32 - 1), $"Only grow when necessary - index: {index}, arrayLength: {_array.Length}"); 96Debug.Assert(elementIndex < _array.Length, $"Set - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 145Debug.Assert(index >= 0, $"Get - Negative - index: {index}, arrayLength: {_array.Length}"); 149Debug.Assert(elementIndex < _array.Length, $"Get - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 165Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}"); 166Debug.Assert(minSize >= 0 && minSize >= _array.Length); 168int 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) 240int newCapacity = toReturn.Length * 2; 248if (newCapacity == toReturn.Length) newCapacity = int.MaxValue; 251Buffer.BlockCopy(toReturn, 0, _data, 0, toReturn.Length);
System\Text\Json\Document\JsonDocument.Parse.cs (11)
710MetadataDb database = MetadataDb.CreateLocked(utf8Json.Length); 711database.Append(tokenType, startLocation: 0, utf8Json.Length); 826Debug.Assert(rented.Length >= utf8Bom.Length); 845if (rented.Length == written) 848rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2)); 849Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length); 854lastRead = stream.Read(rented, written, rented.Length - written); 909Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length); 925if (rented.Length == written) 928rented = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2); 929Buffer.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\Nodes\JsonValueOfJsonPrimitive.cs (11)
211consumed == _value.Length; 220consumed == _value.Length; 229consumed == _value.Length; 238consumed == _value.Length; 247consumed == _value.Length; 256consumed == _value.Length; 265consumed == _value.Length; 274consumed == _value.Length; 283consumed == _value.Length; 292consumed == _value.Length; 301consumed == _value.Length;
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (1)
83Debug.Assert(propertyName.Length is not 0);
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)
190int 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\FSharp\FSharpUnionConverter.cs (15)
47_casesByTag = new CaseInfo[unionCases.Length]; 48_casesByName = new Dictionary<string, CaseInfo>(unionCases.Length, StringComparer.Ordinal); 51? new Dictionary<string, CaseInfo>(unionCases.Length, StringComparer.OrdinalIgnoreCase) 69fields = new CaseFieldInfo[uc.Fields.Length]; 70for (int i = 0; i < uc.Fields.Length; i++) 86for (int i = 0; i < fields.Length; i++) 99defaultFieldValues = new object[fields.Length]; 100for (int i = 0; i < fields.Length; i++) 293BitArray? populatedFields = trackPopulated ? new BitArray(caseInfo.Fields!.Length) : null; 376for (int i = 0; i < caseInfo.Fields!.Length; i++) 436Debug.Assert(fieldValues.Length == caseInfo.Fields!.Length); 438for (int i = 0; i < caseInfo.Fields.Length; i++) 498var map = new Dictionary<string, int>(fields.Length, comparer); 499for (int i = 0; i < fields.Length; i++)
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)
368else if (argumentState.FoundPropertyCount == argumentState.FoundProperties.Length) 373var newCache = ArrayPool<FoundProperty>.Shared.Rent(argumentState.FoundProperties.Length * 2); 564else if (argumentState.FoundPropertyCount == argumentState.FoundPropertiesAsync!.Length) 568var newCache = ArrayPool<FoundPropertyAsync>.Shared.Rent(argumentState.FoundPropertiesAsync!.Length * 2);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (9)
540Debug.Assert(names.Length == values.Length); 551var enumFields = new EnumFieldInfo[names.Length]; 552for (int i = 0; i < names.Length; i++) 691if (enumFields.Length <= 1) 696var indices = new (int negativePopCount, int index)[enumFields.Length]; 697for (int i = 0; i < enumFields.Length; i++) 706var sortedFields = new EnumFieldInfo[enumFields.Length]; 707for (int i = 0; i < indices.Length; i++)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
129Debug.Assert(genericArgs.Length == 2);
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
484for (int i = 0; i < trackedContexts.Length; i++)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (2)
204converterType.GetGenericArguments().Length == typeToConvert.GetGenericArguments().Length)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (2)
192if (propertyInfo.GetIndexParameters().Length > 0 || 357for (int i = 0; i < parameters.Length; i++)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (15)
110if (parameters.Length != 1 || 190UnionCaseEntry[] orderedCases = new UnionCaseEntry[orderedCaseTypes.Length]; 191for (int i = 0; i < orderedCaseTypes.Length; i++) 303if (parameters.Length != 1) 333KeyValuePair<Type, MethodInfo>[] orderedEntries = new KeyValuePair<Type, MethodInfo>[orderedCaseTypes.Length]; 334for (int i = 0; i < orderedCaseTypes.Length; i++) 423valueProperty.GetIndexParameters().Length == 0 453if (types.Length <= 1) 464Debug.Assert(sortedTypesWithRoot.Length == types.Length + 1); 467Type[] sortedTypes = new Type[types.Length]; 468Array.Copy(sortedTypesWithRoot, sourceIndex: 1, sortedTypes, destinationIndex: 0, sortedTypes.Length); 476Type[] rootChildren = new Type[types.Length]; 477for (int i = 0; i < rootChildren.Length; i++) 482rootChildren[i] = types[rootChildren.Length - i - 1];
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (4)
193var result = new FSharpUnionCaseInfo[cases.Length]; 195for (int i = 0; i < cases.Length; i++) 307return attributes.Length == 0 ? null : (Attribute)attributes[0]; 397public bool IsFieldless => Fields.Length == 0;
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (1)
103if (Position < parameters.Length)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (2)
161if ((cacheBuilder?.TotalCount ?? utf8PropertyCache.Length) < PropertyRefCacheBuilder.MaxCapacity) 183Debug.Assert(newCache.Length <= PropertyRefCacheBuilder.MaxCapacity);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (2)
1626Dictionary<ParameterLookupKey, JsonParameterInfoValues> parameterIndex = new(parameterInfoValues.Length); 1633ParameterCount = 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\PropertyRefCacheBuilder.cs (1)
23public int TotalCount => OriginalCache.Length + _propertyRefs.Count;
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (4)
24Debug.Assert(constructorInfo is null || constructorInfo.GetParameters().Length == 0); 83int parameterCount = parameters.Length; 193Debug.Assert(parameters.Length == 1); 253int parameterCount = parameters.Length;
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (5)
22Debug.Assert(ctorInfo is null || ctorInfo.GetParameters().Length == 0); 46int parameterCount = constructor.GetParameters().Length; 81int parameterCount = constructor.GetParameters().Length; 121Debug.Assert(constructor.GetParameters().Length == 1); 227for (int i = 0; i < chain.Length; i++)
System\Text\Json\Serialization\ReadStack.cs (2)
96else if (_count - 1 == _stack.Length) 98Array.Resize(ref _stack, 2 * _stack.Length);
System\Text\Json\Serialization\StreamReadBufferState.cs (6)
71int minBufferCount = fillBuffer || _unsuccessfulReadCount > UnsuccessfulReadCountThreshold ? bufferState._buffer.Length : 0; 114while (_count < _buffer.Length); 134if ((uint)_count > ((uint)_buffer.Length / 2)) 139byte[] newBuffer = ArrayPool<byte>.Shared.Rent((_buffer.Length < (int.MaxValue / 2)) ? _buffer.Length * 2 : int.MaxValue); 180Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.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 (12)
JsonSourceGenerator.Parser.cs (7)
1226Debug.Assert(sortedTypesWithRoot.Length == caseTypes.Count + 1); 1230for (int i = 1; i < sortedTypesWithRoot.Length; i++) 1241for (int i = 0; i < rootChildren.Length; i++) 1246rootChildren[i] = caseTypes[rootChildren.Length - i - 1]; 2645capacity: EncodedPropName.Length + utf8Json.Length * 2); 2647for (int i = 0; i < utf8Json.Length; i++) 2736if (publicCtors.Length == 1)
src\runtime\src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (2)
22public int Count => _values.Length; 63if ((uint)newIndex < (uint)_values.Length)
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (3)
145if (index >= adjacencyRow.Length) 162int idx = sortedNodes.Length; 172if (adjacency[i] is { } childMap && nextIndex < childMap.Length && childMap[nextIndex])
System.Text.RegularExpressions (217)
System\Text\RegularExpressions\CaptureCollection.cs (2)
187if ((uint)arrayIndex > (uint)array.Length) 191if (array.Length - arrayIndex < Count)
System\Text\RegularExpressions\GroupCollection.cs (6)
67public int Count => _match._matchcount.Length; 139else if ((uint)groupnum < _match._matchcount.Length) 160_groups = new Group[_match._matchcount.Length - 1]; 161for (int i = 0; i < _groups.Length; i++) 245ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length); 247if (array.Length - arrayIndex < Count)
System\Text\RegularExpressions\Match.cs (7)
84for (int i = 0; i < matchcount.Length; i++) 225GroupToStringImpl(_matchcount.Length - 1); 243int numgroups = inner._matchcount.Length; 265if (capcount * 2 + 2 > matches[cap].Length) 323(uint)cap < (uint)matchcount.Length && 386for (int groupNumber = 0; groupNumber < matches.Length; groupNumber++) 413for (int cap = 0; cap < matchcount.Length; cap++)
System\Text\RegularExpressions\Regex.cs (6)
327for (int i = 0; i < regexinfos.Length; i++) 447for (int i = 0; i < result.Length; i++) 474for (int i = 0; i < result.Length; i++) 746runner.runtrackpos = runner.runtrack!.Length; 747runner.runstackpos = runner.runstack!.Length; 748runner.runcrawlpos = runner.runcrawl!.Length;
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (2)
159Ldc(tree.CaptureNames.Length); 163for (int i = 0; i < tree.CaptureNames.Length; i++)
System\Text\RegularExpressions\RegexCharClass.cs (5)
202int len = s_propTable.Length; 1239Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1245if ((uint)index < (uint)cache.Length) 1556if (chars[0] < asciiStrings.Length) 1833int max = s_propTable.Length;
System\Text\RegularExpressions\RegexCompiler.cs (4)
943Debug.Assert(primarySet.Chars.Length > 0); 944switch (primarySet.Chars.Length) 1205if (set.Chars is { Length: 1 }) 1316switch (literalChars.Length)
System\Text\RegularExpressions\RegexFindOptimizations.cs (10)
138chars is { Length: 1 }) 175RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: true) is { Length: > 1 } caseInsensitivePrefixes) 220RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: false) is { Length: > 1 } caseSensitivePrefixes) 240fixedDistanceSets[0].Chars is { Length: 1 } && 357bool invalidChars = chars is not { Length: 1 } || fixedDistanceSets[i].Negated; 384Debug.Assert(chars is { Length: 1 }); 653if (chars is { Length: <= 5 }) // 5 == currently the max length efficiently handled by IndexOfAny{Except} without SearchValues 747if (primarySet.Chars is { Length: <= 5 }) // 5 == currently the max length efficiently handled by IndexOfAny{Except} 888if (set.Chars is not { Length: > 1 } chars) 912return totalFrequency >= HighFrequencyThreshold * chars.Length;
System\Text\RegularExpressions\RegexInterpreter.cs (9)
62private void Trackto(int newpos) => runtrackpos = runtrack!.Length - newpos; 64private int Trackpos() => runtrack!.Length - runtrackpos; 343runtrackpos = runtrack.Length; 344runstackpos = runstack.Length; 345runcrawlpos = runcrawl.Length; 361runtrackpos = runtrack.Length; 362runstackpos = runstack.Length; 363runcrawlpos = runcrawl.Length; 1142ref int trackingpos = ref runtrack![runtrack.Length - 1];
System\Text\RegularExpressions\RegexInterpreterCode.cs (2)
21public readonly uint[]?[] StringsAsciiLookup = new uint[strings.Length][]; 129for (int i = 0; i < Codes.Length; i += OpcodeSize((RegexOpcode)Codes[i]))
System\Text\RegularExpressions\RegexParser.cs (4)
116if (captureNumberList == null || captop == captureNumberList.Length) 126captureCount = captureNumberList.Length; 127for (int i = 0; i < captureNumberList.Length; i++) 2303(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)
262runtrackpos = runtrack!.Length; 263runstackpos = runstack!.Length; 264runcrawlpos = runcrawl!.Length; 308runtrackpos = runtrack!.Length; 309runstackpos = runstack!.Length; 310runcrawlpos = runcrawl.Length; 476int[] newtrack = new int[runtrack!.Length * 2]; 478Array.Copy(runtrack, 0, newtrack, runtrack.Length, runtrack.Length); 479runtrackpos += runtrack.Length; 489int[] newstack = new int[runstack!.Length * 2]; 491Array.Copy(runstack, 0, newstack, runstack.Length, runstack.Length); 492runstackpos += runstack.Length; 501int[] newcrawl = new int[runcrawl!.Length * 2]; 503Array.Copy(runcrawl, 0, newcrawl, runcrawl.Length, runcrawl.Length); 504runcrawlpos += runcrawl.Length; 532return 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)
42if (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)
339for (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 (19)
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) 1045for (int j = 0; j < transitions.Length; ++j) 1055Registers newRegisters = j != transitions.Length - 1 ? sourceRegisters.Clone() : sourceRegisters; 1102c < (uint)mintermLookup.Length ? 1159Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 1160Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 1162Array.Copy(other.CaptureStarts, CaptureStarts, CaptureStarts.Length); 1163Array.Copy(other.CaptureEnds, CaptureEnds, CaptureEnds.Length); 1489matcher._minterms.Length : // mintermId = minterms.Length represents an \n at the very end of input 1678matcher.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)
54int[] mintermIdsWithoutZ = new int[_minterms.Length]; 55int[] mintermIdsWithZ = new int[_minterms.Length + 1]; 56for (int i = 0; i < _minterms.Length; ++i) 61mintermIdsWithZ[_minterms.Length] = _minterms.Length;
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (4)
42_matcher = minterms.Length > 64 ? 87Debug.Assert(pos.CaptureStarts.Length == pos.CaptureEnds.Length); 88for (int cap = 0; cap < pos.CaptureStarts.Length; ++cap)
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)
28Debug.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++) 102for (int i = 1; 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 (72)
RegexGenerator.Emitter.cs (49)
1327Debug.Assert(primarySet.Chars.Length > 0); 1336indexOf = primarySet.Chars.Length switch 1474if (set.Chars is { Length: 1 }) 1534literalChars.Length switch 2188for (int i = 0; i < labelMap.Length; i++) 4818Debug.Assert(args.Length is >= 1); 4821string key = $"{MethodName}{args.Length}"; 4827var lines = new string[24 + args.Length]; 4828lines[0] = $"/// <summary>Pushes {args.Length} value{(args.Length == 1 ? "" : "s")} onto the backtracking stack.</summary>"; 4830lines[2] = $"internal static void {MethodName}(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})"; 4832lines[4] = $" // If there's space available for {(args.Length > 1 ? $"all {args.Length} values, store them" : "the value, store it")}."; 4835lines[7] = $" if ((uint){(args.Length > 1 ? $"(p + {args.Length - 1})" : "p")} < (uint)s.Length)"; 4837for (int i = 0; i < args.Length; i++) 4841lines[9 + args.Length] = args.Length > 1 ? $" pos += {args.Length};" : " pos++;"; 4842lines[10 + args.Length] = $" return;"; 4843lines[11 + args.Length] = $" }}"; 4844lines[12 + args.Length] = $""; 4845lines[13 + args.Length] = $" // Otherwise, resize the stack to make room and try again."; 4846lines[14 + args.Length] = $" WithResize(ref stack, ref pos{FormatN(", arg{0}", args.Length)});"; 4847lines[15 + args.Length] = $""; 4848lines[16 + args.Length] = $" // <summary>Resize the backtracking stack array and push {args.Length} value{(args.Length == 1 ? "" : "s")} onto the stack.</summary>"; 4849lines[17 + args.Length] = $" [MethodImpl(MethodImplOptions.NoInlining)]"; 4850lines[18 + args.Length] = $" static void WithResize(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})"; 4851lines[19 + args.Length] = $" {{"; 4852lines[20 + args.Length] = $" Array.Resize(ref stack, (pos + {args.Length - 1}) * 2);"; 4853lines[21 + args.Length] = $" {MethodName}(ref stack, ref pos{FormatN(", arg{0}", args.Length)});"; 4854lines[22 + args.Length] = $" }}"; 4855lines[23 + args.Length] = $"}}"; 4870Debug.Assert(args.Length is >= 1); 4872if (args.Length == 1) 4879string key = $"{MethodName}{args.Length}"; 4883var lines = new string[5 + args.Length]; 4884lines[0] = $"/// <summary>Pops {args.Length} value{(args.Length == 1 ? "" : "s")} from the backtracking stack.</summary>"; 4886lines[2] = $"internal static void {MethodName}(int[] stack, ref int pos{FormatN(", out int arg{0}", args.Length)})"; 4888for (int i = 0; i < args.Length; i++) 4892lines[4 + args.Length] = $"}}"; 5560for (int i = 0; i < parts.Length; i++)
src\runtime\src\libraries\Common\src\System\Buffers\SearchValuesPolyfills.cs (1)
75if (offset < (uint)lookup.Length)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (5)
202int len = s_propTable.Length; 1239Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1245if ((uint)index < (uint)cache.Length) 1556if (chars[0] < asciiStrings.Length) 1833int max = s_propTable.Length;
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (8)
138chars is { Length: 1 }) 175RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: true) is { Length: > 1 } caseInsensitivePrefixes) 220RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: false) is { Length: > 1 } caseSensitivePrefixes) 240fixedDistanceSets[0].Chars is { Length: 1 } && 357bool invalidChars = chars is not { Length: 1 } || fixedDistanceSets[i].Negated; 384Debug.Assert(chars is { Length: 1 }); 888if (set.Chars is not { Length: > 1 } chars) 912return totalFrequency >= HighFrequencyThreshold * chars.Length;
src\runtime\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++) 2303(uint)i < (uint)capslist.Length)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (2)
795int s1CharsLength = s1Chars?.Length ?? 0; 796int s2CharsLength = s2Chars?.Length ?? 0;
src\runtime\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)
29stringBuilder.CopyTo(0, chars, 0, chars.Length);
System.Threading.Channels (20)
src\runtime\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\runtime\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 (24)
src\runtime\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 (4)
65for (int i = 0; i < _limiters.Length; i++) 79RateLimitLease? notAcquiredLease = ChainedRateLimiterShared.CommonAcquireLogic(exception, lease, ref leases, i, _limiters.Length); 96for (int i = 0; i < _limiters.Length; i++) 110RateLimitLease? notAcquiredLease = ChainedRateLimiterShared.CommonAcquireLogic(exception, lease, ref leases, i, _limiters.Length);
System\Threading\RateLimiting\ChainedRateLimiterShared.cs (5)
73for (int i = 0; i < limiters.Length; i++) 87RateLimitLease? notAcquiredLease = CommonAcquireLogic(exception, lease, ref leases, i, limiters.Length); 102for (int i = 0; i < limiters.Length; i++) 116RateLimitLease? notAcquiredLease = CommonAcquireLogic(exception, lease, ref leases, i, limiters.Length); 137exceptions[exceptions.Length - 1] = ex;
System\Threading\RateLimiting\CombinedRateLimitLease.cs (1)
77for (int i = _leases.Length - 1; i >= 0; i--)
System\Threading\RateLimiting\PartitionedRateLimiter.cs (1)
62if (limiters.Length == 0)
System\Threading\RateLimiting\RateLimiter.cs (1)
41if (limiters.Length == 0)
System.Threading.Tasks.Dataflow (25)
Base\DataflowBlock.cs (1)
1961Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID");
Blocks\BatchBlock.cs (5)
738for (int i = 0; i < newBatch.Length; i++) newBatch[i] = _messages.Dequeue(); 797Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long 911Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long 1141if (multipleOutputItems == null) return singleOutputItem.Length; 1145foreach (T[] item in multipleOutputItems) count += item.Length;
Blocks\JoinBlock.cs (1)
1382Debug.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)
430for (int i = 0; i < itemsAsArray.Length; i++)
src\runtime\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)
208Action[] actionsCopy = new Action[actions.Length]; 209for (int i = 0; i < actionsCopy.Length; i++) 225actionsCopy.Length); 233if (actionsCopy.Length < 1) return; 245(actionsCopy.Length > SMALL_ACTIONCOUNT_LIMIT) || 246(parallelOptions.MaxDegreeOfParallelism != -1 && parallelOptions.MaxDegreeOfParallelism < actionsCopy.Length) 268while (myIndex <= actionsCopy.Length) 329Task[] tasks = new Task[actionsCopy.Length]; 335for (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 (25)
System\Transactions\DtcProxyShim\DtcProxyShimFactory.cs (3)
130Debug.Assert(pcbUsed == tmpWhereabouts.Length); 227txImport.Import(Convert.ToUInt32(cookie.Length), cookie, Guids.IID_ITransaction_Guid, out object? tx); 244Convert.ToUInt32(propagationToken.Length),
System\Transactions\DtcProxyShim\ResourceManagerShim.cs (1)
44ResourceManager!.Reenlist(prepareInfo, (uint)prepareInfo.Length, 5, out OletxXactStat xactStatus);
System\Transactions\DtcProxyShim\TransactionShim.cs (1)
42_shimFactory.ExportFactory.Create((uint)whereabouts.Length, whereabouts, out ITransactionExport export);
System\Transactions\Oletx\OletxEnlistment.cs (7)
102int prepareInfoLength = prepareInfoByteArray.Length; 277long arrayLength = prepareInfo.Length; 630byte[] temp = new byte[txGuidArray.Length + rmGuidArray.Length]; 633for (int index = 0; index < txGuidArray.Length; index++) 639for (int index = 0; index < rmGuidArray.Length; index++) 641_proxyPrepareInfoByteArray[txGuidArray.Length + index] =
System\Transactions\Oletx\OletxTransaction.cs (1)
135if (_propagationTokenForDeserialize.Length < 24)
System\Transactions\Transaction.cs (2)
465byte[] toReturn = new byte[internalPromotedToken.Length]; 466Array.Copy(internalPromotedToken, toReturn, toReturn.Length);
System\Transactions\TransactionInterop.cs (9)
61var whereaboutsCopy = new byte[whereabouts.Length]; 62Buffer.BlockCopy(whereabouts, 0, whereaboutsCopy, 0, whereabouts.Length); 97if (cookie.Length < 32) 108var cookieCopy = new byte[cookie.Length]; 109Buffer.BlockCopy(cookie, 0, cookieCopy, 0, cookie.Length); 232if (propagationToken.Length < 24) 501if (propagationToken.Length < 24) 511byte[] propagationTokenCopy = new byte[propagationToken.Length]; 512Array.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)
607ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, bytes.Length); 610ArgumentOutOfRangeException.ThrowIfGreaterThan(count, bytes.Length - offset);
System.Windows.Controls.Ribbon (9)
Microsoft\Windows\Controls\GenericValueConverters.cs (2)
29if (values.Length < 2) 34for (int i = 1; i < values.Length; i++)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (1)
461if (handleTypeCount == 0 || handleTypeCount == handleTypes.Length)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonScrollButtonVisibilityConverter.cs (1)
43values.Length != 4 ||
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (3)
193for (i = 1; i < _unitStrings.Length; ++i) 208if (i >= _unitStrings.Length) 210for (i = 0; i < _pixelUnitStrings.Length; ++i)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2215for (int i = 0; i < properties.Length; i++)
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (1)
388int wordCount = string.IsNullOrEmpty(Text) ? 0 : Text.Split().Length;
System.Windows.Extensions (5)
System\Media\SoundPlayer.cs (5)
509if (_streamData.Length < _currentPos + BlockSize) 511byte[] newData = new byte[_streamData.Length * 2]; 512Array.Copy(_streamData, newData, _streamData.Length); 621if (data.Length < 12 || 630int len = data.Length;
System.Windows.Forms (553)
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)
112List<AssemblyName> assemblyList = new(_names.Length);
System\Resources\ResXDataNode.cs (4)
131if (fileRefDetails is not null && fileRefDetails.Length > 1) 138if (fileRefDetails.Length > 2) 423if (serializedData.Length <= 0) 679if (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)
2988if (args?.Length == 0 && s_propertiesWithArguments.Contains(name)) 3270int 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)
151index = ctrls.Length - 1; 183if (ctrls is null || ctrls.Length == 0) 190if (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)
2354if (index > 0 && index < s_categoryNames.Length && s_categoryNames[index] is not null) 2549else 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)
1196for (int i = 0; i < _ambientProperties.Length; i++) 1262for (int i = 0; i < _ambientProperties.Length; i++) 1272for (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)
173if (attrs is not null && attrs.Length > 0) 504if (attrs is not null && attrs.Length > 0) 554if (attrs is not null && attrs.Length > 0) 1310Debug.Assert(arguments is not null && arguments.Length > 0); 1317if (arguments.Length >= 2) 1319StringBuilder sb = new((arguments.Length - 1) * 16); 1320for (int argumentIndex = 1; argumentIndex < arguments.Length; argumentIndex++)
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 (3)
199if (typeInfos.Length == 0) 210for (int i = 0; i < typeInfos.Length; i++) 222for (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)
6148if (tme._args is null || tme._args.Length < 1) 6152else if (tme._args.Length < 2) 6171Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for WaitCallback"); 6176Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for SendOrPostCallback"); 6594Marshal.Copy(bytes, 0, m.LParamInternal, bytes.Length); 6595Marshal.Copy(nullBytes, 0, m.LParamInternal + (nint)bytes.Length, nullBytes.Length); 6597m.ResultInternal = (LRESULT)((bytes.Length + nullBytes.Length) / sizeof(char)); 9322for (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)
1322if (value is null || value.Length == 0) 2982for (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)
1580if (clonedColumns.Length == clonedColumnsCount) 1634Debug.Assert(finalClonedColumns.Length == 0); 1642for (int k = 0; k < finalClonedColumns.Length; k++) 5268for (int arrayIndex = 0; arrayIndex < dataGridViewRows.Length; arrayIndex++) 5277if (arrayIndex == dataGridViewRows.Length - 1 && !currentRowFrozen && nextVisibleRowPresent && nextRowFrozen) 8155int bytecountEndOfFragment = 135 + destinationBytes.Length; 10917int columnCount = dataGridViewColumns.Length; 11058int rowCount = dataGridViewRows.Length; 11235if (previousModes.Length != Columns.Count) 15326Debug.Assert(dataGridViewRows.Length > 0); 15329DisplayedBandsInfo.CorrectRowIndexAfterInsertion(rowIndex, dataGridViewRows.Length); 15332CorrectRowIndexesAfterInsertion(rowIndex, dataGridViewRows.Length); 15341Debug.Assert(dataGridViewRows.Length > 0); 15613newCurrentCell = new Point(_ptCurrentCell.X, _ptCurrentCell.Y + dataGridViewRows.Length); 15640_selectedBandIndexes[rowEntry] = rowIndex + dataGridViewRows.Length; 15655_selectedBandSnapshotIndexes[rowEntry] = rowIndex + dataGridViewRows.Length; 26247for (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)
193List<DataGridViewColumn> initialColumns = new(dataGridViewColumns.Length); 194List<DataGridViewColumn> sortedColumns = new(dataGridViewColumns.Length);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
1099for (int i = 0; i < newItems.Length; i++)
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (2)
1800if (columnIndex == values.Length) 1811return 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)
553Debug.Assert(regionIndex == (textRegions.Length - 1), "Failed to consume all link label visual regions"); 1052&& regionRectangles.Length > 0) 1317&& link.VisualRegion.GetRegionScans(g.Transform) is { } regionRectangles && regionRectangles.Length > 0)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
643for (int i = 1; i < tabStops.Length; i++)
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (2)
1176if (value is null || value.Length == 0) 1987for (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)
483PInvokeCore.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++) 2520ColumnHeader? col = (_columnHeaders is not null && _columnHeaders.Length > 0) ? _columnHeaders[0] : null; 3072for (int colIdx = _columnHeaders.Length - 1; colIdx >= 0; colIdx--) 3464for (int i = 0; i < _columnHeaders.Length; i++) 3809for (int i = 0; i < _columnHeaders.Length; i++) 3839int columnCount = _columnHeaders is null ? 0 : _columnHeaders.Length; 3999if (items is null || items.Length == 0) 4016for (int i = 0; i < items.Length; i++) 4030for (int i = 0; i < items.Length; i++) 4041for (int i = 0; i < items.Length; i++) 4095if (items is null || items.Length == 0) 4121for (int i = 0; i < items.Length; i++) 4136cColumns = (uint)(_columnHeaders is not null ? Math.Min(MAXTILECOLUMNS, _columnHeaders.Length) : 0), 4602: _columnHeaders.Length; 4727_savedSelectedItems = new List<ListViewItem>(lviArr.Length); 4728for (int i = 0; i < lviArr.Length; i++) 5292ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, _columnHeaders?.Length ?? 0); 5370int[] orderedColumns = new int[indices.Length]; 5371for (int i = 0; i < indices.Length; i++) 5384(WPARAM)orderedColumns.Length, 5651for (int i = 0; i < _columnHeaders.Length; i++) 5869cLines = _columnHeaders is not null ? _columnHeaders.Length : 0, 6110if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem) 6126if (_columnHeaders is not null && nmheader->iItem < _columnHeaders.Length && 6161if (_columnHeaders is not null && nmheader->iItem < _columnHeaders.Length) 6219if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem) 6341if (_columnHeaders is not null && _columnHeaders.Length > nmheader->iItem) 6359Debug.Assert(_columnHeaders!.Length > 0, "there should be a column that we need to compensate for"); 6889Marshal.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)
272for (int i = 0; i < items.Length; i++) 357for (int index = 0; index < items.Length; ++index)
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (1)
111Debug.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\ListView\ListViewItemConverter.cs (1)
74for (int i = 0; i < subItems.Length; ++i)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (3)
177if (value is not null && value.Length > 0) 250if (value is not null && value.Length > 0) 533if (value is not null && value.Length > 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (53)
375if (_selectedObjects is not null && _selectedObjects.Length > 0 && _rootEntry is not null) 889get => _selectedObjects is null || _selectedObjects.Length == 0 ? null : _selectedObjects[0]; 916if (value is not null && value.Length > 0) 918for (int count = 0; count < value.Length; count++) 922throw new ArgumentException(string.Format(SR.PropertyGridSetNull, count, value.Length)); 935&& _selectedObjects.Length == value.Length) 940for (int i = 0; i < value.Length && (isSame || classesSame); i++) 1046HashSet<Type>? typesWithEvents = _selectedObjects.Length > 10 ? new() : null; 1048for (int i = 0; i < _selectedObjects.Length && showEvents; i++) 1079ShowEventsButton(showEvents && _selectedObjects.Length > 0); 1081EnablePropPageButton(_selectedObjects.Length == 1 ? _selectedObjects[0] : null); 1093if (_selectedObjects!.Length > 0 && GetFlag(Flags.ReInitTab)) 1117if (_selectedObjects.Length > 0) 1540int oldArraySize = tabComponents is null ? 0 : tabComponents.Length; 1741if (_selectedObjects is not null && _selectedObjects.Length > 0) 1743for (int i = 0; i < _selectedObjects.Length; i++) 1764if (_selectedObjects.Length == 1 && site.TryGetService(out IDesignerHost? designerHost)) 1780if (verbs is not null && verbs.Length > 0) 2023for (int j = 0; j < _selectedObjects.Length; j++) 2144if (components is null || components.Length == 0) 2157for (int i = 0; i < tabAttribute.TabScopes.Length; i++) 2165for (int i = 1; i < components.Length && tabClasses.Count > 0; i++) 2220if (_selectedObjects is null || index < 0 || index > _selectedObjects.Length) 2428for (int i = 0; i < tabAttribute.TabClasses.Length; i++) 2441(_selectedObjects is null) || (_selectedObjects.Length == 0)) 2451int objectCount = _selectedObjects.Length; 2475for (int i = 0; i < tabAttribute.TabClasses.Length; i++) 2485for (int i = 0; i < _selectedObjects.Length; i++) 2489object[] newObjects = new object[_selectedObjects.Length - 1]; 2491if (i < newObjects.Length) 2494Array.Copy(_selectedObjects, i + 1, newObjects, i, newObjects.Length - i); 2541if (_selectedObjects is not null && _selectedObjects.Length > 0) 3030for (int i = 0; i < _selectedObjects.Length; i++) 3059for (index = 0; index < _viewSortButtons.Length; index++) 3112_selectedObjects.Length > 0) 3427if (tabScope <= PropertyTabScope.Component && _selectedObjects is not null && _selectedObjects.Length > 0) 3447for (int i = 0; i < tabAttribute.TabClasses.Length; i++) 3493object[] newComponents = new object[components!.Length - 1]; 3495Array.Copy(components, index + 1, newComponents, index, components.Length - index - 1); 3500killTab = components is not null && components.Length == 0; 3647for (int i = 0; i < _selectedObjects.Length; ++i) 3764if (state >= (_tabs.Count * _viewSortButtons.Length)) 3770state = (_tabs.Count * _viewSortButtons.Length) - 1; 3781int viewTypes = _viewSortButtons.Length; 3788Debug.Assert(view < _viewSortButtons.Length, "Can't select view type > 1"); 4044for (int i = 0; _connectionPointCookies is not null && i < _connectionPointCookies.Length; i++) 4053if (_selectedObjects is null || _selectedObjects.Length == 0) 4060if (_connectionPointCookies is null || (_selectedObjects.Length > _connectionPointCookies.Length)) 4062_connectionPointCookies = new AxHost.ConnectionPointCookie[_selectedObjects.Length]; 4065for (int i = 0; i < _selectedObjects.Length; i++) 4149if (_selectedObjects is not null && _selectedObjects.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)
885if (objects is null || objects.Length == 0) 890return objects.Length == 1 940bool expandable = childProperties is not null && childProperties.Length > 0; 945if (childProperties is not null && childProperties.Length == _children.Count) 947for (int i = 0; i < childProperties.Length; i++) 1333entries = new GridEntry[objArray.Length]; 1335for (int i = 0; i < entries.Length; i++) 2097for (int i = 0; i < props.Length; i++) 2101newProperties ??= new PropertyDescriptor[props.Length]; 2110for (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++) 285for (int i = 0; i < _descriptors.Length; i++) 315for (int i = 0; i < _descriptors.Length; i++) 327for (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 (13)
34for (int i = 0; i < entries.Length; i++) 49if (objects.Length == 0) 59if (objects.Length > 1) 61object?[] restObjects = new object?[objects.Length - 1]; 62Array.Copy(objects, 1, restObjects, 0, objects.Length - 1); 71if (objects.Length == 1) 79for (int i = 0; i < entries.Length; i++) 103for (int i = 0; i < entries.Length; i++) 174int[] positions = new int[objectProperties.Length]; 183for (int j = 1; match && j < objectProperties.Length; j++) 269for (int i = 0; i < entries.Length; i++) 273newEntries ??= new MultiPropertyDescriptorGridEntry[entries.Length]; 283for (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)
1301if (index >= (values.Length - 1)) 1542for (int i = 0; i < values.Length; i++) 1544object currentValue = values[(i + index + 1) % values.Length]; 1731if (values.Length == 0) 1739for (int i = 0; i < values.Length; i++) 1853if (current >= target + targetEntries.Length) 2458for (int i = 0; i < values.Length; i++) 2492if (i == values.Length - 1) 3180if (delta > 0 && index >= (values.Length - 1)) 3186index = values.Length - 1; 3551for (int i = 0; i < entries.Length; i++) 3568int newArraySize = entries.Length + (e.NewChildCount - e.OldChildCount); 3580entries.Length - (parentIndex + e.OldChildCount + 1)); 3738if (rgItems is not null && rgItems.Length > 0) 3740for (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); 1954if (characterSet.Length == 0) 2227int charSetLen = charSet.Length; 2820_editStream = new MemoryStream(encodedBytes.Length); 2821_editStream.Write(encodedBytes, 0, encodedBytes.Length); 2944result = Encoding.Unicode.GetString(bytes, 0, bytes.Length); 2949result = (CodePagesEncodingProvider.Instance.GetEncoding(0) ?? Encoding.UTF8).GetString(bytes, 0, bytes.Length);
System\Windows\Forms\Controls\TabControl\TabControl.cs (4)
1551int index = ((tabPages.Length > 0) && (SelectedIndex == -1)) ? 0 : SelectedIndex; 1565for (int i = 0; i < tabPages.Length; i++) 1631for (int i = 0; i < pages.Length; i++) 1899for (int i = 0; i < tabPages.Length; i++)
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (5)
616if (value is not null && value.Length > 0) 1891if (start > bytes.Length) 1893start = bytes.Length; 1896if (end > bytes.Length) 1898end = bytes.Length;
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1785for (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)
1372for (int i = 0; i < paintRects.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)
1607if (_children is null || _children.Length == 0) 1611else if (_childCount + num > _children.Length)
System\Windows\Forms\Controls\TreeView\TreeNodeCollection.cs (5)
211if (nodes.Length == 0) 217if (tv is not null && nodes.Length > TreeNode.MAX_TREENODES_OPS) 227_owner.EnsureCapacity(nodes.Length); 228for (int i = nodes.Length - 1; i >= 0; i--) 234if (tv is not null && nodes.Length > TreeNode.MAX_TREENODES_OPS)
System\Windows\Forms\Controls\WebBrowser\HtmlDocument.cs (1)
534cArgs = (uint)vectorArgs.Variants.Length,
System\Windows\Forms\Controls\WebBrowser\HtmlElement.cs (1)
604cArgs = (uint)vectorArgs.Variants.Length,
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)
230if (ctls.Length > 0 && _components is null) 236for (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) 419if (startIndex == listAccessors.Length) 453if (listAccessors.Length > startIndex) 472if (listAccessors.Length > startIndex + 1) 474int accessorsCount = listAccessors.Length - (startIndex + 1); 550for (int idx = 0; idx < props.Length; idx++) 552if (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)
76int[] result = new int[_customColors.Length]; 85if (value is not null && value.Length > 0) 87MemoryMarshal.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)
29if (t_helpInfoTable is not null && t_helpInfoTable.Length > 0) 85if (t_helpInfoTable.Length == 1) 91int newCount = t_helpInfoTable.Length - 1; 116lastCount = 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)
310- ((buttons.Length - startIndex) * _scaledButtonAlignmentWidth - _scaledButtonAlignmentPadding); 312for (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)
567for (int i = 0; i < array.Length; i++) 651for (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++) 741int colStop = Math.Min(layoutInfo.ColumnStart + layoutInfo.ColumnSpan, containerInfo.Columns.Length); 762for (int i = 0; i < strips.Length; i++) 782for (int i = 0; i < strips.Length; i++) 858int rowStop = Math.Min(layoutInfo.RowStart + layoutInfo.RowSpan, containerInfo.Rows.Length); 874for (int i = start; i < Math.Min(start + span, strips.Length); i++) 951if (!(i == strips.Length - 1) // this is not the last strip 1025for (int i = 0; i < strips.Length; i++) 1089totalPercentAllocatedSpace = 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."); 1194for (int i = 0; i < childrenInfo.Length; i++) 1231for (; currentCol < colStop && currentCol < containerInfo.Columns.Length; currentCol++) 1245for (int rowIndex = currentRow; rowIndex < rowStop && rowIndex < containerInfo.Rows.Length; rowIndex++) 1428Debug.Assert((containerInfo.Columns is null && cols is null) || containerInfo.Columns!.Length == cols.Length, 1430Debug.Assert((containerInfo.Rows is null && rows is null) || containerInfo.Rows!.Length == rows.Length,
System\Windows\Forms\MDI\MDIClient.cs (1)
344if (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\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) 649if (imageIndex < pages.Length) 681for (int i = 0; i < pageRenderArea.Length; i++) 683if (i + StartPage < pages.Length) 975else if (_pageInfo is not null && StartPage < _pageInfo.Length) 991StartPage = _pageInfo.Length;
System\Windows\Forms\Rendering\ScreenDcCache.cs (3)
46for (int i = 0; i < _itemsCache.Length; i++) 69for (int i = 0; i < _itemsCache.Length; i++) 87for (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++) 1781for (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.Design (326)
System\ComponentModel\Design\ArrayEditor.cs (3)
37Array.Copy(valueArray, items, items.Length); 59Array newArray = Array.CreateInstance(CollectionItemType, value.Length); 60Array.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 = PInvokeCore.MultiByteToWideChar(PInvokeCore.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++) 181for (int i = 0; i < items.Length; i++) 274for (int i = 0; i < items.Length; i++) 692for (int i = 0; i < items.Length; i++) 704for (int i = 0; i < deadItems.Length; i++) 769for (int i = 0; i < items.Length; i++) 1059for (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)
114if (fieldAttrs is not null && fieldAttrs.Length > 0) 116Debug.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++) 1693Debug.Assert(nameParts.Length > 0, "How can we fail to split when IndexOf succeeded?"); 1703for (int idx = 1; idx < nameParts.Length; idx++) 1938object?[] argumentValues = new object[arguments.Length]; 1941if (arguments.Length > 0) 1950for (int i = 0; i < arguments.Length; i++) 2012Debug.Assert(arguments.Length == 0, "Property serialization does not support arguments"); 2018Debug.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)
319for (int i = 0; i < _picker._tabOrder.Length; i++) 324i = 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)
779Marshal.Copy(bytes, 0, m.LParamInternal, bytes.Length); 780Marshal.Copy(nullBytes, 0, m.LParamInternal + (nint)bytes.Length, nullBytes.Length); 781m.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++) 980for (int i = 0; i < _dragComponents.Length; i++) 1025for (int i = 0; i < _dragComponents.Length; i++) 1050if ((_dragComponents is not null) && (_dragComponents.Length > 0)) 1053for (int i = 0; i < _dragComponents.Length; i++) 1108for (int i = 0; i < _dragComponents.Length; i++) 1162for (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)
316if (currentSelectionBounds.Length >= previousSelectionBounds.Length) 330bool[] intersected = new bool[smaller.Length]; 331for (int i = 0; i < smaller.Length; i++) 342for (int s = 0; s < smaller.Length; s++) 366for (int k = 0; k < intersected.Length; k++) 380for (int i = 0; i < currentSelectionBounds.Length; i++) 433if (_currentSelectionBounds.Length > 0) 436for (int i = 1; i < _currentSelectionBounds.Length; i++) 453_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)
207for (int i = 0; i < _commandSet.Length; i++) 352for (int i = 0; i < _commandSet.Length; i++) 452List<IComponent> list = new(components.Length); 1941if (componentNames is not null && idx < componentNames.Length) 2315trans = host?.CreateTransaction(string.Format(SR.CommandSetSize, selectedObjects.Length)); 2394trans = host.CreateTransaction(string.Format(SR.CommandSetSizeToGrid, selectedObjects.Length)); 2531trans = host.CreateTransaction(string.Format(SR.CommandSetFormatSpacing, selectedObjects.Length)); 2591for (int n = 0; n < selectedObjects.Length; n++) 2658for (int n = selectedObjects.Length - 1; n >= 0; n--) 2697? (lastSize.Width + lastLoc.X - curLoc.X - total) / (selectedObjects.Length - 1) 2698: (lastSize.Height + lastLoc.Y - curLoc.Y - total) / (selectedObjects.Length - 1); 2718for (int n = 0; n < selectedObjects.Length; n++) 3138for (int i = 0; i < _commandSet.Length; i++) 3215for (int i = 0; itemCount < 3 && i < _commandSet.Length; i++)
System\Windows\Forms\Design\ComponentTray.cs (2)
1338if (comps.Length == 0) 1686if (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++) 992batchString = string.Format(SR.CommandSetBringToFront, selectedComponents.Length); 996batchString = string.Format(SR.CommandSetSendToBack, selectedComponents.Length); 1004if (selectedComponents.Length > 0) 1006int len = selectedComponents.Length; 1345for (int i = 0; i < _commandSet.Length; i++)
System\Windows\Forms\Design\ControlDesigner.cs (2)
1644for (int i = 0; i < shadowProps.Length; i++) 2190if (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)
545for (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)
359for (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)
190int len = types.Length; 200Debug.Assert(attrs is not null && attrs.Length == 1, $"Invalid number of GuidAttributes found on: {t.FullName}");
System\Windows\Forms\Design\DocumentDesigner.cs (4)
255for (int i = 0; i < dragComps.Length; i++) 1170for (int i = 0; i < types.Length; i++) 1233for (int i = 0; i < shadowProps.Length; i++) 1254for (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++) 231trans = host.CreateTransaction(string.Format(SR.DragDropMoveComponents, _components.Length)); 249List<object> topComponents = new(_components.Length); 250for (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++) 1514for (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 (12)
43_dragControls = new Control[components.Length]; 44for (int i = 0; i < components.Length; i++) 60Debug.Assert(bounds is not null && controls is not null && bounds.Length == controls.Length, "bounds->controls mismatch"); 66for (int i = 0; i < controls.Length; i++) 85for (int i = 0; i < controls.Length; i++) 228_originalCoordinates = new BoundsInfo[controls.Length]; 229for (int i = 0; i < controls.Length; i++) 240for (int i = 0; i < controls.Length; i++) 489for (int i = 0; i < controls.Length; i++) 513if (components is not null && components.Length > 0) 548return components is not null && components.Length > 0;
System\Windows\Forms\Design\SelectionUIService.cs (13)
252if (objects.Length > 1) 254transactionName = string.Format(SR.DragDropMoveComponents, objects.Length); 259if (objects.Length > 0) 276if (objects.Length > 1) 278transactionName = string.Format(SR.DragDropSizeComponents, objects.Length); 283if (objects.Length > 0) 300transactionName = string.Format(SR.DragDropDragComponents, objects.Length); 970if (objects.Length == 0) 990for (int i = 0; i < objects.Length; i++) 1115if (components.Length > 1 || (components.Length == 1 && comp is not null && comp.Site is null)) 1117trans = _host.CreateTransaction(string.Format(SR.DragDropMoveComponents, components.Length)); 1119else if (components.Length == 1)
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (2)
420Array.Copy(s_activeCursorArrays, _cursors, _cursors.Length); 421Array.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)
121for (int j = 0; j < menuItemNames.Length; j++) 125for (int i = 0; i < menuArray.Length; i++) 197if (i == menuArray.Length - 1) 210if (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)
455for (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); 735int numRows = Table.GetRowHeights().Length; 736int numColumns = Table.GetColumnWidths().Length; 851if (cw.Length > 1) 857for (int i = 0; i < cw.Length - 1; i++) 872if (rh.Length > 1) 875for (int i = 0; i < rh.Length - 1; i++) 912if (cw.Length > Table.ColumnStyles.Count) 914int colDifference = cw.Length - Table.ColumnStyles.Count; 925if (rh.Length > Table.RowStyles.Count) 927int rowDifference = rh.Length - Table.RowStyles.Count; 976position.X = columns.Length; 983for (int i = 0; i < columns.Length; i++) 999position.X = columns.Length; 1004for (int i = 0; i < columns.Length; i++) 1022position.Y = rows.Length; 1027for (int i = 0; i < rows.Length; i++) 1085for (int i = 0; i < cw.Length - 1; i++) 1120for (int i = 0; i < rh.Length - 1; i++) 1196_rowCountBeforeAdd = Math.Max(0, Table.GetRowHeights().Length); // don't want negative 1197_colCountBeforeAdd = Math.Max(0, Table.GetColumnWidths().Length); 1217for (int row = 0; row < rows.Length; row++) 1219for (int column = 0; column < columns.Length; column++) 1264if (dropPoint.Y < 0 || dropPoint.Y >= rows.Length || dropPoint.X < 0 || dropPoint.X >= columns.Length) 1336_rowCountBeforeAdd = Math.Max(0, Table.GetRowHeights().Length); // don't want negative 1337_colCountBeforeAdd = Math.Max(0, Table.GetColumnWidths().Length); 1950if ((isRow && rh.Length < index - 1) || (!isRow && ch.Length < index - 1)) 2084for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\TabOrder.cs (3)
605for (int i = 0; i < _tabGlyphs.Length; i++) 671for (int i = 0; i < _commands.Length; i++) 690for (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\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (5)
457if (newToolStripItemTypes.Length > 0) 498for (int i = 0; i < items.Length; i++) 802if (selectedItems.Length > 0) 808if (selectedItems.Length == 1 && selectedItems[0] is ToolStrip toolStrip) 831_btnRemove.Enabled = selectedItems.Length > 0;
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)
1538parentPanel.Join(ToolStrip, parentPanel.Rows.Length); 2228for (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)
552for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripItemDesigner.cs (1)
1020for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (1)
2232for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripPanelDesigner.cs (3)
505for (int i = 0; i < noBrowseEvents.Length; i++) 548for (int i = 0; i < noBrowseProps.Length; i++) 560for (int i = 0; i < shadowProps.Length; i++)
System\Windows\Forms\Design\ToolStripTemplateNode.cs (4)
184for (int i = 0; i < _addCommands.Length; i++) 203for (int i = 0; i < _addCommands.Length; i++) 1192for (int i = 0; i < _commands.Length; i++) 1212for (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.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.Xaml (100)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (4)
108for (int i = assemblies.Length - 1; i >= 0; i--) 237if (reqKeyToken.Length == curKeyToken.Length) 241for (int i = 0; i < reqKeyToken.Length; i++)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (8)
1310public override int Capacity => _entries.Length; 1316if (_count < _entries.Length) 1323int size = _entries.Length; 1339Array.Copy(_entries, 0, destEntries, 0, _entries.Length); 1362if (_count < _entries.Length) 1487if (_entries.Length >= oldCount) 1517ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _entries.Length); 1548if (newCapacity + (newCapacity >> 2) >= _sourceArray.Length)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
87if (nameFrags.Length == 1)
System\Xaml\Context\XamlContext.cs (1)
282for (int i = 0; i < typeArgs.Length; i++)
System\Xaml\Context\XamlParserContext.cs (2)
176if (parInfo.Length >= parameterCount) 178parameterCount = parInfo.Length;
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1155for (int i = 0; i < args.Length; i++)
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
269for (int i = 0; i < attributes.Length; i++)
System\Xaml\Parser\GenericTypeNameScanner.cs (1)
372Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\MeScanner.cs (3)
563Debug.Assert(KnownStrings.WhitespaceChars.Length == 5); 624IsConstructorParsingMode = context.CurrentLongestConstructorOfMarkupExtension.Length > 0; 625MaxConstructorParams = context.CurrentLongestConstructorOfMarkupExtension.Length;
System\Xaml\Parser\NodeStreamSorter.cs (6)
491_sortingInfoArray = new ReorderInfo[_originalNodesInOrder.Length]; 495for (int i = 0; i < _originalNodesInOrder.Length; i++) 527for (int idx = 0; idx < _sortingInfoArray.Length; idx++) 587while (idx < _sortingInfoArray.Length 703for (int idx = start + 1; idx < _sortingInfoArray.Length; idx++) 722end =_sortingInfoArray.Length;
System\Xaml\Parser\XamlText.cs (1)
370for (int i = 0; i < EastAsianCodePointRanges.Length; i++)
System\Xaml\RefOnly\LooseTypeExtensions.cs (2)
97for (int i = 0; i < genericParameterConstraints.Length; i++) 113for (int i = 0; i < interfaces.Length; i++)
System\Xaml\Replacements\TypeListConverter.cs (2)
26Type[] types = new Type[tl.Length]; 27for (int i = 0; i < tl.Length; i++)
System\Xaml\Runtime\ClrObjectRuntime.cs (3)
117if (args is null || args.Length == 0) 128methods = new MethodBase[members.Length]; 129Array.Copy(members, methods, members.Length);
System\Xaml\Runtime\DynamicMethodRuntime.cs (8)
202if (args is null || args.Length == 0) 360if (args.Length == 0) 368Type[] paramTypes = new Type[parameters.Length]; 369LocalBuilder[] locals = new LocalBuilder[paramTypes.Length]; 370for (int i = 0; i < parameters.Length; i++) 405for (int i = 0; i < locals.Length; i++) 581Emit_ConstInt(ilGenerator, paramArgNums.Length); 585for (int i = 0; i < paramArgNums.Length; i++)
System\Xaml\Schema\CollectionReflector.cs (2)
320if (paramInfos is null || paramInfos.Length != paramCount) 370if (method.GetParameters().Length == argCount)
System\Xaml\Schema\Reflector.cs (6)
70if (attributes.Length == 0) 144if (attributes.Length == 0) 178if (attributes.Length == 0) 221if (attributes.Length == 0) 268if (attributes.Length == 0) 303if (attributes.Length == 0)
System\Xaml\Schema\TypeReflector.cs (13)
472knownMembers = new List<XamlMember>(propList.Length + eventList.Length); 488Dictionary<string, PropertyInfo> result = new Dictionary<string, PropertyInfo>(propList.Length); 489for (int i = 0; i < propList.Length; i++) 492if (currentProp.GetIndexParameters().Length > 0) 550Dictionary<string, EventInfo> result = new Dictionary<string, EventInfo>(eventList.Length); 551for (int i = 0; i < eventList.Length; i++) 609if (pi.GetIndexParameters().Length == 0) 930return (pmi.Length == 1) && (mi.ReturnType != typeof(void)); 954return (pmi.Length == 2); 979return (pmi.Length == 2) && typeof(Delegate).IsAssignableFrom(pmi[1].ParameterType); 1089if (objs.Length == 0) 1094if (objs.Length > 1)
System\Xaml\Schema\XamlNamespace.cs (8)
63if (typeArgs is null || typeArgs.Length == 0) 99Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types."); 104string mangledTypeName = MangleGenericTypeName(typeNameSpan, typeArgs.Length); 155var clrTypeArgs = new Type[typeArgs.Length]; 156for (int n = 0; n < typeArgs.Length; n++) 172get => _assemblyNamespaces?.Length ?? 0; 180Debug.Assert(_assemblyNamespaces.Length == 1); 283assemblyNamespacesCopy = new AssemblyNamespacePair[_assemblyNamespaces.Length + 1];
System\Xaml\Schema\XamlTypeInvoker.cs (1)
128if (!_xamlType.UnderlyingType.IsValueType && (arguments is null || arguments.Length == 0))
System\Xaml\XamlBackgroundReader.cs (1)
114get { return _inIdx >= _incoming.Length; }
System\Xaml\XamlMember.cs (5)
685if (parameters.Length > 0) 847if ((method.GetParameters().Length != 1) || (method.ReturnType == typeof(void))) 855if ((method is not null) && (method.GetParameters().Length != 2)) 920if (attribs.Length > 0) 1026if (parameters.Length == 2)
System\Xaml\XamlObjectReader.cs (4)
1272if (arguments.Count != methodParams.Length) 1647if (constructorParameters.Length != ctorArgProps.Count) { continue; } 1649IList constructorArguments = new List<object>(constructorParameters.Length); 1650for (int i = 0; i < constructorParameters.Length; i++)
System\Xaml\XamlSchemaContext.cs (2)
330if (typeArguments is null || typeArguments.Length == 0) 1066_unexaminedAssemblies = new WeakReferenceList<Assembly>(currentAssemblies.Length);
System\Xaml\XamlType.cs (12)
982if (addParams.Length == 2) 1002if (addParams.Length == 2) 1006else if (addParams.Length == 1) 1267Debug.Assert(typeArgs.Length == 1); 1309Debug.Assert(typeArgs.Length == 1); 1608XamlType[] result = new XamlType[types.Length]; 1609for (int i = 0; i < types.Length; i++) 1698XamlType[] typeVector = new XamlType[parameterInfos.Length]; 1699for (int i = 0; i < parameterInfos.Length; i++) 1707if (ctorDict.ContainsKey(typeVector.Length)) 1711throw new XamlSchemaException(SR.Format(SR.MarkupExtensionWithDuplicateArity, UnderlyingType, typeVector.Length)); 1718ctorDict.Add(typeVector.Length, GetReadOnly(typeVector));
System\Xaml\XamlXmlWriter.cs (2)
1921if (constructorParameters.Length != ctorArgProps.Count) 1926for (int i = 0; i < constructorParameters.Length; i++)
testhost (1)
src\vstest\src\testhost.x86\UnitTestClient.cs (1)
42for (var index = 0; index < parmChars.Length; index++)
testhost.arm64 (1)
src\vstest\src\testhost.x86\UnitTestClient.cs (1)
42for (var index = 0; index < parmChars.Length; index++)
testhost.x86 (1)
UnitTestClient.cs (1)
42for (var index = 0; index < parmChars.Length; index++)
TestingAppHost1.MyWebApp (1)
Program.cs (1)
30summaries[Random.Shared.Next(summaries.Length)]
TestProject.AppHost (2)
TestProgram.cs (2)
29for (int i = 0; i < args.Length; i++) 33if (args.Length > i + 1)
tlens (14)
src\runtime\src\tools\illink\external\Mono.Options\Options.cs (14)
481((names.Length == 1 && this.type != OptionValueType.None) || 482(names.Length > 1 && this.MaxValueCount > 1))) 560for (int i = 0; i < names.Length; ++i) 850if (item.Names != null && item.Names.Length > 0) 883for (int i = 1; i < p.Names.Length; ++i) 899List<string> added = new List<string>(option.Names.Length); 903for (int i = 1; i < option.Names.Length; ++i) 1374if (names == null || names.Length == 0) 1381for (int i = 1; i < names.Length; ++i) 1431if (i == names.Length) 1446i < names.Length; i = GetNextOptionIndex(names, i + 1)) 1461string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 1478while (i < names.Length && names[i] == "<>") 1500for (int i = 0; i < nameStart.Length; ++i)
UIAutomationClient (67)
MS\Internal\Automation\ClientEventManager.cs (2)
139int[] propertiesAsInts = new int[properties.Length]; 140for (int i = 0; i < properties.Length; i++)
MS\Internal\Automation\MenuTracker.cs (2)
74Debug.Assert(handlers.Length <= 1, "handlers.Length"); 75if( handlers.Length > 0 )
MS\Internal\Automation\Misc.cs (8)
41int l = a1.Length; 43if (l != a2.Length) 75totalLength += a.Length; 83int l = a.Length; 96if (a.Length == 0) 104for (int src = 1; src < a.Length; src++) 116if (newLength == a.Length) 685for (int source = 0; source < ach.Length; source++)
MS\Internal\Automation\ProxyManager.cs (4)
99for( int i = 0 ; i < _pseudoProxies.Length ; i++ ) 716for( int i = proxyInfo.Length - 1; i >= 0; i-- ) 723for( int j = 0 ; j < _pseudoProxyClassNames.Length ; j++ ) 793if ( index >= QUERYCLASSNAME_BASE && index - QUERYCLASSNAME_BASE < _classNames.Length )
MS\Internal\Automation\Schema.cs (2)
186AutomationElement[] els = new AutomationElement[objArr.Length]; 187for (int i = 0; i < objArr.Length; i++)
MS\Internal\Automation\UiaCoreApi.cs (22)
139IntPtr dataStart = Marshal.AllocCoTaskMem((properties.Length + patterns.Length) * sizeof(int)); 144_propertyCount = properties.Length; 145for (int i = 0; i < properties.Length; i++) 151_patternCount = patterns.Length; 152for (int i = 0; i < patterns.Length; i++) 221for (int propertyIndex = 0; propertyIndex < request.Properties.Length; propertyIndex++) 245int patternBaseIndex = 1 + request.Properties.Length; 246for (int patternIndex = 0; patternIndex < request.Patterns.Length; patternIndex++) 455Debug.Assert(offsets.Length == treeStructures.Length); 458UiaCacheResponse[] responses = new UiaCacheResponse[treeStructures.Length]; 461for (int i = 0; i < treeStructures.Length; i++) 464int endRow = i < treeStructures.Length - 1 ? offsets[i + 1] : requestedData.GetLength(0); 586CheckError(RawUiaAddEvent(hnode, eventId, callback, scope, properties, properties == null ? 0 : properties.Length, miniCR, out hevent)); 873SafeTextRangeHandle[] result = new SafeTextRangeHandle[arr.Length]; 874for (int i = 0; i < arr.Length; i++) 889SafeTextRangeHandle[] result = new SafeTextRangeHandle[arr.Length]; 890for (int i = 0; i < arr.Length; i++) 1016int count = doubles.Length / 4; 1017int leftover = doubles.Length % 4; 1116if (arr == null || arr.Length != 2)
MS\Internal\Automation\WindowHideOrCloseTracker.cs (2)
88Debug.Assert(handlers.Length <= 1, "handlers.Length"); 89if ( handlers.Length > 0 )
MS\Internal\Automation\WindowShowOrOpenTracker.cs (2)
85Debug.Assert(handlers.Length <= 1, "handlers.Length"); 86if (handlers.Length > 0)
MS\Internal\Automation\WinEventWrap.cs (3)
32Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid"); 34_hHooks = new IntPtr[_eventIds.Length]; 127for (int i=0;i<_hHooks.Length;i++)
System\Windows\Automation\AndCondition.cs (2)
32Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) ); 44SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.And, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\Automation.cs (1)
220if (properties.Length == 0)
System\Windows\Automation\AutomationElement.cs (8)
329for (int i = 0; i < id.Length; i++) 750if (responses.Length < 1) 755Debug.Assert(responses.Length == 1); 775AutomationElement[] els = new AutomationElement[responses.Length]; 777for( int i = 0 ; i < responses.Length ; i ++ ) 802if (patterns != null && patterns.Length > 0) 1222int dataOffset = isProperty ? 1 : 1 + _request.Properties.Length; 1223for (int i = 0; i < refTable.Length; i++)
System\Windows\Automation\AutomationElementCollection.cs (1)
90return _elements.Length;
System\Windows\Automation\Condition.cs (2)
60IntPtr mem = Marshal.AllocCoTaskMem(conditions.Length * IntPtr.Size); 67for (int i = 0; i < conditions.Length; i++)
System\Windows\Automation\OrCondition.cs (2)
32Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) ); 44SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.Or, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\Text\TextRange.cs (4)
78TextPatternRange[] ranges = new TextPatternRange[hTextRanges.Length]; 79for (int i = 0; i < hTextRanges.Length; i++) 403AutomationElement[] wrappedChildren = new AutomationElement[rawChildren.Length]; 404for (int i = 0; i < rawChildren.Length; i++)
UIAutomationClientSideProviders (63)
MS\Internal\AutomationProxies\Accessible.cs (6)
553if (accChildren != null && 0 <= index && index < accChildren.Length) 628children = new Accessible[objs.Length]; 629for (int i = 0; i < objs.Length; i++) 965if (index >= children.Length) 966index = children.Length - 1; 989for (int i=0;i<children.Length;i++)
MS\Internal\AutomationProxies\EventManager.cs (1)
477if (currentRanges != null && currentRanges.Length > 0)
MS\Internal\AutomationProxies\Misc.cs (7)
59int len = baseID.Length; 71double[] doubles = new double[rectArray.Length * 4]; 73for (int i = 0; i < rectArray.Length; i++) 134int l = a1.Length; 136if (l != a2.Length) 1064if (index >= QUERYCLASSNAME_BASE && index - QUERYCLASSNAME_BASE < _asClassNames.Length) 1638for (int source = 0; source < ach.Length; source++)
MS\Internal\AutomationProxies\MSAANativeProvider.cs (8)
271properties = new AutomationProperty[propertiesAsInts.Length]; 272for (int i = 0; i < propertiesAsInts.Length; i++) 289properties = new AutomationProperty[propertiesAsInts.Length]; 290for (int i = 0; i < propertiesAsInts.Length; i++) 389rval = new int[parentId.Length + 1]; 400rval[rval.Length - 1] = _acc.AccessibleChildrenIndex(Parent._acc); 574IRawElementProviderSimple [] rawEPS= new IRawElementProviderSimple[accessibles.Length]; 575for (int i=0;i<accessibles.Length;i++)
MS\Internal\AutomationProxies\MSAAWinEventWrap.cs (1)
95for (int i=0;i<_hHooks.Length;i++)
MS\Internal\AutomationProxies\ProxyHwnd.cs (5)
295properties = new AutomationProperty[propertiesAsInts.Length]; 296for (int i = 0; i < propertiesAsInts.Length; i++) 313properties = new AutomationProperty[propertiesAsInts.Length]; 314for (int i = 0; i < propertiesAsInts.Length; i++) 516for (int i = 0; evtId != null && i < evtId.Length; i++)
MS\Internal\AutomationProxies\WindowsHyperlink.cs (3)
293for (int source = 0; source < ach.Length; source++) 297if (source + 1 < ach.Length && ach[source] == '<' && (ach[source + 1] == 'A' || ach[source + 1] == 'a')) 301else if (source + 2 < ach.Length && ach[source] == '<' && ach[source + 1] == '/' && (ach[source + 2] == 'A' || ach[source + 2] == 'a'))
MS\Internal\AutomationProxies\WindowsIPAddress.cs (2)
127if (abOctet.Length == 4) 224if (strIPAddresses.Length != 4)
MS\Internal\AutomationProxies\WindowsListView.cs (12)
234int groupsCount = groupIds.Length; 237if (groupIds.Length == 0) 272int groupsCount = groupIds.Length; 275if (groupIds.Length == 0) 346if (groupIds.Length == 0) 373int groupsCount = groupIds.Length; 376if (groupIds.Length == 0) 489for (int i = 0, c = aidProps.Length; i < c; i++) 518for (int i = 0, c = aidProps.Length; i < c; i++) 823if ( viewID < 0 || viewID > ListViewViews.Length ) 832if ( viewID < 0 || viewID > ListViewViews.Length ) 1596if (groupIds.Length == 0)
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (4)
254if (groupInfo._count <= 0 || groupInfo._count > items.Length) 268if (groupInfo._count <= 0 || groupInfo._count > items.Length) 313if (groupInfo._count <= 0 || groupInfo._count > items.Length) 516if (groupManagerInfo._count <= 0 || groupManagerInfo._count >= items.Length)
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (4)
800System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length"); 801if (min == _items.Length) 805_items = new int[temp.Length * 2]; 806Array.Copy(temp, _items, temp.Length);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
118for (index = 0; index < groupIds.Length && windowsListViewGroup.ID != groupIds[index]; index++); 120if (index >= groupIds.Length)
MS\Internal\AutomationProxies\WindowsMenu.cs (3)
1061int count = aidProps.Length; 1358for (int i = 0; i < keywordsAccelerators.Length; i++) 2772for (int i = 0; i < keywordsAccelerators.Length; i++)
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (2)
405if (a1.Length != a2.Length || a1.Rank != a2.Rank)
MS\Internal\AutomationProxies\WindowsTab.cs (2)
310&& aidProps.Length > 0 329&& aidProps.Length > 0
MS\Internal\AutomationProxies\WindowsTooltip.cs (1)
251for (scan = rects.Length - 1; scan >= 0; scan--)
UIAutomationProvider (1)
MS\Internal\Automation\UiaCoreProviderApi.cs (1)
61CheckError(RawUiaRaiseStructureChangedEvent(provider, structureChangeType, runtimeId, runtimeId == null ? 0 : runtimeId.Length));
UIAutomationTypes (20)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (1)
41if (handleTypeCount == 0 || handleTypeCount == handleTypes.Length)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (17)
2331get { return buffer.Length; } 2336IntPtr result = Marshal.AllocCoTaskMem(buffer.Length); 2337Marshal.Copy(buffer, 0, result, buffer.Length); 2345while (i < buffer.Length && buffer[i] != 0) 2350if (i < buffer.Length) 2360Marshal.Copy(ptr, buffer, 0, buffer.Length); 2367int count = Math.Min(bytes.Length, buffer.Length - offset); 2372if (offset < buffer.Length) 2389get { return buffer.Length; } 2394IntPtr result = Marshal.AllocCoTaskMem(buffer.Length * 2); 2395Marshal.Copy(buffer, 0, result, buffer.Length); 2403while (i < buffer.Length && buffer[i] != 0) 2408if (i < buffer.Length) 2417Marshal.Copy(ptr, buffer, 0, buffer.Length); 2423int count = Math.Min(s.Length, buffer.Length - offset); 2428if (offset < buffer.Length)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (1)
2563int len = args.Length;
System\Windows\Automation\ControlType.cs (1)
95int 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\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
331responseBuffer.Length,
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
161_loggingStream.Write(bytes, 0, bytes.Length);
VBCSCompiler (3)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (1)
437for (var i = 0; i < lines.Length; i++)
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (1)
331responseBuffer.Length,
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
161_loggingStream.Write(bytes, 0, bytes.Length);
vstest.console (13)
CommandLine\CommandLineOptions.cs (1)
176public bool TestAdapterPathsSet => (TestAdapterPath?.Length ?? 0) != 0;
CommandLine\Executor.cs (3)
125if (args != null && args.Length != 0 && args.Contains("--nologo")) 142if (args == null || args.Length == 0 || args.Any(StringUtils.IsNullOrWhiteSpace)) 224for (var index = 0; index < args.Length; index++)
Internal\MSBuildLogger.cs (2)
192if (stackFrames.Length > 0) 395if (stackFrames.Length == 0)
Processors\CLIRunSettingsArgumentProcessor.cs (1)
86if (arguments == null || arguments.Length == 0)
Processors\CollectArgumentProcessor.cs (2)
169if (keyValuePair.Length == 2) 270if (additionalConfigurations.Length > 0)
Processors\TestAdapterLoadingStrategyArgumentProcessor.cs (1)
206for (var i = 0; i < testAdapterPaths.Length; i++)
Processors\Utilities\ArgumentProcessorFactory.cs (1)
145if (arguments == null || arguments.Length == 0)
Processors\Utilities\ArgumentProcessorUtilities.cs (2)
26if (argumentList.Length <= 0) 53if (nameValuePair?.Length != 2)
vstest.console.arm64 (13)
src\vstest\src\vstest.console\CommandLine\CommandLineOptions.cs (1)
176public bool TestAdapterPathsSet => (TestAdapterPath?.Length ?? 0) != 0;
src\vstest\src\vstest.console\CommandLine\Executor.cs (3)
125if (args != null && args.Length != 0 && args.Contains("--nologo")) 142if (args == null || args.Length == 0 || args.Any(StringUtils.IsNullOrWhiteSpace)) 224for (var index = 0; index < args.Length; index++)
src\vstest\src\vstest.console\Internal\MSBuildLogger.cs (2)
192if (stackFrames.Length > 0) 395if (stackFrames.Length == 0)
src\vstest\src\vstest.console\Processors\CLIRunSettingsArgumentProcessor.cs (1)
86if (arguments == null || arguments.Length == 0)
src\vstest\src\vstest.console\Processors\CollectArgumentProcessor.cs (2)
169if (keyValuePair.Length == 2) 270if (additionalConfigurations.Length > 0)
src\vstest\src\vstest.console\Processors\TestAdapterLoadingStrategyArgumentProcessor.cs (1)
206for (var i = 0; i < testAdapterPaths.Length; i++)
src\vstest\src\vstest.console\Processors\Utilities\ArgumentProcessorFactory.cs (1)
145if (arguments == null || arguments.Length == 0)
src\vstest\src\vstest.console\Processors\Utilities\ArgumentProcessorUtilities.cs (2)
26if (argumentList.Length <= 0) 53if (nameValuePair?.Length != 2)
Yarp.Backend (1)
Program.cs (1)
26summaries[Random.Shared.Next(summaries.Length)]