15162 references to Length
AndroidAppBuilder (5)
ApkBuilder.cs (1)
412if (classFiles.Length == 0)
src\tasks\Common\DexBuilder.cs (1)
41if (classFiles.Length == 0)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
AppleAppBuilder (5)
AppleAppBuilder.cs (1)
210if (RuntimeComponents.Length > 0)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
Xcode.cs (1)
143if (runtimeIds.Length != 2)
ApplicationModelWebSite (1)
Conventions\MultipleAreasControllerConvention.cs (1)
18for (var i = 1; i < areaNames?.Length; i++)
AssemblyStripper (113)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Binary\ImageReader.cs (3)
97 if (image.Length == 0) 390 hnt.RuntimeMain = Encoding.ASCII.GetString (bytes, 0, bytes.Length); 395 hnt.RuntimeLibrary = Encoding.ASCII.GetString (bytes, 0, bytes.Length);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Binary\ResourceReader.cs (1)
121 Encoding.Unicode.GetString (str, 0, str.Length),
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Binary\ResourceWriter.cs (6)
107 offset += 2 + str.Length; 116 offset += rde.ResourceData.Length; 136 m_writer.Write ((ushort) namedEntries.Length); 137 m_writer.Write ((ushort) idEntries.Length); 184 m_writer.Write ((uint) rde.ResourceData.Length); 199 m_writer.Write ((ushort) str.Length);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Cil\CodeReader.cs (2)
237 Instruction [] instrs = new Instruction [lbls.Length]; 238 for (int j = 0; j < lbls.Length; j++)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Cil\CodeWriter.cs (3)
130 for (int i = 0; i < targets.Length + 1; i++) 208 m_codeWriter.Write ((uint) targets.Length); 211 instr.OpCode.Size + (4 * (targets.Length + 1)))));
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Cil\GuidAttribute.cs (1)
85 if (attributes == null || attributes.Length != 1)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Cil\Instruction.cs (1)
97 size += (1 + ((Instruction []) m_operand).Length) * 4;
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Cil\MethodBody.cs (2)
206 Instruction [] targets = new Instruction [olds.Length]; 208 for (int j = 0; j < targets.Length; j++)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\BlobHeap.cs (4)
66 for (int i = 0; i < array.Length; i++) 80 if (x.Length != y.Length) 83 for (int i = 0; i < x.Length; i++)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\CultureUtils.cs (1)
53 m_cultures = new Hashtable (cultures.Length + 2);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\GuidHeap.cs (2)
58 if (idx + 16 > this.Data.Length) 62 if (this.Data.Length == 16) {
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\MetadataReader.cs (2)
99 header.Version = Encoding.UTF8.GetString (version, 0, version.Length); 163 if (heap.Data.Length < 1 && heap.Data [0] != 0)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\MetadataWriter.cs (6)
194 if (data == null || data.Length == 0) 203 Utilities.WriteCompressedInteger (m_blobWriter, data.Length); 230 Utilities.WriteCompressedInteger (m_usWriter, us.Length + 1); 238 for (int i = 0; i < chars.Length; i++) { 282 m_resWriter.Write (data.Length); 300 int size = m_assembly.Name.PublicKey.Length;
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\StringsHeap.cs (1)
58 int heap_length = data.Length;
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\TableCollection.cs (1)
91 for (int i = 0; i < m_tables.Length; i++) {
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Metadata\Utilities.cs (1)
653 for (int i = 0; i < rids.Length; i++) {
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Signatures\SignatureReader.cs (18)
323 if (lv.CustomMods == null || lv.CustomMods.Length == 0) 387 if (next == null || next.Length == 0) 390 CustomMod [] mods = new CustomMod [original.Length + next.Length]; 391 Array.Copy (original, mods, original.Length); 392 Array.Copy (next, 0, mods, original.Length, next.Length); 443 if (p.CustomMods == null || p.CustomMods.Length == 0) 564 if (buf >= data.Length - 1) 615 if (data.Length == 0) { 629 for (int i = 0; i < ca.FixedArgs.Length && read; i++) 710 for (int i = 1; i < outers.Length; i++) { 935 if (start < data.Length) 937 if (start < data.Length) 939 if (start < data.Length) 954 if (start < data.Length) 960 if (start < data.Length) 966 if (start < data.Length)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil.Signatures\SignatureWriter.cs (2)
213 for (int i = 0; i < parameters.Length; i++) { 555 Write (str.Length);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\AssemblyNameReference.cs (8)
126 if ((m_publicKeyToken == null || m_publicKeyToken.Length == 0) && (m_publicKey != null && m_publicKey.Length > 0)) { 138 Array.Copy (hash, (hash.Length - 8), m_publicKeyToken, 0, 8); 168 if (this.PublicKeyToken != null && m_publicKeyToken.Length > 0) { 169 for (int i = 0 ; i < m_publicKeyToken.Length ; i++) { 190 for (int i = 0; i < tokens.Length; i++) { 199 if (parts.Length != 2) 215 for (int j = 0; j < name.PublicKeyToken.Length; j++) {
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\BaseAssemblyResolver.cs (3)
209 if (reference.PublicKeyToken == null || reference.PublicKeyToken.Length == 0) 224 for (int i = 0; i < gacs.Length; i++) { 240 for (int i = 0; i < reference.PublicKeyToken.Length; i++)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\ExternTypeCollection.cs (1)
117 return Array.IndexOf (keys, value.FullName, 0, keys.Length);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\ReflectionHelper.cs (5)
98 for (int i = 0; i < genArgs.Length; i++) { 225 for (int i = reference.GenericParameters.Count; i < parameters.Length; i++) 272 for (int i = 0; i < genArgs.Length; i++) { 281 for (int i = 0; i < parameters.Length; i++) { 374 for (int i = 0; i < parameters.Length; i++)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\ReflectionReader.cs (22)
126 if (rid > m_typeDefs.Length) 134 if (rid > m_typeRefs.Length) 142 if (rid > m_typeSpecs.Length) 182 if (rid > m_fields.Length) 190 if (rid > m_meths.Length) 209 if (rid > m_memberRefs.Length) 316 if (rid > m_properties.Length) 324 if (rid > m_events.Length) 332 if (rid > m_parameters.Length) 340 if (rid > m_genericParameters.Length) 348 if (rid > m_methodSpecs.Length) 404 if (parts.Length != 2) 637 for (int i = 0; i < m_typeDefs.Length; i++) { 657 if (fsig.CustomMods.Length > 0) 707 for (int i = 0; i < m_typeDefs.Length; i++) { 737 prms = m_parameters.Length + 1; 800 if (eprid > 0 && eprid <= m_meths.Length) 844 for (int i = 0; i < buffer.Length; i++) { 870 for (int j = 0; j < vals.Length; j++) 1011 if (cmods == null || cmods.Length == 0) 1015 for (int i = cmods.Length - 1; i >= 0; i--) { 1178 int length = constant.Length;
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\ReflectionWriter.cs (8)
908 if (field.InitialValue != null && field.InitialValue.Length > 0) { 916 m_mdWriter.AddData (field.InitialValue.Length + 3 & (~3)); 1216 for (int i = 0; i < ret.Length; i++) { 1433 fa.NumElem = (uint) values.Length; 1434 fa.Elems = new CustomAttrib.Elem [values.Length]; 1435 for (int i = 0; i < values.Length; i++) 1466 for (int i = 0; i < cas.FixedArgs.Length; i++) 1474 if (cas.NamedArgs.Length > 0) {
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\SecurityDeclarationReader.cs (2)
67 return declaration == null || declaration.Length == 0 || 68 (declaration.Length == 1 && declaration [0] == 0);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\StructureWriter.cs (3)
100 if (name.PublicKey != null && name.PublicKey.Length > 0) 126 if (name.PublicKey != null && name.PublicKey.Length > 0) 128 else if (name.PublicKeyToken != null && name.PublicKeyToken.Length > 0)
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\TypeDefinitionCollection.cs (1)
122 return Array.IndexOf (keys, value.FullName, 0, keys.Length);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Cecil\TypeReferenceCollection.cs (1)
122 return Array.IndexOf (keys, value.FullName, 0, keys.Length);
.packages\microsoft.dotnet.cilstrip.sources\9.0.0-beta.24256.1\contentFiles\cs\netstandard2.0\Mono.Xml\SmallXmlParser.cs (1)
315 if (idx == nameBuffer.Length) {
AssemblyStripper.cs (1)
176metadata_writer.AddData(field.InitialValue.Length + 3 & (~3));
BasicTestApp (5)
artifacts\obj\BasicTestApp\Release\net9.0\BasicTestApp.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
InteropTest\DotNetStreamReferenceInterop.cs (1)
14for (var i = 0; i < data.Length; i++)
InteropTest\JSStreamReferenceInterop.cs (3)
42for (var i = 0; i < buffer.Length; i++) 51if (buffer.Length != 100_000) 53return $"Failure, got a stream of length {buffer.Length}, expected a length of 100,000.";
Benchmarks (2)
StartupUsingEndpointRouting.cs (1)
30var payloadLength = _helloWorldPayload.Length;
StartupUsingRouter.cs (1)
24var payloadLength = _helloWorldPayload.Length;
BlazorServerApp (1)
Data\WeatherForecastService.cs (1)
19Summary = Summaries[Random.Shared.Next(Summaries.Length)]
BlazorUnitedApp (1)
Data\WeatherForecastService.cs (1)
19Summary = Summaries[Random.Shared.Next(Summaries.Length)]
ClientSample (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
CodeGenerator (30)
HttpUtilities\CombinationsWithoutRepetition.cs (3)
18ArgumentOutOfRangeException.ThrowIfGreaterThan(p, nElements.Length); 79pointers[_p + 1] = nElements.Length; 91Array.Clear(Current, 0, Current.Length);
HttpUtilities\HttpUtilities.cs (3)
34var maskLength = (byte)Math.Ceiling(Math.Log(httpMethods.Length, 2)); 59int methodNamesArrayLength = httpMethods.Length; 203if (shifts.Length > 0)
HttpUtilities\HttpUtilitiesGeneratorHelpers.cs (4)
79int arrayLength = values.Length; 89for (int i = 0; i < bitsCombination.Length; i++) 175for (; i < array.Length - 1; i++) 181if (array.Length > 0)
Program.cs (5)
10if (args.Length < 1) 15else if (args.Length < 2) 20else if (args.Length < 3) 25else if (args.Length < 4) 30else if (args.Length < 5)
src\Servers\Kestrel\shared\KnownHeaders.cs (8)
773Debug.Assert(requestHeaders.Length <= 64); 778Debug.Assert(responseHeaders.Length <= 63); 816header.BytesCount += header.Bytes.Length; 1403{(!loop.ClassName.Contains("Trailers") ? $@"case {loop.Headers.Length - 1}: // Header: ""Content-Length"" 1428{(!loop.ClassName.Contains("Trailers") ? $@"_next = _collection._contentLength.HasValue ? {loop.Headers.Length - 1} : -1;" : "_next = -1;")} 1439? {loop.Headers.Length - 1} 1451return @$"private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>({DefinedHeaderNames.Length}, StringComparer.OrdinalIgnoreCase) 1476if (values.Count == 1 && values[0].Field.Value.Length == 0)
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\Shared\runtime\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
Diagnostics.EFCore.FunctionalTests (1)
Helpers\StringHelpers.cs (1)
14if (parameters.Length > 0)
Diagnostics.FunctionalTests (1)
WelcomePageSampleTest.cs (1)
26Assert.True(bytes.Length > 1);
dotnet-dev-certs (15)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-getdocument (6)
artifacts\obj\dotnet-getdocument\Release\netcoreapp2.1\Microsoft.Extensions.ApiDescription.Tool.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-openapi (12)
Commands\BaseCommand.cs (6)
110if (projects.Length == 0) 114if (projects.Length > 1) 396var domain = parts.Length switch 536var sameHashes = downloadHash.Length == destinationHash.Length; 537for (var i = 0; sameHashes && i < downloadHash.Length; i++)
DebugMode.cs (1)
15if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-razorpagegenerator (3)
Program.cs (3)
18if (args == null || args.Length < 1) 36var targetProjectDirectory = args.Length > 1 ? args[1] : Directory.GetCurrentDirectory(); 39var physicalPathPrefix = args.Length > 2 ? args[2] : string.Empty;
dotnet-sql-cache (5)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-user-jwts (11)
artifacts\obj\dotnet-user-jwts\Release\net9.0\Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\dotnet-user-jwts\Release\net9.0\Microsoft.AspNetCore.Tools.SecretsHelpersResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Helpers\ConsoleTable.cs (3)
37if (_columns.Count != values.Length) 40$"The number of columns in the table '{_columns.Count}' does not match the number of columns in the row '{values.Length}'."); 111for (var j = 0; j < rows[i].Length; j++)
Helpers\DevJwtCliHelpers.cs (1)
199if (parts.Length != 2)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
dotnet-user-secrets (7)
artifacts\obj\dotnet-user-secrets\Release\net9.0\Microsoft.AspNetCore.Tools.SecretsHelpersResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\dotnet-user-secrets\Release\net9.0\Microsoft.Extensions.SecretManager.Tools.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
GetDocument.Insider (8)
.packages\microsoft.extensions.hostfactoryresolver.sources\9.0.0-preview.5.24262.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
117&& factory.GetParameters().Length == 1 235if (parameters.Length == 0)
artifacts\obj\GetDocument.Insider\Release\netcoreapp2.1\Microsoft.Extensions.ApiDescription.Tool.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
19if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
HeaderPropagationSample (1)
Startup.cs (1)
111for (var i = 0; i < features.Length; i++)
HostedBlazorWebassemblyApp.Server (1)
Data\WeatherForecastService.cs (1)
25Summary = Summaries[Random.Shared.Next(Summaries.Length)]
HostFilteringSample (1)
Startup.cs (1)
33options.AllowedHosts = (hosts?.Length > 0 ? hosts : new[] { "*" });
http2cat (22)
artifacts\obj\http2cat\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\http2cat\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\Http2cat\Http2Utilities.cs (4)
410frame.PayloadLength = payload.Length; 444frame.PayloadLength = payload.Length; 514frame.PayloadLength = headerBlock.Length; 579frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
HttpStress (10)
Program.cs (10)
362for (int i = 0; i < clientOperations.Length; i++) 529long[] success = new long[clientOperations.Length], fail = new long[clientOperations.Length]; 558for (int i = 0; i < clientOperations.Length; i++) 585long opIndex = i % clientOperations.Length; 616for (var i = 0; i < fail.Length; i++) 659versions[_random.Next(0, versions.Length)]; 697stream.WriteAsync(_data, 0, _data.Length); 701length = _data.Length; 715for (int i = 0; i < _buffer.Length; i++)
Identity.DefaultUI.WebSite (1)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (1)
431return mergedCodes.Split(';').Length;
IIS.Common.TestLib (2)
TestConnections.cs (2)
68for (var index = 0; index < bytes.Length; index++) 131var task = _stream.ReadAsync(actual, offset, actual.Length - offset);
IIS.FunctionalTests (29)
artifacts\obj\IIS.FunctionalTests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.FunctionalTests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (3)
72Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 73Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 102eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
41Assert.True(timings.Length > (int)HttpSysRequestTimingType.Http3HeaderDecodeEnd);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (2)
375Assert.Equal(10, (await _fixture.Client.GetByteArrayAsync($"/UnflushedResponsePipe")).Length); 382Assert.Equal(20, (await _fixture.Client.GetByteArrayAsync($"/FlushedPipeAndThenUnflushedPipe")).Length);
src\Shared\Http2cat\Http2Utilities.cs (4)
410frame.PayloadLength = payload.Length; 444frame.PayloadLength = payload.Length; 514frame.PayloadLength = headerBlock.Length; 579frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
IIS.LongTests (27)
artifacts\obj\IIS.LongTests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.LongTests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (3)
72Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 73Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 102eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1518Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
410frame.PayloadLength = payload.Length; 444frame.PayloadLength = payload.Length; 514frame.PayloadLength = headerBlock.Length; 579frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
66var payloadLength = _helloWorldPayload.Length;
IIS.NewHandler.FunctionalTests (27)
artifacts\obj\IIS.NewHandler.FunctionalTests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.NewHandler.FunctionalTests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (3)
72Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 73Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 102eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1518Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
410frame.PayloadLength = payload.Length; 444frame.PayloadLength = payload.Length; 514frame.PayloadLength = headerBlock.Length; 579frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
IIS.NewShim.FunctionalTests (27)
artifacts\obj\IIS.NewShim.FunctionalTests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.NewShim.FunctionalTests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (3)
72Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 73Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 102eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1518Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
410frame.PayloadLength = payload.Length; 444frame.PayloadLength = payload.Length; 514frame.PayloadLength = headerBlock.Length; 579frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
IIS.ShadowCopy.Tests (7)
artifacts\obj\IIS.ShadowCopy.Tests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IIS.ShadowCopy.Tests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (3)
72Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 73Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 102eventLogEntry.ReplacementStrings.Length < 3)
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
IIS.Tests (2)
ResponseBodySizeTests.cs (2)
23await ctx.Response.Body.WriteAsync(buffer, 0, buffer.Length); 30Assert.Equal(bufferSize, content.Length);
IISExpress.FunctionalTests (32)
artifacts\obj\IISExpress.FunctionalTests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\IISExpress.FunctionalTests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
InProcess\WebSocketTests.cs (2)
141await stream.WriteAsync(requestBytes, 0, requestBytes.Length); 157result = await webSocket.ReceiveAsync(new ArraySegment<byte>(received, offset, received.Length - offset), default);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (3)
72Assert.True(matchedEntries.Length > 0, $"No entries matched by '{regexString}'"); 73Assert.True(allowMultiple || matchedEntries.Length < 2, $"Multiple entries matched by '{regexString}': {FormatEntries(matchedEntries)}"); 102eventLogEntry.ReplacementStrings.Length < 3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
41Assert.True(timings.Length > (int)HttpSysRequestTimingType.Http3HeaderDecodeEnd);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (2)
375Assert.Equal(10, (await _fixture.Client.GetByteArrayAsync($"/UnflushedResponsePipe")).Length); 382Assert.Equal(20, (await _fixture.Client.GetByteArrayAsync($"/FlushedPipeAndThenUnflushedPipe")).Length);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1518Assert.True(matchedEntries.Length > 0);
src\Shared\Http2cat\Http2Utilities.cs (4)
410frame.PayloadLength = payload.Length; 444frame.PayloadLength = payload.Length; 514frame.PayloadLength = headerBlock.Length; 579frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
ILCompiler.DependencyAnalysisFramework (1)
src\coreclr\tools\Common\Sorting\ArrayAccessor.cs (1)
22return dataStructure.Length;
illink (52)
ILLink.RoslynAnalyzer (2)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\ValueExtensions.cs (1)
25 for (int i = 0; i < args.Length; i++) {
TrimAnalysis\TrimAnalysisVisitor.cs (1)
112 for (int i = 0; i < elements.Length; i++) {
ILLink.Tasks (2)
CreateRuntimeRootDescriptorFile.cs (2)
161 if (namespaceDefElements.Length == 3) { 193 if (featureSwitchElements.Length != 4) {
InMemory.FunctionalTests (226)
ChunkedRequestTests.cs (9)
32var count = await request.Body.ReadAsync(buffer, 0, buffer.Length); 69response.Headers["Content-Length"] = bytes.Length.ToString(CultureInfo.InvariantCulture); 70await response.Body.WriteAsync(bytes, 0, bytes.Length); 264while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 501while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 545while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 590while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 672while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0) 716while (await request.Body.ReadAsync(buffer, 0, buffer.Length) != 0)
ConnectionMiddlewareTests.cs (2)
455for (int i = 0; i < buffer.Length; i++) 468for (int i = 0; i < buffer.Length; i++)
Http2\Http2ConnectionTests.cs (50)
778withLength: _maxData.Length, 825withLength: _maxData.Length, 840withLength: _maxData.Length, 852withLength: _maxData.Length, 867withLength: _maxData.Length, 886var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length; 888updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 929for (var i = 0; i < _helloWorldBytes.Length; i++) 1054withLength: _maxData.Length, 1069withLength: _maxData.Length, 1081withLength: _maxData.Length, 1102withLength: _maxData.Length, 1115withLength: _maxData.Length, 1130var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length; 1132updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 1242var maxDataMinusPadding = _maxData.AsMemory(0, _maxData.Length - padLength - 1); 1287withLength: _maxData.Length, 1302var updateSize = ((framesInWindow / 2) + 1) * _maxData.Length; 1340var updateSize = ((framesConnectionInWindow / 2) + 1) * _maxData.Length; 1363while (readResult.Buffer.Length != _maxData.Length * 4) 1372Assert.Equal(readResult.Buffer.Length, _maxData.Length * 5); 1412withLength: _maxData.Length, 1436var updateSize = ((framesInStreamWindow / 2) + 1) * _maxData.Length; 1438updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 1848var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 1849var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 1850var remainingBytesAfterBackpressure = _maxData.Length - remainingBytesBeforeBackpressure; 1865await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 1889withLength: _maxData.Length, 3024var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 3025var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 3055await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 3084withLength: _maxData.Length, 3117withLength: _maxData.Length, 3143var initialWindowSize = _helloWorldBytes.Length / 2; 3167await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length); 3253var updateSize = ((framesInConnectionWindow / 2) + 1) * _maxData.Length; 3992var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 3993var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 4023await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 4052withLength: _maxData.Length, 4095var initialWindowSize = _helloWorldBytes.Length / 2; 4119await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length); 4326var expectedFullFrameCountBeforeBackpressure = Http2PeerSettings.DefaultInitialWindowSize / _maxData.Length; 4348await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 4352var lastWriteTask = context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length); 4379withLength: _maxData.Length, 4384var remainingBytesBeforeBackpressure = (int)Http2PeerSettings.DefaultInitialWindowSize % _maxData.Length; 4385var remainingBytesAfterBackpressure = _maxData.Length - remainingBytesBeforeBackpressure; 4417var initialWindowSize = _helloWorldBytes.Length / 2;
Http2\Http2StreamTests.cs (23)
885var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 887read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 915var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 917read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 963var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 967read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total); 1057var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1061read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total); 1158while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1193while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1228while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1264while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1874var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1876read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1919while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 1960var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 1962read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2004while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2065while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2121var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2124read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 3090var thrownExTask = Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Request.Body.ReadAsync(buffer, 0, buffer.Length)); 3115var thrownExTask = Assert.ThrowsAnyAsync<OperationCanceledException>(() => context.Request.Body.ReadAsync(buffer, 0, buffer.Length));
Http2\Http2TestBase.cs (9)
235while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 248while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 259while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 335received += await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 338var stalledReadTask = context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 791frame.PayloadLength = payload.Length; 866frame.PayloadLength = headerBlock.Length; 931frame.PayloadLength = payload.Length; 1294if (expectedErrorMessage?.Length > 0)
Http2\Http2TimeoutTests.cs (21)
165withLength: _helloWorldBytes.Length, 320while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 358AdvanceTime(TimeSpan.FromSeconds((_bytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) + 369withLength: _helloWorldBytes.Length, 409var timeToWriteMaxData = TimeSpan.FromSeconds((_bytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) + 423withLength: _maxData.Length, 496_clientSettings.InitialWindowSize = (uint)_maxData.Length - 1; 549_clientSettings.InitialWindowSize = (uint)_maxData.Length - 1; 616await StartStreamAsync(1, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 662await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false); 677var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 712await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false); 725await StartStreamAsync(3, ReadRateRequestHeaders(_maxData.Length), endStream: false); 737var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond); 778await StartStreamAsync(1, ReadRateRequestHeaders(_maxData.Length), endStream: false); 796await StartStreamAsync(3, ReadRateRequestHeaders(_maxData.Length), endStream: false); 810var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 850await StartStreamAsync(1, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 919await StartStreamAsync(3, ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 949var expectedUpdateSize = ((framesConnectionInWindow / 2) + 1) * _maxData.Length + _helloWorldBytes.Length;
Http3\Http3ConnectionTests.cs (3)
46while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 86while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 149while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0)
Http3\Http3StreamTests.cs (16)
564var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 566read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 593var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 597read = await context.Request.Body.ReadAsync(buffer, total, buffer.Length - total); 731for (var i = 0; i < data.Length; i++) 742while (receivedData.Count < data.Length) 2484var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2486read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2522while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2557var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2559read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2594while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2647while (await context.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) { } 2695var read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2698read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 2829for (var i = 0; i < sourceData.Length; i++)
Http3\Http3TestBase.cs (4)
68while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 83received += await context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 86var stalledReadTask = context.Request.Body.ReadAsync(buffer, 0, buffer.Length); 139if (expectedErrorMessage?.Length > 0)
Http3\Http3TimeoutTests.cs (14)
347var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false); 428while ((received = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length)) > 0) 464Http3Api.AdvanceTime(TimeSpan.FromSeconds((requestStream.BytesReceived + _helloWorldBytes.Length) / limits.MinResponseDataRate.BytesPerSecond) + 475Assert.Equal(_helloWorldBytes.Length, data.Length); 505var timeToWriteMaxData = TimeSpan.FromSeconds((requestStream.BytesReceived + _maxData.Length) / limits.MinResponseDataRate.BytesPerSecond) + 539var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 548var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 584var requestStream1 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 590var requestStream2 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 596var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond); 640var requestStream1 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 649var requestStream2 = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_maxData.Length), endStream: false); 657var timeToReadMaxData = TimeSpan.FromSeconds(_maxData.Length / limits.MinRequestBodyDataRate.BytesPerSecond) - TimeSpan.FromSeconds(.5); 700var requestStream = await Http3Api.CreateRequestStream(ReadRateRequestHeaders(_helloWorldBytes.Length), endStream: false);
Http3\WebTransport\WebTransportHandshakeTests.cs (1)
133for (var i = 0; i < headers.Length; i += 2)
HttpsConnectionMiddlewareTests.cs (3)
1099await stream.WriteAsync(request, 0, request.Length).DefaultTimeout(); 1491var count = await request.Body.ReadAsync(buffer, 0, buffer.Length); 1520await stream.WriteAsync(request, 0, request.Length);
HttpsTests.cs (2)
262await sslStream.WriteAsync(request, 0, request.Length); 306await sslStream.WriteAsync(request, 0, request.Length);
KeepAliveTimeoutTests.cs (2)
250while (await httpContext.Request.Body.ReadAsync(buffer, 0, buffer.Length) > 0) 256await responseStream.WriteAsync(responseBytes, 0, responseBytes.Length);
KestrelMetricsTests.cs (2)
425if (buffer.Length > 0) 428await response.Body.WriteAsync(buffer, 0, buffer.Length);
RequestTests.cs (9)
134var task = context.Request.Body.ReadAsync(data, 0, data.Length, cts.Token); 1129Assert.Equal(22, ms1.ToArray().Length); 1357await duplexStream.WriteAsync(data, 0, data.Length); 1412context.Response.ContentLength = request.Length; 1414await context.Response.Body.WriteAsync(request, 0, request.Length); 1597await duplexStream.WriteAsync(response, 0, response.Length); 1645await stream.WriteAsync(response, 0, response.Length); 2301var mask = Math.Pow(2, lines.Length) - 1; 2309for (var pos = 0; pos < lines.Length; pos++)
ResponseTests.cs (26)
157var writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 164writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 1021await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1056await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1701httpContext.Response.ContentLength = response.Length - 1; 1704await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1743httpContext.Response.ContentLength = response.Length - 1; 1746await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1785httpContext.Response.ContentLength = response.Length - 1; 1788await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1789await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 1830httpContext.Response.ContentLength = response.Length - 1; 1833await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1834await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 1873httpContext.Response.ContentLength = response.Length - 1; 1876return httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)).AsTask(); 1913httpContext.Response.ContentLength = response.Length - 1; 1916await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1917await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 2359await stream.WriteAsync(response, 0, response.Length);
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
149for (int i = intermediates.Length - 1; i >= 0; i--)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
24frame.PayloadLength = payload.Length;
src\Servers\Kestrel\shared\test\RevocationResponder.cs (6)
189Trace($"Responded with {certData.Length}-byte certificate from {authority.SubjectName}."); 207Trace($"Responded with {crl.Length}-byte CRL from {authority.SubjectName}."); 252Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName} delegated to {authority.OcspResponderSubjectName}"); 256Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName}"); 313int read = stream.Read(requestBytes, 0, requestBytes.Length); 314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Servers\Kestrel\shared\test\TestApp.cs (10)
20if (buffer.Length > 0) 23await response.Body.WriteAsync(buffer, 0, buffer.Length); 35response.Headers.ContentLength = bytes.Length; 36await response.Body.WriteAsync(bytes, 0, bytes.Length); 50if (buffer.Length > 0) 54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 69response.Headers.ContentLength = bytes.Length; 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
InProcessWebSite (10)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (9)
631var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 635result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 644var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 649result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 719count += await ctx.Request.Body.ReadAsync(data, count, data.Length - count); 720} while (count != data.Length); 721await ctx.Response.Body.WriteAsync(data, 0, data.Length); 737var result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length); 744result = await ctx.Request.Body.ReadAsync(readBuffer, 0, readBuffer.Length);
src\Servers\IIS\IIS\test\testassets\shared\WebSockets\TestStartup.cs (1)
24parameters.Length == 1)
installer.tasks (21)
GenerateFileVersionProps.cs (1)
116$"Missing FileVersion in {versionlessFiles.Length} shared framework files:" +
GenerateRunScript.cs (9)
28if (RunCommands.Length == 0) 68for (int i = 0; i < SetCommands.Length; i++) 71for (int j = 0; j < setCommandsSplit.Length; j++) 74if ((j < setCommandsSplit.Length - 1) || (i < SetCommands.Length - 1)) 83for (int i = 0; i < RunCommands.Length; i++) 86for (int j = 0; j < runCommandsSplit.Length; j++) 89if ((j < runCommandsSplit.Length - 1) || (i < RunCommands.Length - 1))
RegenerateDownloadTable.cs (2)
79$"| --- | {string.Concat(Enumerable.Repeat(" :---: |", Branches.Length))}" 94.Skip(beforeTable.Length)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
176Log.LogMessage(MessageImportance.High, $"Importing {newSections.Length} sections...");
StaticFileRegeneration\TpnDocument.cs (3)
20int linesUntilNext = lines.Length - headerEndLine; 22if (i + 1 < headers.Length) 45if (sections.Length == 0)
StaticFileRegeneration\TpnSectionHeader.cs (5)
24for (int i = 1; i < lines.Length - 2; i++) 106if (nameLines.Take(nameLines.Length - 1).Any(IsSeparatorLine)) 122LineLength = 2 + nameLines.Length 139int nameStartLine = i - nameLines.Length; 149LineLength = nameLines.Length + 1
Interop.FunctionalTests (34)
Http2\Http2RequestTests.cs (4)
138var memory = c.Response.BodyWriter.GetMemory(randomBytes.Length); 140logger.LogInformation($"Server writing {randomBytes.Length} bytes response"); 145logger.LogInformation($"Server advancing {randomBytes.Length} bytes response"); 146c.Response.BodyWriter.Advance(randomBytes.Length);
Http3\Http3RequestTests.cs (12)
262await responseStream.ReadAtLeastLengthAsync(TestData.Length, clientBufferSize).DefaultTimeout(); 265await responseStream.ReadAtLeastLengthAsync(TestData.Length, clientBufferSize).DefaultTimeout(); 404var data = await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 468await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 710var data = await body.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 984var data = await requestBody.ReadAtLeastLengthAsync(TestData.Length); 1031var data = await responseStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 1079var currentData = await requestBody.ReadAtLeastLengthAsync(data.Length); 1089context.Response.BodyWriter.GetSpan(data.Length); 1090context.Response.BodyWriter.Advance(data.Length); 1192var data = await responseStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 1220await context.Request.BodyReader.ReadAtLeastAsync(TestData.Length);
HttpClientHttp2InteropTests.cs (10)
204for (var i = 0; i < Content.Length; i++) 216await stream.WriteAsync(Content, 0, Content.Length, timer.Token).DefaultTimeout(); 236read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout(); 242Assert.True(totalRead <= Repetitions * Content.Length, "Too Long"); 246Assert.Equal(Content[patternOffset % Content.Length], buffer[offset]); 251read = await stream.ReadAsync(buffer, 0, buffer.Length, timer.Token).DefaultTimeout(); 254Assert.True(totalRead == Repetitions * Content.Length, "Too Short"); 1505read = await context.Request.Body.ReadAsync(buffer, 0, buffer.Length).DefaultTimeout(); 1727var read = await stream.ReadAsync(responseBuffer, totalRead, responseBuffer.Length - totalRead).DefaultTimeout(); 1733} while (totalRead < responseBuffer.Length);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
KeyManagementSimulator (4)
Program.cs (4)
20for (var i = 0; i < args.Length; i++) 26if (i + 1 < args.Length && int.TryParse(args[i + 1], out var d) && d > 0) 41if (i + 1 < args.Length && int.TryParse(args[i + 1], out var inst) && inst > 0) 56if (i + 1 < args.Length && int.TryParse(args[i + 1], out var s) && s > 0)
LibraryBuilder (4)
src\tasks\Common\Builders\AppBuilderTask.cs (1)
67CompiledAssemblies = new List<CompiledAssembly>(Assemblies.Length);
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (1)
291if (args is { Length: > 0 })
WebHost.cs (1)
261options.AllowedHosts = (hosts?.Length > 0 ? hosts : new[] { "*" });
Microsoft.AspNetCore.Analyzer.Testing (7)
DiagnosticAnalyzerRunner.cs (1)
66if (additionalEnabledDiagnostics.Length > 0)
DiagnosticProject.cs (2)
67for (var i = 0; i < sources.Length; i++) 70if (sources.Length > 1)
DiagnosticVerifier.cs (3)
86if (additionalEnabledDiagnostics.Length > 0) 144Debug.Assert(sources.Length == documents.Length);
TestSource.cs (1)
25for (var i = 0; i < lines.Length; i++)
Microsoft.AspNetCore.Antiforgery (16)
artifacts\obj\Microsoft.AspNetCore.Antiforgery\Release\net9.0\Microsoft.AspNetCore.Antiforgery.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\AntiforgerySerializationContext.cs (3)
84if (_chars == null || _chars.Length < count) 86var newLength = _chars == null ? InitialCharsLength : checked(_chars.Length * 2); 100if (_chars != null && _chars.Length > MaximumCharsLength)
Internal\BinaryBlob.cs (10)
32if (data == null || data.Length != bitLength / 8) 44return checked(_data.Length * 8); 52var sb = new StringBuilder("0x", 2 + (_data.Length * 2)); 53for (var i = 0; i < _data.Length; i++) 73Debug.Assert(_data.Length == other._data.Length); 86Debug.Assert(_data != null && _data.Length >= (32 / 8)); 102if (a == null || b == null || a.Length != b.Length) 108for (var i = 0; i < a.Length; i++)
Internal\DefaultAntiforgeryTokenSerializer.cs (2)
48stream.Write(unprotectedBytes, offset: 0, count: unprotectedBytes.Length); 158var count = bytes.Length;
Microsoft.AspNetCore.Antiforgery.Test (3)
BinaryBlobTest.cs (1)
17Assert.Equal(64 / 8, data.Length);
DefaultAntiforgeryTokenSerializerTest.cs (2)
165var salt = data[data.Length - 1]; 171return data.Take(data.Length - 1).ToArray();
Microsoft.AspNetCore.App.Analyzers (4)
artifacts\obj\Microsoft.AspNetCore.App.Analyzers\Release\netstandard2.0\Microsoft.AspNetCore.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
31for (var i = 0; i < WellKnownTypeData.WellKnownTypeNames.Length; i++) 52_lazyWellKnownTypes = new INamedTypeSymbol?[WellKnownTypeData.WellKnownTypeNames.Length];
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
348var length = disallowedMethodTypes.Length;
Microsoft.AspNetCore.App.Analyzers.Test (12)
Http\HeaderDictionaryIndexerAnalyzerTests.cs (1)
165.Where(p => p.CanWrite && p.CanRead && p.PropertyType == typeof(StringValues) && p.GetIndexParameters().Length == 0)
RouteEmbeddedLanguage\Infrastructure\ExportProviderExtensions.cs (4)
41where method.IsGenericMethod && method.GetGenericArguments().Length == 2 42where method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(string) 51where method.IsGenericMethod && method.GetGenericArguments().Length == 1 52where method.GetParameters().Length == 1 && method.GetParameters()[0].ParameterType == typeof(string)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (2)
373var conj = $"({regexes[regexes.Length - 1]})"; 374for (var i = regexes.Length - 2; i >= 0; i--)
RouteEmbeddedLanguage\RoutePatternParserTests_ConformanceTests.cs (3)
832Assert.Equal(expectedNames.Length, tree.RouteParameters.Length); 833Assert.Equal(expectedQualifiers.Length, tree.RouteParameters.Length); 835for (var i = 0; i < expectedNames.Length; i++)
WebApplicationBuilder\UseTopLevelRouteRegistrationInsteadOfUseEndpointsTest.cs (2)
157Assert.Equal(4, diagnostics.Length); 259Assert.Equal(2, diagnostics.Length);
Microsoft.AspNetCore.App.UnitTests (5)
SharedFxTests.cs (2)
253Assert.Equal(2, lines.Length); 281var fileName = fileParts[fileParts.Length - 1];
TargetingPackTests.cs (3)
147Assert.Equal(packageOverrideFileLines.Length, runtimeDependencies.Count + aspnetcoreDependencies.Count); 171Assert.Equal(2, packageOverrideParts.Length); 278Assert.Equal(4, parts.Length);
Microsoft.AspNetCore.Authentication (1)
artifacts\obj\Microsoft.AspNetCore.Authentication\Release\net9.0\Microsoft.AspNetCore.Authentication.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.Abstractions (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.Abstractions\Release\net9.0\Microsoft.AspNetCore.Authentication.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateAuthenticationHandler.cs (1)
146var chainErrors = new List<string>(chain.ChainStatus.Length);
Microsoft.AspNetCore.Authentication.Cookies (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
Microsoft.AspNetCore.Authentication.Facebook (2)
artifacts\obj\Microsoft.AspNetCore.Authentication.Facebook\Release\net9.0\Microsoft.AspNetCore.Authentication.Facebook.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
FacebookHandler.cs (1)
74for (int i = 0; i < hash.Length; i++)
Microsoft.AspNetCore.Authentication.Google (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.Google\Release\net9.0\Microsoft.AspNetCore.Authentication.Google.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.JwtBearer\Release\net9.0\Microsoft.AspNetCore.Authentication.JwtBearer.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.MicrosoftAccount\Release\net9.0\Microsoft.AspNetCore.Authentication.MicrosoftAccount.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.OAuth (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.OAuth\Release\net9.0\Microsoft.AspNetCore.Authentication.OAuth.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
artifacts\obj\Microsoft.AspNetCore.Authentication.OpenIdConnect\Release\net9.0\Microsoft.AspNetCore.Authentication.OpenIdConnect.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
OpenIdConnectHandler.cs (2)
290Response.ContentLength = buffer.Length; 504Response.ContentLength = buffer.Length;
Microsoft.AspNetCore.Authentication.Test (3)
CookieTests.cs (1)
1900return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length);
TestExtensions.cs (2)
61return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length); 78return res.Body.WriteAsync(xmlBytes, 0, xmlBytes.Length);
Microsoft.AspNetCore.Authentication.Twitter (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.Twitter\Release\net9.0\Microsoft.AspNetCore.Authentication.Twitter.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authentication.WsFederation (1)
artifacts\obj\Microsoft.AspNetCore.Authentication.WsFederation\Release\net9.0\Microsoft.AspNetCore.Authentication.WsFederation.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Authorization (3)
artifacts\obj\Microsoft.AspNetCore.Authorization\Release\net9.0\Microsoft.AspNetCore.Authorization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AuthorizationPolicy.cs (2)
153if (rolesSplit?.Length > 0) 161if (authTypesSplit?.Length > 0)
Microsoft.AspNetCore.Authorization.Policy (2)
artifacts\obj\Microsoft.AspNetCore.Authorization.Policy\Release\net9.0\Microsoft.AspNetCore.Authorization.Policy.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AuthorizationEndpointConventionBuilderExtensions.cs (1)
67if (authorizeData.Length == 0)
Microsoft.AspNetCore.Components (63)
artifacts\obj\Microsoft.AspNetCore.Components\Release\net9.0\Microsoft.AspNetCore.Components.Routing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BindConverter.cs (4)
1807if (value.Length == 0) 1816for (var i = 1; i < value.Length; i++) 2016var convertedArray = new T[initialArray.Length]; 2018for (var i = 0; i < initialArray.Length; i++)
CascadingParameterState.cs (3)
40if (infos.Length == 0) 49var numInfos = infos.Length; 57resultStates ??= new List<CascadingParameterState>(infos.Length - infoIndex);
RenderTree\EventArgsTypeCache.cs (2)
18if (parameterInfos.Length == 0) 22else if (parameterInfos.Length > 1)
RenderTree\Renderer.cs (2)
814for (int i = 0; i < updatedComponentsId.Length; i++) 859for (var i = 0; i < updatedComponents.Length; i++)
RenderTree\RenderTreeFrameArrayBuilder.cs (20)
19if (_itemsInUse == _items.Length) 21GrowBuffer(_items.Length * 2); 34if (_itemsInUse == _items.Length) 36GrowBuffer(_items.Length * 2); 49if (_itemsInUse == _items.Length) 51GrowBuffer(_items.Length * 2); 64if (_itemsInUse == _items.Length) 66GrowBuffer(_items.Length * 2); 80if (_itemsInUse == _items.Length) 82GrowBuffer(_items.Length * 2); 95if (_itemsInUse == _items.Length) 97GrowBuffer(_items.Length * 2); 110if (_itemsInUse == _items.Length) 112GrowBuffer(_items.Length * 2); 126if (_itemsInUse == _items.Length) 128GrowBuffer(_items.Length * 2); 140if (_itemsInUse == _items.Length) 142GrowBuffer(_items.Length * 2); 155if (_itemsInUse == _items.Length) 157GrowBuffer(_items.Length * 2);
Routing\RouteTableFactory.cs (3)
105var templates = new string[routeAttributes.Length]; 106for (var i = 0; i < routeAttributes.Length; i++) 149for (var i = 0; i < templates.Length; i++)
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (10)
328for (var i = 0; i < keys.Length; i++) 348for (var i = 0; i < values.Length; i++) 449if (arrayIndex < 0 || arrayIndex > array.Length || array.Length - arrayIndex < Count) 661if (_arrayStorage.Length < capacity) 694if (_arrayStorage.Length < capacity) 696capacity = _arrayStorage.Length == 0 ? DefaultCapacity : _arrayStorage.Length * 2; 733if ((uint)count <= (uint)array.Length) 756if ((uint)count <= (uint)array.Length)
src\Http\Routing\src\ParameterPolicyActivator.cs (8)
105if (constructors.Length == 1 && GetNonConvertableParameterTypeCount(serviceProvider, constructors[0].GetParameters()) == 1) 119var matchingConstructors = GetMatchingConstructors(constructors, serviceProvider, arguments.Length); 125parameterPolicyType.Name, arguments.Length)); 169var length = constructor.GetParameters().Length; 196return parameters.Length; 200for (var i = 0; i < parameters.Length; i++) 213var parameters = new object?[parameterInfos.Length]; 215for (var i = 0; i < parameterInfos.Length; i++)
src\Http\Routing\src\Patterns\RoutePatternFactory.cs (1)
471for (var i = 0; i < updatedSegments.Length; i++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
Microsoft.AspNetCore.Components.Analyzers (2)
artifacts\obj\Microsoft.AspNetCore.Components.Analyzers\Release\netstandard2.0\Microsoft.AspNetCore.Components.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
42for (var i = 0; i < NamespaceParts.Length; i++)
Microsoft.AspNetCore.Components.Analyzers.Tests (18)
Helpers\CodeFixVerifier.Helper.cs (2)
49while (newIndex < newArray.Length) 51if (oldIndex < oldArray.Length && oldArray[oldIndex].Id == newArray[newIndex].Id)
Helpers\DiagnosticResult.cs (3)
71return this.Locations.Length > 0 ? this.Locations[0].Path : ""; 79return this.Locations.Length > 0 ? this.Locations[0].Line : -1; 87return this.Locations.Length > 0 ? this.Locations[0].Column : -1;
Helpers\DiagnosticVerifier.Helper.cs (3)
72for (int i = 0; i < documents.Length; i++) 119if (sources.Length != documents.Length)
Verifiers\CodeFixVerifier.cs (1)
81var attempts = analyzerDiagnostics.Length;
Verifiers\DiagnosticVerifier.cs (9)
108int expectedCount = expectedResults.Length; 119for (int i = 0; i < expectedResults.Length; i++) 138if (additionalLocations.Length != expected.Locations.Length - 1) 144expected.Locations.Length - 1, additionalLocations.Length, 148for (int j = 0; j < additionalLocations.Length; ++j) 240for (int i = 0; i < diagnostics.Length; ++i) 274if (i != diagnostics.Length - 1)
Microsoft.AspNetCore.Components.Authorization (2)
AttributeAuthorizeDataCache.cs (1)
29for (var i = 0; i < allAttributes.Length; i++)
AuthorizeViewCore.cs (1)
121for (var i = 0; i < authorizeData.Length; i++)
Microsoft.AspNetCore.Components.Endpoints (16)
artifacts\obj\Microsoft.AspNetCore.Components.Endpoints\Release\net9.0\Microsoft.AspNetCore.Components.Endpoints.FormMapping.FormDataResources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Components.Endpoints\Release\net9.0\Microsoft.AspNetCore.Components.Endpoints.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DependencyInjection\DefaultRazorComponentsServiceOptionsConfiguration.cs (1)
58if (initializers == null || initializers.Length == 0)
Discovery\IRazorComponentApplication.cs (1)
26for (var i = 0; i < exported.Length; i++)
FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (3)
16if (buffer.Count >= buffer.Data.Length) 18var newBuffer = ArrayPool<TElement>.Shared.Rent(buffer.Data.Length * 2); 19Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
FormMapping\Metadata\FormDataMetadataFactory.cs (2)
125if (constructors.Length == 1) 135else if (constructors.Length > 1)
Rendering\Buffering\TextChunkPage.cs (1)
28if (_count < _buffer.Length)
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 285Debug.Assert(parameters.Length == 1); 447var filteredProperties = new List<PropertyHelper>(allProperties.Length); 560property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Components.Endpoints.Tests (18)
Binding\FormDataMapperTests.cs (8)
2031Assert.Equal(expectedString, Encoding.UTF8.GetString(buffer, 0, buffer.Length)); 2066Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer1, 0, buffer1.Length)); 2073Assert.Equal(expectedString1, Encoding.UTF8.GetString(buffer2, 0, buffer2.Length)); 2248if (components.Length != 2) 2296if (components.Length != 2) 2343if (buffer.Count >= buffer.Data.Length) 2345var newBuffer = Rent(buffer.Data.Length * 2); 2346Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
Binding\PrefixResolverTests.cs (8)
39var prefixResolver = new PrefixResolver(GetKeys(keys), keys.Length); 55var container = new PrefixResolver(GetKeys(keys), keys.Length); 73var container = new PrefixResolver(GetKeys(keys), keys.Length); 96var container = new PrefixResolver(GetKeys(keys), keys.Length); 114var container = new PrefixResolver(GetKeys(keys), keys.Length); 136var container = new PrefixResolver(GetKeys(keys), keys.Length); 160var container = new PrefixResolver(GetKeys(keys), keys.Length); 184var container = new PrefixResolver(GetKeys(keys), keys.Length);
RazorComponentsServiceCollectionExtensionsTest.cs (2)
129if (implementationTypes.Length == 0) 135else if (implementationTypes.Length != implementationTypes.Distinct().Count())
Microsoft.AspNetCore.Components.Forms (1)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
63_nextEndIndex = newBuffer.Length - _currentBuffer.Length;
Microsoft.AspNetCore.Components.Forms.Tests (6)
ExpressionFormatterTest.cs (5)
57for (var i = 0; i < result.Length; i++) 91for (; i < result.Length; i++) 125for (var i = 0; i < result.Length; i++) 143for (; i < result.Length; i++) 163for (; i < result.Length; i++)
FieldIdentifierTest.cs (1)
148for (var i = 0; i < models.Length; i++)
Microsoft.AspNetCore.Components.Performance (1)
Program.cs (1)
10if (args.Length == 0 || args[0] != "--profile")
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
artifacts\obj\Microsoft.AspNetCore.Components.SdkAnalyzers\Release\netstandard2.0\Microsoft.AspNetCore.Components.Analyzers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ComponentInternalUsageDiagnosticAnalzyer.cs (1)
42for (var i = 0; i < NamespaceParts.Length; i++)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (18)
Helpers\CodeFixVerifier.Helper.cs (2)
49while (newIndex < newArray.Length) 51if (oldIndex < oldArray.Length && oldArray[oldIndex].Id == newArray[newIndex].Id)
Helpers\DiagnosticResult.cs (3)
71return this.Locations.Length > 0 ? this.Locations[0].Path : ""; 79return this.Locations.Length > 0 ? this.Locations[0].Line : -1; 87return this.Locations.Length > 0 ? this.Locations[0].Column : -1;
Helpers\DiagnosticVerifier.Helper.cs (3)
72for (int i = 0; i < documents.Length; i++) 119if (sources.Length != documents.Length)
Verifiers\CodeFixVerifier.cs (1)
81var attempts = analyzerDiagnostics.Length;
Verifiers\DiagnosticVerifier.cs (9)
108int expectedCount = expectedResults.Length; 119for (int i = 0; i < expectedResults.Length; i++) 138if (additionalLocations.Length != expected.Locations.Length - 1) 144expected.Locations.Length - 1, additionalLocations.Length, 148for (int j = 0; j < additionalLocations.Length; ++j) 240for (int i = 0; i < diagnostics.Length; ++i) 274if (i != diagnostics.Length - 1)
Microsoft.AspNetCore.Components.Server (41)
Circuits\CircuitHost.cs (6)
237for (var i = 0; i < _circuitHandlers.Length; i++) 266for (var i = 0; i < _circuitHandlers.Length; i++) 295for (var i = 0; i < _circuitHandlers.Length; i++) 322for (var i = 0; i < _circuitHandlers.Length; i++) 811? new Task[operations.Length] 818for (var i = 0; i < operations.Length; i++)
Circuits\CircuitIdFactory.cs (1)
62if (unprotectedBytes.Length != SecretLength)
Circuits\CircuitOptionsJavaScriptInitializersConfiguration.cs (1)
25for (var i = 0; i < initializers.Length; i++)
Circuits\RemoteJSDataStream.cs (3)
104if (chunk.Length == 0) 109if (chunk.Length > _chunkSize) 114_bytesRead += chunk.Length;
Circuits\RemoteJSRuntime.cs (2)
139if (_maximumIncomingBytes - data.Length < _byteArraysToBeRevivedTotalBytes) 148_byteArraysToBeRevivedTotalBytes += Math.Max(4, data.Length);
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
31for (var i = 0; i < assemblies.Length; i++)
src\Components\Shared\src\RootComponentTypeCache.cs (1)
32for (var i = 0; i < assemblies.Length; i++)
src\Shared\PooledArrayBufferWriter.cs (11)
57return _rentedBuffer.Length; 67return _rentedBuffer.Length - _index; 118if (_index > _rentedBuffer.Length - count) 120ThrowInvalidOperationException(_rentedBuffer.Length); 153var availableSpace = _rentedBuffer.Length - _index; 157var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 159var newSize = checked(_rentedBuffer.Length + growBy); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (3)
447writer.WriteArrayHeader(message.Arguments.Length); 472writer.WriteArrayHeader(message.Arguments.Length); 513writer.WriteArrayHeader(streamIds.Length);
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.Components.Server.Tests (23)
Circuits\CircuitHostTest.cs (3)
653for (var i = circuitHandlers.Length - 1; i >= 0; i--) 782for (int i = 0; i < _renderTcsArray.Length; i++) 790if (_instanceCount >= _renderTcsArray.Length)
Circuits\CircuitIdFactoryTest.cs (2)
76for (int i = protectedBytes.Length - 10; i < protectedBytes.Length; i++)
Circuits\RenderBatchWriterTest.cs (4)
156editsBuilder.Append(edits, 0, edits.Length); 157var editsSegment = editsBuilder.ToSegment(1, edits.Length); // Skip first to show offset is respected 289var stringTableStartPosition = ReadInt(bytes, bytes.Length - 4); 290var stringTableEndPositionExcl = bytes.Length - 20;
Circuits\ServerComponentDeserializerTest.cs (6)
462var markers = new ComponentMarker[types.Length]; 463for (var i = 0; i < types.Length; i++) 475var markers = new ComponentMarker[types.Length]; 476for (var i = 0; i < types.Length; i++) 493var markers = new ComponentMarker[types.Length]; 494for (var i = 0; i < types.Length; i++)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
444Assert.Equal(testData.Size, Write(testData.Message).Length); 489BinaryMessageFormatter.WriteLengthPrefix(input.Length, stream);
src\SignalR\common\SignalR.Common\test\Internal\Protocol\TestHubMessageEqualityComparer.cs (6)
92if (left == null || right == null || left.Length != right.Length) 97for (var i = 0; i < left.Length; i++) 148if (left.Length != right.Length) 153for (var i = 0; i < left.Length; i++)
Microsoft.AspNetCore.Components.Tests (19)
CascadingParameterStateTest.cs (2)
405var result = new ComponentState[components.Length]; 407for (var i = 0; i < components.Length; i++)
RendererTest.cs (2)
5666Assert.Equal(parametersSetEvent.Length, parametersSetAsyncEvent.Length);
Rendering\ArrayBuilderSegmentTest.cs (1)
44Array.Clear(originalBuffer, 0, originalBuffer.Length); // Extra proof that we're not using the original storage
Rendering\ArrayBuilderTest.cs (9)
87builder.Append(array, 0, array.Length); 90Assert.Equal(array.Length, builder.Count); 91Assert.Equal(array, builder.Buffer.Take(array.Length)); 122builder.Append(array, 0, array.Length); 125Assert.Equal(array.Length, builder.Count); 126Assert.Equal(array, builder.Buffer.Take(array.Length)); 313buffer => Assert.Equal(2, buffer.Length), 314buffer => Assert.Equal(4, buffer.Length), 315buffer => Assert.Equal(8, buffer.Length));
RenderTreeDiffBuilderTest.cs (4)
2329for (var i = 0; oldTree.GetFrames().Count < oldTree.GetFrames().Array.Length; i++) 2334for (var i = 0; newTree.GetFrames().Count < newTree.GetFrames().Array.Length; i++) 2362for (var i = 0; oldTree.GetFrames().Count < oldTree.GetFrames().Array.Length; i++) 2367for (var i = 0; newTree.GetFrames().Count < newTree.GetFrames().Array.Length; i++)
RenderTreeUpdaterTest.cs (1)
187=> new ArrayRange<RenderTreeFrame>(frames, frames.Length);
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
63_nextEndIndex = newBuffer.Length - _currentBuffer.Length;
Microsoft.AspNetCore.Components.Web.Tests (6)
WebEventData\DragEventArgsReaderTest.cs (3)
73Assert.Equal(expected.Length, actual.Length); 74for (var i = 0; i < expected.Length; i++)
WebEventData\TouchEventArgsReaderTest.cs (3)
93Assert.Equal(expected.Length, actual.Length); 94for (var i = 0; i < expected.Length; i++)
Microsoft.AspNetCore.Components.WebAssembly (7)
Hosting\WebAssemblyCultureProvider.cs (1)
67if (culturesToLoad.Length == 0)
HotReload\HotReloadAgent.cs (1)
155var sortedAssemblies = new List<Assembly>(assemblies.Length);
src\Components\Shared\src\ComponentParametersTypeCache.cs (1)
31for (var i = 0; i < assemblies.Length; i++)
src\Components\Shared\src\PullFromJSDataStream.cs (3)
81return bytesRead.Length; 97if (bytesRead.Length != numBytesToRead) 102_offset += bytesRead.Length;
src\Components\Shared\src\RootComponentTypeCache.cs (1)
32for (var i = 0; i < assemblies.Length; i++)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
TargetPickerUi.cs (2)
54var bytesWithHeader = Encoding.UTF8.GetBytes($"{bytes.Length}:").Concat(bytes).ToArray(); 70if (bytesRead + 1 > _lengthBuffer.Length)
Microsoft.AspNetCore.Components.WebAssembly.Tests (2)
PullFromJSDataStreamTest.cs (2)
48Assert.Equal(pullFromJSDataStream.Position, Data.Length); 108var pullFromJSDataStream = PullFromJSDataStream.CreateJSDataStream(runtime, jsStreamReference, totalLength: data.Length, cancellationToken: CancellationToken.None);
Microsoft.AspNetCore.Components.WebView (22)
artifacts\obj\Microsoft.AspNetCore.Components.WebView\Release\net9.0\Microsoft.AspNetCore.Components.WebView.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
IpcCommon.cs (1)
46args = new ArraySegment<JsonElement>(parsed, 1, parsed.Length - 1);
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
src\Components\Shared\src\PullFromJSDataStream.cs (3)
81return bytesRead.Length; 97if (bytesRead.Length != numBytesToRead) 102_offset += bytesRead.Length;
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (9)
27_fileProviders = new IFileProvider[manifest.ContentRoots.Length]; 29for (int i = 0; i < manifest.ContentRoots.Length; i++) 54for (var i = 0; i < segments.Length; i++) 164for (var i = 0; i < segments.Length; i++) 350internal bool HasPatterns() => Patterns != null && Patterns.Length > 0; 404if (value.Patterns.Length > 0) 406var newList = new StaticWebAssetPattern[existingNode.Patterns.Length + value.Patterns.Length]; 408value.Patterns.CopyTo(newList, existingNode.Patterns.Length);
WebViewManager.cs (1)
286if (manifest.ContentRoots.Length > 0)
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
BasicBlazorHybridTest.cs (1)
32Console.WriteLine($"Found {thisAppFiles.Length} files in this app:");
Microsoft.AspNetCore.Connections.Abstractions (6)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (4)
107_parameterValues = new object?[_parameters.Length]; 114for (var givenIndex = 0; givenIndex != givenParameters.Length; givenIndex++) 119for (var applyIndex = applyIndexStart; givenMatched == false && applyIndex != _parameters.Length; ++applyIndex) 147for (var index = 0; index < _parameters.Length; index++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
Microsoft.AspNetCore.CookiePolicy.Test (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
Microsoft.AspNetCore.Cors (1)
artifacts\obj\Microsoft.AspNetCore.Cors\Release\net9.0\Microsoft.AspNetCore.Cors.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Cryptography.Internal (1)
artifacts\obj\Microsoft.AspNetCore.Cryptography.Internal\Release\net9.0\Microsoft.AspNetCore.Cryptography.Internal.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Cryptography.Internal.Tests (5)
Cng\CachedAlgorithmHandlesTests.cs (5)
149hashHandle.HashData(pInput, (uint)_dataToHash.Length, pOutput, (uint)outputHash.Length); 176var hashHandle = algorithmHandle.CreateHmac(pKey, (uint)_hmacKey.Length); 182hashHandle.HashData(pInput, (uint)_dataToHash.Length, pOutput, (uint)outputHash.Length);
Microsoft.AspNetCore.Cryptography.KeyDerivation (15)
PBKDF2\ManagedPbkdf2Provider.cs (11)
32byte[] saltWithBlockIndex = new byte[checked(salt.Length + sizeof(uint))]; 33Buffer.BlockCopy(salt, 0, saltWithBlockIndex, 0, salt.Length); 40saltWithBlockIndex[saltWithBlockIndex.Length - 4] = (byte)(blockIndex >> 24); 41saltWithBlockIndex[saltWithBlockIndex.Length - 3] = (byte)(blockIndex >> 16); 42saltWithBlockIndex[saltWithBlockIndex.Length - 2] = (byte)(blockIndex >> 8); 43saltWithBlockIndex[saltWithBlockIndex.Length - 1] = (byte)blockIndex; 58int numBytesToCopy = Math.Min(numBytesRemaining, T_blockIndex.Length); 89Array.Clear(passwordBytes, 0, passwordBytes.Length); 96Debug.Assert(src.Length == dest.Length); 97for (int i = 0; i < src.Length; i++)
PBKDF2\Win7Pbkdf2Provider.cs (2)
67cbSalt: (uint)salt.Length, 70cbDerivedKey: (uint)retVal.Length,
PBKDF2\Win8Pbkdf2Provider.cs (2)
36DeriveKeyCore(keyHandle, algorithmName, pbSalt, (uint)salt.Length, (ulong)iterationCount, pbRetVal, (uint)retVal.Length);
Microsoft.AspNetCore.Cryptography.KeyDerivation.Tests (5)
Pbkdf2Tests.cs (5)
34for (int i = 0; i < salt.Length; i++) 97for (int i = 0; i < salt.Length; i++) 124for (int i = 0; i < salt.Length; i++) 151for (int i = 0; i < salt.Length; i++) 205Assert.Equal(numBytesRequested, derivedKey.Length);
Microsoft.AspNetCore.DataProtection (86)
ArraySegmentExtensions.cs (2)
13if (arraySegment.Offset == 0 && arraySegment.Count == arraySegment.Array!.Length) 19Buffer.BlockCopy(arraySegment.Array!, arraySegment.Offset, retVal, 0, retVal.Length);
artifacts\obj\Microsoft.AspNetCore.DataProtection\Release\net9.0\Microsoft.AspNetCore.DataProtection.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AuthenticatedEncryption\AuthenticatedEncryptorExtensions.cs (4)
29var retVal = new byte[checked(preBufferSize + temp.Length + postBufferSize)]; 30Buffer.BlockCopy(temp, 0, retVal, checked((int)preBufferSize), temp.Length); 51CryptoUtil.Assert(roundTrippedData != null && roundTrippedData.Length == plaintextAsBytes.Length && plaintextAsGuid == new Guid(roundTrippedData),
AuthenticatedEncryption\ConfigurationModel\SecretExtensions.cs (2)
33Array.Clear(unprotectedSecretRawBytes, 0, unprotectedSecretRawBytes.Length); 59Array.Clear(unprotectedSecret, 0, unprotectedSecret.Length);
Cng\CbcAuthenticatedEncryptor.cs (3)
102cbDerivedKey: (uint)tempKeys.Length); 136CryptoUtil.Assert(ptr - pbRetVal == retVal.Length, "ptr - pbRetVal == retVal.Length"); 272Buffer.BlockCopy(decryptedPayload, 0, resizedDecryptedPayload, 0, resizedDecryptedPayload.Length);
Cng\CngGcmAuthenticatedEncryptor.cs (2)
93cbDerivedKey: (uint)tempKeys.Length); 110CryptoUtil.Assert(ptr - pbRetVal == retVal.Length, "ptr - pbRetVal == retVal.Length");
Cng\DpapiSecretSerializerHelper.cs (9)
55return ProtectWithDpapiCore(pbPlaintextSecret, (uint)plaintextSecret.Length, pbPurpose, (uint)_purpose.Length, fLocalMachine: protectToLocalMachine); 61Array.Clear(plaintextSecret, 0, plaintextSecret.Length); 134cbData: (uint)plaintextSecret.Length); 139Array.Clear(plaintextSecret, 0, plaintextSecret.Length); 204return UnprotectWithDpapiCore(pbProtectedSecret, (uint)protectedSecret.Length, pbPurpose, (uint)_purpose.Length); 268cbData: (uint)protectedData.Length); 329cbData: (uint)protectedData.Length);
Internal\ContainerUtils.cs (1)
57if (fields.Length < 2 // line had too few fields
KeyManagement\KeyRingBasedDataProtector.cs (8)
47if (originalPurposes != null && originalPurposes.Length > 0) 49var newPurposes = new string[originalPurposes.Length + 1]; 50Array.Copy(originalPurposes, 0, newPurposes, 0, originalPurposes.Length); 51newPurposes[originalPurposes.Length] = newPurpose; 116CryptoUtil.Assert(retVal != null && retVal.Length >= sizeof(uint) + sizeof(Guid), "retVal != null && retVal.Length >= sizeof(uint) + sizeof(Guid)"); 193if (protectedData.Length < sizeof(uint) /* magic header */ + sizeof(Guid) /* key id */) 277ArraySegment<byte> ciphertext = new ArraySegment<byte>(protectedData, sizeof(uint) + sizeof(Guid), protectedData.Length - (sizeof(uint) + sizeof(Guid))); // chop off magic header + encryptor id 356Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */);
Managed\AesGcmAuthenticatedEncryptor.cs (7)
134Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 135Array.Clear(derivedKey, 0, derivedKey.Length); 173Buffer.BlockCopy(keyModifier, 0, retVal, (int)preBufferSize, keyModifier.Length); 174Buffer.BlockCopy(nonceBytes, 0, retVal, (int)preBufferSize + keyModifier.Length, nonceBytes.Length); 210Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 211Array.Clear(derivedKey, 0, derivedKey.Length);
Managed\ManagedAuthenticatedEncryptor.cs (28)
118CryptoUtil.Assert(ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes, "ciphertext != null && ciphertext.Length == _symmetricAlgorithmBlockSizeInBytes"); 119Buffer.BlockCopy(ciphertext, 0, retVal, idx, ciphertext.Length); 129CryptoUtil.Assert(digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes, "digest != null && digest.Length == _validationAlgorithmDigestLengthInBytes"); 130Buffer.BlockCopy(digest, 0, retVal, idx, digest.Length); 134CryptoUtil.Assert(idx == retVal.Length, "idx == retVal.Length"); 191Buffer.BlockCopy(protectedPayload.Array!, ivOffset, iv, 0, iv.Length); 199var derivedKeysBuffer = new byte[checked(decryptionSubkey.Length + validationSubkey.Length)]; 217Buffer.BlockCopy(derivedKeysBuffer, 0, decryptionSubkey, 0, decryptionSubkey.Length); 218Buffer.BlockCopy(derivedKeysBuffer, decryptionSubkey.Length, validationSubkey, 0, validationSubkey.Length); 237if (!CryptoUtil.TimeConstantBuffersAreEqual(correctHash, 0, correctHash.Length, protectedPayload.Array!, macOffset, eofOffset - macOffset)) 261Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 262Array.Clear(decryptionSubkey, 0, decryptionSubkey.Length); 263Array.Clear(validationSubkey, 0, validationSubkey.Length); 264Array.Clear(derivedKeysBuffer, 0, derivedKeysBuffer.Length); 297outputStream.Write(keyModifier, 0, keyModifier.Length); 298outputStream.Write(iv, 0, iv.Length); 308var derivedKeysBuffer = new byte[checked(encryptionSubkey.Length + validationSubkey.Length)]; 326Buffer.BlockCopy(derivedKeysBuffer, 0, encryptionSubkey, 0, encryptionSubkey.Length); 327Buffer.BlockCopy(derivedKeysBuffer, encryptionSubkey.Length, validationSubkey, 0, validationSubkey.Length); 350outputStream.Write(mac, 0, mac.Length); 361Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 362Array.Clear(encryptionSubkey, 0, encryptionSubkey.Length); 363Array.Clear(validationSubkey, 0, validationSubkey.Length); 364Array.Clear(derivedKeysBuffer, 0, derivedKeysBuffer.Length);
RegistryPolicyResolver.cs (1)
106for (var i = 0; i < keyEscrowSinks.Length; i++)
Secret.cs (3)
89_localAllocHandle = Protect(pbTempPlaintextBuffer, (uint)tempPlaintextBuffer.Length); 90_plaintextLength = (uint)tempPlaintextBuffer.Length; 94UnsafeBufferUtil.SecureZeroMemory(pbTempPlaintextBuffer, tempPlaintextBuffer.Length);
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (9)
26prfInput[prfInput.Length - 4] = (byte)(outputSizeInBits >> 24); 27prfInput[prfInput.Length - 3] = (byte)(outputSizeInBits >> 16); 28prfInput[prfInput.Length - 2] = (byte)(outputSizeInBits >> 8); 29prfInput[prfInput.Length - 1] = (byte)(outputSizeInBits); 46CryptoUtil.Assert(prfOutputSizeInBytes == prfOutput.Length, "prfOutputSizeInBytes == prfOutput.Length"); 49Array.Clear(prfOutput, 0, prfOutput.Length); // contains key material, so delete it 60var combinedContext = new byte[checked(contextHeader.Length + context.Count)]; 61Buffer.BlockCopy(contextHeader, 0, combinedContext, 0, contextHeader.Length); 62Buffer.BlockCopy(context.Array!, context.Offset, combinedContext, contextHeader.Length, context.Count);
SP800_108\SP800_108_CTR_HMACSHA512Extensions.cs (3)
12var cbCombinedContext = checked((uint)contextHeader.Length + cbContext); 27UnsafeBufferUtil.BlockCopy(from: pbContextHeader, to: pbCombinedContext, byteCount: contextHeader.Length); 29UnsafeBufferUtil.BlockCopy(from: pbContext, to: &pbCombinedContext[contextHeader.Length], byteCount: cbContext);
SP800_108\Win7SP800_108_CTR_HMACSHA512Provider.cs (1)
63hashHandle.HashData(pbTempInputBuffer, (uint)tempInputBuffer.Length, pbHashDigest, SHA512_DIGEST_SIZE_IN_BYTES);
XmlEncryption\XmlEncryptionExtensions.cs (2)
176Array.Clear(underlyingBuffer, 0, underlyingBuffer.Length); 197Array.Clear(plaintextSecret, 0, plaintextSecret.Length);
Microsoft.AspNetCore.DataProtection.Abstractions (7)
artifacts\obj\Microsoft.AspNetCore.DataProtection.Abstractions\Release\net9.0\Microsoft.AspNetCore.DataProtection.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DataProtectionCommonExtensions.cs (1)
80if (subPurposes != null && subPurposes.Length > 0)
src\Shared\WebEncoders\WebEncoders.cs (5)
113if (buffer.Length - bufferOffset < arraySizeRequired) 186return Base64UrlEncode(input, offset: 0, count: input.Length); 200ValidateParameters(input.Length, nameof(input), offset, count); 241ValidateParameters(input.Length, nameof(input), offset, count); 245if (output.Length - outputOffset < arraySizeRequired)
Microsoft.AspNetCore.DataProtection.Extensions (6)
artifacts\obj\Microsoft.AspNetCore.DataProtection.Extensions\Release\net462\Microsoft.AspNetCore.DataProtection.Extensions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
TimeLimitedDataProtector.cs (5)
53byte[] plaintextWithHeader = new byte[checked(8 + plaintext.Length)]; 55Buffer.BlockCopy(plaintext, 0, plaintextWithHeader, 8, plaintext.Length); 74if (plaintextWithHeader.Length < 8) 91byte[] retVal = new byte[plaintextWithHeader.Length - 8]; 92Buffer.BlockCopy(plaintextWithHeader, 8, retVal, 0, retVal.Length);
Microsoft.AspNetCore.DataProtection.Tests (16)
KeyManagement\KeyRingBasedDataProtectorTests.cs (2)
150badProtectedPayload = badProtectedPayload.Take(badProtectedPayload.Length - 1).ToArray(); // chop off the last byte 625.Concat(BitConverter.GetBytes(IPAddress.HostToNetworkOrder(purposes.Length))); // purposeCount
KeyManagement\XmlKeyManagerTests.cs (2)
371Assert.Equal(2, keys.Length); 448Assert.Equal(4, keys.Length);
SequentialGenRandom.cs (1)
16for (int i = 0; i < bytes.Length; i++)
SP800_108\SP800_108Tests.cs (11)
81for (int i = 0; i < kdk.Length; i++) 105for (int i = 0; i < kdk.Length; i++) 129for (int i = 0; i < kdk.Length; i++) 151ISP800_108_CTR_HMACSHA512Provider provider = factory(pbKdk, (uint)kdk.Length); 152provider.DeriveKeyWithContextHeader(pbLabel, (uint)label.Length, contextHeader, pbContext, (uint)context.Length, pbDerivedSubkey, (uint)derivedSubkey.Length); 160var labelSegment = new ArraySegment<byte>(new byte[label.Length + 10], 3, label.Length); 162var contextSegment = new ArraySegment<byte>(new byte[context.Length + 10], 5, context.Length);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (10)
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
Microsoft.AspNetCore.Diagnostics (7)
artifacts\obj\Microsoft.AspNetCore.Diagnostics\Release\net9.0\Microsoft.AspNetCore.Diagnostics.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
459if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
artifacts\obj\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore\Release\net9.0\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Strings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
artifacts\obj\Microsoft.AspNetCore.Diagnostics.HealthChecks\Release\net9.0\Microsoft.AspNetCore.Diagnostics.HealthChecks.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\JsonRequestHelpers.cs (1)
357Debug.Assert(read == data.Length);
Internal\JsonTranscodingRouteAdapter.cs (1)
147for (var i = 0; i < values.Length; i++)
src\Grpc\JsonTranscoding\src\Shared\X509CertificateHelpers.cs (1)
55for (var i = 0; i < rawDnsEntries.Length; i++)
Microsoft.AspNetCore.Grpc.JsonTranscoding.IntegrationTests (1)
Infrastructure\SyncPoint.cs (1)
76if (counter >= localSyncPoints.Length)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
Infrastructure\SyncPoint.cs (1)
76if (counter >= localSyncPoints.Length)
UnaryServerCallHandlerTests.cs (3)
1175return Task.FromResult(new HelloReply { Message = $"Hello {requestData.Length}!" }); 1187for (var i = 0; i < requestContent.Length; i++) 1209Assert.Equal($"Hello {requestContent.Length}!", responseJson.RootElement.GetProperty("message").GetString());
Microsoft.AspNetCore.HostFiltering (2)
HostFilteringMiddleware.cs (2)
72context.Response.ContentLength = DefaultResponse.Length; 74return context.Response.Body.WriteAsync(DefaultResponse, 0, DefaultResponse.Length);
Microsoft.AspNetCore.Hosting (26)
artifacts\obj\Microsoft.AspNetCore.Hosting\Release\net9.0\Microsoft.AspNetCore.Hosting.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\ConfigureBuilder.cs (2)
30var parameters = new object[parameterInfos.Length]; 31for (var index = 0; index < parameterInfos.Length; index++)
Internal\ConfigureContainerBuilder.cs (1)
27if (parameters.Length != 1)
Internal\ConfigureServicesBuilder.cs (3)
39if (parameters.Length > 1 || 45var arguments = new object[MethodInfo.GetParameters().Length]; 47if (parameters.Length > 0)
Internal\HostingMetrics.cs (1)
114return (uint)statusCode < (uint)boxes.Length
Internal\StartupLoader.cs (3)
180if (filters.Length == 0) 186for (int i = filters.Length - 1; i >= 0; i--) 199if (filters.Length > 0 && result != null)
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
397if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (9)
27_fileProviders = new IFileProvider[manifest.ContentRoots.Length]; 29for (int i = 0; i < manifest.ContentRoots.Length; i++) 54for (var i = 0; i < segments.Length; i++) 164for (var i = 0; i < segments.Length; i++) 350internal bool HasPatterns() => Patterns != null && Patterns.Length > 0; 404if (value.Patterns.Length > 0) 406var newList = new StaticWebAssetPattern[existingNode.Patterns.Length + value.Patterns.Length]; 408value.Patterns.CopyTo(newList, existingNode.Patterns.Length);
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Hosting.Tests (4)
Internal\HostingEventSourceTests.cs (2)
125Assert.Equal(expected.Length, payloadList.Count); 126for (var i = 0; i < expected.Length; i++)
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
WebHostTests.cs (1)
1133for (int i = 0; i < signals.Length; i++)
Microsoft.AspNetCore.Http (12)
Internal\ResponseCookies.cs (1)
151for (var i = 0; i < values.Length; i++)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
163for (var i = 0; i < keys.Length; i++) 188for (var i = 0; i < values.Length; i++) 297if ((uint)arrayIndex > array.Length || array.Length - arrayIndex < this.Count) 505if (_arrayStorage!.Length >= capacity) 530capacity = _arrayStorage.Length == 0 ? DefaultArrayThreshold : _arrayStorage.Length * 2; 546Debug.Assert(_count <= _arrayStorage.Length);
Microsoft.AspNetCore.Http.Abstractions (48)
artifacts\obj\Microsoft.AspNetCore.Http.Abstractions\Release\net9.0\Microsoft.AspNetCore.Http.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Extensions\UseMiddlewareExtensions.cs (10)
57if (args.Length > 0) 92if (parameters.Length == 0 || parameters[0].ParameterType != typeof(HttpContext)) 127var ctorArgs = new object[_args.Length + 1]; 129Array.Copy(_args, 0, ctorArgs, 1, _args.Length); 131if (_parameters.Length == 1) 203for (var i = 1; i < parameters.Length; i++) 214var methodArguments = new object[parameters.Length]; 216for (var i = 1; i < parameters.Length; i++) 261var methodArguments = new Expression[parameters.Length]; 263for (var i = 1; i < parameters.Length; i++)
Internal\ParsingHelpers.cs (1)
107if (values == null || values.Length == 0)
Metadata\ProducesResponseTypeMetadata.cs (2)
29if (contentTypes is null || contentTypes.Length == 0) 35for (var i = 0; i < contentTypes.Length; i++)
Routing\EndpointMetadataCollection.cs (5)
63public int Count => _items.Length; 78var length = result.Length; 88var length = result.Length; 115for (var i = 0; i < items.Length; i++) 202if (_index < _items.Length)
Routing\RouteValueDictionary.cs (17)
68var end = items.Length - 1; 153_count = storage.Properties.Length; 328for (var i = 0; i < keys.Length; i++) 348for (var i = 0; i < values.Length; i++) 449if (arrayIndex < 0 || arrayIndex > array.Length || array.Length - arrayIndex < Count) 631for (var i = 0; i < storage.Properties.Length; i++) 656if (_propertyStorage != null || _arrayStorage.Length < capacity) 680capacity = Math.Max(DefaultCapacity, Math.Max(storage.Properties.Length, capacity)); 683for (var i = 0; i < storage.Properties.Length; i++) 694if (_arrayStorage.Length < capacity) 696capacity = _arrayStorage.Length == 0 ? DefaultCapacity : _arrayStorage.Length * 2; 733if ((uint)count <= (uint)array.Length) 756if ((uint)count <= (uint)array.Length) 777for (var i = 0; i < properties.Length; i++) 903for (var i = 0; i < properties.Length; i++)
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (4)
107_parameterValues = new object?[_parameters.Length]; 114for (var givenIndex = 0; givenIndex != givenParameters.Length; givenIndex++) 119for (var applyIndex = applyIndexStart; givenMatched == false && applyIndex != _parameters.Length; ++applyIndex) 147for (var index = 0; index < _parameters.Length; index++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 285Debug.Assert(parameters.Length == 1); 447var filteredProperties = new List<PropertyHelper>(allProperties.Length); 560property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (4)
GetHeaderSplitBenchmark.cs (4)
30if (values.Length != 1) 40if (values.Length != 1) 50if (values.Length != 2) 60if (values.Length != 6)
Microsoft.AspNetCore.Http.Abstractions.Tests (7)
HttpMethodslTests.cs (1)
29for (int j = 0; j < testCase.methods.Length; j++)
HttpResponseWritingExtensionsTests.cs (4)
43var actual = new byte[expected.Length]; 46Assert.Equal(expected.Length, length); 61var actual = new byte[expected.Length * 2]; 67Assert.Equal(expected.Length, length);
RouteValueDictionaryTests.cs (2)
2047Assert.Equal(4, storage.Length); 2057Assert.Equal(8, storage.Length);
Microsoft.AspNetCore.Http.Connections (10)
src\Shared\WebEncoders\WebEncoders.cs (5)
113if (buffer.Length - bufferOffset < arraySizeRequired) 186return Base64UrlEncode(input, offset: 0, count: input.Length); 200ValidateParameters(input.Length, nameof(input), offset, count); 241ValidateParameters(input.Length, nameof(input), offset, count); 245if (output.Length - outputOffset < arraySizeRequired)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.Http.Connections.Client (7)
Internal\ServerSentEventsMessageParser.cs (6)
91payloadSize += dataLine.Length; 94payloadSize += _newLine.Length * _data.Count; 98payload = new byte[payloadSize - _newLine.Length]; 104offset += dataLine.Length; 105if (offset < payload.Length) 108offset += _newLine.Length;
Internal\ServerSentEventsTransport.cs (1)
172Log.MessageToApplication(_logger, message!.Length);
Microsoft.AspNetCore.Http.Connections.Tests (29)
HttpConnectionDispatcherTests.cs (8)
216requestBody.Write(bytes, 0, bytes.Length); 586requestBody.Write(bytes, 0, bytes.Length); 650requestBody.Write(bytes, 0, bytes.Length); 2576requestBody.Write(buffer, 0, buffer.Length); 2636requestBody.Write(buffer, 0, buffer.Length); 2640await connection.ApplicationStream.WriteAsync(buffer, 0, buffer.Length).DefaultTimeout(); 2693requestBody.Write(buffer, 0, buffer.Length); 2697await connection.ApplicationStream.WriteAsync(buffer, 0, buffer.Length).DefaultTimeout();
NegotiateProtocolTests.cs (1)
35Assert.Equal(availableTransports?.Length, response.AvailableTransports?.Count);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
TestWebSocketConnectionFeature.cs (5)
134if (_internalBuffer.Buffer == null || _internalBuffer.Buffer.Length == 0) 152var length = _internalBuffer.Buffer.Length; 153if (buffer.Count - buffer.Offset < _internalBuffer.Buffer.Length) 155length = Math.Min(buffer.Count - buffer.Offset, _internalBuffer.Buffer.Length); 168endOfMessage = _internalBuffer.Buffer.Length == 0 && endOfMessage;
Microsoft.AspNetCore.Http.Extensions (54)
artifacts\obj\Microsoft.AspNetCore.Http.Extensions\Release\net9.0\Microsoft.AspNetCore.Components.Endpoints.FormMapping.FormDataResources.cs (1)
25for (var i = 0; i < formatterNames.Length; i++)
HeaderDictionaryTypeExtensions.cs (2)
272if (methodParams.Length == 2 309return methodParams.Length == 2
ProblemDetailsService.cs (1)
35for (var i = 0; i < _writers.Length; i++)
RequestDelegateFactory.cs (11)
600var expandedArguments = new Expression[arguments.Length + 1]; 638if (parameters is null || parameters.Length == 0) 643var args = new Expression[parameters.Length]; 645factoryContext.ArgumentTypes = new Type[parameters.Length]; 646factoryContext.BoxedArgs = new Expression[parameters.Length]; 649for (var i = 0; i < parameters.Length; i++) 1549if (constructor is not null && parameters is { Length: > 0 }) 1553var constructorArguments = new Expression[parameters.Length]; 1555for (var i = 0; i < parameters.Length; i++) 1574var bindings = new List<MemberBinding>(properties.Length); 1576for (var i = 0; i < properties.Length; i++)
SessionExtensions.cs (1)
39if (data == null || data.Length < 4)
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (3)
16if (buffer.Count >= buffer.Data.Length) 18var newBuffer = ArrayPool<TElement>.Shared.Rent(buffer.Data.Length * 2); 19Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (2)
125if (constructors.Length == 1) 135else if (constructors.Length > 1)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
143if (index < 0 || index > MethodParameters.Length - 1) 159var parameters = new List<Expression>(paramInfos.Length); 160for (int i = 0; i < paramInfos.Length; i++) 211var parameters = new List<Expression>(paramInfos.Length); 212for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
236if (parameters.Length == 3
src\Shared\ParameterBindingMethodCache.cs (8)
313if (constructor is null || constructor.GetParameters().Length == 0) 319var lookupTable = new Dictionary<ParameterLookupKey, PropertyInfo>(properties.Length); 320for (var i = 0; i < properties.Length; i++) 333var parametersWithPropertyInfo = new ConstructorParameter[parameters.Length]; 335for (var i = 0; i < parameters.Length; i++) 364if (constructors.Length == 1) 371var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0); 395if (parameterlessConstructor is null && constructors.Length > 1)
src\Shared\PropertyAsParameterInfo.cs (16)
69if (parameters.Length == 0) 77for (var i = 0; i < parameters.Length; i++) 91List<ParameterInfo> list = new(parameters.Length); 107if (constructor is not null && constructorParameters is { Length: > 0 }) 144if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length]; 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 162if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length]; 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Http.Extensions.Tests (37)
HttpResponseJsonExtensionsTests.cs (4)
325Assert.InRange(body.ToArray().Length, 0, 1); 359Assert.InRange(body.ToArray().Length, 0, 1); 393Assert.InRange(body.ToArray().Length, 0, 1); 427Assert.InRange(body.ToArray().Length, 0, 1);
ParameterBindingMethodCacheTests.cs (7)
37Assert.Equal(4, parameters.Length); 55Assert.Equal(3, parameters.Length); 79Assert.Equal(3, parameters.Length); 86Assert.Equal(4, parameters.Length); 109Assert.Equal(3, parameters.Length); 133Assert.Equal(2, parameters.Length); 190Assert.Equal(2, parameters.Length);
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
142for (int i = 0; i < endpoints.Length; i++)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
139var sourceText = SourceText.From(buffer, buffer.Length, encoding, canBeEmbedded: true); 383if (expectedLines.Length != sourceText.Lines.Count) 385message = $"Line numbers do not match. Expected: {expectedLines.Length} lines, but generated {sourceText.Lines.Count}";
RequestDelegateGenerator\RequestDelegateCreationTests.AsParameters.cs (1)
391Assert.Equal(3, logs.Length);
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (4)
158while (i < BindAsyncUriTypesAndOptionalitySupport.Length * 2) 172Assert.Equal(BindAsyncUriTypesAndOptionalitySupport.Length * 2, endpoints.Length); 174for (i = 0; i < BindAsyncUriTypesAndOptionalitySupport.Length * 2; i++)
RequestDelegateGenerator\RequestDelegateCreationTests.cs (2)
157Assert.Equal(3, endpoints.Length); 310Assert.Equal(3, endpoints.Length);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (11)
133Assert.Equal(2, endpoints.Length); 243byte[] data = new byte[requestBodyBytes.Length]; 245Assert.Equal(read, data.Length); 250Assert.Equal(requestBodyBytes.Length, result.Buffer.Length); 284byte[] data = new byte[requestBodyBytes.Length]; 286Assert.Equal(read, data.Length); 291Assert.Equal(requestBodyBytes.Length, result.Buffer.Length); 319httpContext.Request.Headers["Content-Length"] = requestBodyBytes.Length.ToString(CultureInfo.InvariantCulture); 328int read = await httpContext.Request.Body.ReadAsync(new byte[requestBodyBytes.Length].AsMemory()); 360httpContext.Request.Headers["Content-Length"] = requestBodyBytes.Length.ToString(CultureInfo.InvariantCulture); 369int read = await httpContext.Request.Body.ReadAsync(new byte[requestBodyBytes.Length].AsMemory());
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (4)
47Assert.Equal(4, logs.Length); 110Assert.Equal(2, logs.Length); 230Assert.Equal(2, logs.Length); 310Assert.Equal(2, logs.Length);
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
139var sourceText = SourceText.From(buffer, buffer.Length, encoding, canBeEmbedded: true); 383if (expectedLines.Length != sourceText.Lines.Count) 385message = $"Line numbers do not match. Expected: {expectedLines.Length} lines, but generated {sourceText.Lines.Count}";
Microsoft.AspNetCore.Http.RequestDelegateGenerator (18)
artifacts\obj\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Release\netstandard2.0\Microsoft.AspNetCore.Http.RequestDelegateGenerator.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
31for (var i = 0; i < WellKnownTypeData.WellKnownTypeNames.Length; i++) 52_lazyWellKnownTypes = new INamedTypeSymbol?[WellKnownTypeData.WellKnownTypeNames.Length];
StaticRouteHandlerModel\Endpoint.cs (3)
120a.Parameters.Length != b.Parameters.Length) 125for (var i = 0; i < a.Parameters.Length; i++)
StaticRouteHandlerModel\StaticRouteHandlerModel.Emitter.cs (12)
23if (endpoint.Parameters.Length == 0) 73if (endpoint.Parameters.Length > 0) 171var argumentList = endpoint.Parameters.Length == 0 ? string.Empty : $", {endpoint.EmitArgumentList()}"; 172var invocationCreator = endpoint.Parameters.Length > 8 175var invocationGenericArgs = endpoint.Parameters.Length is > 0 and < 8 183if (endpoint.Parameters.Length > 0) 401if (endpoint.Parameters.Length == 0) 408for (var i = 0; i < endpoint.Parameters.Length; i++) 416if (i < endpoint.Parameters.Length - 1) 427if (endpoint.Parameters.Length == 0) 434for (var i = 0; i < endpoint.Parameters.Length; i++) 438if (i < endpoint.Parameters.Length - 1)
Microsoft.AspNetCore.Http.Results (2)
src\Http\Shared\StreamCopyOperationInternal.cs (1)
54var readLength = buffer.Length;
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
379for (var i = 0; i < states.Length; i++)
Microsoft.AspNetCore.Http.Results.Tests (9)
ContentResultTests.cs (1)
123Assert.Equal(expectedContentData.Length, httpContext.Response.ContentLength);
HttpResultsHelperTests.cs (1)
202Assert.Equal(3, body.Length);
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
Microsoft.AspNetCore.Http.Tests (12)
Features\FormFeatureTests.cs (7)
620var toWrite = Math.Min(size - written, bytes.Length); 641stream.Write(bytes, 0, bytes.Length); 647stream.Write(bytes, 0, bytes.Length); 656var readA = streamA.Read(bytesA, 0, bytesA.Length); 657var readB = streamB.Read(bytesB, 0, bytesB.Length); 670readA = streamA.Read(bytesA, 0, bytesA.Length); 671readB = streamB.Read(bytesB, 0, bytesB.Length);
RequestCookiesCollectionTests.cs (2)
51Assert.Equal(expectedCookieValues.Length, cookies.Count); 52for (int i = 0; i < expectedCookieValues.Length; i++)
ResponseCookiesTest.cs (3)
138Assert.Equal(testCookies.Length, deletedCookies.Length); 169Assert.Equal(2, deletedCookies.Length);
Microsoft.AspNetCore.HttpLogging (14)
artifacts\obj\Microsoft.AspNetCore.HttpLogging\Release\net9.0\Microsoft.AspNetCore.HttpLogging.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
FileLoggerProcessor.cs (1)
310return files.Length == 0
HttpLoggingMiddleware.cs (5)
61if (_interceptors.Length == 0 && loggingFields == HttpLoggingFields.None) 95for (var i = 0; i < _interceptors.Length; i++) 202if (loggingFields.HasFlag(HttpLoggingFields.ResponseBody) || _interceptors.Length > 0) 310for (var i = 0; i < interceptors.Length; i++) 320for (var i = 0; i < interceptors.Length; i++)
src\Shared\Buffers\BufferSegmentStack.cs (3)
28if ((uint)size >= (uint)array.Length) 46if ((uint)size < (uint)array.Length) 61Array.Resize(ref _array, 2 * _array.Length);
W3CLogger.cs (2)
40for (var i = 0; i < elements.Length; i++) 64for (var i = 0; i < additionalHeaders.Length; i++)
W3CLoggingMiddleware.cs (2)
250if (src.Length == 0) 258if (src.Length == 0)
Microsoft.AspNetCore.HttpLogging.Tests (11)
FileLoggerProcessorTests.cs (7)
191Assert.Equal(4, actualFiles.Length); 244.ToArray().Length); 314Assert.Equal(6, actualFiles1.Length); 338Assert.Equal(5, actualFiles2.Length); 398Assert.Equal(3, actualFiles.Length); 464Assert.Equal(2, actualFiles.Length); 534Assert.Equal(2, actualFiles.Length);
HttpLoggingMiddlewareTests.cs (3)
1293Assert.Equal(lines.Length, i); 1566Assert.Equal(lines.Length, i); 1606Assert.Equal(lines.Length, i);
W3CLoggingMiddlewareTests.cs (1)
266Assert.Equal(19, lines[3].Split(' ').Length);
Microsoft.AspNetCore.HttpOverrides (33)
ForwardedHeadersMiddleware.cs (31)
133entryCount = Math.Max(forwardedFor.Length, entryCount); 140if (_options.RequireHeaderSymmetry && checkFor && forwardedFor!.Length != forwardedProto.Length) 145entryCount = Math.Max(forwardedProto.Length, entryCount); 153&& ((checkFor && forwardedFor!.Length != forwardedHost.Length) 154|| (checkProto && forwardedProto!.Length != forwardedHost.Length))) 159entryCount = Math.Max(forwardedHost.Length, entryCount); 167&& ((checkFor && forwardedFor!.Length != forwardedPrefix.Length) 168|| (checkProto && forwardedProto!.Length != forwardedPrefix.Length) 169|| (checkHost && forwardedHost!.Length != forwardedPrefix.Length))) 174entryCount = Math.Max(forwardedPrefix.Length, entryCount); 185for (int i = 0; i < sets.Length; i++) 189if (checkFor && i < forwardedFor!.Length) 191set.IpAndPortText = forwardedFor[forwardedFor.Length - i - 1]; 193if (checkProto && i < forwardedProto!.Length) 195set.Scheme = forwardedProto[forwardedProto.Length - i - 1]; 197if (checkHost && i < forwardedHost!.Length) 199set.Host = forwardedHost[forwardedHost.Length - i - 1]; 201if (checkPrefix && i < forwardedPrefix!.Length) 203set.Prefix = forwardedPrefix[forwardedPrefix.Length - i - 1]; 220for (; entriesConsumed < sets.Length; entriesConsumed++) 312if (forwardedFor!.Length > entriesConsumed) 331if (forwardedProto!.Length > entriesConsumed) 349if (forwardedHost!.Length > entriesConsumed) 371if (forwardedPrefix!.Length > entriesConsumed) 483var newLength = forwarded.Length - entriesConsumed;
IPNetwork.cs (2)
66for (int i = 0; i < PrefixBytes.Length && Mask[i] != 0; i++) 79var mask = new byte[PrefixBytes.Length];
Microsoft.AspNetCore.Identity (5)
artifacts\obj\Microsoft.AspNetCore.Identity\Release\net9.0\Microsoft.AspNetCore.Identity.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
IdentityApiEndpointRouteBuilderExtensions.cs (4)
328RecoveryCodesLeft = recoveryCodes?.Length ?? await userManager.CountRecoveryCodesAsync(user), 440newDescriptions = new string[descriptions.Length + 1]; 441Array.Copy(descriptions, newDescriptions, descriptions.Length); 442newDescriptions[descriptions.Length] = error.Description;
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
artifacts\obj\Microsoft.AspNetCore.Identity.EntityFrameworkCore\Release\net9.0\Microsoft.AspNetCore.Identity.EntityFrameworkCore.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (2)
DbUtil.cs (2)
59return count == columns.Length; 78return count == columns.Length;
Microsoft.AspNetCore.Identity.FunctionalTests (7)
MapIdentityApiTests.cs (3)
748Assert.Equal(10, recoveryCodes.Length); 846Assert.Equal(10, recoveryCodes.Length); 877Assert.Equal(10, resetRecoveryCodes.Length);
src\Identity\Extensions.Core\src\Base32.cs (2)
56for (int offset = 0; offset < input.Length;) 88while (outputIndex < output.Length)
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (2)
72var combined = new byte[checked(input.Length + modifierBytes.Length)]; 74Buffer.BlockCopy(modifierBytes, 0, combined, input.Length, modifierBytes.Length);
Microsoft.AspNetCore.Identity.InMemory.Test (2)
FunctionalTest.cs (1)
424await res.Body.WriteAsync(memory.ToArray(), 0, memory.ToArray().Length);
InMemoryUserStore.cs (1)
431return mergedCodes.Split(';').Length;
Microsoft.AspNetCore.Identity.Test (2)
Base32Test.cs (1)
33Assert.Equal(20, output.Length);
PasswordHasherTest.cs (1)
198for (int i = 0; i < data.Length; i++)
Microsoft.AspNetCore.Identity.UI (3)
Areas\Identity\Pages\V4\Account\Manage\ShowRecoveryCodes.cshtml.cs (1)
35if (RecoveryCodes == null || RecoveryCodes.Length == 0)
Areas\Identity\Pages\V5\Account\Manage\ShowRecoveryCodes.cshtml.cs (1)
35if (RecoveryCodes == null || RecoveryCodes.Length == 0)
IdentityPageModelConvention.cs (1)
31if (genericArguments.Length != 1)
Microsoft.AspNetCore.InternalTesting (1)
xunit\ConditionalTheoryDiscoverer.cs (1)
49if (skipReason == null && dataRow?.Length > 0)
Microsoft.AspNetCore.InternalTesting.Tests (1)
HttpClientSlimTest.cs (1)
107await context.Response.OutputStream.WriteAsync(_defaultResponse, 0, _defaultResponse.Length);
Microsoft.AspNetCore.JsonPatch (3)
artifacts\obj\Microsoft.AspNetCore.JsonPatch\Release\net9.0\Microsoft.AspNetCore.JsonPatch.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\ParsedPath.cs (2)
31if (_segments == null || _segments.Length == 0) 36return _segments[_segments.Length - 1];
Microsoft.AspNetCore.Localization (4)
ApplicationBuilderExtensions.cs (1)
84if (cultures.Length == 0)
artifacts\obj\Microsoft.AspNetCore.Localization\Release\net9.0\Microsoft.AspNetCore.Localization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
RequestLocalizationOptions.cs (2)
125var supportedCultures = new List<CultureInfo>(cultures.Length); 144var supportedUICultures = new List<CultureInfo>(uiCultures.Length);
Microsoft.AspNetCore.Localization.Tests (1)
CustomRequestCultureProviderTest.cs (1)
68if (segments.Length > 1 && segments[0].Length == 2)
Microsoft.AspNetCore.Mvc.Abstractions (15)
artifacts\obj\Microsoft.AspNetCore.Mvc.Abstractions\Release\net9.0\Microsoft.AspNetCore.Mvc.Abstractions.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ModelBinding\BindingInfo.cs (2)
150if (propertyFilterProviders.Length == 1) 155else if (propertyFilterProviders.Length > 1)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\ParameterBindingMethodCache.cs (8)
313if (constructor is null || constructor.GetParameters().Length == 0) 319var lookupTable = new Dictionary<ParameterLookupKey, PropertyInfo>(properties.Length); 320for (var i = 0; i < properties.Length; i++) 333var parametersWithPropertyInfo = new ConstructorParameter[parameters.Length]; 335for (var i = 0; i < parameters.Length; i++) 364if (constructors.Length == 1) 371var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0); 395if (parameterlessConstructor is null && constructors.Length > 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
SymbolApiResponseMetadataProvider.cs (2)
164if (attributes.Length == 0) 170for (var i = 0; i < attributes.Length; i++)
Microsoft.AspNetCore.Mvc.ApiExplorer (16)
ApiDescriptionGroupCollectionProvider.cs (1)
58for (var i = _apiDescriptionProviders.Length - 1; i >= 0; i--)
src\Shared\PropertyAsParameterInfo.cs (15)
69if (parameters.Length == 0) 77for (var i = 0; i < parameters.Length; i++) 91List<ParameterInfo> list = new(parameters.Length); 144if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length]; 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 162if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length]; 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
Microsoft.AspNetCore.Mvc.Core (114)
ActionConstraints\ActionConstraintCache.cs (2)
125for (var i = 0; i < _actionConstraintProviders.Length; i++) 130for (var i = _actionConstraintProviders.Length - 1; i >= 0; i--)
ApiConventionMethodAttribute.cs (2)
53if (methods.Length == 0) 57else if (methods.Length > 1)
ApiConventionTypeAttribute.cs (1)
67if (unsupportedAttributes.Length == 0)
ApiExplorer\ApiConventionMatcher.cs (5)
25for (var i = 0; i < conventionMethodParameters.Length; i++) 33if (methodParameters.Length <= i) 50return methodParameters.Length == conventionMethodParameters.Length; 69for (var i = 0; i < attributes.Length; i++)
ApplicationModels\ApiConventionApplicationModelConvention.cs (1)
64if (apiConventionAttributes.Length == 0)
ApplicationModels\ApplicationModelFactory.cs (2)
39for (var i = 0; i < _applicationModelProviders.Length; i++) 44for (var i = _applicationModelProviders.Length - 1; i >= 0; i--)
ApplicationModels\AuthorizationApplicationModelProvider.cs (2)
45if (controllerModelAuthData.Length > 0) 57if (actionModelAuthData.Length > 0)
ApplicationModels\DefaultApplicationModelProvider.cs (4)
128if (routeAttributes.Length > 0) 318if (routeAttributes.Length > 0) 336var applicableAttributes = new List<object>(routeAttributes.Length); 638if (httpMethods.Length > 0)
ApplicationParts\RelatedAssemblyAttribute.cs (2)
63if (attributes.Length == 0) 80for (var i = 0; i < attributes.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Mvc.Core\Release\net9.0\Microsoft.AspNetCore.Mvc.Core.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BindAttribute.cs (2)
26var items = new List<string>(include.Length); 56if (Include != null && Include.Length > 0)
ConsumesAttribute.cs (3)
47for (var i = 0; i < otherContentTypes.Length; i++) 70for (var i = 0; i < otherContentTypes.Length; i++) 238var completeArgs = new List<string>(args.Length + 1);
Controllers\ControllerBinderDelegateProvider.cs (2)
62for (var i = 0; i < parameters.Length; i++) 88for (var i = 0; i < properties.Length; i++)
Controllers\ControllerFactoryProvider.cs (3)
61for (var i = 0; i < propertyActivators.Length; i++) 117var propertyActivators = new Action<ControllerContext, object>[_propertyActivators.Length]; 118for (var i = 0; i < _propertyActivators.Length; i++)
Controllers\DefaultControllerPropertyActivator.cs (2)
24for (var i = 0; i < propertiesToActivate.Length; i++) 49for (var i = 0; i < propertiesToActivate.Length; i++)
Filters\FilterCursor.cs (1)
46while (_index < _filters.Length)
Filters\FilterFactory.cs (6)
41for (var i = 0; i < staticFilterItems.Length; i++) 51if (allFiltersAreReusable && filterProviders.Length == 1 && filterProviders[0] is DefaultFilterProvider defaultFilterProvider) 76var filterItems = new List<FilterItem>(cachedFilterItems.Length); 77for (var i = 0; i < cachedFilterItems.Length; i++) 99for (var i = 0; i < filterProviders.Length; i++) 104for (var i = filterProviders.Length - 1; i >= 0; i--)
Filters\MiddlewareFilterConfigurationProvider.cs (2)
94var parameters = new object[parameterInfos.Length]; 95for (var index = 0; index < parameterInfos.Length; index++)
Infrastructure\ActionInvokerFactory.cs (1)
29for (var i = _actionInvokerProviders.Length - 1; i >= 0; i--)
Infrastructure\ActionMethodExecutor.cs (1)
45for (var i = 0; i < Executors.Length; i++)
Infrastructure\ActionSelectionTable.cs (2)
167var routeValues = new string[routeKeys.Length]; 168for (var i = 0; i < routeKeys.Length; i++)
Infrastructure\ControllerActionInvoker.cs (3)
532var count = declaredParameterInfos.Length; 628var convertedArguments = new string?[arguments.Length]; 629for (var i = 0; i < arguments.Length; i++)
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (5)
80if (_actionDescriptorChangeProviders.Length == 1) 85var changeTokens = new IChangeToken[_actionDescriptorChangeProviders.Length]; 86for (var i = 0; i < _actionDescriptorChangeProviders.Length; i++) 122for (var i = 0; i < _actionDescriptorProviders.Length; i++) 127for (var i = _actionDescriptorProviders.Length - 1; i >= 0; i--)
Infrastructure\FileContentResultExecutor.cs (1)
36result.FileContents.Length,
Infrastructure\ParameterDefaultValues.cs (2)
17var values = new object?[parameters.Length]; 19for (var i = 0; i < parameters.Length; i++)
Infrastructure\StringArrayComparer.cs (4)
36if (x.Length != y.Length) 41for (var i = 0; i < x.Length; i++) 65for (var i = 0; i < obj.Length; i++)
ModelBinding\Binders\CollectionModelBinder.cs (1)
487return (indexes == null || indexes.Length == 0) ? null : indexes;
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (1)
53for (var i = 0; i < parameterBinders.Length; i++)
ModelBinding\Binders\HeaderModelBinder.cs (5)
168if (!bindingContext.IsTopLevelObject && values.Length == 0) 179var collection = ModelBindingHelper.GetCompatibleCollection<string>(bindingContext, values.Length); 180for (var i = 0; i < values.Length; i++) 201return _values.Length != 0; 206if (_values.Length == 0)
ModelBinding\DefaultModelBindingContext.cs (1)
288var rootModelType = states[states.Length - 1].ModelMetadata.ModelType;
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (6)
53if (propertyFilterProviders.Length == 0) 57else if (propertyFilterProviders.Length == 1) 88if (constructors.Length == 0) 108if (constructors.Length > 1) 116if (parameters.Length == 0) 124for (var i = 0; i < parameters.Length; i++)
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (10)
85var properties = new ModelMetadata[propertyDetails.Length]; 86for (var i = 0; i < properties.Length; i++) 218for (var i = 0; i < propertyHelpers.Length; i++) 235var parameterMetadata = new ModelMetadata[parameters.Length]; 236var parameterTypes = new Type[parameters.Length]; 238for (var i = 0; i < parameters.Length; i++) 269var constructorArguments = new Expression[constructorParameters.Length]; 271for (var i = 0; i < constructorParameters.Length; i++) 337var propertyEntries = new List<DefaultMetadataDetails>(propertyHelpers.Length); 338for (var i = 0; i < propertyHelpers.Length; i++)
ModelBinding\Metadata\HasValidatorsValidationMetadataProvider.cs (1)
34for (var i = 0; i < _validatorProviders!.Length; i++)
ModelBinding\ModelBinderFactory.cs (2)
55if (_providers.Length == 0) 148for (var i = 0; i < _providers.Length; i++)
ModelBinding\ModelBindingHelper.cs (4)
330if (expressions.Length == 0) 640var converted = (IList)Array.CreateInstance(destinationElementType, valueAsArray.Length); 641for (var i = 0; i < valueAsArray.Length; i++) 660if (valueAsArray.Length > 0)
ModelBinding\PrefixContainer.cs (2)
51if (_sortedValues.Length == 0) 187var end = _sortedValues.Length - 1;
ProducesAttribute.cs (2)
44for (var i = 0; i < additionalContentTypes.Length; i++) 106var completeArgs = new List<string>(args.Length + 1);
ProducesResponseTypeAttribute.cs (2)
57for (var i = 0; i < additionalContentTypes.Length; i++) 105var completeContentTypes = new List<string>(additionalContentTypes.Length + 1);
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
282for (var i = 0; i < values.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
143if (index < 0 || index > MethodParameters.Length - 1) 159var parameters = new List<Expression>(paramInfos.Length); 160for (int i = 0; i < paramInfos.Length; i++) 211var parameters = new List<Expression>(paramInfos.Length); 212for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
236if (parameters.Length == 3
src\Shared\PropertyActivator\PropertyActivator.cs (1)
90property.GetIndexParameters().Length == 0 &&
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 285Debug.Assert(parameters.Length == 1); 447var filteredProperties = new List<PropertyHelper>(allProperties.Length); 560property.GetMethod.GetParameters().Length == 0;
src\Shared\ResultsHelpers\FileResultHelper.cs (1)
379for (var i = 0; i < states.Length; i++)
Microsoft.AspNetCore.Mvc.Core.Test (32)
ApplicationModels\ControllerActionDescriptorProviderTests.cs (4)
369Assert.Equal(2, descriptors.Length); 1431for (var i = unorderedStart + unorderedLineCount; i < expectedLines.Length; i++) 1436Assert.Equal(expectedLines.Length, actualLines.Length);
ContentResultTest.cs (1)
140Assert.Equal(expectedContentData.Length, httpContext.Response.ContentLength);
DependencyInjection\MvcCoreServiceCollectionExtensionsTest.cs (3)
49AssertServiceCountEquals(services, serviceType.Key, serviceType.Value.Length + 1); 363if (matches.Length == 0) 369else if (matches.Length > 1)
Filters\FilterFactoryTest.cs (3)
161Assert.Equal(2, filters.Length); 236Assert.Equal(3, filters.Length); 247Assert.Equal(3, filters.Length);
Formatters\SystemTextJsonOutputFormatterTest.cs (1)
144Assert.InRange(body.ToArray().Length, 0, 1);
Infrastructure\JsonResultExecutorTestBase.cs (3)
379Assert.InRange(written.Length, 0, 1); 413Assert.InRange(written.Length, 0, 2); 463Assert.InRange(written.Length, 0, 2);
ModelBinding\Binders\ArrayModelBinderTest.cs (1)
184var arrayLength = model.Length;
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (1)
521if (tokens.Length >= 2)
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (4)
96Assert.Equal(2, metadata.Length); 126Assert.Equal(properties1.Length, properties2.Length); 127for (var i = 0; i < properties1.Length; i++)
ModelBinding\Metadata\DefaultModelMetadataTest.cs (2)
495Assert.Equal(expectedProperties.Length, properties.Count); 497for (var i = 0; i < expectedProperties.Length; i++)
ModelBinding\ModelBindingHelperTest.cs (2)
1137Assert.Equal(2, result.Length); 1155Assert.Equal(2, result.Length);
src\Shared\ResultsTests\FileContentResultTestBase.cs (3)
85var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 124var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 254var contentRange = new ContentRangeHeaderValue(byteArray.Length);
src\Shared\ResultsTests\FileStreamResultTestBase.cs (4)
59var contentRange = new ContentRangeHeaderValue(start.Value, end.Value, byteArray.Length); 102var contentRange = new ContentRangeHeaderValue(0, 4, byteArray.Length); 244var contentRange = new ContentRangeHeaderValue(byteArray.Length); 362var contentRange = new ContentRangeHeaderValue(byteArray.Length);
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
SimpleValueProvider.cs (2)
44var stringValues = new string[array.Length]; 45for (var i = 0; i < array.Length; i++)
Microsoft.AspNetCore.Mvc.Cors (1)
artifacts\obj\Microsoft.AspNetCore.Mvc.Cors\Release\net9.0\Microsoft.AspNetCore.Mvc.Cors.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
artifacts\obj\Microsoft.AspNetCore.Mvc.DataAnnotations\Release\net9.0\Microsoft.AspNetCore.Mvc.DataAnnotations.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
artifacts\obj\Microsoft.AspNetCore.Mvc.DataAnnotations.Test\Release\net9.0\Microsoft.AspNetCore.Mvc.DataAnnotations.Test.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ModelMetadataProviderTest.cs (1)
1062if (_attributes?.Length > 0)
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
artifacts\obj\Microsoft.AspNetCore.Mvc.Formatters.Xml\Release\net9.0\Microsoft.AspNetCore.Mvc.Formatters.Xml.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (48)
DelegatingEnumerableTest.cs (2)
44Assert.Equal(errors.Length, delegatingEnumerable.Count()); 46for (var i = 0; i < errors.Length; i++)
XmlDataContractSerializerInputFormatterTest.cs (23)
485var contentBytes = new byte[inpStart.Length + inp.Length + inpEnd.Length]; 486Buffer.BlockCopy(inpStart, 0, contentBytes, 0, inpStart.Length); 487Buffer.BlockCopy(inp, 0, contentBytes, inpStart.Length, inp.Length); 488Buffer.BlockCopy(inpEnd, 0, contentBytes, inpStart.Length + inp.Length, inpEnd.Length); 538var expectedBytes = new byte[sampleString.Length + bom.Length]; 540var contentBytes = new byte[inputStart.Length + bom.Length + inputEnd.Length]; 541Buffer.BlockCopy(inputStart, 0, contentBytes, 0, inputStart.Length); 542Buffer.BlockCopy(bom, 0, contentBytes, inputStart.Length, bom.Length); 543Buffer.BlockCopy(inputEnd, 0, contentBytes, inputStart.Length + bom.Length, inputEnd.Length); 555Buffer.BlockCopy(sampleStringBytes, 0, expectedBytes, 0, sampleStringBytes.Length); 556Buffer.BlockCopy(bom, 0, expectedBytes, sampleStringBytes.Length, bom.Length); 743request.SetupGet(f => f.ContentLength).Returns(contentBytes.Length);
XmlSerializerInputFormatterTest.cs (23)
505var contentBytes = new byte[inpStart.Length + inp.Length + inpEnd.Length]; 506Buffer.BlockCopy(inpStart, 0, contentBytes, 0, inpStart.Length); 507Buffer.BlockCopy(inp, 0, contentBytes, inpStart.Length, inp.Length); 508Buffer.BlockCopy(inpEnd, 0, contentBytes, inpStart.Length + inp.Length, inpEnd.Length); 558var expectedBytes = new byte[sampleString.Length + bom.Length]; 560var contentBytes = new byte[inputStart.Length + bom.Length + inputEnd.Length]; 561Buffer.BlockCopy(inputStart, 0, contentBytes, 0, inputStart.Length); 562Buffer.BlockCopy(bom, 0, contentBytes, inputStart.Length, bom.Length); 563Buffer.BlockCopy(inputEnd, 0, contentBytes, inputStart.Length + bom.Length, inputEnd.Length); 575Buffer.BlockCopy(sampleStringBytes, 0, expectedBytes, 0, sampleStringBytes.Length); 576Buffer.BlockCopy(bom, 0, expectedBytes, sampleStringBytes.Length, bom.Length); 679request.SetupGet(f => f.ContentLength).Returns(contentBytes.Length);
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
BasicTests.cs (1)
441Assert.Equal(2, result.Length);
InputObjectValidationTests.cs (2)
134var errorKeyValuePair = Assert.Single(responseObject, keyValuePair => keyValuePair.Value.Length > 0); 162var errorKeyValuePair = Assert.Single(responseObject, keyValuePair => keyValuePair.Value.Length > 0);
Microsoft.AspNetCore.Mvc.Localization (1)
Properties\Resources.Designer.cs (1)
53for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.Mvc.Localization.Test (2)
MvcLocalizationServiceCollectionExtensionsTest.cs (2)
62if (matches.Length == 0) 68else if (matches.Length > 1)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
artifacts\obj\Microsoft.AspNetCore.Mvc.NewtonsoftJson\Release\net9.0\Microsoft.AspNetCore.Mvc.NewtonsoftJson.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BsonTempDataSerializer.cs (2)
182Debug.Assert(genericTypeArguments.Length == 1, "IList<T> has one generic argument"); 189genericTypeArguments.Length == 2,
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (5)
NewtonsoftJsonInputFormatterTest.cs (1)
455httpContext.Setup(h => h.Request.ContentLength).Returns(content.Length);
NewtonsoftJsonPatchInputFormatterTest.cs (1)
263request.SetupGet(f => f.ContentLength).Returns(contentBytes.Length);
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (3)
379Assert.InRange(written.Length, 0, 1); 413Assert.InRange(written.Length, 0, 2); 463Assert.InRange(written.Length, 0, 2);
Microsoft.AspNetCore.Mvc.Razor (9)
artifacts\obj\Microsoft.AspNetCore.Mvc.Razor\Release\net9.0\Microsoft.AspNetCore.Mvc.Razor.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DefaultTagHelperFactory.cs (1)
60for (var i = 0; i < propertiesToActivate.Length; i++)
RazorPage.cs (1)
228if (sectionsNotIgnored.Length > 0)
RazorPagePropertyActivator.cs (1)
49for (var i = 0; i < _propertyActivators.Length; i++)
RazorViewEngine.cs (1)
465for (var i = 0; i < viewStarts.Length; i++)
TagHelpers\TagHelperComponentPropertyActivator.cs (1)
36for (var i = 0; i < propertiesToActivate.Length; i++)
TagHelpers\TagHelperComponentTagHelper.cs (2)
65for (var i = 0; i < _components.Length; i++) 80for (var i = 0; i < _components.Length; i++)
TagHelpers\UrlResolutionTagHelper.cs (1)
127for (var i = 0; i < attributeNames.Length; i++)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (8)
artifacts\obj\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation\Release\net9.0\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ChecksumValidator.cs (2)
122if (bytes.Length * 2 != checksum.Length) 127for (var i = 0; i < bytes.Length; i++)
PageActionDescriptorChangeProvider.cs (5)
60var changeTokens = new IChangeToken[_additionalFilesToTrack.Length + _searchPatterns.Length]; 61for (var i = 0; i < _additionalFilesToTrack.Length; i++) 66for (var i = 0; i < _searchPatterns.Length; i++) 69changeTokens[_additionalFilesToTrack.Length + i] = wildcardChangeToken;
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
PageLoaderMatcherPolicyTest.cs (3)
98var values = new RouteValueDictionary[actions.Length]; 99for (var i = 0; i < actions.Length; i++) 107new int[actions.Length]);
Microsoft.AspNetCore.Mvc.Razor.Test (3)
RazorPageTest.cs (3)
1032page.BeginAddHtmlAttributeValues(executionContext, "someattr", attributeValues.Length, HtmlAttributeValueStyle.SingleQuotes); 1078page.BeginAddHtmlAttributeValues(executionContext, "someattr", attributeValues.Length, HtmlAttributeValueStyle.SingleQuotes); 1246page.BeginWriteAttribute("someattr", prefix, 0, suffix, 0, attributeValues.Length);
Microsoft.AspNetCore.Mvc.RazorPages (20)
ApplicationModels\AuthorizationPageApplicationModelProvider.cs (1)
40if (authorizeData.Length > 0)
ApplicationModels\CompiledPageActionDescriptorBuilder.cs (2)
80for (var i = 0; i < handlerDescriptors.Length; i++) 102for (var i = 0; i < parameters.Length; i++)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (1)
58for (var i = 0; i < methodParameters.Length; i++)
ApplicationModels\DefaultPageApplicationModelProvider.cs (1)
144for (var i = 0; i < methods.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Mvc.RazorPages\Release\net9.0\Microsoft.AspNetCore.Mvc.RazorPages.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Infrastructure\CompiledPageActionDescriptorFactory.cs (2)
38for (var i = 0; i < _applicationModelProviders.Length; i++) 43for (var i = _applicationModelProviders.Length - 1; i >= 0; i--)
Infrastructure\DefaultPageModelFactoryProvider.cs (1)
39for (var i = 0; i < propertyActivator.Length; i++)
Infrastructure\ExecutorFactory.cs (2)
56var unpackExpressions = new Expression[parameters.Length]; 57for (var i = 0; i < parameters.Length; i++)
Infrastructure\PageActionDescriptorProvider.cs (4)
63for (var i = 0; i < _routeModelProviders.Length; i++) 68for (var i = _routeModelProviders.Length - 1; i >= 0; i--) 83for (var i = 0; i < _conventions.Length; i++) 145for (var i = 0; i < segments.Length; i++)
Infrastructure\PageActionInvoker.cs (1)
228for (var i = 0; i < arguments.Length; i++)
Infrastructure\PageBinderFactory.cs (2)
96for (var i = 0; i < parameterBindingInfo.Length; i++) 135for (var i = 0; i < parameterBindingInfo.Length; i++)
PageLoggerExtensions.cs (2)
97var convertedArguments = new string[arguments.Length]; 98for (var i = 0; i < arguments.Length; i++)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\PageActionInvokerTest.cs (1)
1532for (var i = 0; i < handlers.Length; i++)
Microsoft.AspNetCore.Mvc.TagHelpers (14)
artifacts\obj\Microsoft.AspNetCore.Mvc.TagHelpers\Release\net9.0\Microsoft.AspNetCore.Mvc.TagHelpers.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AttributeMatcher.cs (2)
44if (allAttributesCount >= requiredAttributes.Length && 60for (var i = 0; i < requiredAttributes.Length; i++)
Cache\DistributedCacheTagHelperService.cs (10)
168var keyLength = BitConverter.GetBytes(serializedKey.Length); 170buffer.Write(keyLength, 0, keyLength.Length); 171buffer.Write(serializedKey, 0, serializedKey.Length); 172buffer.Write(value, 0, value.Length); 185buffer.Read(keyLengthBuffer, 0, keyLengthBuffer.Length); 189buffer.Read(serializedKeyBuffer, 0, serializedKeyBuffer.Length); 194decoded = new byte[value.Length - keyLengthBuffer.Length - serializedKeyBuffer.Length]; 195buffer.Read(decoded, 0, decoded.Length);
CacheTagHelper.cs (1)
264var pageLength = Math.Min(length, page.Length);
Microsoft.AspNetCore.Mvc.Test (7)
MvcServiceCollectionExtensionsTest.cs (3)
73AssertServiceCountEquals(services, serviceType.Key, serviceType.Value.Length + 1); 640if (matches.Length == 0) 646else if (matches.Length > 1)
Routing\ActionConstraintMatcherPolicyTest.cs (4)
445for (var i = 0; i < actions.Length; i++) 487var values = new RouteValueDictionary[actions.Length]; 488for (var i = 0; i < actions.Length; i++) 496new int[actions.Length]);
Microsoft.AspNetCore.Mvc.Testing (6)
.packages\microsoft.extensions.hostfactoryresolver.sources\9.0.0-preview.5.24262.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
117&& factory.GetParameters().Length == 1 235if (parameters.Length == 0)
artifacts\obj\Microsoft.AspNetCore.Mvc.Testing\Release\net9.0\Microsoft.AspNetCore.Mvc.Testing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
WebApplicationFactory.cs (3)
258for (var i = 0; i < metadataAttributes.Length; i++) 478if (handlers == null || handlers.Length == 0) 484for (var i = handlers.Length - 1; i > 0; i--)
Microsoft.AspNetCore.Mvc.ViewFeatures (37)
artifacts\obj\Microsoft.AspNetCore.Mvc.ViewFeatures\Release\net9.0\Microsoft.AspNetCore.Mvc.ViewFeatures.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
AttributeDictionary.cs (3)
229if (arrayIndex < 0 || arrayIndex >= array.Length) 408if (arrayIndex < 0 || arrayIndex >= array.Length) 513if (arrayIndex < 0 || arrayIndex >= array.Length)
Buffers\MemoryPoolViewBufferScope.cs (1)
75Array.Clear(segment, 0, segment.Length);
Buffers\PagedBufferedTextWriter.cs (2)
57var pageLength = Math.Min(length, page.Length); 82_charBuffer.Append(buffer, 0, buffer.Length);
Buffers\PagedCharBuffer.cs (4)
32length += pages[i].Length; 60var copyLength = Math.Min(count, page.Length - _charIndex); 81var copyLength = Math.Min(count, page.Length - _charIndex); 125if (CurrentPage == null || _charIndex == CurrentPage.Length)
Buffers\ViewBufferPage.cs (1)
17public int Capacity => Buffer.Length;
Buffers\ViewBufferTextWriter.cs (2)
86ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 189if (count < 0 || (buffer.Length - index < count))
Infrastructure\DefaultTempDataSerializer.cs (1)
15if (value.Length == 0)
MemberExpressionCacheKey.cs (1)
68if (_index >= _members.Length)
ModelExplorer.cs (1)
238for (var i = 0; i < PropertiesInternal.Length; i++)
ModelExplorerExtensions.cs (1)
75if (modelExplorer.PropertiesInternal.Length == 0)
src\Shared\PooledArrayBufferWriter.cs (11)
57return _rentedBuffer.Length; 67return _rentedBuffer.Length - _index; 118if (_index > _rentedBuffer.Length - count) 120ThrowInvalidOperationException(_rentedBuffer.Length); 153var availableSpace = _rentedBuffer.Length - _index; 157var growBy = Math.Max(sizeHint, _rentedBuffer.Length); 159var newSize = checked(_rentedBuffer.Length + growBy); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
ViewComponents\DefaultViewComponentDescriptorProvider.cs (2)
72if (methods.Length == 0) 77else if (methods.Length > 1)
ViewComponents\DefaultViewComponentFactory.cs (1)
57for (var i = 0; i < propertiesToActivate.Length; i++)
ViewComponents\DefaultViewComponentInvoker.cs (3)
270if (arguments == null || arguments.Length == 0) 275var formattedArguments = new string[arguments.Length]; 276for (var i = 0; i < formattedArguments.Length; i++)
ViewDataDictionaryControllerPropertyActivator.cs (2)
45for (var i = 0; i < propertiesToActivate.Length; i++) 68for (var i = 0; i < propertiesToActivate.Length; i++)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (19)
artifacts\obj\Microsoft.AspNetCore.Mvc.ViewFeatures.Test\Release\net9.0\Microsoft.AspNetCore.Mvc.ViewFeatures.Test.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Buffers\PagedBufferedTextWriterTest.cs (10)
15for (var i = 0; i < Content.Length; i++) 31for (var i = 0; i < Content.Length; i++) 70Assert.Equal(4096, Content.Length); // Update these numbers if this changes. 91for (var i = 0; i < Content.Length; i++) 122Assert.Equal(4096, Content.Length); // Update these numbers if this changes. 167Assert.Equal(4096, Content.Length); // Update these numbers if this changes. 251for (var i = 0; i < Content.Length; i++) 271for (var i = 0; i < Content.Length; i++) 291for (var i = 0; i < Content.Length; i++) 311for (var i = 0; i < Content.Length; i++)
Buffers\PagedCharBufferTest.cs (7)
339buffer.Append(laterChars, 0, laterChars.Length); 340buffer.Append(laterChars, 0, laterChars.Length); 369buffer.Append(laterChars, 0, laterChars.Length); 370buffer.Append(laterChars, 0, laterChars.Length); 398buffer.Append(laterChars, 0, laterChars.Length); 399buffer.Append(laterChars, 0, laterChars.Length); 418buffer.Append(arrayToAppend, 0, arrayToAppend.Length);
ModelExplorerTest.cs (1)
49Assert.Equal(2, properties.Length);
Microsoft.AspNetCore.OpenApi (42)
Schemas\JsonSchemaMapper\JsonSchemaMapper.ReflectionHelpers.cs (4)
164if (parameters?.Length > 0) 166Dictionary<ParameterLookupKey, ParameterInfo> dict = new(parameters.Length); 218if (constructors.Length == 1) 235else if (constructor.GetParameters().Length == 0)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
143if (index < 0 || index > MethodParameters.Length - 1) 159var parameters = new List<Expression>(paramInfos.Length); 160for (int i = 0; i < paramInfos.Length; i++) 211var parameters = new List<Expression>(paramInfos.Length); 212for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
236if (parameters.Length == 3
src\Shared\ParameterBindingMethodCache.cs (8)
313if (constructor is null || constructor.GetParameters().Length == 0) 319var lookupTable = new Dictionary<ParameterLookupKey, PropertyInfo>(properties.Length); 320for (var i = 0; i < properties.Length; i++) 333var parametersWithPropertyInfo = new ConstructorParameter[parameters.Length]; 335for (var i = 0; i < parameters.Length; i++) 364if (constructors.Length == 1) 371var parameterlessConstructor = constructors.SingleOrDefault(c => c.GetParameters().Length == 0); 395if (parameterlessConstructor is null && constructors.Length > 1)
src\Shared\PropertyAsParameterInfo.cs (16)
69if (parameters.Length == 0) 77for (var i = 0; i < parameters.Length; i++) 91List<ParameterInfo> list = new(parameters.Length); 107if (constructor is not null && constructorParameters is { Length: > 0 }) 144if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 151var mergedAttributes = new Attribute[constructorAttributes.Length + propertyAttributes.Length]; 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 162if (constructorAttributes == null || constructorAttributes is { Length: 0 }) 171var mergedAttributes = new object[constructorAttributes.Length + propertyAttributes.Length]; 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length);
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Transformers\DelegateOpenApiDocumentTransformer.cs (1)
51for (var i = 0; i < _operationTypes.Length; i++)
Microsoft.AspNetCore.OutputCaching (17)
artifacts\obj\Microsoft.AspNetCore.OutputCaching\Release\net9.0\Microsoft.AspNetCore.OutputCaching.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Memory\MemoryOutputCacheStore.cs (3)
120Size = value.Length 123if (tags != null && tags.Length > 0) 137Debug.Assert(tags.Length > 0);
OutputCacheEntryFormatter.cs (2)
510var pairs = new List<KeyValuePair<string, int>>(arr.Length); 511for (var i = 0; i < arr.Length; i++)
OutputCacheKeyProvider.cs (1)
309var valueNamesCount = orderedKeys.Length;
Policies\VaryByHeaderPolicy.cs (1)
25if (headerNames != null && headerNames.Length > 0)
Policies\VaryByQueryPolicy.cs (1)
26if (queryKeys != null && queryKeys.Length > 0)
Policies\VaryByRouteValuePolicy.cs (1)
25if (routeValueNames != null && routeValueNames.Length > 0)
RecyclableArrayBufferWriter.cs (7)
24public int FreeCapacity => _buffer.Length - _index; 37if (tmp.Length != 0) 50if (_index > _buffer.Length - count) 66Debug.Assert(_buffer.Length > _index); 73Debug.Assert(_buffer.Length > _index); 91int currentLength = _buffer.Length; 121if (oldArray.Length != 0)
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (1)
EndToEndBenchmarks.cs (1)
39if (arr.Length != 0)
Microsoft.AspNetCore.OutputCaching.Tests (5)
OutputCacheEntryFormatterTests.cs (1)
108for (int i = 0; i < arr.Length; i++)
OutputCacheTests.cs (2)
984for (int i = 0; i < clients.Length; i++) 991for (int i = 0; i < clients.Length; i++)
TestUtils.cs (2)
259Assert.Equal(expectedMessages.Length, messageList.Count); 282response.Body.Write(data, 0, data.Length);
Microsoft.AspNetCore.Owin (2)
DictionaryStringValuesWrapper.cs (1)
55if (rawValue.Length == 1 &&
OwinEnvironment.cs (1)
259if (arrayIndex + _entries.Count + _context.Items.Count > array.Length)
Microsoft.AspNetCore.RateLimiting (1)
artifacts\obj\Microsoft.AspNetCore.RateLimiting\Release\net9.0\Microsoft.AspNetCore.RateLimiting.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.AspNetCore.RateLimiting.Tests (1)
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
Microsoft.AspNetCore.Razor (1)
TagHelpers\RestrictChildrenAttribute.cs (1)
26var concatenatedNames = new string[1 + childTags.Length];
Microsoft.AspNetCore.Razor.Runtime (3)
artifacts\obj\Microsoft.AspNetCore.Razor.Runtime\Release\net9.0\Microsoft.AspNetCore.Razor.Runtime.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
Microsoft.AspNetCore.Razor.Runtime.Test (1)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (1)
579Assert.Equal(2, tagHelpers.Length);
Microsoft.AspNetCore.RequestDecompression.Tests (5)
SizeLimitedStreamTests.cs (5)
33var buffer = new byte[bytes.Length]; 57var buffer = new byte[bytes.Length]; 62while (sizeLimitedStream.Read(buffer, 0, buffer.Length) > 0) { } 81var buffer = new byte[bytes.Length]; 86var asyncResult = sizeLimitedStream.BeginRead(buffer, 0, buffer.Length, (o) => { }, null);
Microsoft.AspNetCore.ResponseCaching (10)
CacheEntry\CachedResponseBody.cs (2)
36var span = destination.GetSpan(segment.Length); 39destination.Advance(segment.Length);
ResponseCachingFeature.cs (2)
20if (value?.Length > 1) 22for (var i = 0; i < value.Length; i++)
ResponseCachingKeyProvider.cs (4)
118for (var j = 0; j < headerValuesArray.Length; j++) 139for (var i = 0; i < queryArray.Length; i++) 148for (var j = 0; j < queryValueArray.Length; j++) 172for (var j = 0; j < queryValueArray.Length; j++)
ResponseCachingMiddleware.cs (2)
492var newArray = new string[originalArray.Length]; 494for (var i = 0; i < originalArray.Length; i++)
Microsoft.AspNetCore.ResponseCaching.Tests (2)
TestUtils.cs (2)
246Assert.Equal(messageList.Count, expectedMessages.Length); 269response.Body.Write(data, 0, data.Length);
Microsoft.AspNetCore.ResponseCompression (5)
ResponseCompressionBody.cs (1)
211for (var i = 0; i < varyValues.Length; i++)
ResponseCompressionProvider.cs (4)
38if (_providers.Length == 0) 47for (var i = 0; i < _providers.Length; i++) 106for (int i = 0; i < _providers.Length; i++) 119for (int i = 0; i < _providers.Length; i++)
Microsoft.AspNetCore.ResponseCompression.Tests (8)
ResponseCompressionBodyTest.cs (3)
40stream.Write(buffer, 0, buffer.Length); 56await stream.WriteAsync(buffer, 0, buffer.Length); 88stream.BeginWrite(buffer, 0, buffer.Length, (o) => { }, null);
ResponseCompressionMiddlewareTest.cs (5)
479Assert.Equal(expectedLength, response.Content.ReadAsByteArrayAsync().Result.Length); 542Assert.Equal(expectedLength, response.Content.ReadAsByteArrayAsync().Result.Length); 605Assert.Equal(expectedLength, response.Content.ReadAsByteArrayAsync().Result.Length); 1014var read = await body.ReadAsync(data, 0, data.Length); 1279for (var i = 0; i < requestAcceptEncodings?.Length; i++)
Microsoft.AspNetCore.Rewrite (5)
artifacts\obj\Microsoft.AspNetCore.Rewrite\Release\net9.0\Microsoft.AspNetCore.Rewrite.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
RedirectToNonWwwRule.cs (1)
25if (domains.Length < 1)
RedirectToWwwRule.cs (1)
25if (domains.Length < 1)
UrlActions\CustomResponseAction.cs (2)
40response.ContentLength = content.Length; 42response.Body.Write(content, 0, content.Length);
Microsoft.AspNetCore.Routing (89)
ArrayBuilder.cs (2)
43public int Capacity => _array?.Length ?? 0; 114if (_count < result.Length)
artifacts\obj\Microsoft.AspNetCore.Routing\Release\net9.0\Microsoft.AspNetCore.Routing.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (3)
87var contentTypes = new string[additionalContentTypes.Length + 1]; 260var allContentTypes = new string[additionalContentTypes.Length + 1]; 263for (var i = 0; i < additionalContentTypes.Length; i++)
EndpointNameAddressScheme.cs (4)
61var newEntry = new Endpoint[existing.Length + 1]; 62Array.Copy(existing, newEntry, existing.Length); 63newEntry[existing.Length] = endpoint; 80if (group.Key is not null && group.Value.Length > 1)
Matching\AcceptsMatcherPolicy.cs (3)
276for (var i = 0; i < ordered.Length; i++) 292for (var i = 0; i < destinations.Length; i++) 367for (var i = 0; i < destinations.Length; i++)
Matching\Candidate.cs (4)
82for (var i = 0; i < slots.Length; i++) 90if (captures.Length > 0) 100if (complexSegments.Length > 0) 105if (constraints.Length > 0)
Matching\CandidateSet.cs (14)
41if (endpoints.Length != values.Length || endpoints.Length != scores.Length) 46Candidates = new CandidateState[endpoints.Length]; 47for (var i = 0; i < endpoints.Length; i++) 56Candidates = new CandidateState[candidates.Length]; 57for (var i = 0; i < candidates.Length; i++) 71public int Count => Candidates.Length; 246var candidates = new CandidateState[original.Length - 1 + endpoints.Count]; 284for (var i = 1; i < buffer.Length; i++) 303for (var i = index + 1; i < original.Length; i++) 327for (var i = 0; i < candidates.Length; i++) 340for (var i = 0; i < candidates.Length; i++)
Matching\ContentEncodingNegotiationMatcherPolicy.cs (1)
52for (var i = 0; i < destinations.Length; i++)
Matching\DfaMatcher.cs (9)
52var candidateCount = candidates.Length; 68var policyCount = policies.Length; 134var slots = new KeyValuePair<string, object?>[prototype.Length]; 138Array.Copy(prototype, 0, slots, 0, prototype.Length); 240for (var i = 0; i < captures.Length; i++) 282for (var i = 0; i < complexSegments.Length; i++) 303for (var i = 0; i < constraints.Length; i++) 321for (var i = 0; i < policies.Length; i++) 356=> CandidatesFound(logger, candidates.Length, path);
Matching\DfaMatcherBuilder.cs (2)
652for (var i = 0; i < _endpointSelectorPolicies.Length; i++) 891for (var i = 0; i < _nodeBuilders.Length; i++)
Matching\DfaState.cs (1)
31$"matches: {Candidates?.Length ?? 0}, " +
Matching\EndpointComparer.cs (3)
30_comparers = new IComparer<Endpoint>[2 + policies.Length]; 33for (var i = 0; i < policies.Length; i++) 94for (var i = 0; i < _comparers.Length; i++)
Matching\EndpointMetadataComparer.cs (1)
54for (var i = 0; i < comparers.Length; i++)
Matching\HostMatcherPolicy.cs (5)
203if (hosts is null || hosts.Length == 0) 208for (var j = 0; j < hosts.Length; j++) 225if (endpointKeys is null || endpointKeys.Length == 0) 242for (var j = 0; j < endpointKeys.Length; j++) 383for (var i = 0; i < destinations.Length; i++)
Matching\ILEmitTrieFactory.cs (4)
108if (groups.Length >= binarySearchThreshold) 333if (groups.Length >= binarySearchThreshold) 457if (!disableBinarySearch && groups.Length >= binarySearchThreshold) 524Debug.Assert(entries.Length == 1, "We should have a single entry");
Matching\JumpTableBuilder.cs (5)
39if (pathEntries == null || pathEntries.Length == 0) 46if (pathEntries.Length == 1 && Ascii.IsValid(pathEntries[0].text)) 53if (pathEntries.Length == 1) 70if (pathEntries.Length >= threshold) 80if (pathEntries.Length <= 10)
Matching\LinearSearchJumpTable.cs (1)
33for (var i = 0; i < entries.Length; i++)
Matching\NegotiationMatcherPolicy.cs (1)
335for (var i = 0; i < destinations.Length; i++)
ParameterPolicyActivator.cs (8)
105if (constructors.Length == 1 && GetNonConvertableParameterTypeCount(serviceProvider, constructors[0].GetParameters()) == 1) 119var matchingConstructors = GetMatchingConstructors(constructors, serviceProvider, arguments.Length); 125parameterPolicyType.Name, arguments.Length)); 169var length = constructor.GetParameters().Length; 196return parameters.Length; 200for (var i = 0; i < parameters.Length; i++) 213var parameters = new object?[parameterInfos.Length]; 215for (var i = 0; i < parameterInfos.Length; i++)
Patterns\RoutePatternFactory.cs (2)
471for (var i = 0; i < updatedSegments.Length; i++) 1120var check = checkDuplicates?.Invoke(combinedList.Length, rawText!);
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 285Debug.Assert(parameters.Length == 1); 447var filteredProperties = new List<PropertyHelper>(allProperties.Length); 560property.GetMethod.GetParameters().Length == 0;
Template\TemplateBinder.cs (9)
164var slots = new KeyValuePair<string, object?>[_slots.Length]; 165Array.Copy(_slots, 0, slots, 0, slots.Length); 174for (var i = 0; i < slots.Length; i++) 206for (var i = 0; i < requiredKeys.Length; i++) 356for (var i = 0; i < filters.Length; i++) 434for (var i = 0; i < constraints.Length; i++) 504for (var i = 0; i < parameterTransformers.Length; i++) 722var slots = new KeyValuePair<string, object?>[pattern.Parameters.Count + filters.Length]; 729for (var i = 0; i < filters.Length; i++)
Microsoft.AspNetCore.Routing.Abstractions (6)
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 285Debug.Assert(parameters.Length == 1); 447var filteredProperties = new List<PropertyHelper>(allProperties.Length); 560property.GetMethod.GetParameters().Length == 0;
Microsoft.AspNetCore.Routing.Microbenchmarks (35)
EndpointMetadataCollectionBenchmark.cs (7)
34for (var i = 0; i < _items.Length; i++) 36_items[i] = seeds[i % seeds.Length]; 47for (var i = items.Length - 1; i >= 0; i--) 52for (var i = items.Length - 1; i >= 0; i--) 57for (var i = items.Length - 1; i >= 0; i--) 62for (var i = items.Length - 1; i >= 0; i--) 67for (var i = items.Length - 1; i >= 0; i--)
EndpointRoutingBenchmarkBase.cs (1)
59for (var i = 0; i < samples.Length; i++)
Matching\CreateMatcherRegexConstraintBenchmark.cs (2)
19for (var i = 0; i < Endpoints.Length; i++) 32for (var i = 0; i < Endpoints.Length; i++)
Matching\JumpTableMultipleEntryBenchmark.cs (9)
28for (var i = 0; i < _strings.Length; i++) 34for (var i = 0; i < samples.Length; i++) 36samples[i] = i * (_strings.Length / Count); 40for (var i = 0; i < samples.Length; i++) 60for (var i = 0; i < strings.Length; i++) 95for (var i = 0; i < strings.Length; i++) 110for (var i = 0; i < strings.Length; i++) 125for (var i = 0; i < strings.Length; i++) 140for (var i = 0; i < strings.Length; i++)
Matching\JumpTableSingleEntryBenchmark.cs (5)
51for (var i = 0; i < strings.Length; i++) 86for (var i = 0; i < strings.Length; i++) 101for (var i = 0; i < strings.Length; i++) 116for (var i = 0; i < strings.Length; i++) 131for (var i = 0; i < strings.Length; i++)
Matching\JumpTableZeroEntryBenchmark.cs (2)
43for (var i = 0; i < strings.Length; i++) 58for (var i = 0; i < strings.Length; i++)
Matching\MatcherBuilderMultipleEntryBenchmark.cs (1)
64for (int i = 0; i < Endpoints.Length; i++)
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcher.cs (4)
25for (var i = 0; i < Matchers.Length; i++) 60var comparand = _segments.Length > segment ? _segments[segment] : null; 83var comparand = _segments.Length > segment ? _segments[segment] : null; 100return segment == _segments.Length;
src\Http\Routing\test\UnitTests\Matching\RouteMatcherBuilder.cs (2)
86_values = new RouteValueDictionary[_candidates.Length]; 87_scores = new int[_candidates.Length];
src\Http\Routing\test\UnitTests\Matching\TreeRouterMatcherBuilder.cs (2)
88_values = new RouteValueDictionary[_candidates.Length]; 89_scores = new int[_candidates.Length];
Microsoft.AspNetCore.Routing.Tests (43)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (2)
84Assert.Equal(3, metadataArray.Length); 1115for (var i = 0; i < otherContentTypes.Length; i++)
DefaultLinkGeneratorTest.cs (3)
637for (int i = 0; i < routeNames.Length; i++) 676for (int i = 0; i < routeNames.Length; i++) 714for (int i = 0; i < routeNames.Length; i++)
Matching\AcceptsMatcherPolicyTest.cs (2)
621return new CandidateSet(endpoints, new RouteValueDictionary[endpoints.Length], new int[endpoints.Length]);
Matching\BarebonesMatcher.cs (4)
25for (var i = 0; i < Matchers.Length; i++) 60var comparand = _segments.Length > segment ? _segments[segment] : null; 83var comparand = _segments.Length > segment ? _segments[segment] : null; 100return segment == _segments.Length;
Matching\BarebonesMatcherConformanceTest.cs (1)
48for (var i = 0; i < endpoints.Length; i++)
Matching\CandidateSetTest.cs (11)
19for (var i = 0; i < endpoints.Length; i++) 50for (var i = 0; i < endpoints.Length; i++) 83for (var i = 0; i < endpoints.Length; i++) 113for (var i = 0; i < endpoints.Length; i++) 149for (var i = 0; i < endpoints.Length; i++) 199for (var i = 0; i < endpoints.Length; i++) 256for (var i = 0; i < endpoints.Length; i++) 306for (var i = 0; i < endpoints.Length; i++) 338for (var i = 0; i < endpoints.Length; i++) 344for (var i = 0; i < endpoints.Length; i++) 373for (var i = 0; i < metadata.Length; i++)
Matching\DefaultEndpointSelectorTest.cs (1)
187return new CandidateSet(endpoints, new RouteValueDictionary[endpoints.Length], scores);
Matching\DfaMatcherConformanceTest.cs (1)
72for (var i = 0; i < endpoints.Length; i++)
Matching\DfaMatcherTest.cs (1)
39for (var i = 0; i < policies.Length; i++)
Matching\HostMatcherPolicyIntegrationTestBase.cs (1)
376for (var i = 0; i < endpoints.Length; i++)
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (1)
355for (var i = 0; i < endpoints.Length; i++)
Matching\HttpMethodMatcherPolicyTest.cs (1)
167var candidates = new CandidateSet(endpoints, new RouteValueDictionary[endpoints.Length], Enumerable.Repeat<int>(-1, candidateNum).ToArray());
Matching\MatcherAssert.cs (2)
46if (keys.Length != values.Length)
Matching\RouteMatcherBuilder.cs (2)
86_values = new RouteValueDictionary[_candidates.Length]; 87_scores = new int[_candidates.Length];
Matching\RouteMatcherConformanceTest.cs (1)
44for (var i = 0; i < endpoints.Length; i++)
Matching\TreeRouterMatcherBuilder.cs (2)
88_values = new RouteValueDictionary[_candidates.Length]; 89_scores = new int[_candidates.Length];
Matching\TreeRouterMatcherConformanceTest.cs (1)
58for (var i = 0; i < endpoints.Length; i++)
PathTokenizerTest.cs (2)
88Assert.Equal(expectedSegments.Length, count); 99for (var i = 0; i < expectedSegments.Length; i++)
RouteCollectionTest.cs (1)
508int index = Random.Shared.Next(0, routeNames.Length - 1);
Tree\TreeRouterTest.cs (3)
141for (var i = 0; i < routeValueKeys.Length; i++) 193for (var i = 0; i < routeValueKeys.Length; i++) 236for (var i = 0; i < routeValueKeys.Length; i++)
Microsoft.AspNetCore.Server.HttpSys (15)
artifacts\obj\Microsoft.AspNetCore.Server.HttpSys\Release\net9.0\Microsoft.AspNetCore.Server.HttpSys.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Helpers.cs (1)
84return new ArraySegment<byte>(header, offset, header.Length - offset);
RequestProcessing\ClientCertLoader.cs (1)
279Marshal.Copy((IntPtr)pClientCertInfo->pCertEncoded, certEncoded, 0, certEncoded.Length);
RequestProcessing\HttpReasonPhrase.cs (1)
93if (j < HttpReasonPhrases[i]!.Length)
RequestProcessing\RequestContext.cs (1)
226(uint)buffer.Length,
RequestProcessing\Response.cs (1)
136for (var i = 0; i < StatusWithNoResponseBody.Length; i++)
RequestProcessing\ResponseStreamAsyncResult.cs (6)
54objectsToPin = new object[_dataChunks.Length + 1]; 94Debug.Assert(currentChunk == _dataChunks.Length); 115object[] objectsToPin = new object[_dataChunks.Length]; 116objectsToPin[_dataChunks.Length - 1] = _dataChunks; 135Debug.Assert(currentChunk == _dataChunks.Length); 204return (ushort)_dataChunks.Length;
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length); 811Marshal.Copy((IntPtr)clientCert, certEncoded, 0, certEncoded.Length);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (118)
artifacts\obj\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
HttpsTests.cs (4)
43httpContext.Response.ContentLength = body.Length; 44return httpContext.Response.Body.WriteAsync(body, 0, body.Length); 60httpContext.Response.ContentLength = body.Length; 61await httpContext.Response.Body.WriteAsync(body, 0, body.Length);
Listener\RequestBodyTests.cs (13)
31Assert.Throws<InvalidOperationException>(() => context.Request.Body.Read(input, 0, input.Length)); 36var read = context.Request.Body.Read(input, 0, input.Length); 59Task<int> task = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 81int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 84read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 106int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 109read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 130int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 132var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 155int read = await context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 158var readTask = context.Request.Body.ReadAsync(input, 0, input.Length, cts.Token); 182int read = await context.Request.Body.ReadAsync(input, 0, input.Length, context.DisconnectToken); 185var assertTask = Assert.ThrowsAsync<IOException>(async () => await context.Request.Body.ReadAsync(input, 0, input.Length, context.DisconnectToken));
Listener\ResponseBodyTests.cs (11)
72Assert.Equal(20, (await response.Content.ReadAsByteArrayAsync()).Length); 256context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 261Assert.Throws<ObjectDisposedException>(() => context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length)); 292await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 297await Assert.ThrowsAsync<ObjectDisposedException>(() => context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length)); 325context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 352await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 390context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 429await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 466context.Response.Body.Write(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length); 500await context.Response.Body.WriteAsync(Utilities.WriteBuffer, 0, Utilities.WriteBuffer.Length);
OpaqueUpgradeTests.cs (4)
226int read = await opaqueStream.ReadAsync(buffer, 0, buffer.Length); 240int read = await stream.ReadAsync(data, 0, data.Length); 352await stream.WriteAsync(requestBytes, 0, requestBytes.Length); 391await stream.WriteAsync(requestBytes, 0, requestBytes.Length);
RequestBodyLimitTests.cs (24)
31int read = httpContext.Request.Body.Read(input, 0, input.Length); 54int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 75int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 98int read = httpContext.Request.Body.Read(input, 0, input.Length); 121int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 142int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 165var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 168ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 190var ex = Assert.Throws<BadHttpRequestException>(() => { var t = httpContext.Request.Body.ReadAsync(input, 0, input.Length); }); 193ex = Assert.Throws<BadHttpRequestException>(() => { var t = httpContext.Request.Body.ReadAsync(input, 0, input.Length); }); 215var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 218ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 241var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 244ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 266var ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length)); 269ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length)); 291var ex = Assert.Throws<BadHttpRequestException>(() => body.EndRead(body.BeginRead(input, 0, input.Length, null, null))); 294ex = Assert.Throws<BadHttpRequestException>(() => body.EndRead(body.BeginRead(input, 0, input.Length, null, null))); 318int read = httpContext.Request.Body.Read(input, 0, input.Length); 321var ex = Assert.Throws<BadHttpRequestException>(() => httpContext.Request.Body.Read(input, 0, input.Length)); 344int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 347var ex = await Assert.ThrowsAsync<BadHttpRequestException>(() => httpContext.Request.Body.ReadAsync(input, 0, input.Length)); 370int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 394int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length);
RequestBodyTests.cs (17)
32int read = httpContext.Request.Body.Read(input, 0, input.Length); 54read = httpContext.Request.Body.Read(input, 0, input.Length); 73int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 93read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 110int read = httpContext.Request.Body.EndRead(httpContext.Request.Body.BeginRead(input, 0, input.Length, null, null)); 131Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, input.Length + 1, 1)); 133Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 1, input.Length)); 134Assert.Throws<ArgumentOutOfRangeException>("count", () => httpContext.Request.Body.Read(input, 0, input.Length + 1)); 152int read = httpContext.Request.Body.Read(input, 0, input.Length); 155read = httpContext.Request.Body.Read(input, 0, input.Length); 173int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 176read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 192int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 194read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 202Assert.Equal(13, lines.Length); 229int read = await httpContext.Request.Body.ReadAsync(input, 0, input.Length); 322await stream.WriteAsync(requestBytes, 0, requestBytes.Length);
RequestTests.cs (5)
66httpContext.Response.Body.Write(body, 0, body.Length); 130httpContext.Response.Body.Write(body, 0, body.Length); 193httpContext.Response.Body.Write(body, 0, body.Length); 237httpContext.Response.Body.Write(body, 0, body.Length); 334httpContext.Response.Body.Write(body, 0, body.Length);
ResponseBodyTests.cs (5)
85Assert.True(0 < (await response.Content.ReadAsByteArrayAsync()).Length); 104Assert.True(0 < (await response.Content.ReadAsByteArrayAsync()).Length); 159Assert.Equal(WriteSize * NumWrites, bytes.Length); 195await stream.WriteAsync(responseBytes, 0, responseBytes.Length); 411httpContext.Response.ContentLength = data.Length;
ResponseHeaderTests.cs (1)
194return response.Body.WriteAsync(responseBytes, 0, responseBytes.Length);
ResponseSendFileTests.cs (11)
75Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 94Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 113Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 133Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length); 152Assert.Equal(FileLength / 2, (await response.Content.ReadAsByteArrayAsync()).Length); 230Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 251Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 300Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 323Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 345Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length); 363Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length);
ServerTests.cs (1)
668await stream.WriteAsync(requestBytes, 0, requestBytes.Length);
src\Shared\Http2cat\Http2Utilities.cs (4)
410frame.PayloadLength = payload.Length; 444frame.PayloadLength = payload.Length; 514frame.PayloadLength = headerBlock.Length; 579frame.PayloadLength = payload.Length;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
Microsoft.AspNetCore.Server.IIS (17)
artifacts\obj\Microsoft.AspNetCore.Server.IIS\Release\net9.0\Microsoft.AspNetCore.Server.IIS.CoreStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Core\IISHttpContext.cs (4)
420(uint)buffer.Length, 614NativeMethods.HttpResponseSetUnknownHeader(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst); 619NativeMethods.HttpResponseSetKnownHeader(_requestNativeHandle, knownHeaderIndex, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst); 653NativeMethods.HttpResponseSetTrailer(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, replace: isFirst);
Core\IISHttpContext.FeatureCollection.cs (1)
394Marshal.Copy((IntPtr)NativeRequest->pSslInfo->pClientCertInfo->pCertEncoded, rawCertificateCopy, 0, rawCertificateCopy.Length);
Core\IO\AsyncWriteOperationBase.cs (1)
101if (_handles == null || _handles.Length < nChunks)
NativeMethods.cs (1)
333http_set_startup_error_page_content(bytePtr, content.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\ErrorPage\ErrorPage.Designer.cs (1)
397if (reflectionTypeLoadException.LoaderExceptions.Length > 0)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length); 811Marshal.Copy((IntPtr)clientCert, certEncoded, 0, certEncoded.Length);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (2)
314var filesOnDisk = new string[embeddedFileNames.Length]; 315for (var i = 0; i < embeddedFileNames.Length; i++)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
IISExpressDeployer.cs (1)
504var length = WindowsNativeMethods.GetClassName(ptr, buffer, buffer.Length);
LoggingHandler.cs (1)
46} while (count != 0 && offset != buffer.Length);
Microsoft.AspNetCore.Server.Kestrel.Core (153)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net9.0\Microsoft.AspNetCore.Server.Kestrel.Core.CoreStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Core\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Internal\AddressBinder.cs (2)
37var hasListenOptions = listenOptions.Length > 0; 38var hasAddresses = addresses.Length > 0;
Internal\ConfigurationReader.cs (3)
191if (childrenSections.Length > 0) 193stringProtocols = new string[childrenSections.Length]; 194for (var i = 0; i < childrenSections.Length; i++)
Internal\Http\Http1OutputProducer.cs (1)
671if (_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)
659if (_fakeMemory.Length < minSize)
Internal\Http3\Http3OutputProducer.cs (1)
233if (_fakeMemory.Length < minSize)
Internal\Http3\QPack\EncoderStreamReader.cs (2)
244if (length > _stringOctets.Length) 301_headerNameLength = header.Name.Length;
Internal\Infrastructure\HttpUtilities.cs (5)
42var length = knownMethods.Length; 213if ((uint)index < (uint)knownMethods.Length) 265Debug.Assert(WordListForPerfectHashOfMethods.Length == (MaxHashValue + 1) && methodsLookup.Length == (MaxHashValue + 1)); 269if (index < (uint)WordListForPerfectHashOfMethods.Length 458if ((uint)methodIndex < (uint)methodNames.Length)
src\Servers\Kestrel\shared\PooledStreamStack.cs (4)
37if ((uint)size >= (uint)array.Length) 54if ((uint)size >= (uint)array.Length) 70if ((uint)size < (uint)array.Length) 85Array.Resize(ref _array, 2 * _array.Length);
src\Shared\Buffers\BufferSegmentStack.cs (3)
28if ((uint)size >= (uint)array.Length) 46if ((uint)size < (uint)array.Length) 61Array.Resize(ref _array, 2 * _array.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
36_hashMask = (byte)(_headerBuckets.Length - 1);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\runtime\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\Shared\runtime\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (1)
674else if (buffer.Length < requiredLength)
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (3)
237int valueLength = separator.Length * (values.Length - 1); 269buffer = buffer.Slice(separator.Length); 284buffer = buffer.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (160)
AsciiDecoding.cs (5)
30for (var i = 0; i <= byteArray.Length; i++) 79Assert.Equal(expectedByteRange.Length, s.Length); 81for (var i = 0; i < expectedByteRange.Length; i++) 96for (var i = 1; i < byteRange.Length; i++) 128for (var i = 0; i <= byteArray.Length; i++)
BufferWriterTests.cs (4)
46for (var i = 0; i < array.Length; i++) 52writer.Write(new Span<byte>(array, array.Length, 0)); 64writer.Write(new Span<byte>(array, 0, array.Length)); 98writer.Write(new Span<byte>(array, 0, array.Length));
Http2\Http2HPackEncoderTests.cs (12)
491Assert.Equal(expectedPayload.Length, length); 550var sliceLength = expectedStatusCodePayload.Length + (exactSize ? 0 : expectedDateHeaderPayload.Length - 1); 552Assert.Equal(expectedStatusCodePayload.Length, length); 557sliceLength = expectedDateHeaderPayload.Length + (exactSize ? 0 : expectedContentTypeHeaderPayload.Length - 1); 559Assert.Equal(expectedDateHeaderPayload.Length, length); 564sliceLength = expectedContentTypeHeaderPayload.Length + (exactSize ? 0 : expectedServerHeaderPayload.Length - 1); 566Assert.Equal(expectedContentTypeHeaderPayload.Length, length); 571sliceLength = expectedServerHeaderPayload.Length; 573Assert.Equal(expectedServerHeaderPayload.Length, length);
HttpParserTests.cs (1)
832Assert.Equal(expectedHeaderNames.Count(), parsedHeaders.Length);
HttpRequestHeadersTests.cs (6)
524for (var i = 0; i < headerValue.Length; i++) 529for (var i = 0; i < headerValue.Length; i++) 585for (var i = 0; i < headerValue.Length; i++) 590for (var i = 0; i < headerValue.Length; i++) 641for (var i = 0; i < valueArray.Length; i++) 646for (var i = 1; i < valueArray.Length; i++)
MessageBodyTests.cs (27)
44var count = stream.Read(buffer, 0, buffer.Length); 48count = stream.Read(buffer, 0, buffer.Length); 170var count = await stream.ReadAsync(buffer, 0, buffer.Length); 174count = await stream.ReadAsync(buffer, 0, buffer.Length); 197var count = stream.Read(buffer, 0, buffer.Length); 203count = stream.Read(buffer, 0, buffer.Length); 222var task = stream.ReadAsync(buffer, 0, buffer.Length); 247var task = stream.ReadAsync(buffer, 0, buffer.Length); 280await stream.ReadAsync(buffer, 0, buffer.Length); 318var count = await stream.ReadAsync(buffer, 0, buffer.Length); 324count = await stream.ReadAsync(buffer, 0, buffer.Length); 344var readTask = stream.ReadAsync(buffer, 0, buffer.Length); 353var res = await stream.ReadAsync(buffer, 0, buffer.Length); 379await stream.ReadAsync(buffer, 0, buffer.Length)); 403await stream.ReadAsync(buffer, 0, buffer.Length)); 430var count = stream.Read(buffer, 0, buffer.Length); 457var count = await stream.ReadAsync(buffer, 0, buffer.Length); 485Assert.Equal(0, stream.Read(buffer, 0, buffer.Length)); 507Assert.Equal(0, await stream.ReadAsync(buffer, 0, buffer.Length)); 535Assert.Equal(8197, requestArray.Length); 536AssertASCII(largeInput + "Hello", new ArraySegment<byte>(requestArray, 0, requestArray.Length)); 666Assert.Equal(5, await stream.ReadAsync(buffer, 0, buffer.Length)); 693Assert.Equal(5, await stream.ReadAsync(buffer, 0, buffer.Length)); 1404Assert.Equal(bytes.Length, actual.Count); 1405for (var index = 0; index < bytes.Length; index++) 1416Assert.Equal(bytes.Length, actual.Length); 1417for (var index = 0; index < bytes.Length; index++)
PipelineExtensionTests.cs (3)
72var written = reader.Buffer.Slice(spacer.Length, numAsString.Length); 98if (expected.Length > 0) 176var written = reader.Buffer.Slice(spacer.Length, stringLength);
src\Servers\Kestrel\shared\KnownHeaders.cs (7)
773Debug.Assert(requestHeaders.Length <= 64); 778Debug.Assert(responseHeaders.Length <= 63); 816header.BytesCount += header.Bytes.Length; 1403{(!loop.ClassName.Contains("Trailers") ? $@"case {loop.Headers.Length - 1}: // Header: ""Content-Length"" 1428{(!loop.ClassName.Contains("Trailers") ? $@"_next = _collection._contentLength.HasValue ? {loop.Headers.Length - 1} : -1;" : "_next = -1;")} 1439? {loop.Headers.Length - 1} 1451return @$"private readonly static HashSet<string> _internedHeaderNames = new HashSet<string>({DefinedHeaderNames.Length}, StringComparer.OrdinalIgnoreCase)
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
149for (int i = intermediates.Length - 1; i >= 0; i--)
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
24frame.PayloadLength = payload.Length;
src\Servers\Kestrel\shared\test\RevocationResponder.cs (6)
189Trace($"Responded with {certData.Length}-byte certificate from {authority.SubjectName}."); 207Trace($"Responded with {crl.Length}-byte CRL from {authority.SubjectName}."); 252Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName} delegated to {authority.OcspResponderSubjectName}"); 256Trace($"OCSP Response: {ocspResponse.Length} bytes from {authority.SubjectName}"); 313int read = stream.Read(requestBytes, 0, requestBytes.Length); 314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Servers\Kestrel\shared\test\TestApp.cs (10)
20if (buffer.Length > 0) 23await response.Body.WriteAsync(buffer, 0, buffer.Length); 35response.Headers.ContentLength = bytes.Length; 36await response.Body.WriteAsync(bytes, 0, bytes.Length); 50if (buffer.Length > 0) 54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 69response.Headers.ContentLength = bytes.Length; 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (4)
157Debug.Assert(data.Length == 16); 160insertedSize += data.Length * 2 + HeaderField.RfcOverhead; 239Assert.Equal(entries.Length, dynamicTable.Count); 242for (int i = 0; i < entries.Length; i++)
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (14)
68private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length } 78private static readonly byte[] _headerNameHuffman = new byte[] { (byte)(0x80 | _headerNameHuffmanBytes.Length) } 82private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 86private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 461_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 462_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 477_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 478_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 650for (int i = 0; i < encoded.Length; i++) 652bool end = i + 1 == encoded.Length; 675for (int i = 0; i < segments.Length; i++) 677bool end = i + 1 == segments.Length; 837for (int i = 0; i < encoded.Length; i++) 839bool end = i + 1 == encoded.Length;
src\Shared\test\Shared.Tests\runtime\Http2\HPackIntegerTest.cs (6)
20Assert.Equal(expectedResult.Length, bytesWritten); 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 43for (; !finished && i < encoded.Length; ++i) 49Assert.Equal(encoded.Length, i); 98for (var j = 1; j < octets.Length - 1; j++) 103Assert.Throws<HPackDecodingException>(() => decoder.TryDecode(octets[octets.Length - 1], out intResult));
src\Shared\test\Shared.Tests\runtime\Http2\HuffmanDecodingTests.cs (12)
29for (int i = 0; i < source.Length; i++) 68byte[] encoded = new byte[input.Length * 4]; 72byte[] decoded = new byte[encoded.Length * 2]; 76Assert.Equal(input.Length, decodedByteCount); 87byte[] decoded = new byte[encoded.Length * 2]; 249byte[] dst = new byte[expected.Length]; 250Assert.Equal(expected.Length, Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 270byte[] dst = new byte[encoded.Length * 2]; 287byte[] dst = new byte[encoded.Length * 2]; 297byte[] originalDestination = new byte[encoded.Length]; 332byte[] dst = new byte[encoded.Length * 2]; 344int decodedLength = Huffman.Decode(new ReadOnlySpan<byte>(encoded, 0, encoded.Length), ref decodedBytes);
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (9)
51private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 55private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 236_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 237_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 252_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 253_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 341for (int i = 0; i < encoded.Length; i += chunkSize) 343int resolvedSize = Math.Min(encoded.Length - i, chunkSize); 344bool end = i + resolvedSize == encoded.Length;
TestHelpers\AssertExtensions.cs (3)
13if (expected.Length != actual.Length) 15throw new XunitException($"Expected length to be {expected.Length} but was {actual.Length}"); 18for (var i = 0; i < expected.Length; i++)
UTF8Decoding.cs (4)
32for (var length = bytes.Length; length < Vector<sbyte>.Count * 4 + bytes.Length; length++) 34for (var position = 0; position <= length - bytes.Length; position++) 37Array.Copy(bytes, 0, byteRange, position, bytes.Length);
VariableIntHelperTests.cs (2)
27Assert.Equal(expected.Length, encodedLength); 28for (var i = 0; i < expected.Length; i++)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (24)
Http1LargeWritingBenchmark.cs (3)
40_http1Connection.RequestHeaders.ContentLength = _writeData.Length; 47return _http1Connection.ResponseBody.WriteAsync(_writeData, 0, _writeData.Length, default); 54var segmentSize = _writeData.Length / 10;
Http1ReadingBenchmark.cs (1)
56_http1Connection.RequestHeaders.ContentLength = _readData.Length;
Http1WritingBenchmark.cs (2)
62_http1Connection.RequestHeaders.ContentLength = _writeData.Length; 96return _http1Connection.ResponseBody.WriteAsync(_writeData, 0, _writeData.Length, default(CancellationToken));
Http2\HPackDecoderBenchmark.cs (2)
22private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length } 30private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length }
Http2\Http2ConnectionHeadersBenchmark.cs (1)
27for (var i = 0; i < _headerNames.Length; i++)
HttpParserBenchmark.cs (1)
22var split = RequestParsingData.UnicodeRequest.Length / 2;
InMemoryTransportBenchmark.cs (1)
261var payloadLength = _helloWorldPayload.Length;
IntegerDecoderBenchmark.cs (1)
35for (var j = 1; j < _multiByte.Length; j++)
NamedPipesTransportBenchmark.cs (3)
70await clientStream.ReadAtLeastAsync(_responseBuffer, _responseBuffer.Length); 108await namedPipeClient.ReadAtLeastAsync(_responseBuffer, _responseBuffer.Length); 159var payloadLength = _helloWorldPayload.Length;
ResponseHeadersWritingBenchmark.cs (2)
73responseHeaders.ContentLength = _helloWorldPayload.Length; 152responseHeaders.ContentLength = _helloWorldPayload.Length;
SchedulerBenchmark.cs (5)
40for (var i = 0; i < _inlineSchedulers.Length; i++) 46for (var i = 0; i < _threadPoolSchedulers.Length; i++) 52for (var i = 0; i < _ioQueueSchedulers.Length; i++) 63for (var i = 0; i < _counters.Length; i++) 101PipeScheduler pipeScheduler = schedulers[i % schedulers.Length];
src\Servers\Kestrel\shared\test\PipeWriterHttp2FrameExtensions.cs (1)
24frame.PayloadLength = payload.Length;
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
143Assert.Equal(2, serverOptions.GetListenOptions().Length);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Internal\NamedPipeConnectionListener.cs (1)
75for (var i = 0; i < listeningTasks.Length; i++)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (5)
src\Servers\Kestrel\shared\PooledStreamStack.cs (4)
37if ((uint)size >= (uint)array.Length) 54if ((uint)size >= (uint)array.Length) 70if ((uint)size < (uint)array.Length) 85Array.Resize(ref _array, 2 * _array.Length);
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (34)
QuicConnectionContextTests.cs (12)
109var read = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 174var read = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 217var read = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 222var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 268if (data.Count == TestData.Length) 331var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 374var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 420var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 469var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 599var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 653var readResult1 = await serverStream1.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 681var readResult2 = await serverStream2.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout();
QuicStreamContextTests.cs (13)
70var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 123var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 189var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 208Assert.Equal(testData.Length, data.Length); 266var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 310var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 344var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 383var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 417var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 458var data = await clientStream.ReadAtLeastLengthAsync(TestData.Length).DefaultTimeout(); 500var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout(); 503var serverReadTask = serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).AsTask();
QuicTestHelpers.cs (1)
155var readResult = await serverStream.Transport.Input.ReadAtLeastAsync(TestData.Length).DefaultTimeout();
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (2)
artifacts\obj\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets\Release\net9.0\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketsStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
src\Shared\Buffers.MemoryPool\MemoryPoolBlock.cs (1)
19Memory = MemoryMarshal.CreateFromPinnedArray(pinnedArray, 0, pinnedArray.Length);
Microsoft.AspNetCore.Session (13)
artifacts\obj\Microsoft.AspNetCore.Session\Release\net9.0\Microsoft.AspNetCore.Session.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
DistributedSession.cs (7)
146if (encodedKey.KeyBytes.Length > KeyLengthLimit) 157var copy = new byte[value.Length]; 158Buffer.BlockCopy(src: value, srcOffset: 0, dst: copy, dstOffset: 0, count: value.Length); 326SerializeNumAs2Bytes(output, keyBytes.Length); 327output.Write(keyBytes, 0, keyBytes.Length); 328SerializeNumAs4Bytes(output, entry.Value.Length); 329output.Write(entry.Value, 0, entry.Value.Length);
EncodedKey.cs (4)
32_keyString = Encoding.UTF8.GetString(KeyBytes, 0, KeyBytes.Length); 47if (KeyBytes.Length != otherKey.KeyBytes.Length) 56for (int i = 0; i < KeyBytes.Length; i++)
SipHash.cs (1)
31uint inlen = (uint)bytes.Length;
Microsoft.AspNetCore.Shared.Tests (148)
AdaptiveCapacityDictionaryTests.cs (3)
1177Assert.Equal(10, storage.Length); 1207Assert.Equal(10, storage.Length); 1237Assert.Equal(10, storage.Length);
artifacts\obj\Microsoft.AspNetCore.Shared.Tests\Release\net9.0\Microsoft.AspNetCore.Server.SharedStrings.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\Microsoft.AspNetCore.Shared.Tests\Release\net9.0\System.Net.Http.SR.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
PropertyActivatorTest.cs (1)
133Assert.Equal(5, propertiesToActivate.Length);
PropertyHelperTest.cs (8)
236Assert.Equal(2, helpers.Length); 256Assert.Equal(2, helpers.Length); 276Assert.Equal(2, helpers.Length); 329Assert.Equal(3, result.Length); 360Assert.Equal(2, result.Length); 377Assert.Equal(2, result.Length); 409Assert.Equal(2, result.Length); 426Assert.Equal(2, result.Length);
runtime\Http2\DynamicTableTest.cs (4)
157Debug.Assert(data.Length == 16); 160insertedSize += data.Length * 2 + HeaderField.RfcOverhead; 239Assert.Equal(entries.Length, dynamicTable.Count); 242for (int i = 0; i < entries.Length; i++)
runtime\Http2\HPackDecoderTest.cs (14)
68private static readonly byte[] _headerName = new byte[] { (byte)_headerNameBytes.Length } 78private static readonly byte[] _headerNameHuffman = new byte[] { (byte)(0x80 | _headerNameHuffmanBytes.Length) } 82private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 86private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 461_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 462_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 477_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 478_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 650for (int i = 0; i < encoded.Length; i++) 652bool end = i + 1 == encoded.Length; 675for (int i = 0; i < segments.Length; i++) 677bool end = i + 1 == segments.Length; 837for (int i = 0; i < encoded.Length; i++) 839bool end = i + 1 == encoded.Length;
runtime\Http2\HPackIntegerTest.cs (6)
20Assert.Equal(expectedResult.Length, bytesWritten); 28Span<byte> actualResult = new byte[expectedResult.Length - 1]; 43for (; !finished && i < encoded.Length; ++i) 49Assert.Equal(encoded.Length, i); 98for (var j = 1; j < octets.Length - 1; j++) 103Assert.Throws<HPackDecodingException>(() => decoder.TryDecode(octets[octets.Length - 1], out intResult));
runtime\Http2\HuffmanDecodingTests.cs (12)
29for (int i = 0; i < source.Length; i++) 68byte[] encoded = new byte[input.Length * 4]; 72byte[] decoded = new byte[encoded.Length * 2]; 76Assert.Equal(input.Length, decodedByteCount); 87byte[] decoded = new byte[encoded.Length * 2]; 249byte[] dst = new byte[expected.Length]; 250Assert.Equal(expected.Length, Huffman.Decode(new ReadOnlySpan<byte>(encoded), ref dst)); 270byte[] dst = new byte[encoded.Length * 2]; 287byte[] dst = new byte[encoded.Length * 2]; 297byte[] originalDestination = new byte[encoded.Length]; 332byte[] dst = new byte[encoded.Length * 2]; 344int decodedLength = Huffman.Decode(new ReadOnlySpan<byte>(encoded, 0, encoded.Length), ref decodedBytes);
runtime\Http3\QPackDecoderTest.cs (9)
51private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } 55private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } 236_decoder.Decode(encoded[..^_headerValue.Length], endHeaders: false, handler: _handler); 237_decoder.Decode(encoded[^_headerValue.Length..], endHeaders: true, handler: _handler); 252_decoder.Decode(encoded[..^(_headerValue.Length - 1)], endHeaders: false, handler: _handler); 253_decoder.Decode(encoded[^(_headerValue.Length - 1)..], endHeaders: true, handler: _handler); 341for (int i = 0; i < encoded.Length; i += chunkSize) 343int resolvedSize = Math.Min(encoded.Length - i, chunkSize); 344bool end = i + resolvedSize == encoded.Length;
SegmentWriteStreamTests.cs (12)
55Assert.Equal(WriteData.Length, stream.Length); 56Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count); 58for (var i = 0; i < WriteData.Length; i += segmentSize) 60var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i); 68Assert.Equal(expectedSegmentSize, segment.Length); 82for (var i = 0; i < WriteData.Length; i += writeSize) 84stream.Write(WriteData, i, Math.Min(writeSize, WriteData.Length - i)); 88Assert.Equal(WriteData.Length, stream.Length); 89Assert.Equal((WriteData.Length + segmentSize - 1) / segmentSize, segments.Count); 91for (var i = 0; i < WriteData.Length; i += segmentSize) 93var expectedSegmentSize = Math.Min(segmentSize, WriteData.Length - i); 101Assert.Equal(expectedSegmentSize, segment.Length);
src\Shared\ActivatorUtilities\ActivatorUtilities.cs (4)
107_parameterValues = new object?[_parameters.Length]; 114for (var givenIndex = 0; givenIndex != givenParameters.Length; givenIndex++) 119for (var applyIndex = applyIndexStart; givenMatched == false && applyIndex != _parameters.Length; ++applyIndex) 147for (var index = 0; index < _parameters.Length; index++)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
src\Shared\Debugger\DictionaryDebugView.cs (2)
25var items = new DictionaryItemDebugView<TKey, TValue>[keyValuePairs.Length]; 26for (int i = 0; i < items.Length; i++)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
163for (var i = 0; i < keys.Length; i++) 188for (var i = 0; i < values.Length; i++) 297if ((uint)arrayIndex > array.Length || array.Length - arrayIndex < this.Count) 505if (_arrayStorage!.Length >= capacity) 530capacity = _arrayStorage.Length == 0 ? DefaultArrayThreshold : _arrayStorage.Length * 2; 546Debug.Assert(_count <= _arrayStorage.Length);
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
36_hashMask = (byte)(_headerBuckets.Length - 1);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length); 811Marshal.Copy((IntPtr)clientCert, certEncoded, 0, certEncoded.Length);
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
143if (index < 0 || index > MethodParameters.Length - 1) 159var parameters = new List<Expression>(paramInfos.Length); 160for (int i = 0; i < paramInfos.Length; i++) 211var parameters = new List<Expression>(paramInfos.Length); 212for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
236if (parameters.Length == 3
src\Shared\PropertyActivator\PropertyActivator.cs (1)
90property.GetIndexParameters().Length == 0 &&
src\Shared\PropertyHelper\PropertyHelper.cs (6)
200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 210Debug.Assert(getMethod.GetParameters().Length == 0); 285Debug.Assert(parameters.Length == 1); 447var filteredProperties = new List<PropertyHelper>(allProperties.Length); 560property.GetMethod.GetParameters().Length == 0;
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\Shared\runtime\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\Shared\runtime\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\Shared\runtime\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
src\Shared\runtime\Http3\QPack\QPackDecoder.cs (1)
674else if (buffer.Length < requiredLength)
src\Shared\runtime\Http3\QPack\QPackEncoder.cs (3)
237int valueLength = separator.Length * (values.Length - 1); 269buffer = buffer.Slice(separator.Length); 284buffer = buffer.Slice(separator.Length);
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
227for (int i = 0; i < settings.Length; i++)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (3)
39var frames = new List<StackFrameInfo>(stackFrames.Length); 43for (var i = 0; i < stackFrames.Length; i++) 56if (!ShowInStackTrace(method) && i < stackFrames.Length - 1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (2)
64ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 117offset = type.DeclaringType!.GetGenericArguments().Length;
src\Shared\WebEncoders\WebEncoders.cs (5)
113if (buffer.Length - bufferOffset < arraySizeRequired) 186return Base64UrlEncode(input, offset: 0, count: input.Length); 200ValidateParameters(input.Length, nameof(input), offset, count); 241ValidateParameters(input.Length, nameof(input), offset, count); 245if (output.Length - outputOffset < arraySizeRequired)
UrlDecoderTests.cs (6)
28var destination = new byte[input.Length]; 47var destination = new byte[input.Length]; 71var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new char[source.Length + 10]); 79var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new byte[source.Length + 10], false); 121Assert.Equal(source.Length, length); 159Assert.Equal(source.Length, length);
WebEncodersTests.cs (3)
50string actualBase64Url = WebEncoders.Base64UrlEncode(input, 3, input.Length - 5); // also helps test offsets 71for (var i = 0; i < buffer.Length; i++) 79WebEncoders.Base64UrlEncode(input, offset: 3, output: output, outputOffset: 4, count: input.Length - 5);
Microsoft.AspNetCore.SignalR.Client.Core (14)
HubConnection.cs (11)
756var newArgsCount = args.Length; 758Span<bool> isStreaming = args.Length <= MaxStackSize 759? stackalloc bool[MaxStackSize].Slice(0, args.Length) 760: new bool[args.Length]; 761for (var i = 0; i < args.Length; i++) 786if (newArgsCount == args.Length) 796for (var i = 0; i < args.Length; i++) 962Log.PreparingBlockingInvocation(_logger, irq.InvocationId, methodName, irq.ResultType.FullName!, args.Length); 989Log.PreparingStreamingInvocation(_logger, irq.InvocationId, methodName, irq.ResultType.FullName!, args.Length); 1046Log.PreparingNonBlockingInvocation(_logger, methodName, args.Length); 2210if (handlers.Length > 0)
Internal\DefaultRetryPolicy.cs (2)
28_retryDelays = new TimeSpan?[retryDelays.Length + 1]; 30for (int i = 0; i < retryDelays.Length; i++)
src\SignalR\common\Shared\ReflectionHelper.cs (1)
37Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Client.Tests (17)
HttpConnectionTests.Transport.cs (2)
202if (requestCount >= messageFragments.Length) 368if (pollCount / 2 >= messageFragments.Length)
HubClientProxyGeneratorTests.cs (6)
85It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 93It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)), 136It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 144It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)), 197It.Is<Type[]>(t => t.Length == 1 && t[0] == typeof(int)), 213It.Is<Type[]>(t => t.Length == 3 && t[0] == typeof(int) && t[1] == typeof(float) && t[2] == typeof(int?)),
ServerSentEventsParserTests.cs (2)
111for (var i = 0; i < messageParts.Length; i++) 122i == messageParts.Length - 1
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
TestConnection.cs (1)
218output.Write(message, 0, message.Length);
Microsoft.AspNetCore.SignalR.Common (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Common.Tests (68)
Internal\Formatters\BinaryMessageFormatterTests.cs (4)
40BinaryMessageFormatter.WriteLengthPrefix(message.Length, writer); 85BinaryMessageFormatter.WriteLengthPrefix(payload.Length, writer); 107BinaryMessageFormatter.WriteLengthPrefix(message.Length, writer); 125BinaryMessageFormatter.WriteLengthPrefix(payload.Length, writer);
Internal\Formatters\BinaryMessageParserTests.cs (1)
119Assert.Equal(encoded.Length, buffer.Length);
Internal\Formatters\TextMessageFormatterTests.cs (1)
20ms.Write(buffer, 0, buffer.Length);
Internal\Protocol\JsonHubProtocolTests.cs (1)
134Assert.Equal(1, invocationMessage.Arguments?.Length);
Internal\Protocol\JsonHubProtocolTestsBase.cs (1)
507output.Write(message, 0, message.Length);
Internal\Protocol\MemoryBufferWriterTests.cs (27)
22MinimumSegmentSize = buffer.Length; 86bufferWriter.Write(input, 0, input.Length); 105bufferWriter.Write(input, 0, input.Length); 125bufferWriter.Write(input, 0, input.Length); 146bufferWriter.Write(input, 0, input.Length); 169bufferWriter.Write(input, 0, input.Length); 170Assert.Equal(input.Length, bufferWriter.Length); 185bufferWriter.Write(input, 0, input.Length); 186Assert.Equal(input.Length, bufferWriter.Length); 203bufferWriter.Write(input, 0, input.Length); 204Assert.Equal(input.Length, bufferWriter.Length); 219bufferWriter.Write(input, 0, input.Length); 220Assert.Equal(input.Length, bufferWriter.Length); 236bufferWriter.Write(input, 0, input.Length); 237Assert.Equal(input.Length, bufferWriter.Length); 255bufferWriter.Write(input, 0, input.Length); 256Assert.Equal(input.Length, bufferWriter.Length); 273bufferWriter.Write(input, 0, input.Length); 274Assert.Equal(input.Length, bufferWriter.Length); 293bufferWriter.Write(input, 0, input.Length); 294Assert.Equal(input.Length, bufferWriter.Length); 304Array.Clear(data, 0, data.Length); 320bufferWriter.Write(input, 0, input.Length); 321Assert.Equal(input.Length, bufferWriter.Length); 340bufferWriter.Write(input, 0, input.Length); 341Assert.Equal(input.Length, bufferWriter.Length); 351Array.Clear(data, 0, data.Length);
Internal\Protocol\MessagePackHubProtocolTestBase.cs (2)
444Assert.Equal(testData.Size, Write(testData.Message).Length); 489BinaryMessageFormatter.WriteLengthPrefix(input.Length, stream);
Internal\Protocol\TestHubMessageEqualityComparer.cs (6)
92if (left == null || right == null || left.Length != right.Length) 97for (var i = 0; i < left.Length; i++) 148if (left.Length != right.Length) 153for (var i = 0; i < left.Length; i++)
Internal\Protocol\Utf8BufferTextReaderTests.cs (11)
23var read = reader.Read(chars, 0, chars.Length); 36var read = reader.Read(chars, 0, chars.Length); 41read = reader.Read(chars, 0, chars.Length); 54var read = reader.Read(chars, 10, chars.Length - 10); 68var read = reader.Read(chars, 0, chars.Length); 73read = reader.Read(chars, 0, chars.Length); 78read = reader.Read(chars, 0, chars.Length); 83read = reader.Read(chars, 0, chars.Length); 100var read = reader.Read(chars, 0, chars.Length); 105read = reader.Read(chars, 0, chars.Length); 110read = reader.Read(chars, 0, chars.Length);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.AspNetCore.SignalR.Core (22)
Internal\DefaultHubDispatcher.cs (3)
320var clientStreamLength = hubMethodInvocationMessage.StreamIds?.Length ?? 0; 656for (var parameterPointer = 0; parameterPointer < arguments.Length; parameterPointer++) 658if (hubMethodInvocationMessage.Arguments?.Length > hubInvocationArgumentPointer &&
Internal\TypedClientBuilder.cs (7)
143if (genericTypeNames.Length > 0) 153paramTypes = paramTypes.Take(paramTypes.Length - 1).ToArray(); 197generator.Emit(OpCodes.Ldc_I4, paramTypes.Length); // Stack: 202for (var i = 0; i < paramTypes.Length; i++) 217generator.Emit(OpCodes.Ldarg, paramTypes.Length + 1); 249if (interfaceType.GetProperties().Length != 0) 254if (interfaceType.GetEvents().Length != 0)
Internal\Utf8HashLookup.cs (5)
31if (_count == _slots.Length) 42int bucketIndex = hashCode % _buckets.Length; 43int caseSensitiveBucketIndex = caseSensitiveHashCode % _caseSensitiveBuckets.Length; 62for (var i = _caseSensitiveBuckets[caseSensitiveHashCode % _caseSensitiveBuckets.Length] - 1; i >= 0; i = _slots[i].caseSensitiveNext) 99for (var i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (5)
143if (index < 0 || index > MethodParameters.Length - 1) 159var parameters = new List<Expression>(paramInfos.Length); 160for (int i = 0; i < paramInfos.Length; i++) 211var parameters = new List<Expression>(paramInfos.Length); 212for (int i = 0; i < paramInfos.Length; i++)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutorFSharpSupport.cs (1)
236if (parameters.Length == 3
src\SignalR\common\Shared\ReflectionHelper.cs (1)
37Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Microbenchmarks (18)
HubConnectionReceiveBenchmark.cs (1)
38for (var i = 0; i < arguments.Length; i++)
HubConnectionSendBenchmark.cs (1)
71for (var i = 0; i < _arguments.Length; i++)
MessageParserBenchmark.cs (1)
29BinaryMessageFormatter.WriteLengthPrefix(buffer.Length, writer);
RedisHubLifetimeManagerBenchmark.cs (1)
59for (var i = 0; i < _clients.Length; i++)
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (8)
Protocol\MessagePackHubProtocolWorker.cs (3)
447writer.WriteArrayHeader(message.Arguments.Length); 472writer.WriteArrayHeader(message.Arguments.Length); 513writer.WriteArrayHeader(streamIds.Length);
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Specification.Tests (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (5)
src\SignalR\common\Shared\MemoryBufferWriter.cs (5)
113return _currentSegment.AsMemory(_position, _currentSegment.Length - _position); 120return _currentSegment.AsSpan(_position, _currentSegment.Length - _position); 154var remainingSize = _currentSegment?.Length - _position ?? 0; 284if (_currentSegment != null && (uint)_position < (uint)_currentSegment.Length) 301if (_currentSegment != null && position < _currentSegment.Length - count)
Microsoft.AspNetCore.SignalR.Tests (16)
EndToEndTests.cs (6)
103logger.LogInformation("Sending {length} byte frame", bytes.Length); 141logger.LogInformation("Sending {length} byte frame", bytes.Length); 276logger.LogInformation("Sending {length} byte message", bytes.Length); 293Assert.Equal(message, Encoding.UTF8.GetString(await connection.Transport.Input.ReadAsync(bytes.Length).DefaultTimeout())); 335logger.LogInformation("Sending {length} byte message", bytes.Length); 344var receivedData = await connection.Transport.Input.ReadAsync(bytes.Length).DefaultTimeout();
HubConnectionHandlerTests.cs (8)
480var maximumMessageSize = payload.Length - 10; 509var maximumMessageSize = payload.Length - 10; 520await client.Connection.Application.Output.WriteAsync(payload.AsMemory(0, payload.Length / 2)); 521await client.Connection.Application.Output.WriteAsync(payload.AsMemory(payload.Length / 2)); 544var maximumMessageSize = payload1.Length + 1; 594var maximumMessageSize = payload3.Length + 10; 4433Assert.Equal(phrases.Length + 1, messages.Count); 4434for (var i = 0; i < phrases.Length; i++)
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
TestFilters.cs (1)
48Debug.Assert(syncPoints.Length == 3);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Util\EventedStreamReader.cs (1)
79var chunkLength = await _streamReader.ReadAsync(buf, 0, buf.Length);
Microsoft.AspNetCore.StaticFiles (4)
artifacts\obj\Microsoft.AspNetCore.StaticFiles\Release\net9.0\Microsoft.AspNetCore.StaticFiles.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
HtmlDirectoryFormatter.cs (2)
205context.Response.ContentLength = bytes.Length; 206return context.Response.Body.WriteAsync(bytes, 0, bytes.Length);
StaticFileContext.cs (1)
287for (int i = 0; i < states.Length; i++)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
StaticFileMiddlewareTests.cs (1)
165Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length);
Microsoft.AspNetCore.StaticFiles.Tests (7)
DirectoryBrowserMiddlewareTests.cs (2)
173Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); 230Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length);
StaticFileMiddlewareTests.cs (5)
192Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 231Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 273Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 323Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 366Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length);
Microsoft.AspNetCore.TestHost (4)
.packages\microsoft.extensions.hostfactoryresolver.sources\9.0.0-preview.5.24262.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
117&& factory.GetParameters().Length == 1 235if (parameters.Length == 0)
TestWebSocket.cs (2)
200if (buffer.Offset < 0 || buffer.Offset > buffer.Array.Length) 204if (buffer.Count < 0 || buffer.Count > buffer.Array.Length - buffer.Offset)
Microsoft.AspNetCore.TestHost.Tests (17)
HttpContextBuilderTests.cs (2)
126c.Response.Body.Write(bytes, 0, bytes.Length); 129c.Response.Body.Write(bytes, 0, bytes.Length);
ResponseBodyTests.cs (6)
29Assert.Equal(length, bytes.Length); 46Assert.Equal(length, bytes.Length); 56httpContext.Response.Body.Write(contentBytes, 0, contentBytes.Length); 72httpContext.Response.Body.Write(contentBytes, 0, contentBytes.Length); 91await httpContext.Response.Body.WriteAsync(contentBytes, 0, contentBytes.Length); 110await httpContext.Response.Body.WriteAsync(contentBytes, 0, contentBytes.Length);
src\Shared\SyncPoint\SyncPoint.cs (1)
65if (counter >= localSyncPoints.Length)
TestClientTests.cs (8)
130for (var i = 0; i < data.Length; i++) 627Assert.Equal(hello.Length, result.Count); 628Assert.True(hello.SequenceEqual(buffer.Take(hello.Length))); 632Assert.Equal(world.Length, result.Count); 633Assert.True(world.SequenceEqual(buffer.Take(world.Length))); 813for (var i = 0; i < hello.Length; i++) 815bool last = i == (hello.Length - 1); 817Assert.Equal(buffer.Length, result.Count);
Microsoft.AspNetCore.Tests (3)
WebApplicationTests.cs (3)
1568Assert.Equal(hostLifetimes1.Length, hostLifetimes0.Length); 1991Assert.Equal(5, displayNames.Length);
Microsoft.AspNetCore.WebSockets (3)
WebSocketMiddleware.cs (3)
242if (values.Length == 1) 262if (values.Length == 1) 303if (values.Length == 1)
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Autobahn\AutobahnServerResult.cs (1)
22if (splat.Length < 3)
Microsoft.AspNetCore.WebSockets.Tests (20)
BufferStream.cs (2)
274if (offset < 0 || offset > buffer.Length) 278if (count < 0 || count > buffer.Length - offset
WebSocketMiddlewareTests.cs (18)
95var serverBuffer = new byte[originalData.Length]; 98Assert.Equal(originalData.Length, result.Count); 120var serverBuffer = new byte[originalData.Length]; 123Assert.Equal(originalData.Length, result.Count); 146var serverBuffer = new byte[originalData.Length]; 177var serverBuffer = new byte[originalData.Length]; 186new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None); 194new ArraySegment<byte>(serverBuffer, totalReceived, serverBuffer.Length - totalReceived), CancellationToken.None); 232var clientBuffer = new byte[originalData.Length]; 235Assert.Equal(originalData.Length, result.Count); 257var clientBuffer = new byte[originalData.Length]; 260Assert.Equal(originalData.Length, result.Count); 282var clientBuffer = new byte[originalData.Length]; 287result = await client.ReceiveAsync(new ArraySegment<byte>(clientBuffer, receivedCount, clientBuffer.Length - receivedCount), CancellationToken.None); 293Assert.Equal(originalData.Length, receivedCount); 317var clientBuffer = new byte[originalData.Length]; 325new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None); 332new ArraySegment<byte>(clientBuffer, totalReceived, clientBuffer.Length - totalReceived), CancellationToken.None);
Microsoft.AspNetCore.WebUtilities (24)
artifacts\obj\Microsoft.AspNetCore.WebUtilities\Release\net9.0\Microsoft.AspNetCore.WebUtilities.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
BufferedReadStream.cs (7)
253_bufferCount = _inner.Read(_buffer, 0, _buffer.Length); 281if (minCount > _buffer.Length) 283throw new ArgumentOutOfRangeException(nameof(minCount), minCount, "The value must be smaller than the buffer size: " + _buffer.Length); 296int read = _inner.Read(_buffer, _bufferOffset + _bufferCount, _buffer.Length - _bufferCount - _bufferOffset); 314if (minCount > _buffer.Length) 316throw new ArgumentOutOfRangeException(nameof(minCount), minCount, "The value must be smaller than the buffer size: " + _buffer.Length); 329int read = await _inner.ReadAsync(_buffer.AsMemory(_bufferOffset + _bufferCount, _buffer.Length - _bufferCount - _bufferOffset), cancellationToken);
FormReader.cs (2)
266_bufferCount = _reader.Read(_buffer, 0, _buffer.Length); 275_bufferCount = await _reader.ReadAsync(_buffer, 0, _buffer.Length);
HttpRequestStreamReader.cs (2)
158if (count < 0 || index + count > buffer.Length) 219if (count < 0 || index + count > buffer.Length)
HttpResponseStreamWriter.cs (1)
417if (remaining >= values.Length + NewLine.Length)
MultipartReaderStream.cs (1)
177var slice = buffer.AsSpan(0, Math.Min(buffer.Length, index));
PagedByteBuffer.cs (5)
32if (_currentPage == null || _currentPageIndex == _currentPage.Length) 53var copyLength = Math.Min(memory.Length, currentPage.Length - _currentPageIndex); 73page.Length; 90page.Length; 107page.Length;
src\Shared\WebEncoders\WebEncoders.cs (5)
113if (buffer.Length - bufferOffset < arraySizeRequired) 186return Base64UrlEncode(input, offset: 0, count: input.Length); 200ValidateParameters(input.Length, nameof(input), offset, count); 241ValidateParameters(input.Length, nameof(input), offset, count); 245if (output.Length - outputOffset < arraySizeRequired)
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (14)
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.AspNetCore.WebUtilities.Tests (129)
FileBufferingReadStreamTests.cs (57)
54var read1 = stream.Read(bytes, 0, bytes.Length); 55Assert.Equal(bytes.Length, read1); 61var read2 = stream.Read(bytes, 0, bytes.Length); 68var read3 = stream.Read(bytes, 0, bytes.Length); 80var read0 = stream.Read(bytes, 0, bytes.Length); 81Assert.Equal(bytes.Length, read0); 87var read1 = stream.Read(bytes, 0, bytes.Length); 88Assert.Equal(bytes.Length, read1); 94var read2 = stream.Read(bytes, 0, bytes.Length); 101var read3 = stream.Read(bytes, 0, bytes.Length); 114var read0 = stream.Read(bytes, 0, bytes.Length); 115Assert.Equal(bytes.Length, read0); 121var read1 = stream.Read(bytes, 0, bytes.Length); 122Assert.Equal(bytes.Length, read1); 130var read2 = stream.Read(bytes, 0, bytes.Length); 138var read3 = stream.Read(bytes, 0, bytes.Length); 152var read0 = stream.Read(bytes, 0, bytes.Length); 153Assert.Equal(bytes.Length, read0); 159var exception = Assert.Throws<IOException>(() => stream.Read(bytes, 0, bytes.Length)); 175var read0 = stream.Read(bytes, 0, bytes.Length); 176Assert.Equal(bytes.Length, read0); 182var read1 = stream.Read(bytes, 0, bytes.Length); 183Assert.Equal(bytes.Length, read1); 191var exception = Assert.Throws<IOException>(() => stream.Read(bytes, 0, bytes.Length)); 216var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 217Assert.Equal(bytes.Length, read1); 223var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 230var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 242var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 243Assert.Equal(bytes.Length, read0); 249var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 250Assert.Equal(bytes.Length, read1); 256var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 263var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 276var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 277Assert.Equal(bytes.Length, read0); 283var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 284Assert.Equal(bytes.Length, read1); 292var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 300var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 328var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 329Assert.Equal(bytes.Length, read1); 332var read2 = await stream.ReadAsync(bytes, 0, bytes.Length); 333Assert.Equal(bytes.Length, read2); 336var read3 = await stream.ReadAsync(bytes, 0, bytes.Length); 341var read4 = await stream.ReadAsync(bytes, 0, bytes.Length); 355var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 356Assert.Equal(bytes.Length, read0); 362var exception = await Assert.ThrowsAsync<IOException>(() => stream.ReadAsync(bytes, 0, bytes.Length)); 378var read0 = await stream.ReadAsync(bytes, 0, bytes.Length); 379Assert.Equal(bytes.Length, read0); 385var read1 = await stream.ReadAsync(bytes, 0, bytes.Length); 386Assert.Equal(bytes.Length, read1); 394var exception = await Assert.ThrowsAsync<IOException>(() => stream.ReadAsync(bytes, 0, bytes.Length)); 612var read0 = stream.Read(bytes, 0, bytes.Length); 613Assert.Equal(bytes.Length, read0); 619var read1 = stream.Read(bytes, 0, bytes.Length);
FileBufferingWriteStreamTests.cs (19)
27bufferingStream.Write(input, 0, input.Length); 30Assert.Equal(input.Length, bufferingStream.Length); 54Assert.Equal(input.Length, bufferingStream.Length); 96bufferingStream.Write(input, 0, input.Length); 142await bufferingStream.WriteAsync(input, 0, input.Length); 207await bufferingStream.WriteAsync(input, 0, input.Length); 241Assert.Equal(input.Length, bufferingStream.Length); 255var exception = Assert.Throws<IOException>(() => bufferingStream.Write(input, 0, input.Length)); 269bufferingStream.Write(input, 0, input.Length); 270var exception = Assert.Throws<IOException>(() => bufferingStream.Write(input, 0, input.Length)); 285bufferingStream.Write(input, 0, input.Length); 286bufferingStream.Write(input, 0, input.Length); // Should get to exactly the buffer limit, which is fine 299var exception = await Assert.ThrowsAsync<IOException>(() => bufferingStream.WriteAsync(input, 0, input.Length)); 313await bufferingStream.WriteAsync(input, 0, input.Length); 314var exception = await Assert.ThrowsAsync<IOException>(() => bufferingStream.WriteAsync(input, 0, input.Length)); 329await bufferingStream.WriteAsync(input, 0, input.Length); 330await bufferingStream.WriteAsync(input, 0, input.Length); // Should get to exactly the buffer limit, which is fine 341bufferingStream.Write(input, 0, input.Length); 358bufferingStream.Write(input, 0, input.Length);
HttpRequestStreamReaderTest.cs (19)
75for (var i = 0; i < CharData.Length; i++) 89for (var i = 0; i < CharData.Length; i++) 117var chars = new char[CharData.Length]; 120var read = reader.Read(chars, 0, chars.Length); 123Assert.Equal(chars.Length, read); 124for (var i = 0; i < CharData.Length; i++) 135var chars = new char[CharData.Length]; 271var chars = new char[CharData.Length]; 278Assert.Equal(chars.Length, read); 279for (var i = 0; i < CharData.Length; i++) 290var chars = new char[CharData.Length]; 297Assert.Equal(chars.Length, read); 298for (var i = 0; i < CharData.Length; i++) 309var chars = new char[CharData.Length]; 316Assert.Equal(chars.Length, read); 317for (var i = 0; i < CharData.Length; i++) 328var chars = new char[CharData.Length]; 335Assert.Equal(chars.Length, read); 336for (var i = 0; i < CharData.Length; i++)
MultipartReaderTests.cs (6)
293var read = section.Body.Read(buffer, 0, buffer.Length); 302read = section.Body.Read(buffer, 0, buffer.Length); 326stream.Write(bytes, 0, bytes.Length); 332stream.Write(bytes, 0, bytes.Length); 361stream.Write(bytes, 0, bytes.Length); 367stream.Write(bytes, 0, bytes.Length);
PagedByteBufferTest.cs (14)
20buffer.Add(input, 0, input.Length); 24Assert.Equal(input.Length, buffer.Length); 35buffer.Add(input1, 0, input1.Length); 38buffer.Add(input2, 0, input2.Length); 69buffer.Add(input1, 0, input1.Length); 88buffer.Add(input, 0, input.Length); 102buffer.Add(input, 0, input.Length); 113buffer.Add(newInput, 0, newInput.Length); 127buffer.Add(input, 0, input.Length); 138buffer.Add(newInput, 0, newInput.Length); 151buffer.Add(input, 0, input.Length); 181buffer.Add(input, 0, input.Length); 206buffer.Add(input, 0, input.Length); 229buffer.Add(input, 0, input.Length);
src\Shared\Buffers.Testing\CustomMemoryForTest.cs (1)
13public CustomMemoryForTest(T[] array) : this(array, 0, array.Length)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (13)
36var startSegment = new byte[data.Length + 20]; 37Array.Copy(data, 0, startSegment, 10, data.Length); 38return new ReadOnlySequence<byte>(startSegment, 10, data.Length); 51var startSegment = new byte[data.Length + 20]; 52Array.Copy(data, 0, startSegment, 10, data.Length); 53return new ReadOnlySequence<byte>(new Memory<byte>(startSegment, 10, data.Length)); 66var startSegment = new byte[data.Length + 20]; 67Array.Copy(data, 0, startSegment, 10, data.Length); 68return new ReadOnlySequence<byte>(new CustomMemoryForTest<byte>(startSegment, 10, data.Length).Memory); 94var segments = new List<byte[]>((data.Length * 2) + 1); 109if (inputs == null || inputs.Length == 0) 122int length = s.Length; 144} while (i < inputs.Length);
Microsoft.Build (296)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
AwaitExtensions.cs (2)
113RegisteredWaitHandle[] callbackHandles = new RegisteredWaitHandle[handles.Length]; 114for (int i = 0; i < handles.Length; i++)
BackEnd\BuildManager\BuildManager.cs (2)
1481for (int i = 1; i < instances.Length; i++) 3172if (inputCacheFiles.Length == 0)
BackEnd\BuildManager\CacheAggregator.cs (4)
61ErrorUtilities.VerifyThrow(configs.Length == results.Length, "Assuming 1-to-1 mapping between configs and results. Otherwise it means the caches are either not minimal or incomplete"); 63if (configs.Length == 0 && results.Length == 0)
BackEnd\Client\MSBuildClientPacketPump.cs (4)
196IAsyncResult result = localStream.BeginRead(headerByte, 0, headerByte.Length, null, null); 235if ((headerBytesRead != headerByte.Length) && !localPacketPumpShutdownEvent.WaitOne(0)) 250ErrorUtilities.ThrowInternalError("Incomplete header read. {0} of {1} bytes read", headerBytesRead, headerByte.Length); 294result = localStream.BeginRead(headerByte, 0, headerByte.Length, null, null);
BackEnd\Components\BuildRequestEngine\FullyQualifiedBuildRequest.cs (3)
148if (Targets.Length != other.Targets.Length) 153for (int i = 0; i < Targets.Length; ++i)
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (4)
506for (int i = 0; i < handshakeComponents.Length; i++) 633_clientToServerStream.BeginRead(_headerByte, 0, _headerByte.Length, HeaderReadComplete, this); 891if (bytesRead != _headerByte.Length) 893CommunicationsUtilities.Trace(_nodeId, "COMMUNICATIONS ERROR (HRC) Node: {0} Process: {1} Bytes Read: {2} Expected: {3}", _nodeId, _process.Id, bytesRead, _headerByte.Length);
BackEnd\Components\FileAccesses\FileAccessManager.cs (4)
109Handlers[] newHandlers = new Handlers[_handlers.Length + 1]; 113newHandlers[_handlers.Length] = addedHandlers; 125Handlers[] newHandlers = new Handlers[_handlers.Length - 1]; 127for (int handlersIdx = 0; handlersIdx < _handlers.Length; handlersIdx++)
BackEnd\Components\Logging\ProjectLoggingContext.cs (1)
120propertiesToSerialize?.Length > 0 &&
BackEnd\Components\RequestBuilder\IntrinsicTasks\CallTarget.cs (1)
89if ((Targets == null) || (Targets.Length == 0))
BackEnd\Components\RequestBuilder\IntrinsicTasks\IntrinsicTaskFactory.cs (2)
64var propertyInfos = new TaskPropertyInfo[infos.Length]; 65for (int i = 0; i < infos.Length; i++)
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (17)
236if ((Projects == null) || (Projects.Length == 0)) 242if (TargetAndPropertyListSeparators?.Length > 0) 298skipProjects = new bool[Projects.Length]; 299for (int i = 0; i < skipProjects.Length; i++) 313for (int i = 0; i < Projects.Length; i++) 413for (int i = 0; i < Projects.Length; i++) 423if (projectToBuildInParallel.Length <= 0) 502if (runEachTargetSeparately && targets?.Length > 0) 539var projectDirectory = new string[projects.Length]; 540var projectNames = new string[projects.Length]; 541var toolsVersions = new string[projects.Length]; 542var projectProperties = new Dictionary<string, string>[projects.Length]; 543var undefinePropertiesPerProject = new List<string>[projects.Length]; 545for (int i = 0; i < projectNames.Length; i++) 588undefinePropertiesPerProject[i] = new List<string>(propertiesToUndefine.Length); 591if (log != null && propertiesToUndefine.Length > 0) 670for (int i = 0; i < projects.Length; i++)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (14)
339ErrorUtilities.VerifyThrow(projectFiles.Length == properties.Length, "Properties and project counts not the same"); 340ErrorUtilities.VerifyThrow(projectFiles.Length == toolsVersions.Length, "Tools versions and project counts not the same"); 342FullyQualifiedBuildRequest[] requests = new FullyQualifiedBuildRequest[projectFiles.Length]; 344for (int i = 0; i < projectFiles.Length; ++i) 383ErrorUtilities.VerifyThrow(requests.Length == results.Length, "# results != # requests"); 582WaitHandle[] allHandles = new WaitHandle[handles.Length + 1]; 584Array.Copy(handles, 0, allHandles, 1, handles.Length); 996ErrorUtilities.VerifyThrow(requests.Length == results.Length, "# results != # requests"); 1016for (int i = 0; i < requests.Length; i++) 1183ProjectErrorUtilities.VerifyThrowInvalidProject(allTargets.Length > 0,
BackEnd\Components\RequestBuilder\TargetBuilder.cs (4)
110ErrorUtilities.VerifyThrow(targetNames.Length > 0, "List of targets must be non-empty"); 144List<TargetSpecification> targets = new List<TargetSpecification>(targetNames.Length); 247ITargetResult[] results = new TargetResult[targets.Length]; 267for (int i = 0; i < targets.Length; i++)
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
666targetLoggingContext?.LogTargetBatchFinished(projectFullPath, targetSuccess, targetOutputItems.Length > 0 ? targetOutputItems : null);
BackEnd\Components\RequestBuilder\TaskHost.cs (26)
291ErrorUtilities.VerifyThrowArgument((targetOutputsPerProject == null) || (projectFileNames.Length == targetOutputsPerProject.Length), "General.TwoVectorsMustHaveSameLength", projectFileNames.Length, targetOutputsPerProject?.Length ?? 0, "projectFileNames", "targetOutputsPerProject"); 293BuildEngineResult result = BuildProjectFilesInParallel(projectFileNames, targetNames, globalProperties, new List<String>[projectFileNames.Length], toolsVersion, includeTargetOutputs); 299ErrorUtilities.VerifyThrow(targetOutputsPerProject.Length == result.TargetOutputsPerProject.Count, "{0} != {1}", targetOutputsPerProject.Length, result.TargetOutputsPerProject.Count); 301for (int i = 0; i < targetOutputsPerProject.Length; i++) 973if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null) 987for (int i = 0; i < targetNames.Length; i++) 1153if (projectFileNames.Length == 1 && projectFileNames[0] == null && globalProperties[0] == null && (undefineProperties == null || undefineProperties[0] == null) && toolsVersion[0] == null) 1166for (int i = 0; i < targetNames.Length; i++) 1178PropertyDictionary<ProjectPropertyInstance>[] propertyDictionaries = new PropertyDictionary<ProjectPropertyInstance>[projectFileNames.Length]; 1180for (int i = 0; i < projectFileNames.Length; i++) 1214ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length, "{0}!={1}.", results.Length, projectFileNames.Length); 1218targetOutputsPerProject = new List<IDictionary<string, ITaskItem[]>>(results.Length); 1222for (int i = 0; i < results.Length; i++) 1233ITaskItem[] clonedTaskItem = new ITaskItem[resultEntry.Value.Items.Length]; 1234for (int j = 0; j < resultEntry.Value.Items.Length; j++) 1259ErrorUtilities.VerifyThrow(results.Length == projectFileNames.Length || !overallSuccess, "The number of results returned {0} cannot be less than the number of project files {1} unless one of the results indicated failure.", results.Length, projectFileNames.Length);
BackEnd\Components\Scheduler\Scheduler.cs (7)
1686Stack<BuildRequest> requestsToAdd = new Stack<BuildRequest>(blocker.BuildRequests.Length); 2297int[] previousWork = new int[currentWork.Length]; 2298HashSet<int>[] runningRequests = new HashSet<int>[currentWork.Length]; 2321for (int i = 0; i < currentWork.Length; i++) 2343for (int i = 0; i < currentWork.Length; i++) 2413for (int i = 0; i < nodeActiveTimes.Length; i++) 2438for (int i = 0; i < currentWork.Length; i++)
BackEnd\Components\Scheduler\SchedulingPlan.cs (3)
375if (values.Length < 1) 383for (int i = 1; i < values.Length; i++) 406if (values.Length < 3)
BackEnd\Node\OutOfProcNode.cs (1)
789if (configuration.LoggerDescriptions?.Length > 0)
BackEnd\Shared\BuildResult.cs (1)
684ConcurrentDictionary<string, TargetResult> resultsByTarget = CreateTargetResultDictionary(targetNames.Length);
BackEnd\Shared\TargetResult.cs (6)
242if (_items.Length == 0) 302var itemsCount = _items?.Length ?? 0; 310var defaultBufferCapacity = _items.Length * 128; 320var interner = new LookasideStringInterner(StringComparer.Ordinal, _items.Length); 339using MemoryStream itemsStream = new MemoryStream(buffer, 0, buffer.Length, writable: false, publiclyVisible: true); 342for (int i = 0; i < _items.Length; i++)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (6)
827var stringOutputs = new string[convertibleOutputs.Length]; 828for (int i = 0; i < convertibleOutputs.Length; i++) 1018for (int i = 0; i < loadedType.Properties.Length; i++) 1443StringBuilder joinedOutputs = (outputs.Length == 0) ? new StringBuilder() : null; 1503if (LogTaskInputs && !_taskLoggingContext.LoggingService.OnlyLogCriticalEvents && outputs.Length > 0 && parameter.Log) 1519StringBuilder joinedOutputs = (outputs.Length == 0) ? new StringBuilder() : null;
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (1)
61if (ex.LoaderExceptions.Length != 0)
BuildCheck\Infrastructure\BuildEventsProcessor.cs (1)
179BuildAnalyzerConfigurationInternal config = configPerRule.Length == 1
BuildCheck\Infrastructure\ConfigurationProvider.cs (2)
119var configurations = new BuildAnalyzerConfigurationInternal[userConfigs.Length]; 121for (int idx = 0; idx < userConfigs.Length; idx++)
CanonicalError.cs (1)
321if (explodedText.Length > 0)
Collections\ArrayDictionary.cs (2)
96if (count < keys.Length) 104throw new InvalidOperationException($"ArrayDictionary is at capacity {keys.Length}");
Collections\ReadOnlyConvertingDictionary.cs (1)
158ErrorUtilities.VerifyThrow(array.Length - arrayIndex >= _backing.Count, "Specified array size insufficient to hold the contents of the collection.");
Collections\RetrievableEntryHashSet\HashHelpers.cs (1)
63for (int i = 0; i < primes.Length; i++)
Collections\RetrievableEntryHashSet\HashSet.cs (16)
184if ((_count == 0 && _slots.Length > HashHelpers.GetMinPrime()) || 185(_count > 0 && _slots.Length / _count > ShrinkThreshold)) 271Array.Clear(_buckets, 0, _buckets.Length); 369for (int i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next) 420int bucket = hashCode % _buckets.Length; 526info.AddValue(CapacityName, _buckets == null ? 0 : _buckets.Length); 568for (int i = 0; i < array.Length; i++) 638if (index < 0 || Count > array.Length - index) 677if (arrayIndex > array.Length || count > array.Length - arrayIndex) 743Debug.Assert(newSlots.Length <= _slots.Length, "capacity increased after TrimExcess"); 826int bucket = hashCode % _buckets.Length; 827for (int i = _buckets[hashCode % _buckets.Length] - 1; i >= 0; i = _slots[i].next) 846if (_lastIndex == _slots.Length) 850bucket = hashCode % _buckets.Length;
CommunicationsUtilities.cs (3)
463ErrorUtilities.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes"); 465stream.Write(bytes, 0, bytes.Length); 543for (int i = 0; i < bytes.Length; i++)
Construction\Solution\SolutionFile.cs (6)
702if (words.Length >= 2) 1393ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationNames.Length == 2, "SubCategoryForSolutionParsingErrors", 1419configurationPlatformParts.Length == 2, 1470ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(nameValue.Length == 2, "SubCategoryForSolutionParsingErrors", 1518ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationPlatformParts.Length <= 2, "SubCategoryForSolutionParsingErrors", 1524(configurationPlatformParts.Length > 1) ? configurationPlatformParts[1] : string.Empty,
Construction\Solution\SolutionProjectGenerator.cs (1)
2059var properties = new Dictionary<string, string>(_metaprojectGlobalProperties.Length, StringComparer.OrdinalIgnoreCase);
Definition\BuiltInMetadata.cs (1)
27{ return FileUtilities.ItemSpecModifiers.All.Length; }
Definition\ProjectItem.cs (1)
301{ return Metadata.Count + FileUtilities.ItemSpecModifiers.All.Length; }
Definition\Toolset.cs (1)
704if (defaultTasksFiles.Length == 0)
ErrorUtilities.cs (5)
161if (parameterValue.Length == 0) 586if (parameter1.Length != parameter2.Length) 620VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 622int arrayCapacity = array.Length - arrayIndex;
Evaluation\Evaluator.cs (2)
392if (includeSplitFilesEscaped.Length > 0) 2100if (importFilesEscaped.Length == 0)
Evaluation\Expander.cs (74)
2338ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2386ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2433ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2457ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2533ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2600ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2672ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2691ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2700ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2783ProjectErrorUtilities.VerifyThrowInvalidProject(arguments == null || arguments.Length == 0, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2800ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 1, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2834ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2867ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 2900ProjectErrorUtilities.VerifyThrowInvalidProject(arguments?.Length == 2, elementLocation, "InvalidItemFunctionSyntax", functionName, arguments == null ? 0 : arguments.Length); 3480args = new object[_arguments.Length]; 3483for (int n = 0; n < _arguments.Length; n++) 3517if (objectInstance != null && args.Length == 1 && (String.Equals("Equals", _methodMethodName, StringComparison.OrdinalIgnoreCase) || String.Equals("CompareTo", _methodMethodName, StringComparison.OrdinalIgnoreCase))) 3533if (_methodMethodName.Equals("GetPathOfFileAbove") && args.Length == 1) 3707if (args.Length == 0) 3715if (args.Length == 0) 3731if (args.Length == 0) 3781if (args.Length == 0) 3964if (args.Length >= 4 && 3967returnVal = IntrinsicFunctions.GetRegistryValueFromView(arg0, arg1, args[2], new ArraySegment<object>(args, 3, args.Length - 3)); 3973if (args.Length == 0) 4040if (args.Length == 0) 4048if (args.Length == 0) 4056if (args.Length == 0) 4064if (args.Length == 0) 4072if (args.Length == 0) 4080if (args.Length == 0) 4088if (args.Length == 0) 4312switch (args.Length) 4355if (args.Length == 0) 4379if (args.Length == 0) 4417if (args.Length == 0) 4447if (args.Length == 0) 4463for (var i = 0; i < args.Length; i++) 4479if (enforceLength && args.Length != 2) 4502if (args.Length != 3) 4528if (args.Length != 4) 4554if (args.Length != 2) 4577if (args.Length != 3) 4599if (args.Length != 1) 4610if (args.Length != 1) 4727if (args.Length != 1) 4739if (args.Length != 2) 4769if (args.Length != 1) 4782if (args.Length != 2) 4796if (args.Length != 2) 4810if (args.Length != 2) 4835if (args.Length != 2) 4861if (args.Length != 2) 5227object[] coercedArguments = new object[args.Length]; 5232for (int n = 0; n < parameters.Length; n++) 5397Type[] types = new Type[_arguments.Length]; 5398for (int n = 0; n < _arguments.Length; n++) 5443if (parameters.Length == _arguments.Length) 5584return parameters.Length > 0
Evaluation\IntrinsicFunctions.cs (1)
233if (views == null || views.Length == 0)
EventArgsFormatting.cs (2)
351for (int i = 0; i < lines.Length; i++) 360if (i < (lines.Length - 1))
FileMatcher.cs (5)
484string[] longParts = new string[parts.Length - startingElement]; 487for (int i = startingElement; i < parts.Length; ++i) 511for (int j = i; j < parts.Length; ++j) 894for (int i = 0; i < excludeNextSteps.Length; i++) 942for (int i = 0; i < excludeNextSteps.Length; i++)
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1137ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1152while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1157if (index == splitBase.Length && index == splitPath.Length) 1170for (int i = index; i < splitBase.Length; i++) 1174for (int i = index; i < splitPath.Length; i++)
FrameworkLocationHelper.cs (2)
838if (directories.Length == 0) 854for (int i = 1; i < directories.Length; ++i)
Graph\ProjectInterpretation.cs (1)
150if (configurationPlatformParts.Length > 1)
Instance\ProjectItemInstance.cs (1)
914List<string> names = new List<string>(capacity: metadataCollection.Count + FileUtilities.ItemSpecModifiers.All.Length);
Instance\TaskFactoryWrapper.cs (1)
268for (int i = 0; i < propertyInfos.Length; i++)
Instance\TaskRegistry.cs (1)
727string unqualifiedTaskName = nameComponents[nameComponents.Length - 1];
LoadedType.cs (3)
72Properties = new ReflectableTaskPropertyInfo[props.Length]; 75PropertyAssemblyQualifiedNames = new string[props.Length]; 78for (int i = 0; i < props.Length; i++)
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
480var dictionary = ArrayDictionary<string, string>.Create(list.Length); 481for (int i = 0; i < list.Length; i++)
Logging\BinaryLogger\BuildEventArgsWriter.cs (3)
694if (arguments == null || arguments.Length == 0) 699int count = arguments.Length; 777if (e is LazyFormattedBuildEventArgs { RawArguments: { Length: > 0 } } and
Logging\BinaryLogger\Postprocessing\StreamExtensions.cs (1)
48int read = stream.Read(buffer, 0, (int)Math.Min(bytesCount - totalRead, buffer.Length));
Logging\DistributedLoggers\ConfigurableForwardingLogger.cs (1)
76for (int param = 0; param < parameterComponents.Length; param++)
Logging\DistributedLoggers\DistributedFileLogger.cs (2)
47for (int param = 0; param < parameterComponents.Length; param++) 53if (parameterAndValue.Length > 1)
Logging\FileLogger.cs (1)
190parameterAndValue.Length > 1 ? parameterAndValue[1] : null);
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++) 524IAsyncResult result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null); 566if (bytesRead != headerByte.Length) 586CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length); 611result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
PlatformNegotiation.cs (1)
113if (keyVal.Length != 2 || string.IsNullOrEmpty(keyVal[0]) || string.IsNullOrEmpty(keyVal[1]))
ProjectWriter.cs (2)
142ErrorUtilities.VerifyThrow(itemVectorTransforms.Count == (surroundingTextPieces.Length - 1), 167base.WriteString(surroundingTextPieces[surroundingTextPieces.Length - 1]);
ResourceUtilities.cs (1)
230if ((args?.Length > 0))
TaskLoggingHelper.cs (3)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 295if (messageArgs?.Length > 0) 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
TaskParameter.cs (6)
133ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 135for (int i = 0; i < inputAsITaskItemArray.Length; i++) 365int length = wrappedItems.Length; 623int length = array.Length; 706int length = array.Length; 824return count + FileUtilities.ItemSpecModifiers.All.Length;
TypeLoader.cs (2)
195Dictionary<string, string> assembliesDictionary = new(localAssemblies.Length + runtimeAssemblies.Length);
Utilities\EngineFileUtilities.cs (1)
349for (int i = 0; i < fileList.Length; i++)
Utilities\NuGetFrameworkWrapper.cs (2)
168StringBuilder publicKeyTokenString = new(publicKeyToken.Length * 2); 169for (int i = 0; i < publicKeyToken.Length; i++)
Utilities\RegistryKeyWrapper.cs (1)
168for (int i = 0; i < keyNames.Length && wrapper.Exists(); ++i)
Microsoft.Build.CommandLine.UnitTests (11)
CommandLineSwitches_Tests.cs (8)
794Assert.Equal(3, parameters.Length); 838Assert.Equal(2, parameters.Length); 879Assert.Equal(4, parameters.Length); 899Assert.True(parameters.Length > 0); 1072Assert.Equal(3, parameters.Length); 1091switches[CommandLineSwitches.ParameterizedSwitch.Target].Length.ShouldBe(2); 1111switches[CommandLineSwitches.ParameterizedSwitch.Target].Length.ShouldBe(1); 1571for (int i = 0; i < helpMessageLines.Length; i++)
XMake_Tests.cs (3)
92parameters.Length.ShouldBe(1); 109parameters.Length.ShouldBe(2); 128parameters.Length.ShouldBe(0);
Microsoft.Build.Conversion.Core (4)
AdditionalOptionsParser.cs (1)
299for (int i = 0; i < compSwitchInfo.SwitchIDs.Length; i++)
OldVSProjectFileReader.cs (2)
145if ((startIndexIntoBuffer + charactersToRead) > bufferToReadInto.Length) 463for (int i = 0; i < entities.Length; i++)
ProjectFileConverter.cs (1)
1307for (var oi = 0; oi < oldWarnings.Length; oi++)
Microsoft.Build.Engine (205)
Caching\BuildItemCacheEntry.cs (4)
88if (this.BuildItems.Length != otherEntry.BuildItems.Length) 93for (int i = 0; i < this.BuildItems.Length; i++) 135writer.Write((Int32)buildItems.Length);
Collections\DualQueue.cs (2)
151writingQueueCount += items.Length; 154if (writingQueueCount == items.Length)
Engine\BuildRequest.cs (2)
591if (targetNames.Length == 1) 663writer.Write((Int32)targetNames.Length);
Engine\BuildResult.cs (4)
80BuildItem[] itemArray = new BuildItem[originalArray.Length]; 81for (int i = 0; i < originalArray.Length; i++) 240for (int key_index = 0; key_index < keys.Length; key_index++) 291writer.Write((Int32)items.Length);
Engine\CacheManager.cs (1)
161return new CacheEntry[names.Length];
Engine\CacheScope.cs (5)
117for (int i = 0; i < cacheEntries.Length; i++) 175CacheEntry[] results = new CacheEntry[names.Length]; 183for (int i = 0; i < names.Length; i++) 292for (int i = 0; i < outputItems.Length; i++) 359if (buildRequest.TargetNames == null || buildRequest.TargetNames.Length == 0)
Engine\Engine.cs (10)
2273error.VerifyThrowArgument(projectFiles.Length > 0, "projectFilesEmpty"); 2279for (int i = 0; i < projectFiles.Length; i++) 2342BuildRequest[] buildRequests = new BuildRequest[projectFiles.Length]; 2343Hashtable[] targetOutputsWorkingCopy = new Hashtable[buildRequests.Length]; 2344for (int i = 0; i < buildRequests.Length; i++) 2375for (int i = 0; i < buildRequests.Length; i++) 2782if (targetNames?.Length > 0) 2988new TargetInProgessState[waitingTargets.Length + inProgressTargets.Count]; 2989for (int i = 0; i < waitingTargets.Length; i++) 3012stateOfInProgressTargets[waitingTargets.Length + i] =
Engine\EngineCallback.cs (8)
45if (buildRequests.Length > 0) 49for (int i = 0; i < buildRequests.Length; i++) 336bool haveCompleteResult = (result.Length == names.Length); 340for (int i = 0; i < result.Length; i++) 369if (nodeLoggingEventArray.Length > 0) 438Target[] targets = new Target[handleIds.Length]; 440for (int i = 0; i < handleIds.Length; i++)
Engine\EngineLoggingServices.cs (1)
121for (int i = 0; i < eventArray.Length; i++)
Engine\EngineProxy.cs (2)
539targetOutputsPerProject = new Dictionary<string, ITaskItem[]>[projectFileNames.Length]; 540for (int i = 0; i < targetOutputsPerProject.Length; i++)
Engine\Expander.cs (9)
1163args = new object[arguments.Length]; 1166for (int n = 0; n < arguments.Length; n++) 1188if (objectInstance != null && args.Length == 1 && (String.Equals("Equals", this.name, StringComparison.OrdinalIgnoreCase) || String.Equals("CompareTo", this.name, StringComparison.OrdinalIgnoreCase))) 1690object[] coercedArguments = new object[args.Length]; 1695for (int n = 0; n < parameters.Length; n++) 1783Type[] types = new Type[arguments.Length]; 1784for (int n = 0; n < arguments.Length; n++) 1819if (parameters.Length == this.arguments.Length)
Engine\IntrinsicFunctions.cs (1)
179if (views == null || views.Length == 0)
Engine\Node.cs (4)
272if (nodeLoggers.Length > 0) 497if (nodeLoggers.Length != 0) 553if (nodeLoggers.Length != 0) 585if (nodeLoggers.Length > 0)
Engine\NodeManager.cs (3)
59int[] nodeIds = new int[nodeDescriptions.Length]; 60for (int i = 0; i < nodeIds.Length; i++) 67for (int i = 0; i < nodeDescriptions.Length; i++)
Engine\Project.cs (6)
585if (this.defaultTargetNames.Length != 0) 3518if (targetNamesToBuild?.Length > 0) 3540if (propertyListToSerialize?.Length > 0) 3591if ((targetNamesToBuild == null) || (targetNamesToBuild.Length == 0)) 3779if ((defaultTargetNames == null) || (defaultTargetNames.Length == 0)) 4013for (int i = 0; i < importedFilenames.Length; i++)
Engine\ProjectBuildState.cs (1)
251for (int i = requiredTargetsArray.Length - 1; i >= 0; i--)
Engine\RegistryKeyWrapper.cs (1)
168for (int i = 0; i < keyNames.Length && wrapper.Exists(); ++i)
Engine\Scheduler.cs (13)
52this.totalRequestsPerNode = new int[nodes.Length]; 53this.blockedRequestsPerNode = new int[nodes.Length]; 54this.postBlockCount = new int[nodes.Length]; 56for (int i = 0; i < totalRequestsPerNode.Length; i++) 88if (nodes.Length == 1) 113for (int i = 0; i < nodes.Length; i++) 161nodeUsed = (lastUsedNode % nodes.Length); 188if (childMode || nodes.Length == 1) 243if (!childMode && nodes.Length > 1) 306for (int i = 0; i < totalRequestsPerNode.Length; i++) 338if (!childMode && nodes.Length > 1) 364if (!childMode && nodes.Length > 1) 396for (int i = 0; i < totalRequestsPerNode.Length; i++)
Engine\TargetDependencyAnalyzer.cs (1)
612for (int i = 0; i < inputItemsAssumedToBeUpToDate.Length; i++)
Engine\TaskExecutionModule.cs (15)
195if (projectFileNames.Length == 0) 208for (int r = 0; r < projectFileNames.Length; r++) 222BuildRequest[] buildRequests = new BuildRequest[projectFileNames.Length]; 223for (int i = 0; i < buildRequests.Length; i++) 236BuildResult[] buildResultsLocal = new BuildResult[projectFileNames.Length]; 240for (int i = 0; i < projectFileNames.Length; i++) 258for (int i = 0; i < buildResultsLocal.Length; i++) 316if ((breadthFirstTraversal && buildRequests.Length < batchRequestSize) || buildRequests.Length == 1) 334while (currentRequestIndex < buildRequests.Length) 340int numberOfRequestsToSend = (buildRequests.Length - currentRequestIndex) < batchRequestSize ? (buildRequests.Length - currentRequestIndex) : batchRequestSize; 343if (numberOfRequestsToSend != wrapperArrayBreadthFirst.Length) 360if ((buildRequests.Length - currentRequestIndex) > batchRequestSize) 372while ((currentRequestIndex < buildRequests.Length) && !breadthFirstTraversal)
Engine\TaskWorkerThread.cs (3)
437buildResult.RequestId < buildResults.Length, 452if (resultCount == buildResults.Length) 540for (int j = 0; j < taskData.buildRequests.Length; j++)
Engine\ToolsetState.cs (1)
193if (defaultTasksFiles.Length == 0)
Engine\Utilities.cs (3)
65for (int i = 0; i < leftValuePieces.Length; i++) 79if ((indexOfVerticalBar == -1) || (i == (leftValuePieces.Length - 1))) 82i = leftValuePieces.Length;
Introspector\Introspector.cs (8)
84for (int i = 0; i < nodeStatus.Length; i++) 159if (previousStatus == null || previousLocalStatus == null || nodeStatus.Length != previousStatus.Length) 175for (int i = 0; i < nodeStatus.Length; i++) 219for (int i = 0; i < nodeStatus.Length; i++) 232for (int i = 0; i < nodeStatus.Length; i++) 240for (int j = 0; j < nodeStatus[i].StateOfInProgressTargets.Length; j++) 250for (int j = 0; j < localStatus.StateOfInProgressTargets.Length; j++)
Introspector\NodeStatus.cs (2)
264writer.Write((Int32)stateOfInProgressTargets.Length); 265for (int i = 0; i < stateOfInProgressTargets.Length; i++)
Introspector\TargetCycleDetector.cs (3)
70for (int i = 0; i < inprogressTargets.Length; i++) 116for (int i = 0; i < inProgressTarget.OutstandingBuildRequests.Length; i++) 234for (int i = 0; i < externalRequests.Length && !foundParent; i++)
Introspector\TargetInProgressState.cs (4)
395writer.Write((Int32)outstandingBuildRequests.Length); 396for (int i = 0; i < outstandingBuildRequests.Length; i++) 418writer.Write((Int32)parentTargetsForBuildRequests.Length); 419for (int i = 0; i < parentTargetsForBuildRequests.Length; i++)
Items\BuildItem.cs (5)
704return GetCustomMetadataCount() + FileUtilities.ItemSpecModifiers.All.Length; 1985ITaskItem[] convertedItems = new TaskItem[originalItems.Length]; 1987for (int i = 0; i < originalItems.Length; i++) 2018BuildItem[] convertedItems = new BuildItem[originalItems.Length]; 2020for (int i = 0; i < originalItems.Length; i++)
Items\BuildItemGroup.cs (1)
874for (int j = 0; j < includeFileList.Length; j++)
LocalProvider\LocalCallDescriptor.cs (13)
204writer.Write((Int32)cacheArray.Length); 205for (int i = 0; i < cacheArray.Length; i++) 299for (int i = 0; i < buildRequests.Length; i++) 326writer.Write(buildRequests.Length); 454writer.Write((Int32)buildEvents.Length); 824writer.Write((Int32)nodeLoggers.Length); 825for (int i = 0; i < nodeLoggers.Length; i++) 1216writer.Write((Int32)entries.Length); 1217for (int i = 0; i < entries.Length; i++) 1271for (int i = 0; i < entries.Length; i++) 1417writer.Write((Int32)names.Length); 1418for (int i = 0; i < names.Length; i++) 1479for (int i = 0; i < names.Length; i++)
LocalProvider\LocalNodeProvider.cs (27)
47for (int param = 0; param < parameters.Length; param++) 53if (parameterComponents.Length == 2) 91for (int i = 0; i < nodeData.Length; i++) 183ErrorUtilities.VerifyThrow(nodeIds.Length == nodeData.Length, "Expected an ID for each node"); 185for (int i = 0; i < nodeIds.Length; i++) 205ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries"); 230ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries"); 275ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries"); 348for (int i = 0; i < nodeData.Length; i++) 376for (int i = 0; i < nodeData.Length; i++) 410for (int i = 0; i < nodeData.Length; i++) 513for (; i < nodeData.Length; i++) 522ErrorUtilities.VerifyThrow(i < nodeData.Length, "Expected to find a node to decrement count"); 548for (; i < nodeData.Length; i++) 558ErrorUtilities.VerifyThrow(i < nodeData.Length, "Expected to find a node to decrement count"); 566for (int i = 0; i < nodeData.Length; i++) 827if (nodeIndex >= 0 && nodeIndex < nodeData.Length) 841if (nodeIndex < 0 || nodeIndex >= nodeData.Length) 858WaitHandle[] waitHandles = new WaitHandle[1 + nodeData.Length]; 860for (int i = 0; i < nodeData.Length; i++) 889if (nodeIndex >= 0 && nodeIndex < nodeData.Length) 897for (int i = 0; i < nodeData.Length; i++) 915WaitHandle[] waitHandles = new WaitHandle[1 + nodeData.Length]; 917for (int i = 0; i < nodeData.Length; i++) 961if (nodeIndex >= 0 && nodeIndex < nodeData.Length) 969for (int i = 0; i < nodeData.Length; i++)
LocalProvider\SharedMemory.cs (1)
755if (readBuffer.Length < frameSizeInPages * NativeMethods.PAGE_SIZE)
Logging\BaseConsoleLogger.cs (5)
120for (int param = 0; param < parameterComponents.Length; param++) 126if (parameterAndValue.Length > 1) 189(subStrings.Length * indent) + 190(subStrings.Length * Environment.NewLine.Length) + 193for (int i = 0; i < subStrings.Length; i++)
Logging\ConsoleLogger.cs (1)
119for (int param = 0; param < parameterComponents.Length; param++)
Logging\DistributedLoggers\ConfigurableForwardingLogger.cs (1)
106for (int param = 0; param < parameterComponents.Length; param++)
Logging\DistributedLoggers\DistributedFileLogger.cs (2)
46for (int param = 0; param < parameterComponents.Length; param++) 52if (parameterAndValue.Length > 1)
Logging\FileLogger.cs (2)
158for (int param = 0; param < parameterComponents.Length; param++) 164if (parameterAndValue.Length > 1)
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
1182for (int i = 0; i < nonNullMessages.Length; i++)
Shared\AssemblyNameExtension.cs (3)
444if (aPKT.Length != bPKT.Length) 448for (int i = 0; i < aPKT.Length; ++i)
Shared\ErrorUtilities.cs (2)
624if (parameter1.Length != parameter2.Length)
Shared\EventArgsFormatting.cs (2)
224for (int i = 0; i < lines.Length; i++) 233if (i < (lines.Length - 1))
Shared\FileMatcher.cs (8)
298string[] longParts = new string[parts.Length - startingElement]; 301for (int i = startingElement; i < parts.Length; ++i) 321if (0 == entries.Length) 325for (int j = i; j < parts.Length; ++j) 333ErrorUtilities.VerifyThrow(entries.Length == 1, 335parts[i], longPath, path, entries.Length); 498for (int i = 0; i < paths.Length; i++) 529for (int i = 0; i < paths.Length; i++)
Shared\FileUtilities.cs (1)
72ItemSpecModifiers.tableOfItemSpecModifiers = new Hashtable(ItemSpecModifiers.All.Length, StringComparer.OrdinalIgnoreCase);
Shared\FrameworkLocationHelper.cs (2)
502if (directories.Length == 0) 518for (int i = 1; i < directories.Length; ++i)
Shared\LoadedType.cs (1)
114for (int i = 0; i < propertyInfos.Length; i++)
Shared\ProjectWriter.cs (2)
165ErrorUtilities.VerifyThrow(itemVectorTransforms.Count == (surroundingTextPieces.Length - 1), 190base.WriteString(surroundingTextPieces[surroundingTextPieces.Length - 1]);
Shared\ResourceUtilities.cs (1)
130if ((args?.Length > 0))
Shared\SolutionParser.cs (5)
1108ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationNames.Length == 2, "SubCategoryForSolutionParsingErrors", 1125ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationPlatformParts.Length == 2, "SubCategoryForSolutionParsingErrors", 1170ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(nameValue.Length == 2, "SubCategoryForSolutionParsingErrors", 1222ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationPlatformParts.Length <= 2, "SubCategoryForSolutionParsingErrors", 1228(configurationPlatformParts.Length > 1) ? configurationPlatformParts[1] : string.Empty,
Shared\XMakeElements.cs (1)
90illegalItemOrPropertyNamesHashtable = new Hashtable(XMakeElements.illegalPropertyOrItemNames.Length);
Utilities\EngineFileUtilities.cs (1)
71for (int i = 0; i < fileList.Length; i++)
Microsoft.Build.Engine.OM.UnitTests (22)
Construction\ConstructionEditing_Tests.cs (4)
3216Assert.True(splits.Length >= 1); 3220if (splits.Length == 1) 3228for (var i = 1; i < splits.Length - 1; i++) 3233sb.Append(itemSpace).Append(splits[splits.Length - 1]);
Construction\SolutionFile_Tests.cs (1)
1044for (int i = 0; i < lines.Length; i++)
Definition\Project_Tests.cs (1)
349for (int i = 0; i < tasks.Length; i++)
ErrorUtilities.cs (5)
161if (parameterValue.Length == 0) 586if (parameter1.Length != parameter2.Length) 620VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 622int arrayCapacity = array.Length - arrayIndex;
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1137ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1152while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1157if (index == splitBase.Length && index == splitPath.Length) 1170for (int i = index; i < splitBase.Length; i++) 1174for (int i = index; i < splitPath.Length; i++)
Instance\ProjectItemInstance_Tests.cs (1)
1181for (int i = 0; i < includes.Length; i++)
ResourceUtilities.cs (1)
230if ((args?.Length > 0))
Microsoft.Build.Engine.UnitTests (109)
BackEnd\AssemblyTaskFactory_Tests.cs (3)
217Assert.Equal(comparisonInfo.Length, propertyInfos.Length); 222for (int i = 0; i < propertyInfos.Length; i++)
BackEnd\BuildManager_Tests.cs (2)
454Assert.Equal(3, item.Length); 988deferredMessages.Length.ShouldBe(3);
BackEnd\CacheAggregator_Tests.cs (2)
270aggregatedConfigs.Length.ShouldBe(currentBuildResultIndex); 271aggregatedResults.Length.ShouldBe(currentBuildResultIndex);
BackEnd\DebugUtils_tests.cs (2)
34(exceptionFiles.Length - exceptionFilesBefore.Length).ShouldBe(1);
BackEnd\ItemCreationTask.cs (2)
57CopiedOutputItems = new ITaskItem[InputItemsToCopy.Length]; 59for (int i = 0; i < InputItemsToCopy.Length; i++)
BackEnd\MockLoggingService.cs (1)
326if (messageArgs?.Length > 0)
BackEnd\MSBuild_Tests.cs (7)
163Assert.Equal(7, targetOutputs["Build"].Items.Length); 572Assert.Equal(4, targetOutputs["Build"].Items.Length); 639Assert.Equal(2, targetOutputs["Build"].Items.Length); 1067Assert.Equal(3, targetOutputs["Build"].Items.Length); 1136Assert.Equal(3, targetOutputs["Build"].Items.Length); 1202Assert.Equal(2, targetOutputs["Build"].Items.Length); 1812Assert.Equal(5, targetOutputs["Build"].Items.Length);
BackEnd\RequestBuilder_Tests.cs (5)
294_newBuildRequests_BuildRequests = new BuildRequest[requests.Length]; 375string[] projectFiles = new string[_newRequests.Length]; 376PropertyDictionary<ProjectPropertyInstance>[] properties = new PropertyDictionary<ProjectPropertyInstance>[_newRequests.Length]; 377string[] toolsVersions = new string[_newRequests.Length]; 379for (int i = 0; i < projectFiles.Length; ++i)
BackEnd\ResultsCache_Tests.cs (1)
85results.Length.ShouldBe(2);
BackEnd\TargetBuilder_Tests.cs (1)
1515Assert.Equal(tasks.Length, mockBuilder.ExecutedTasks.Count);
BackEnd\TargetEntry_Tests.cs (5)
478Assert.Equal(2, results.Items.Length); 497Assert.Equal(3, results.Items.Length); 515Assert.Equal(3, results.Items.Length); 556Assert.Equal(2, results.Items.Length); 619Assert.Equal(4, results.Items.Length);
BackEnd\TargetUpToDateChecker_Tests.cs (1)
539for (int i = 0; i < filesToAnalyze.Length; ++i)
BackEnd\TaskBuilderTestTask.cs (4)
1307var propertyInfos = new TaskPropertyInfo[infos.Length]; 1308for (int i = 0; i < infos.Length; i++) 1313infos[i].GetCustomAttributes(typeof(OutputAttribute), false).Length > 0, 1314infos[i].GetCustomAttributes(typeof(RequiredAttribute), false).Length > 0);
BackEnd\TaskExecutionHost_Tests.cs (13)
1325Assert.Equal(values.Length, _bucket.Lookup.GetItems("output").Count); 1326for (int i = 0; i < values.Length; i++) 1340Assert.Equal(values.Length, _bucket.Lookup.GetItems("output").Count); 1341for (int i = 0; i < values.Length; i++) 1421Assert.Equal(expectedItems.Length, actualItems.Length); 1423for (int i = 0; i < expectedItems.Length; i++) 1439Assert.Equal(expectedItems.Length, actualItems.Length); 1441for (int i = 0; i < expectedItems.Length; i++) 1459Assert.Equal(expectedArray.Length, actualArray.Length); 1460for (int i = 0; i < expectedArray.Length; i++)
BackEnd\TaskHostConfiguration_Tests.cs (3)
745if (x.Length != y.Length) 750for (int i = 0; i < x.Length; i++)
BackEnd\TaskThatReturnsDictionaryTaskItem.cs (2)
146if (index < 0 || index > array.Length) 151if (array.Length - index < Count)
BackEnd\TranslationHelpers.cs (1)
75for (int i = 0; i < leftArray.Length; i++)
BinaryLogger_Tests.cs (2)
256while (br1.ReadBytes(bufferSize) is { Length: > 0 } bytes1) 265br2.ReadBytes(bufferSize).Length.ShouldBe(0, "Second buffer contains bytes after first file end");
BuildEventArgsSerialization_Tests.cs (3)
48Assert.Equal(bytes.Length, binaryReader.Read7BitEncodedInt()); 49Assert.Equal(bytes, binaryReader.ReadBytes(bytes.Length)); 471(AssemblyLoadingContext)(new Random().Next(Enum.GetNames(typeof(AssemblyLoadingContext)).Length));
ChangeWaves_Tests.cs (7)
72log.WarningCount.ShouldBe(warningCodesLogShouldContain.Length); 86for (int i = 0; i < ChangeWaves.AllWaves.Length - 1; i++) 146for (int i = 0; i < ChangeWaves.AllWaves.Length; i++) 166for (int i = 0; i < ChangeWaves.AllWaves.Length - 1; i++) 176versionToCheckAgainstCurrentChangeWave: ChangeWaves.AllWaves[ChangeWaves.AllWaves.Length - 1], 203for (int i = 0; i < ChangeWaves.AllWaves.Length - 1; i++) 213versionToCheckAgainstCurrentChangeWave: ChangeWaves.AllWaves[ChangeWaves.AllWaves.Length - 1],
Construction\SolutionProjectGenerator_Tests.cs (1)
605for (int i = 0; i < solutions.Length; i++)
Definition\ProjectEvaluationContext_Tests.cs (4)
692string[][] prependedExpectedGlobExpansions = new string[expectedGlobExpansions.Length][]; 693for (int expIndex = 0; expIndex < expectedGlobExpansions.Length; expIndex++) 696string[] prependedGlobExpansion = new string[globExpansion.Length]; 699for (var i = 0; i < globExpansion.Length; i++)
Definition\ToolsetConfigurationReader_Tests.cs (1)
587Assert.Equal(paths.SearchPaths.Count, expectedPaths.Length);
Definition\ToolsVersion_Tests.cs (4)
262Assert.Equal(sortedTasksExpectedPaths.Count, foundFiles.Length); 263for (int i = 0; i < foundFiles.Length; i++) 268Assert.Equal(sortedOverrideExpectedPaths.Count, foundoverrideFiles.Length); 269for (int i = 0; i < foundoverrideFiles.Length; i++)
Evaluation\Expander_Tests.cs (2)
3922for (int a = 0; a < hashes.Length; a++) 3924for (int b = a; b < hashes.Length; b++)
Evaluation\ProjectSdkImplicitImport_Tests.cs (1)
484events.Length.ShouldBe(2);
FileLogger_Tests.cs (5)
144for (int i = 0; i < verbositySettings.Length; i++) 155for (int i = 0; i < verbositySettings.Length; i++) 473Assert.Equal(expectedLines.Length, actualLines.Length); 475for (int i = 0; i < expectedLines.Length; i++)
FileMatcher_Tests.cs (2)
71fileMatches.Length.ShouldBe(expectedMatchCount, $"Matches: '{String.Join("', '", fileMatches)}'"); 86fileMatches.Length.ShouldBe(1);
Globbing\CompositeGlob_Tests.cs (1)
133Assert.Equal(4, leafGlobs.Length);
Graph\GraphLoadedFromSolution_tests.cs (1)
39for (var i = 0; i < files.Length; i++)
Graph\GraphTestingUtilities.cs (1)
71innerBuilds.Length.ShouldBe(expectedInnerBuildCount);
Graph\IsolateProjects_Tests.cs (4)
345declaredReferenceBuildResults.Length.ShouldBe(1); 346rootBuildResults.Length.ShouldBe(1); 364declaredReferenceBuildResults[0]["DeclaredReferenceTarget"].Items.Length.ShouldBe(1); 366rootBuildResults[0]["BuildDeclaredReference"].Items.Length.ShouldBe(0);
Graph\ProjectGraph_Tests.cs (2)
1815toposort.Length.ShouldBe(projectGraph.ProjectNodes.Count); 1817for (var i = 0; i < toposort.Length; i++)
Graph\ResultCacheBasedBuilds_Tests.cs (2)
140result.ResultsByTarget["Build"].Items.Length.ShouldBe(1); 172resultFromCachedBuild.ResultsByTarget["Build"].Items.Length.ShouldBe(1);
Instance\TaskItem_Tests.cs (1)
194item.MetadataCount.ShouldBe(s_builtInMetadataNames.Length + 2);
ProjectCache\ProjectCacheTests.cs (3)
1633logger.ProjectStartedEvents.Count.ShouldBe(2 * projectPaths.Length); 1635cacheHitCount.ShouldBe(projectPaths.Length); 1636nonCacheHitCount.ShouldBe(projectPaths.Length);
SolutionFileBuilder.cs (2)
114if (SolutionDependencies?.Length > 0) 125if (SolutionDependenciesProjectNameToGuids?.Length > 0)
TaskParameter_Tests.cs (5)
99Array array = Array.CreateInstance(type, values.Length); 100for (int i = 0; i < values.Length; i++) 158Assert.Equal(2, stringArray.Length); 254Assert.Equal(2, wrappedParameter.Length); 265Assert.Equal(2, wrappedParameter2.Length);
Microsoft.Build.Framework (53)
BinaryTranslator.cs (7)
262length = byteArray.Length; 838int count = array.Length; 897int count = array.Length; 949int count = array.Length; 1186var length = byteArray?.Length ?? 0; 1222int count = array.Length; 1244int count = array.Length;
ChangeWaves.cs (1)
65return AllWaves[AllWaves.Length - 1];
EncodingUtilities.cs (4)
144var buffer = new byte[preamble.Length]; 154bytesRead = stream.Read(buffer, 0, preamble.Length); 162return bytesRead == preamble.Length && !buffer.Where((t, i) => preamble[i] != t).Any(); 234if (defaultEncoding is UTF8Encoding e && e.GetPreamble().Length > 0)
LazyFormattedBuildEventArgs.cs (4)
91if (argsOrMessage is object[] arguments && arguments.Length > 0 && base.Message is not null) 109if (argsOrMessage is object[] arguments && arguments.Length > 0) 112writer.Write(arguments.Length); 173if ((args?.Length > 0))
Logging\LoggerParametersHelper.cs (1)
64yield return new Tuple<string, string?>(parameterAndValue[0], parameterAndValue.Length > 1 ? parameterAndValue[1] : null);
NativeMethods.cs (1)
1284if (statFields.Length >= 3)
Sdk\SdkReference.cs (4)
89if (parts.Length < 1 || parts.Length > 2) 99if (parts.Length == 1 || string.IsNullOrWhiteSpace(parts[1])) 103else if (parts.Length == 2)
SegmentedArray.cs (6)
55if (length > destinationArray.Length) 487var remainingInSegment = firstSegment.Length - offset; 590var remainingInFirstSegment = firstSegment.Length - firstOffset; 591var remainingInSecondSegment = secondSegment.Length - secondOffset; 729var remainingInSegment = segment.Length - offset; 778var remainingInSegment = segment.Length - offset;
SegmentedArray`1.cs (11)
84for (var i = 0; i < _items.Length - 1; i++) 93var lastPageSize = length - ((_items.Length - 1) << SegmentShift); 95_items[_items.Length - 1] = new T[lastPageSize]; 148for (var i = 0; i < items.Length; i++) 158for (var i = 0; i < _items.Length; i++) 166for (var i = 0; i < _items.Length; i++) 242for (var i = 0; i < _items.Length; i++) 257for (var i = 0; i < _items.Length; i++) 398if (_items.Length == 0) 401if (_nextItemIndex == _items[_nextItemSegment].Length) 403if (_nextItemSegment == _items.Length - 1)
SegmentedDictionary`2.cs (12)
300if ((uint)index > (uint)array.Length) 305if (array.Length - index < Count) 862if ((uint)index > (uint)array.Length) 867if (array.Length - index < Count) 1282if (index < 0 || index > array.Length) 1287if (array.Length - index < _dictionary.Count) 1343if ((uint)index > (uint)array.Length) 1348if (array.Length - index < _dictionary.Count) 1482if ((uint)index > array.Length) 1487if (array.Length - index < _dictionary.Count) 1543if ((uint)index > (uint)array.Length) 1548if (array.Length - index < _dictionary.Count)
SegmentedList`1.cs (1)
94if ((T[][])_items.SyncRoot is { Length: 1 } segments)
Traits.cs (1)
576if ((args?.Length > 0))
Microsoft.Build.Framework.UnitTests (2)
AssemblyLoadBuildEventArgs_Tests.cs (1)
22(AssemblyLoadingContext)(new Random().Next(Enum.GetNames(typeof(AssemblyLoadingContext)).Length));
ResourceUtilities.cs (1)
230if ((args?.Length > 0))
Microsoft.Build.Tasks.Core (239)
AssemblyDependency\AssemblyInformation.cs (1)
556if (publicKeyOrToken.Length <= 8)
AssemblyDependency\AssemblyResolution.cs (2)
161var resolvers = new Resolver[searchPaths.Length]; 163for (int p = 0; p < searchPaths.Length; ++p)
AssemblyDependency\GenerateBindingRedirects.cs (5)
57if (SuggestedRedirects == null || SuggestedRedirects.Length == 0) 257if (oldVersionRange.Length == 0 || oldVersionRange.Length > 2) 263var oldVerStrHigh = oldVersionRange[oldVersionRange.Length == 1 ? 0 : 1]; 361ErrorUtilities.VerifyThrow(SuggestedRedirects?.Length > 0, "This should not be called if there is no suggested redirect.");
AssemblyDependency\Reference.cs (1)
259if (scatterFilesToAttach == null || scatterFilesToAttach.Length == 0)
AssemblyDependency\ReferenceTable.cs (11)
965string satelliteFilename = subDirectories.Length > 0 1034var dependencies = new List<AssemblyNameExtension>(dependentAssemblies?.Length ?? 0); 1036if (dependentAssemblies?.Length > 0) 1039for (int i = 0; i < dependentAssemblies.Length; i++) 1886if (pkt?.Length > 0) 2026if (_latestTargetFrameworkDirectories?.Length > 0) 2293return refPkt != null && refPkt.Length != 0; 2307if (rpkt.Length != dpkt.Length) 2312for (int i = 0; i < rpkt.Length; i++) 2740if (relatedFileExtensions.Count > 0 || satellites.Count > 0 || serializationAssemblyFiles.Count > 0 || scatterFiles.Length > 0)
AssemblyDependency\ResolveAssemblyReference.cs (29)
1314var buffer = new StringBuilder(a.Length * 2); 1315for (int i = 0; i < a.Length; ++i) 2055if (_cache == null && AssemblyInformationCachePaths != null && AssemblyInformationCachePaths.Length > 0) 2194for (int i = 0; i < _targetFrameworkDirectories.Length; i++) 2207if (installedAssemblyTableInfo?.Length > 0) 2218bool targetingProfile = !String.IsNullOrEmpty(ProfileName) && ((FullFrameworkFolders.Length > 0) || (FullFrameworkAssemblyTables.Length > 0)); 2232if (inclusionListSubsetTableInfo.Length > 0 && (redistList?.Count > 0)) 2286for (int i = 0; i < redistList.Errors.Length; ++i) 2648MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies); 2665MSBuildEventSource.Log.RarOverallStop(_assemblyNames?.Length ?? -1, _assemblyFiles?.Length ?? -1, _resolvedFiles?.Length ?? -1, _resolvedDependencyFiles?.Length ?? -1, _copyLocalFiles?.Length ?? -1, _findDependencies); 2771if (fullRedistAssemblyTableInfo.Length > 0) 2802for (int i = 0; i < fullFrameworkRedistList.Errors.Length; ++i) 2855bool targetFrameworkSubsetIsSet = TargetFrameworkSubsets.Length != 0 || InstalledAssemblySubsetTables.Length != 0; 2859bool fullFrameworkFoldersIsSet = FullFrameworkFolders.Length > 0; 2860bool fullFrameworkTableLocationsIsSet = FullFrameworkAssemblyTables.Length > 0; 2958if (IgnoreDefaultInstalledAssemblySubsetTables && _installedAssemblySubsetTables.Length == 0) 2965if (_targetFrameworkSubsets.Length == 0 && _installedAssemblySubsetTables.Length == 0) 3048if (TargetFrameworkDirectories?.Length == 1)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
AssignCulture.cs (3)
129AssignedFiles = new ITaskItem[Files.Length]; 130CultureNeutralAssignedFiles = new ITaskItem[Files.Length]; 136for (int i = 0; i < Files.Length; ++i)
AssignProjectConfiguration.cs (2)
311if (configurationPlatformParts.Length > 1) 398if (platforms.Length != 2)
AssignTargetPath.cs (3)
48AssignedFiles = new ITaskItem[Files.Length]; 50if (Files.Length > 0) 74for (int i = 0; i < Files.Length; ++i)
BootstrapperUtil\BootstrapperBuilder.cs (1)
1605var output = new StringBuilder(byteArray.Length);
BootstrapperUtil\ResourceUpdater.cs (6)
74if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)resource.Type, resource.Name, 0, data, data.Length)) 86if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)42, "COUNT", 0, countArray, countArray.Length)) 119if (!NativeMethods.UpdateResourceW(hUpdate, (IntPtr)42, keyName, 0, data, data.Length)) 147byte[] data = new byte[strBytes.Length + 2]; 149data[data.Length - 2] = 0; 150data[data.Length - 1] = 0;
CallTarget.cs (1)
65if ((Targets == null) || (Targets.Length == 0))
CanonicalError.cs (1)
321if (explodedText.Length > 0)
CommandLineBuilderExtension.cs (5)
188string[] splitAndTrimmed = new string[splits.Length]; 189for (int i = 0; i < splits.Length; ++i) 238(metadataNames != null && metadataNames.Length == treatAsFlags.Length), 249for (int i = 0; i < metadataNames.Length; ++i)
Copy.cs (18)
434success = parallelism == 1 || DestinationFiles.Length == 1 458destinationFilesSuccessfullyCopied = new List<ITaskItem>(DestinationFiles.Length); 466DestinationFiles.Length, // Set length to common case of 1:1 source->dest. 470for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 545DestinationFiles.Length, // Set length to common case of 1:1 source->dest. 548for (int i = 0; i < SourceFiles.Length && !_cancellationTokenSource.IsCancellationRequested; ++i) 562var successFlags = new IntPtr[DestinationFiles.Length]; 636destinationFilesSuccessfullyCopied = new List<ITaskItem>(DestinationFiles.Length); 637for (int i = 0; i < successFlags.Length; i++) 650return (SourceFiles == null || SourceFiles.Length == 0) && (SourceFolders == null || SourceFolders.Length == 0); 693if (DestinationFiles != null && DestinationFiles.Length != SourceFiles.Length) 695Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", DestinationFiles.Length, SourceFiles.Length, "DestinationFiles", "SourceFiles"); 723DestinationFiles = new ITaskItem[SourceFiles.Length]; 725for (int i = 0; i < SourceFiles.Length; ++i) 748if (isSuccess && SourceFolders != null && SourceFolders.Length > 0)
CreateManifestResourceName.cs (4)
124ManifestResourceNames = new ITaskItem[ResourceFiles.Length]; 125ResourceFilesWithManifestResourceNames = new ITaskItem[ResourceFiles.Length]; 349for (int i = 1; i < subNames.Length; i++) 379for (int i = 1; i < subNames.Length; i++)
ErrorUtilities.cs (5)
161if (parameterValue.Length == 0) 586if (parameter1.Length != parameter2.Length) 620VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 622int arrayCapacity = array.Length - arrayIndex;
Exec.cs (1)
628for (int i = 0; i < _charactersToEscape.Length; i++)
FileIO\GetFileHash.cs (2)
84Parallel.For(0, Files.Length, parallelOptions, index => 113if (Files.Length == 1)
FileMatcher.cs (5)
484string[] longParts = new string[parts.Length - startingElement]; 487for (int i = startingElement; i < parts.Length; ++i) 511for (int j = i; j < parts.Length; ++j) 894for (int i = 0; i < excludeNextSteps.Length; i++) 942for (int i = 0; i < excludeNextSteps.Length; i++)
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1137ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1152while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1157if (index == splitBase.Length && index == splitPath.Length) 1170for (int i = index; i < splitBase.Length; i++) 1174for (int i = index; i < splitPath.Length; i++)
FindAppConfigFile.cs (2)
97for (int i = PrimaryList.Length - 1; i >= 0; i--) 105for (int i = SecondaryList.Length - 1; i >= 0; i--)
FindInList.cs (1)
86for (int i = List.Length - 1; i >= 0; i--)
GenerateApplicationManifest.cs (1)
421if (values.Length != 5)
GenerateResource.cs (17)
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) 2060OutputResources = new ITaskItem[Sources.Length]; 2064for (i = 0; i < Sources.Length; ++i) 2105ErrorUtilities.VerifyThrow(OutputResources != null && OutputResources.Length != 0, "Should be at least one output resource"); 2108ITaskItem[] temp = new ITaskItem[OutputResources.Length - _unsuccessfullyCreatedOutFiles.Count]; 2111for (int i = 0; i < Sources.Length; i++) 2523_assemblyNames = new AssemblyNameExtension[_assemblyFiles.Length]; 2524for (int i = 0; i < _assemblyFiles.Length; i++) 3470if (errors.Length > 0)
GetAssemblyIdentity.cs (1)
48var s = new StringBuilder(a.Length * 2);
GetCompatiblePlatform.cs (2)
54AssignedProjectsWithPlatform = new ITaskItem[AnnotatedProjects.Length]; 55for (int i = 0; i < AnnotatedProjects.Length; i++)
GetSDKReferenceFiles.cs (2)
373if (manifestReferencePaths?.Length > 0) 1006if (sdkManifestReferences?.Length > 0)
Hash.cs (3)
62if (ItemsToHash?.Length > 0) 79for (int i = 0; i < ItemsToHash.Length; i++) 92shaBufferPosition = AddBytesToShaBuffer(sha, shaBuffer, shaBufferPosition, ShaBufferSize, s_itemSeparatorCharacterBytes, s_itemSeparatorCharacterBytes.Length);
ListOperators\RemoveDuplicates.cs (4)
41if (Inputs == null || Inputs.Length == 0) 49var filteredList = new List<ITaskItem>(Inputs.Length); 60HadAnyDuplicates = Inputs.Length != Filtered.Length;
LockCheck.cs (2)
145private static readonly int RM_SESSION_KEY_LEN = Guid.Empty.ToByteArray().Length; // 16-byte 300res = RmRegisterResources(handle, (uint)resources.Length, resources, 0, null, 0, null);
ManifestUtil\EmbeddedManifestReader.cs (1)
56Marshal.Copy(hResource, buffer, 0, buffer.Length);
ManifestUtil\mansign2.cs (10)
516if (cspPublicKeyBlob == null || cspPublicKeyBlob.Length == 0) 535publicKeyBlob.cbData = (uint)cspPublicKeyBlob.Length; 708manifestInformationNode.SetAttribute("Hash", hash.Length == 0 ? "" : BytesToHexString(hash, 0, hash.Length)); 837nonce[nonce.Length - 1] &= 0x7f; 838nonce[nonce.Length - 1] |= 0x01; 848para.Nonce.cbData = (uint)nonce.Length; 858sigValueBytes.Length, 929licenseBlob.cbData = (uint)licenseXml.Length; 941Marshal.Copy(timestampBlob.pbData, timestampSignature, 0, timestampSignature.Length);
ManifestUtil\MetadataReader.cs (1)
170if (pk.Length != 0)
ManifestUtil\Util.cs (4)
70StringBuilder s = new StringBuilder(a.Length); 86StringBuilder s = new StringBuilder(a.Length); 405for (int i = 0; i < s_platforms.Length; ++i) 423if (items.Length <= 1)
ManifestUtil\XmlUtil.cs (2)
105if (entries.Length > 0) 148string filename = uri.Segments[uri.Segments.Length - 1];
Move.cs (8)
94if (SourceFiles == null || SourceFiles.Length == 0) 116if (DestinationFiles != null && DestinationFiles.Length != SourceFiles.Length) 118Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", DestinationFiles.Length, SourceFiles.Length, "DestinationFiles", "SourceFiles"); 125DestinationFiles = new ITaskItem[SourceFiles.Length]; 127for (int i = 0; i < SourceFiles.Length; ++i) 153for (int i = 0; i < SourceFiles.Length && !_canceling; ++i)
MSBuild.cs (11)
202if ((Projects == null) || (Projects.Length == 0)) 208if (TargetAndPropertyListSeparators?.Length > 0) 263skipProjects = new bool[Projects.Length]; 264for (int i = 0; i < skipProjects.Length; i++) 278for (int i = 0; i < Projects.Length; i++) 376for (int i = 0; i < Projects.Length; i++) 457var targetLists = new List<string[]>(runEachTargetSeparately ? targets.Length : 1); 458if (runEachTargetSeparately && targets.Length > 0) 501for (int i = 0; i < projectNames.Length; i++) 540undefinePropertiesPerProject[i] = new List<string>(propertiesToUndefine.Length); 543if (log != null && propertiesToUndefine.Length > 0)
PlatformNegotiation.cs (1)
113if (keyVal.Length != 2 || string.IsNullOrEmpty(keyVal[0]) || string.IsNullOrEmpty(keyVal[1]))
RedistList.cs (11)
224var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 225for (int i = 0; i < redistListPaths.Length; ++i) 260var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 261for (int i = 0; i < redistListPaths.Length; ++i) 277var assemblyTableInfos = new AssemblyTableInfo[redistListPaths.Length]; 278for (int i = 0; i < redistListPaths.Length; ++i) 346var keyBuilder = assemblyTables.Length > 0 ? new StringBuilder(assemblyTables[0].Descriptor) : new StringBuilder(); 347for (int i = 1; i < assemblyTables.Length; ++i) 534var keyBuilder = allowListAssemblyTableInfo.Length > 0 ? new StringBuilder(allowListAssemblyTableInfo[0].Descriptor) : new StringBuilder(); 537for (int i = 1; i < allowListAssemblyTableInfo.Length; ++i) 1022if (_subsetToSearchFor.Length > 0)
ResGenDependencies.cs (3)
397if (OutputFiles.Length != otherLibrary.OutputFiles.Length) 402for (int i = 0; i < OutputFiles.Length; i++)
ResolveManifestFiles.cs (3)
174if (RuntimePackAssets != null && RuntimePackAssets.Length > 0) 348itemCulture = pathSegments.Length > 1 ? pathSegments[pathSegments.Length - 2] : null;
ResolveSDKReference.cs (6)
276if (InstalledSDKs.Length == 0) 296var sdkItems = new Dictionary<string, ITaskItem>(InstalledSDKs.Length, StringComparer.OrdinalIgnoreCase); 1233for (int i = 0; i < supportedArchitectures.Length; i++) 1238if (supportedArchitectures.Length > 1 && i != supportedArchitectures.Length - 1) 1360switch (appxComponents.Length)
ResourceHandling\MSBuildResXReader.cs (3)
240if (fileRefInfo.Length == 3) 367if (parts.Length > 1) 371else if (parts.Length > 0)
ResourceUtilities.cs (1)
230if ((args?.Length > 0))
SetRidAgnosticValueForProjects.cs (2)
47if (isRidAgnosticArray.Length != targetFrameworksArray.Length)
StateFileBase.cs (1)
103if (parameters.Length == 1 && parameters[0].ParameterType == typeof(ITranslator))
System.Design.cs (2)
137if (args?.Length > 0) 139for (int i = 0; i < args.Length; i++)
SystemState.cs (1)
572retVal.isDirty = stateFiles.Length > 0;
Telemetry.cs (1)
42if (item.Length != 2)
Unzip.cs (2)
260if (_includePatterns.Length > 0) 265if (_excludePatterns.Length > 0)
WriteCodeFragment.cs (1)
480.Where(t => t.Length == positionalParameters.Count)
XmlPeek.cs (1)
159if (Result.Length == 0)
XslTransformation.cs (10)
115if (XmlInputPaths != null && XmlInputPaths.Length != _outputPaths.Length) 117Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", _outputPaths.Length, XmlInputPaths.Length, "OutputPaths", "XmlInputPaths"); 122if (XmlContent != null && _outputPaths.Length != 1) 124Log.LogErrorWithCodeFromResources("General.TwoVectorsMustHaveSameLength", _outputPaths.Length, 1, "OutputPaths", "XmlContent"); 191for (int i = 0; i < XmlInputPaths.Length; i++) 286_data = new string[xmlFile.Length]; 287for (int i = 0; i < xmlFile.Length; i++) 318public int Count => _data.Length;
Microsoft.Build.Tasks.UnitTests (128)
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (2)
138dll2.scatterFiles.Length.ShouldBe(dll.scatterFiles.Length);
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (5)
2998if (t.InstalledAssemblyTables.Length == 0) 3048Assert.Equal(loadModeResolvedFiles.Length, t.ResolvedFiles.Length); 3049for (int i = 0; i < loadModeResolvedFiles.Length; i++) 3101for (int i = 0; i < t.ResolvedFiles.Length; i++)
AssemblyDependency\SuggestedRedirects.cs (5)
66Assert.Equal(3, t.ResolvedDependencyFiles.Length); 210Assert.Equal(3, t.ResolvedFiles.Length); 255Assert.Equal(3, t.ResolvedFiles.Length); 414Assert.Equal(2, t.ResolvedDependencyFiles.Length); 457Assert.Equal(2, t.ResolvedDependencyFiles.Length);
AssignTargetPath_Tests.cs (5)
28t.AssignedFiles.Length.ShouldBe(1); 43t.AssignedFiles.Length.ShouldBe(1); 64t.AssignedFiles.Length.ShouldBe(1); 81t.AssignedFiles.Length.ShouldBe(1); 107t.AssignedFiles.Length.ShouldBe(1);
Copy_Tests.cs (25)
135(task.CopiedFiles == null || task.CopiedFiles.Length == 0).ShouldBeTrue(); 136(task.DestinationFiles == null || task.DestinationFiles.Length == 0).ShouldBeTrue(); 156task.CopiedFiles.Length.ShouldBe(1); 158task.DestinationFiles.Length.ShouldBe(1); 181task.CopiedFiles.Length.ShouldBe(1); 183task.DestinationFiles.Length.ShouldBe(1); 224task.CopiedFiles.Length.ShouldBe(10); 226task.DestinationFiles.Length.ShouldBe(10); 248task.CopiedFiles.Length.ShouldBe(0); 250task.DestinationFiles.Length.ShouldBe(0); 279task.CopiedFiles.Length.ShouldBe(3); 281task.DestinationFiles.Length.ShouldBe(3); 303task.CopiedFiles.Length.ShouldBe(0); 305task.DestinationFiles.Length.ShouldBe(0); 327task.CopiedFiles.Length.ShouldBe(0); 329task.DestinationFiles.Length.ShouldBe(0); 353(task.DestinationFiles == null || task.DestinationFiles.Length == 0).ShouldBeTrue(); 1006Assert.Equal(2, t.CopiedFiles.Length); 1619Assert.Equal(2, t.DestinationFiles.Length); 1818Assert.Equal(2, t.DestinationFiles.Length); 1825Assert.Equal(2, t.CopiedFiles.Length); 2022Assert.Equal(4, t.CopiedFiles.Length); 2089Assert.Equal(5, t.CopiedFiles.Length); 2685Assert.Equal(2, t.DestinationFiles.Length); 2686Assert.Equal(2, t.CopiedFiles.Length);
Exec_Tests.cs (2)
927Assert.Equal(2, exec.ConsoleOutput.Length); 1047exec.ConsoleOutput.Length.ShouldBe(1);
FindInvalidProjectReferences_Tests.cs (1)
57Assert.Equal(2, t.InvalidReferences.Length);
GetFileHash_Tests.cs (1)
96task.Items.Length.ShouldBe(2);
GetInstalledSDKLocations_Tests.cs (3)
287Assert.Equal(6, installedSDKs.Length); 334Assert.Equal(6, installedSDKs.Length); 408Assert.Equal(6, installedSDKs.Length);
GetSDKReference_Tests.cs (27)
432Assert.Equal(9, t.CopyLocalFiles.Length); 433Assert.Equal(8, t.References.Length); 508Assert.Equal(8, t.References.Length); 519Assert.Equal(8, t.References.Length); 557Assert.Equal(8, t.References.Length); 650Assert.Equal(2, allCacheFiles.Length); 675Assert.Equal(8, t.References.Length); 724Assert.Equal(5, t.References.Length); 816Assert.Equal(8, t.References.Length); 868Assert.Equal(8, t.References.Length); 919Assert.Equal(8, t.References.Length); 956Assert.Equal(8, t.References.Length); 957Assert.Equal(5, t.RedistFiles.Length); 1018Assert.Equal(5, t.RedistFiles.Length); 1049Assert.Equal(5, t.RedistFiles.Length); 1081Assert.Equal(5, t.RedistFiles.Length); 1112Assert.Equal(8, t.References.Length); 1141Assert.Equal(8, t.References.Length); 1169Assert.Equal(5, t.RedistFiles.Length); 1197Assert.Equal(5, t.RedistFiles.Length); 1234Assert.Equal(8, t.References.Length); 1235Assert.Equal(6, t.RedistFiles.Length); 1280Assert.Equal(8, t.References.Length); 1281Assert.Equal(6, t.RedistFiles.Length); 1323Assert.Equal(8, t.References.Length); 1324Assert.Equal(6, t.RedistFiles.Length); 1368Assert.Equal(7, t.RedistFiles.Length);
Hash_Tests.cs (2)
59for (int i = 0; i < itemsToHash.Length; i++) 75for (int i = 0; i < array.Length; i++)
MakeDir_Tests.cs (2)
94Assert.Equal(2, t.DirectoriesCreated.Length); 102Assert.Equal(3, t.DirectoriesCreated.Length);
Move_Tests.cs (2)
461Assert.Equal(2, t.DestinationFiles.Length); 662Assert.Equal(2, t.DestinationFiles.Length);
MSBuild_Tests.cs (1)
1350Assert.Equal(5, msbuildTask.TargetOutputs.Length);
RARPrecomputedCache_Tests.cs (1)
149assembly3.scatterFiles.Length.ShouldBe(2);
ReadLinesFromFile_Tests.cs (3)
55Assert.Equal(3, r.Lines.Length); 102Assert.Equal(3, r.Lines.Length); 198Assert.Equal(3, r.Lines.Length);
RemoveDir_Tests.cs (2)
74t2.RemovedDirectories.Length.ShouldBe(list.Count); 113t.RemovedDirectories.Length.ShouldBe(0);
RemoveDuplicates_Tests.cs (3)
70Assert.Equal(3, t.Filtered.Length); 96Assert.Equal(3, t.Filtered.Length); 115Assert.Equal(2, t.Filtered.Length);
ResolveNonMSBuildProjectOutput_Tests.cs (2)
198for (int i = 0; i < rvpo.UnresolvedProjectReferences.Length; i++) 204for (int i = 0; i < rvpo.ResolvedOutputPaths.Length; i++)
ResolveSDKReference_Tests.cs (9)
106Assert.Equal(4, result.Length); 116Assert.Equal(2, result.Length); 1531Assert.Equal(2, t.ResolvedSDKReferences.Length); 3822Assert.Equal(2, resolvedSDKReferences.Length); 3831Assert.Equal(2, SDkRedistFolders.Length); 3965Assert.Equal(2, resolvedSDKReferences.Length); 3974Assert.Equal(2, SDkRedistFolders.Length); 4083Assert.Equal(2, SDkRedistFolders.Length); 4182Assert.Equal(2, SDkRedistFolders.Length);
ResourceHandling\GenerateResource_Tests.cs (5)
333t.OutputResources.Length.ShouldBe(1); 2152Assert.True(t.FilesWritten?.Length == 0); 2265for (int i = 0; i < t.Sources.Length; i++) 2797Assert.True(t.OutputResources == null || t.OutputResources.Length == 0); 3833for (int i = t.FilesWritten.Length - 1; i >= 0; i--)
ResourceManagement_Tests.cs (3)
28filteredMessages.Length.ShouldBe(1); 43filteredMessages.Length.ShouldBe(2); 70filteredMessages.Length.ShouldBe(2);
RoslynCodeTaskFactory_Tests.cs (1)
215messages.Length.ShouldBe(1);
XmlPeek_Tests.cs (12)
68Assert.Equal(3, p.Result.Length); // "result Length should be 3" 70for (int i = 0; i < p.Result.Length; i++) 91Assert.Equal(3, p.Result.Length); // "result Length should be 3" 99for (int i = 0; i < p.Result.Length; i++) 120Assert.Equal(3, p.Result.Length); // "result Length should be 3" 128for (int i = 0; i < p.Result.Length; i++) 148Assert.Equal(3, p.Result.Length); // "result Length should be 3" 150for (int i = 0; i < p.Result.Length; i++) 168Assert.Equal(3, p.Result.Length); // "result Length should be 3" 170for (int i = 0; i < p.Result.Length; i++) 277for (int i = 0; i < Math.Pow(2, attrs.Length); i++) 280for (int k = 0; k < attrs.Length; k++)
XmlPoke_Tests.cs (2)
264for (int i = 0; i < Math.Pow(2, attrs.Length); i++) 267for (int k = 0; k < attrs.Length; k++)
XslTransformation_Tests.cs (2)
442for (int i = 0; i < Math.Pow(2, attrs.Length); i++) 445for (int k = 0; k < attrs.Length; k++)
Microsoft.Build.UnitTests.Shared (37)
DriveMapping.cs (3)
59while (QueryDosDevice(ToDeviceName(letter), buffer, buffer.Length) == 0) 73buffer = new char[buffer.Length * 4]; 77return new string(buffer, 4, buffer.Length - 4);
MockEngine.cs (3)
265BuildEngineResult result = BuildProjectFilesInParallel(projectFileNames, targetNames, globalProperties, new List<String>[projectFileNames.Length], toolsVersion, includeTargetOutputs); 269for (int i = 0; i < targetOutputsPerProject.Length; i++) 303for (int i = 0; i < projectFileNames.Length; i++)
MockLogger.cs (2)
486if (index == contains.Length) 499if (index != contains.Length)
ObjectModelHelpers.cs (27)
264var metadata = new Dictionary<string, string>[expectedItems.Length]; 266for (var i = 0; i < metadata.Length; i++) 282if (items.Count != 0 || expectedDirectMetadataPerItem.Length != 0) 288int minimumLength = Math.Min(expectedItems.Length, items.Count); 305items.Count.ShouldBe(expectedItems.Length, 308expectedItems.Length.ShouldBe(expectedDirectMetadataPerItem.Length); 382for (int actualItemIndex = 0; actualItemIndex < actualItems.Length; actualItemIndex++) 492Assert.Equal(expected.Length, actual.Length); // "Expected array length of <" + expected.Length + "> but was <" + actual.Length + ">."); 495for (int i = 0; i < expected.Length; i++) 1041for (int i = 0; i < files.Length; i++) 1647var result = new string[files.Length]; 1649for (var i = 0; i < files.Length; i++) 1856if (FileSystems.Default.DirectoryExists(directory) && (Directory.GetFileSystemEntries(directory).Length == 0)) 1923string[] temporary = new string[actualLines.Length - 1]; 1925for (int i = 0; i < temporary.Length; i++) 1936for (int i = 0; i < Math.Min(actualLines.Length, expectedLines.Length); i++) 1945if (actualLines.Length == expectedLines.Length && expectedAndActualDontMatch) 1953if (actualLines.Length > expectedLines.Length) 1958Assert.True(false, "Expected content was shorter, actual had this extra line: '" + actualLines[expectedLines.Length] + "'"); 1960else if (actualLines.Length < expectedLines.Length) 1965Assert.True(false, "Actual content was shorter, expected had this extra line: '" + expectedLines[actualLines.Length] + "'");
TestEnvironment.cs (2)
499int newFilesCount = newFiles.Length; 528Assert.Equal(_originalFiles.Length, newFilesCount);
Microsoft.Build.Utilities.Core (76)
CanonicalError.cs (1)
321if (explodedText.Length > 0)
CommandLineBuilder.cs (10)
404if (fileNames?.Length > 0) 408for (int i = 0; i < fileNames.Length; ++i) 414for (int i = 0; i < fileNames.Length; ++i) 439if (fileItems?.Length > 0) 443for (int i = 0; i < fileItems.Length; ++i) 452for (int i = 0; i < fileItems.Length; ++i) 571if (parameters?.Length > 0) 603if (parameters?.Length > 0) 682if (parameters?.Length > 0) 713if (parameters?.Length > 0)
ErrorUtilities.cs (5)
161if (parameterValue.Length == 0) 586if (parameter1.Length != parameter2.Length) 620VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 622int arrayCapacity = array.Length - arrayIndex;
EventArgsFormatting.cs (2)
351for (int i = 0; i < lines.Length; i++) 360if (i < (lines.Length - 1))
ExtensionSDK.cs (1)
161if (words.Length > 1 && Version.TryParse(words[1], out Version ver))
FileMatcher.cs (5)
484string[] longParts = new string[parts.Length - startingElement]; 487for (int i = startingElement; i < parts.Length; ++i) 511for (int j = i; j < parts.Length; ++j) 894for (int i = 0; i < excludeNextSteps.Length; i++) 942for (int i = 0; i < excludeNextSteps.Length; i++)
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1137ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1152while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1157if (index == splitBase.Length && index == splitPath.Length) 1170for (int i = index; i < splitBase.Length; i++) 1174for (int i = index; i < splitPath.Length; i++)
FrameworkLocationHelper.cs (2)
838if (directories.Length == 0) 854for (int i = 1; i < directories.Length; ++i)
ResourceUtilities.cs (1)
230if ((args?.Length > 0))
TaskItem.cs (2)
192int count = (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 211public int MetadataCount => (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length;
TaskLoggingHelper.cs (3)
274Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 295if (messageArgs?.Length > 0) 469Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
ToolLocationHelper.cs (10)
1051if (winmdPaths.Length > 0) 1053ErrorUtilities.DebugTraceMessage("GetLegacyTargetPlatformReferences", "Found {0} contract winmds in '{1}'", winmdPaths.Length, winmdLocation); 1138if (winmdPaths.Length > 0) 1140ErrorUtilities.DebugTraceMessage("GetApiContractReferences", "Found {0} contract winmds in '{1}'", winmdPaths.Length, contractPath); 2524ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkName directories under '{1}'", sdkNameDirectories.Length, extensionSdksDirectory.FullName); 2530ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkVersion directories under '{1}'", sdkVersionDirectories.Length, sdkNameFolders.FullName); 2946if (diskRoots?.Length > 0) 2971if (sdkDiskRoots.Count == 0 && diskRoots?.Length > 0) 3028ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Found '{0}' platform identifier directories under '{1}'", platformIdentifiers.Length, platformsRoot); 3034ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Found '{0}' platform version directories under '{1}'", platformVersions.Length, platformIdentifier.FullName);
ToolTask.cs (3)
1359_environmentVariablePairs = new List<KeyValuePair<string, string>>(EnvironmentVariables.Length); 1365if (nameValuePair.Length == 1 || (nameValuePair.Length == 2 && nameValuePair[0].Length == 0))
TrackedDependencies\CanonicalTrackedInputFiles.cs (7)
237Parallel.For(0, _sourceFiles.Length, index => CheckIfSourceNeedsCompilation(sourcesNeedingCompilationList, allOutputFilesExist, _sourceFiles[index])); 241if (SourcesNeedingCompilation.Length == 0) 428bool thereAreFilesToIgnore = filesToIgnore?.Length > 0; 863if (_tlogFiles?.Length > 0) 1032ErrorUtilities.VerifyThrowArgument(source.Length == correspondingOutputs.Length, "Tracking_SourcesAndCorrespondingOutputMismatch"); 1041for (int sourceIndex = 0; sourceIndex < source.Length; sourceIndex++)
TrackedDependencies\CanonicalTrackedOutputFiles.cs (4)
575if (_tlogFiles?.Length > 0) 726ErrorUtilities.VerifyThrowArgument(source.Length == correspondingOutputs.Length, "Tracking_SourcesAndCorrespondingOutputMismatch"); 735for (int sourceIndex = 0; sourceIndex < source.Length; sourceIndex++)
TrackedDependencies\DependencyTableCache.cs (3)
92for (int i = 0; i < tlogFiles.Length; i++) 251TlogFiles = new ITaskItem[tlogFiles.Length]; 255for (int tlogItemCount = 0; tlogItemCount < tlogFiles.Length; tlogItemCount++)
TrackedDependencies\FileTracker.cs (2)
318var rootSources = new List<string>(sources.Length + outputs.Length);
TrackedDependencies\FlatTrackingData.cs (4)
278if (expandedTlogFilesToIgnore.Length > 0) 313if (TlogFiles == null || TlogFiles.Length == 0) 610if (TlogFiles?.Length > 0) 864if (trackedFilesToRemoveFromTLogs?.Length > 0)
TrackedDependencies\TrackedDependencies.cs (2)
34var expanded = new List<ITaskItem>(expand.Length); 77if (files?.Length > 0)
Microsoft.Build.Utilities.UnitTests (10)
TaskItem_Tests.cs (4)
93taskItem.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length); 99taskItem.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length + 1); 173t.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length); 177t.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length + 1);
ToolLocationHelper_Tests.cs (6)
52returnValue.Length.ShouldBe(0); 59returnValue.Length.ShouldBe(0); 69returnValue.Length.ShouldBe(0); 85returnValue.Length.ShouldBe(3); 108returnValue.Length.ShouldBe(1); 4113for (int i = 0; i < rootDirectories.Length; i++)
Microsoft.Cci.Extensions (10)
Dgml\DgmlExtensions.cs (1)
37for (var i = 0; i < nodes.Length; i++)
Differs\IDifferences.cs (2)
28if (args.Length == 0) 40if (args.Length == 0)
Differs\ListMerger.cs (2)
24return Merge<T>(list0, 0, list0.Length, list1, 0, list1.Length);
HostEnvironment.cs (1)
732for (int extIndex = 0; extIndex < s_probingExtensions.Length; extIndex++)
Mappings\ElementMapping.cs (1)
43public int ElementCount { get { return _elements.Length; } }
Writers\CSharp\CSDeclarationWriter.Attributes.cs (1)
200if (parameters.Length > 0)
Writers\CSharp\CSDeclarationWriter.Generics.cs (1)
46if (constraints.Length <= 0)
Writers\Syntax\IndentionSyntaxWriter.cs (1)
29if (args.Length > 0)
Microsoft.CSharp (126)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (11)
31Expression[] parameters = new Expression[args.Length]; 37for (int index = 0; index < args.Length; ++index) 160for (int i = 0; i < arguments.Length; ++i) 289Debug.Assert(args.Length != 0); 307if (sourceTail?.Length != 0) 309T[] array = new T[sourceTail.Length + 1]; 320if (sourceMiddle?.Length != 0) 322T[] array = new T[sourceMiddle.Length + 2]; 324array[array.Length - 1] = sourceLast; 448for (int i = 0; i < typeArgs.Length; i++) 461for (int i = 0; i < argInfos.Length; i++)
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (1)
84Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (1)
35Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetIndexBinder.cs (3)
26Expr indexerArguments = runtimeBinder.CreateArgumentListEXPR(arguments, locals, 1, arguments.Length); 77_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (3)
26Debug.Assert(arguments.Length == 1); 93_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeBinder.cs (2)
90_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeConstructorBinder.cs (4)
79TypeArguments.Length != otherBinder.TypeArguments.Length || 80_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpInvokeMemberBinder.cs (5)
47CSharpArgumentInfo[] array = new CSharpArgumentInfo[_argumentInfo.Length]; 102TypeArguments.Length != otherBinder.TypeArguments.Length || 103_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpSetIndexBinder.cs (2)
96_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpSetMemberBinder.cs (2)
97_argumentInfo.Length != otherBinder._argumentInfo.Length)
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (1)
70Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (4)
174int numberOfArguments = args.Length; 175Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch."); 215object[] argsWithSite = new object[args.Length + 1];
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (3)
16string[] prgpsz = new string[args.Length]; 17int[] prgiarg = new int[args.Length]; 25for (int iarg = 0; iarg < args.Length; iarg++)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (19)
76Debug.Assert(args.Length >= 1); 152int arity = callPayload.TypeArguments?.Length ?? 0; 177DynamicMetaObject[] newArgs = new DynamicMetaObject[args.Length - 1]; 178Array.Copy(args, 1, newArgs, 0, args.Length - 1); 251ArgumentObject[] array = new ArgumentObject[parameters.Length]; 252for (int i = 0; i < parameters.Length; i++) 335LocalVariableSymbol[] locals = new LocalVariableSymbol[parameterExpressions.Length]; 337for (int i = 0; i < parameterExpressions.Length; i++) 601TypeArray typeArgumentsAsTypeArray = typeArguments?.Length > 0 732int arity = payload.TypeArguments?.Length ?? 0; 819BindingFlag.BIND_RVALUEREQUIRED | BindingFlag.BIND_STMTEXPRONLY, memGroup, CreateArgumentListEXPR(arguments, locals, 1, arguments.Length)) as ExprCall; 832if (conditions.Length > 0) 945Debug.Assert(arguments.Length == 1); 985Debug.Assert(arguments.Length == 2); 1193Debug.Assert(arguments.Length == 1); 1228Debug.Assert(arguments.Length == 1); 1251Debug.Assert(arguments.Length >= 2); 1264indexerArguments = CreateArgumentListEXPR(arguments, locals, 1, arguments.Length - 1); 1276int indexOfLast = arguments.Length - 1;
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (10)
47if (method1.GetGenericArguments().Length != method2.GetGenericArguments().Length) 83if (pis1.Length != pis2.Length) 88for (int i = 0; i < pis1.Length; ++i) 187if (args1.Length == args2.Length) 194for (int i = 0; i < args1.Length; i++) 239args.Length > position && 348if (p.Name == name && p.GetIndexParameters().Length != 0)
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (2)
321if (o.Length == 1) 335if (o.Length == 1)
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (2)
196for (int ibos = 0; ibos < s_binopSignatures.Length; ibos++) 1403for (int index = 0; index < s_rguos.Length; index++)
Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs (2)
262for (int iTypeArg = 0; iTypeArg < typeArgs.Length; iTypeArg++) 282for (int i = 0; i < ptypes.Length; i++)
Microsoft\CSharp\RuntimeBinder\Semantics\SubstitutionContext.cs (2)
38public bool IsNop => ClassTypes.Length == 0 & MethodTypes.Length == 0;
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (2)
57m.GetParameters().Length == genericParams.Count && 125Debug.Assert(c.GetParameters() == null || c.GetParameters().Length == genericInstanceParams.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (1)
53(p.GetIndexParameters() == null || p.GetIndexParameters().Length == genericInstanceParams.Count));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (1)
318for (int i = 0; i < systemTypeArgs.Length; i++)
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (12)
54if (other._hashCode != _hashCode || otherTypes.Length != types.Length) 59for (int i = 0; i < types.Length; i++) 92public int Count => Items.Length; 127if (types?.Length > 0) 146if (prgtype1.Length == 0) 152if (prgtype2.Length == 0) 157CType[] combined = new CType[prgtype1.Length + prgtype2.Length]; 158Array.Copy(prgtype1, combined, prgtype1.Length); 159Array.Copy(prgtype2, 0, combined, prgtype1.Length, prgtype2.Length);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (10)
205for (int i = 0; i < srcs.Length; i++) 211CType[] dsts = new CType[srcs.Length]; 214while (++i < srcs.Length) 299if (index < pctx.MethodTypes.Length) 308return index < pctx.ClassTypes.Length ? pctx.ClassTypes[index] : type; 439Debug.Assert(tvs.GetIndexInTotalParameters() < pctx.MethodTypes.Length); 440if (index < pctx.MethodTypes.Length) 447Debug.Assert(index < pctx.ClassTypes.Length); 448if (index < pctx.ClassTypes.Length) 685for (int i = 0; i < newTypeArgsTemp.Length; i++)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (20)
241list = new List<Type>(ifaces.Length + 2) 304CType[] ctypes = new CType[genericArguments.Length]; 305for (int i = 0; i < genericArguments.Length; i++) 312for (int i = 0; i < genericArguments.Length; i++) 336for (int i = 0; i < genericArguments.Length; i++) 469if (parentType.GetGenericArguments() == null || pos >= parentType.GetGenericArguments().Length) 475while (parentType.GetGenericArguments().Length > pos) 483if (nextParent?.GetGenericArguments()?.Length > pos) 813int length = types.Length; 820for (int i = 0; i < types.Length; i++) 1153bool isIndexer = property.GetIndexParameters().Length != 0 1439if (parameters.Length > 0) 1442if (parameters[parameters.Length - 1].GetCustomAttribute<ParamArrayAttribute>(false) != null) 1448for (int i = 0; i < parameters.Length; i++) 1612CType[] types = new CType[isVarArg ? parameters.Length + 1 : parameters.Length]; 1614for (int i = 0; i < parameters.Length; i++) 1621types[types.Length - 1] = ArgumentListType.Instance; 1658if (parameters.Length == 0) 1663ParameterInfo p = parameters[parameters.Length - 1];
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (1)
154for (int i = 0; i < oldEntries.Length; i++)
Microsoft.DotNet.Arcade.Sdk (5)
src\GetLicenseFilePath.cs (2)
66if (matches.Length == 0) 70else if (matches.Length > 1)
src\ValidateLicense.cs (3)
57if (normalizedActual.Length != normalizedExpected.Length) 62for (int i = 0; i < normalizedActual.Length; i++)
Microsoft.DotNet.Arcade.Sdk.Tests (1)
RepoWithConditionalProjectsToBuildTests.cs (1)
53Assert.Equal(expectedPackages, nupkgFiles.Length);
Microsoft.DotNet.AsmDiff (10)
AssemblySet.cs (6)
46IsEmpty = includedAssembliesSorted.Length == 0 && dependencies.Length == 0; 73if (string.IsNullOrEmpty(name) && (assemblies == null || assemblies.Length == 0)) 79name = assemblies.Length == 1 111if (string.IsNullOrEmpty(name) && assemblyArray.Length == 0 && allPaths.Any()) 114name = allPaths.Length == 1
DiffCSharpWriter.cs (4)
357while (t1Start < t1.Length && t2Start < t2.Length) 372merged.AddRange(ListMerger.Merge(t1, t1Start, t1.Length, t2, t2Start, t2.Length));
Microsoft.DotNet.Build.Tasks.Feed (3)
src\common\UploadToAzure.cs (2)
70if (Items.Length == 0) 128Log.LogMessage("Upload to Azure is complete, a total of {0} items were uploaded.", Items.Length);
src\ConfigureInputFeed.cs (1)
36for (int i = 0; i < EnableFeeds.Length; i++)
Microsoft.DotNet.Build.Tasks.Feed.Tests (2)
PublishArtifactsInManifestTests.cs (2)
206if (_callIndex < _maxStreamBytesReturned.Length) 211int bytesToWrite = Math.Min(Math.Min(_streamBytes.Length - _position, count), maxStreamBytesThisCall);
Microsoft.DotNet.Build.Tasks.Installers (8)
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\StabilizeWixFileId.cs (2)
76if (matchingFileElements.Length != 1) 79$"Expected 1 match for '{file.ItemSpec}', found {matchingFileElements.Length}: " +
Microsoft.DotNet.Build.Tasks.Packaging (33)
ApplyBaseLine.cs (1)
47if (PackageIndexes != null && PackageIndexes.Length > 0)
ApplyPreReleaseSuffix.cs (2)
52if (null == OriginalPackages || OriginalPackages.Length == 0) 64if (PackageIndexes != null && PackageIndexes.Length > 0)
CreateTrimDependencyGroups.cs (1)
62if (PackageIndexes == null && PackageIndexes.Length == 0)
FilterUnknownPackages.cs (1)
39if (PackageIndexes != null && PackageIndexes.Length > 0)
GenerateNuSpec.cs (1)
362if (packageTypeSplitInPart.Length > 1)
GenerateRuntimeDependencies.cs (1)
49if (Dependencies == null || Dependencies.Length == 0)
GetApplicableAssetsFromPackageReports.cs (1)
50if (PackageReports == null || PackageReports.Length == 0)
GetApplicableAssetsFromPackages.cs (3)
70if (PackageAssets == null || PackageAssets.Length == 0) 76if (TargetMonikers == null || TargetMonikers.Length == 0) 85if (RuntimeTargetMonikers != null && RuntimeTargetMonikers.Length > 0)
GetAssemblyReferences.cs (1)
40if (Assemblies == null || Assemblies.Length == 0)
GetInboxFrameworks.cs (1)
43if (PackageIndexes == null && PackageIndexes.Length == 0)
GetLastStablePackage.cs (2)
55if (LatestPackages == null || LatestPackages.Length == 0) 60if (PackageIndexes != null && PackageIndexes.Length > 0)
GetLayoutFiles.cs (1)
70if (targetParts.Length > 1)
GetPackageDescription.cs (1)
126if (metadata.CommonTypes != null && metadata.CommonTypes.Length > 0)
GetPackageFromModule.cs (1)
42if (PackageIndexes != null && PackageIndexes.Length > 0)
GetPackageVersion.cs (1)
30if (Files == null || Files.Length == 0)
HarvestPackage.cs (3)
132if (Frameworks != null && Frameworks.Length > 0) 582if (parts.Length >= 2) 590if (parts.Length >= 4 &&
NuGetPack.cs (1)
137if (Nuspecs == null || Nuspecs.Length == 0)
PackageIndex.cs (1)
682if (parts.Length > 1)
PackageReport.cs (3)
126public bool ShouldSerializeCompileAssets() { return CompileAssets != null && CompileAssets.Length != 0; } 127public bool ShouldSerializeRuntimeAssets() { return RuntimeAssets != null && RuntimeAssets.Length != 0; } 128public bool ShouldSerializeNativeAssets() { return NativeAssets != null && NativeAssets.Length != 0; }
PromoteDependencies.cs (3)
36if (PackageIndexes == null && PackageIndexes.Length == 0) 58if (libFxs.Length > 0) 72if (refFxs.Length > 0)
SplitReferences.cs (2)
51if (References == null || References.Length == 0) 54if (PackageIndexes == null && PackageIndexes.Length == 0)
ValidatePackage.cs (1)
373if (PackageIndexes == null || PackageIndexes.Length == 0)
Microsoft.DotNet.Build.Tasks.Packaging.Tests (2)
HarvestPackageTests.cs (2)
109task.SupportedFrameworks.Should().HaveCount(_frameworks.Length); 167task.SupportedFrameworks.Should().HaveCount(_frameworks.Length);
Microsoft.DotNet.Build.Tasks.TargetFramework (2)
ChooseBestP2PTargetFrameworkTask.cs (1)
63List<ITaskItem> assignedProjects = new(AnnotatedProjectReferences.Length);
ChooseBestTargetFrameworksTask.cs (1)
31List<ITaskItem> bestTargetFrameworkList = new(BuildTargetFrameworks!.Length);
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\GetPkgDefAssemblyDependencyGuid.cs (1)
63Debug.Assert(reducedHash.Length == targetBlockSize);
Microsoft.DotNet.Build.Tasks.Workloads (5)
StringExtensions.cs (1)
42if ((replacementStrings is not null) && (replacementStrings.Length > 0))
Utils.cs (3)
141byte[] hashBuffer = new byte[namespaceBytes.Length + nameBytes.Length]; 147Buffer.BlockCopy(nameBytes, 0, hashBuffer, 16, nameBytes.Length);
WorkloadPackageBase.cs (1)
290string prerelease = (preleaseParts.Length > 1) ?
Microsoft.DotNet.Build.Tasks.Workloads.Tests (1)
SwixComponentTests.cs (1)
192Assert.Equal(2, componentSwr.Split(new[] { "vs.dependency" }, StringSplitOptions.None).Length);
Microsoft.DotNet.CodeAnalysis (3)
Analyzers\PinvokeAnalyzer.cs (3)
84if (splitCount.Length == 2 || splitCount.Length == 3) 87if (splitCount.Length == 3)
Microsoft.DotNet.GenFacades (1)
NotSupportedAssemblyGenerator.cs (1)
33if (SourceFiles == null || SourceFiles.Length == 0)
Microsoft.DotNet.Helix.Client (1)
generated-code\PagedResponse.cs (1)
101if (parts.Length < 2)
Microsoft.DotNet.Helix.JobSender (1)
Payloads\SingleFilePayload.cs (1)
42await entryStream.WriteAsync(Content, 0, Content.Length, cancellationToken);
Microsoft.DotNet.Helix.Sdk (1)
CheckAzurePipelinesTestResults.cs (1)
29if (ExpectedTestFailures?.Length > 0)
Microsoft.DotNet.Helix.Sdk.Tests (11)
CreateXHarnessAndroidWorkItemsTests.cs (5)
57_task.WorkItems.Length.Should().Be(0); 75_task.WorkItems.Length.Should().Be(1); 114_task.WorkItems.Length.Should().Be(2); 144_task.WorkItems.Length.Should().Be(2); 177_task.WorkItems.Length.Should().Be(1);
CreateXHarnessAppleWorkItemsTests.cs (6)
59_task.WorkItems.Length.Should().Be(0); 78_task.WorkItems.Length.Should().Be(1); 124_task.WorkItems.Length.Should().Be(2); 156_task.WorkItems.Length.Should().Be(1); 185_task.WorkItems.Length.Should().Be(2); 229_task.WorkItems.Length.Should().Be(1);
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
DependencyInjectionValidation.cs (2)
98.OrderBy(c => c.GetParameters().Length) 101if (constructors.Length == 0)
Microsoft.DotNet.NuGetRepack.Tasks (2)
src\ReplacePackageParts.cs (2)
88int partCount = Parts?.Length ?? 0; 90if (partCount != (ReplacementFiles?.Length ?? 0))
Microsoft.DotNet.NuGetRepack.Tests (3)
VersionUpdaterTests.cs (3)
40Assert.Equal(expectedParts.Length, actualParts.Length); 41for (int i = 0; i < expectedParts.Length; i++)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.DotNet.PackageTesting (6)
VerifyClosure.cs (4)
47if (Sources == null || Sources.Length == 0) 129if (IgnoredReferences == null || IgnoredReferences.Length == 0) return; 311existingCycle.Length > cycle.Length)
VerifyTypes.cs (2)
38if (Sources == null || Sources.Length == 0) 127if (IgnoredTypes == null || IgnoredTypes.Length == 0) return;
Microsoft.DotNet.RemoteExecutor (4)
Program.cs (4)
23if (args.Length < 4) 34string[] additionalArgs = args.Length > 4 ? 35args.Subarray(4, args.Length - 4) : 89if (additionalArgs.Length > 0)
Microsoft.DotNet.SharedFramework.Sdk (12)
src\CreateFrameworkListFile.cs (5)
124if (pathParts.Length > 1 && pathParts[1].Contains("_")) 147if (pathParts.Length < 3 || !pathParts[1].Equals("dotnet", StringComparison.Ordinal) || pathParts.Length > 4) 152if (pathParts.Length > 3) 186int len = publicKeyToken.Length;
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (4)
47if (Sources == null || Sources.Length == 0) 129if (IgnoredReferences == null || IgnoredReferences.Length == 0) return; 311existingCycle.Length > cycle.Length)
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
38if (Sources == null || Sources.Length == 0) 127if (IgnoredTypes == null || IgnoredTypes.Length == 0) return;
src\ValidateFileVersions.cs (1)
85$"Missing FileVersion in {versionlessFiles.Length} shared framework files:" +
Microsoft.DotNet.SignCheck (3)
SignCheckTask.cs (3)
124if(matchedFiles.Length == 1) 128else if(matchedFiles.Length == 0) 132else if (matchedFiles.Length > 1)
Microsoft.DotNet.SignCheckLibrary (4)
Verification\Exclusion.cs (1)
84if ((_exclusionParts != null) && (index >= 0) && (index < _exclusionParts.Length))
Verification\Exclusions.cs (1)
82if ((e.ParentFiles.Length == 0) || (e.ParentFiles.All(pf => String.IsNullOrEmpty(pf))) || IsMatch(e.ParentFiles, parent))
Verification\VsixVerifier.cs (2)
76(uint)binaryTimestamp.Length, 78(uint)packageSignature.SignatureValue.Length,
Microsoft.DotNet.SignTool (16)
src\BatchSignUtil.cs (6)
126signedCount = filesToSign.Length; 127if (filesToSign.Length == 0) return true; 129_log.LogMessage(MessageImportance.High, $"Round {round}: Signing {filesToSign.Length} files."); 155signedCount = enginesToSign.Length; 156if (enginesToSign.Length == 0) 161_log.LogMessage(MessageImportance.High, $"Round {round}: Signing {enginesToSign.Length} engines.");
src\ByteSequenceComparer.cs (3)
48if (left == null || right == null || left.Length != right.Length) 53for (var i = 0; i < left.Length; i++)
src\ContentUtil.cs (1)
114return (pktBytes == null || pktBytes.Length == 0) ?
src\Hash.cs (2)
76var maxSize = Math.Min(maxItemsToHash, values.Length); 166for (int i = 0; i < data.Length; i++)
src\SignToolTask.cs (4)
316if (ItemsToSign.Length == 0) 339if (result == null || result.Length == 0) 349int min = Math.Min(dir1.Length, dir2.Length);
Microsoft.DotNet.SignTool.Tests (5)
FakeSignTool.cs (4)
28var buffer = new byte[_stamp.Length]; 29return stream.TryReadAll(buffer, 0, buffer.Length) == buffer.Length && 56stream.Write(_stamp, 0, _stamp.Length);
SignToolTests.cs (1)
340actualXmlElementsPerSigningRound.Count().Should().Be(expectedXmlElementsPerSigningRound.Length);
Microsoft.DotNet.SourceBuild.Tasks (4)
src\UsageReport\ValidateUsageAgainstBaseline.cs (3)
92$"{diff.Added.Length} new pre-builts discovered! Detailed usage " + 110$"{diff.Removed.Length} packages in baseline weren't used!"); 119$"{diff.Unchanged.Length} packages used as expected in the baseline.");
src\UsageReport\WriteUsageReports.cs (1)
98if (segments.Length > 2 &&
Microsoft.DotNet.SourceBuild.Tasks.Tests (2)
ValidateUsageAgainstBaselineTests.cs (2)
108Assert.Equal(baseline.IgnorePatterns.Length, data.ActualUsageData.IgnorePatterns.Length);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (5)
HelperFactory.cs (2)
223m.GetParameters().Length == 2 && 252for (int i = 0; i < parameters.Length; i++)
Languages\angular\Angular.cs (3)
29if (args.Length > 0) 120if (args.Length > 0) 209if (args.Length > 0)
Microsoft.DotNet.VersionTools (12)
BuildManifest\BuildManifestClient.cs (1)
278if (remainingSemaphores.Length == joinGroup.ParallelSemaphorePaths.Count())
BuildManifest\Model\OrchestratedBuildModel.cs (2)
31if (feeds.Length != 1) 34$"1 orchestrated blob feed must exist, but found {feeds.Length}.");
BuildManifest\VersionIdentifier.cs (2)
55for (int i = pathSegments.Length - 1; i >= 0; i--) 224for (int i = 0; i < pathSegments.Length; i++)
Dependencies\BuildManifest\OrchestratedBuildIdentityMatch.cs (2)
24if (matches.Length > 1) 27$"Expected only 1 build matching '{buildName}', but found {matches.Length}: " +
Dependencies\Submodule\LatestCommitSubmoduleUpdater.cs (2)
50if (matchingInfos.Length != 1) 58$"but found {matchingInfos.Length}/{allSubmoduleInfoCount}: " +
Dependencies\Submodule\SubmoduleDependencyInfo.cs (3)
29if (remoteRefLines.Length != 1) 32if (remoteRefLines.Length > 1) 40$"Matched {remoteRefLines.Length}{allRefs}. ");
Microsoft.DotNet.VersionTools.Tests (19)
BuildManifest\BuildManifestClientTests.cs (2)
66objects.Length == 2 && 132objects.Length == 1 &&
BuildManifest\ManifestModelTests.cs (16)
40if (infos.Length % 2 != 0) 49for (int i = 0; i < infos.Length / 2; i++) 91if (infos.Length % 2 != 0) 101for (int i = 0; i < infos.Length / 2; i++) 145if (infos.Length % 4 != 0) 152for (int i = 0; i < infos.Length / 4; i++) 221if (infos.Length % 4 != 0) 231for (int i = 0; i < infos.Length / 4; i++) 256if (infos.Length % 2 != 0) 263for (int i = 0; i < infos.Length / 2; i++) 296if (infos.Length % 2 != 0) 306for (int i = 0; i < infos.Length / 2; i++) 333if (infos.Length % 3 != 0) 340for (int i = 0; i < infos.Length / 3; i++) 374if (infos.Length % 3 != 0) 384for (int i = 0; i < infos.Length / 3; i++)
BuildManifest\VersionIdentiferTests.cs (1)
69for (int i = 0; i < assets.Length; i++)
Microsoft.DotNet.XliffTasks (5)
Tasks\GatherTranslatedSource.cs (2)
22ITaskItem[] outputs = new ITaskItem[XlfFiles.Length]; 46Release.Assert(index == XlfFiles.Length);
Tasks\GatherXlf.cs (3)
29ITaskItem[] outputs = new ITaskItem[Sources.Length * Languages.Length]; 47Release.Assert(index == outputs.Length);
Microsoft.DotNet.XUnitExtensions (5)
Discoverers\ConditionalTestDiscoverer.cs (5)
52if (symbols.Length == 2) 131if (mi != null && mi.IsStatic && mi.GetParameters().Length == 0 && mi.ReturnType == typeof(bool)) 135if (pi != null && pi.PropertyType == typeof(bool) && pi.GetMethod != null && pi.GetMethod.IsStatic && pi.GetMethod.GetParameters().Length == 0) 150if (conditionArguments == null || conditionArguments.Length == 0) return true; 155if (conditionArguments.Length < 2)
Microsoft.Extensions.ApiDescription.Client (2)
artifacts\obj\Microsoft.Extensions.ApiDescription.Client\Release\netstandard2.0\Microsoft.Extensions.ApiDescription.Client.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
GetOpenApiReferenceMetadata.cs (1)
52var outputs = new List<ITaskItem>(Inputs.Length);
Microsoft.Extensions.ApiDescription.Client.Tests (2)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.Extensions.Caching.Abstractions (2)
DistributedCacheExtensions.cs (2)
121return Encoding.UTF8.GetString(data, 0, data.Length); 138return Encoding.UTF8.GetString(data, 0, data.Length);
Microsoft.Extensions.Caching.Hybrid (12)
Internal\BufferChunk.cs (2)
42_lengthAndPoolFlag = array.Length; 49Debug.Assert(Length == array.Length, "array length not respected");
Internal\DefaultHybridCache.L2.cs (3)
68if (payload.Length > MaximumPayloadBytes) 70ThrowPayloadLengthExceeded(payload.Length); 91if (arr.Length != buffer.Length)
Internal\RecyclableArrayBufferWriter.cs (7)
44public int FreeCapacity => _buffer.Length - _index; 71if (tmp.Length != 0) 85if (_index > _buffer.Length - count) 137Debug.Assert(_buffer.Length > _index); 144Debug.Assert(_buffer.Length > _index); 160var currentLength = _buffer.Length; 190if (oldArray.Length != 0)
Microsoft.Extensions.Caching.Hybrid.Tests (5)
DistributedCacheTests.cs (5)
283payload = new(arr, 5, arr.Length - 10); 329Assert.Equal(size, segment.Array.Length); 337Assert.NotEqual(size, segment.Array.Length); 349Memory = new(arr, 5, arr.Length - 10); 366public override Span<byte> GetSpan() => new(_data, 5, _data.Length - 10);
Microsoft.Extensions.Caching.Memory (1)
MemoryDistributedCache.cs (1)
82memoryCacheEntryOptions.Size = value.Length;
Microsoft.Extensions.Caching.MicroBenchmarks (17)
DistributedCacheBenchmarks.cs (10)
70for (int i = 0; i < keys.Length; i++) 123total += _backend.Get(RandomKey())?.Length ?? 0; 156total += (pendingBlobs[i].Result)?.Length ?? 0; 168total += (await _backend.GetAsync(RandomKey()))?.Length ?? 0; 201total += (await pendingBlobs[i])?.Length ?? 0; 212total += _backend.Get(FixedKey())?.Length ?? 0; 245total += (pendingBlobs[i].Result)?.Length ?? 0; 256total += (await _backend.GetAsync(FixedKey()))?.Length ?? 0; 289total += (await pendingBlobs[i])?.Length ?? 0; 296private string RandomKey() => keys[random.Next(keys.Length)];
src\Caching\Hybrid\src\Internal\RecyclableArrayBufferWriter.cs (7)
44public int FreeCapacity => _buffer.Length - _index; 71if (tmp.Length != 0) 85if (_index > _buffer.Length - count) 137Debug.Assert(_buffer.Length > _index); 144Debug.Assert(_buffer.Length > _index); 160var currentLength = _buffer.Length; 190if (oldArray.Length != 0)
Microsoft.Extensions.Caching.SqlServer (2)
DatabaseOperations.cs (1)
335read = (int)source.GetBytes(ordinal, dataIndex, lease, 0, lease.Length);
SqlParameterCollectionExtensions.cs (1)
38if (value.Offset == 0 & value.Count == value.Array!.Length) // right-sized array
Microsoft.Extensions.Caching.StackExchangeRedis (6)
RedisCache.cs (6)
404if (results.Length >= 2) 413if (results.Length >= 3 && !results[2].IsNull) 443if (results.Length >= 2) 452if (results.Length >= 3 && !results[2].IsNull) 722if (metadata.Length >= 2) 769if (metadata.Length >= 2)
Microsoft.Extensions.Configuration.Binder (7)
ConfigurationBinder.cs (7)
262property.GetMethod.GetParameters().Length > 0) 461type.IsValueType || constructors.Any(ctor => ctor.GetParameters().Length == 0); 463if (!type.IsValueType && constructors.Length == 0) 468if (constructors.Length > 1 && !hasParameterlessConstructor) 473if (constructors.Length == 1 && !hasParameterlessConstructor) 491object?[] parameterValues = new object?[parameters.Length]; 493for (int index = 0; index < parameters.Length; index++)
Microsoft.Extensions.Configuration.KeyPerFile.Tests (1)
ConfigurationProviderTestBase.cs (1)
403for (var i = 0; i < AsArray.Length; i++)
Microsoft.Extensions.DependencyInjection (34)
CallSiteJsonFormatter.cs (3)
32if (constructorCallSite.ParameterCallSites.Length > 0) 87argument.WriteProperty("size", enumerableCallSite.ServiceCallSites.Length); 89if (enumerableCallSite.ServiceCallSites.Length > 0)
ServiceLookup\CallSiteFactory.cs (16)
59if (serviceTypeGenericArguments.Length != implementationTypeGenericArguments.Length) 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 107for (int i = 0; i < serviceTypeGenericArguments.Length; i++) 318for (int i = _descriptors.Length - 1; i >= 0; i--) 328for (int i = _descriptors.Length - 1; i >= 0; i--) 341for (var i = 0; i < callSites.Length; ++i) 471if (constructors.Length == 0) 475else if (constructors.Length == 1) 479if (parameters.Length == 0) 495(a, b) => b.GetParameters().Length.CompareTo(a.GetParameters().Length)); 499for (int i = 0; i < constructors.Length; i++) 572var parameterCallSites = new ServiceCallSite[parameters.Length]; 574for (int index = 0; index < parameters.Length; index++)
ServiceLookup\CallSiteRuntimeResolver.cs (5)
44if (constructorCallSite.ParameterCallSites.Length == 0) 50parameterValues = new object?[constructorCallSite.ParameterCallSites.Length]; 51for (int index = 0; index < parameterValues.Length; index++) 167enumerableCallSite.ServiceCallSites.Length); 169for (int index = 0; index < enumerableCallSite.ServiceCallSites.Length; index++)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (4)
135if (callSite.ServiceCallSites.Length == 0) 173if (callSite.ParameterCallSites.Length == 0) 179parameterExpressions = new Expression[callSite.ParameterCallSites.Length]; 180for (int i = 0; i < parameterExpressions.Length; i++)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (3)
212if (enumerableCallSite.ServiceCallSites.Length == 0) 222argument.Generator.Emit(OpCodes.Ldc_I4, enumerableCallSite.ServiceCallSites.Length); 224for (int i = 0; i < enumerableCallSite.ServiceCallSites.Length; i++)
ServiceLookup\ServiceProviderEngineScope.cs (1)
234string debugText = $"ServiceDescriptors = {RootProvider.CallSiteFactory.Descriptors.Length}";
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.DependencyInjection.Abstractions (46)
ActivatorUtilities.cs (44)
95for (int i = 0; i < constructors.Length; i++) 101for (int j = i + 1; j < constructors.Length; j++) 109InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 125for (int i = 0; i < constructors.Length; i++) 129InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 173if (parameters.Length == 0) 179argumentTypes = new Type[parameters.Length]; 180for (int i = 0; i < argumentTypes.Length; i++) 189InitializeCtorArgValues(ref ctorArgs, constructor.Parameters.Length); 198for (int i = 0; i < constructors.Length; i++) 200max = int.Max(max, constructors[i].Parameters.Length); 255ConstructorInfoEx[]? value = new ConstructorInfoEx[constructors.Length]; 256for (int i = 0; i < constructors.Length; i++) 402var constructorArguments = new Expression[constructorParameters.Length]; 404for (int i = 0; i < constructorParameters.Length; i++) 458if (constructorParameters.Length == 0) 465bool useFixedValues = constructorParameters.Length <= FixedArgumentThreshold; 469for (int i = 0; i < constructorParameters.Length; i++) 498if (matchedArgCount == constructorParameters.Length) 527FactoryParameterContext[] parameters = new FactoryParameterContext[constructorParameters.Length]; 528for (int i = 0; i < constructorParameters.Length; i++) 588for (int i = 0; i < constructorExs.Length; i++) 690parameterMap = new int?[constructorParameters.Length]; 692for (int i = 0; i < argumentTypes.Length; i++) 697for (int j = 0; j < constructorParameters.Length; j++) 746for (int i = 0; i < Parameters.Length; i++) 753_parameterKeys ??= new object?[Parameters.Length]; 820for (int givenIndex = 0; givenIndex < givenParameters.Length; givenIndex++) 825for (int applyIndex = 0; applyIndex < _constructor.Parameters.Length; applyIndex++) 843for (int i = 0; i < _constructor.Parameters.Length; i++) 859return _constructor.Parameters.Length; 864for (int index = 0; index < _constructor.Parameters.Length; index++) 888return _constructor.Invoker.Invoke(_parameterValues.Slice(0, _constructor.Parameters.Length)); 905for (int i = 0; i < _constructor.Parameters.Length; i++) 932Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 938switch (parameters.Length) 975object?[] arguments = new object?[parameters.Length]; 976for (int i = 0; i < parameters.Length; i++) 991Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 999switch (parameters.Length) 1130object?[] constructorArguments = new object?[parameters.Length]; 1131for (int i = 0; i < parameters.Length; i++)
ServiceDescriptor.cs (2)
308Debug.Assert(typeArguments.Length == 2); 327Debug.Assert(typeArguments.Length == 3);
Microsoft.Extensions.DependencyModel (10)
CompilationLibrary.cs (1)
60if (customResolvers?.Length > 0)
DependencyContextJsonReader.cs (7)
81Debug.Assert(rented.Length >= utf8Bom.Length); 100if (rented.Length == written) 103rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2)); 104Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length); 109lastRead = stream.Read(rented, written, rented.Length - written); 792if (groupRuntimeAssemblies.Length != 0) 804if (groupNativeLibraries.Length != 0)
DependencyContextPaths.cs (1)
50string? application = files != null && files.Length > 0 ? files[0] : null;
Resolution\PackageCompilationAssemblyResolver.cs (1)
81if (_nugetPackageDirectories == null || _nugetPackageDirectories.Length == 0 ||
Microsoft.Extensions.Diagnostics (1)
Metrics\MetricsSubscriptionManager.cs (1)
22for (int i = 0; i < _listeners.Length; i++)
Microsoft.Extensions.Diagnostics.Abstractions (2)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.Diagnostics.HealthChecks (4)
HealthCheckPublisherHostedService.cs (4)
64if (_publishers.Length == 0) 87if (_publishers.Length == 0) 195var tasks = new Task[publishers.Length]; 196for (var i = 0; i < publishers.Length; i++)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (4)
HealthCheckPublisherHostedServiceTest.cs (4)
432for (var i = 0; i < publishers.Length; i++) 638for (var i = 0; i < publishers.Length; i++) 654for (var i = 0; i < publishers.Length; i++) 767for (var i = 0; i < publishers.Length; i++)
Microsoft.Extensions.FileProviders.Embedded (3)
EmbeddedFileProvider.cs (3)
155for (var i = 0; i < resources.Length; i++) 265for (var i = 1; i < subNames.Length; i++) 294for (var i = 1; i < subNames.Length; i++)
Microsoft.Extensions.FileProviders.Physical (6)
PollingWildCardChangeToken.cs (6)
160Debug.Assert(previousHash.Length == currentHash.Length); 167if (_byteBuffer == null || byteCount > _byteBuffer.Length) 174sha256.AppendData(Separator, 0, Separator.Length); 176Debug.Assert(_byteBuffer.Length > sizeof(long)); 185sha256.AppendData(Separator, 0, Separator.Length);
Microsoft.Extensions.FileSystemGlobbing (2)
Abstractions\DirectoryInfoWrapper.cs (2)
84if (dirs.Length == 1) 88else if (dirs.Length == 0)
Microsoft.Extensions.Hosting (1)
HostingHostBuilderExtensions.cs (1)
267if (args is { Length: > 0 })
Microsoft.Extensions.Http (3)
DefaultHttpClientFactory.cs (1)
151for (int i = _filters.Length - 1; i >= 0; i--)
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.Http.Polly (1)
artifacts\obj\Microsoft.Extensions.Http.Polly\Release\netstandard2.0\Microsoft.Extensions.Http.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.Extensions.Identity.Core (25)
artifacts\obj\Microsoft.Extensions.Identity.Core\Release\net462\Microsoft.Extensions.Identity.Core.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Base32.cs (2)
56for (int offset = 0; offset < input.Length;) 88while (outputIndex < output.Length)
PasswordHasher.cs (17)
80if (a == null || b == null || a.Length != b.Length) 85for (var i = 0; i < a.Length; i++) 148var outputBytes = new byte[13 + salt.Length + subkey.Length]; 153Buffer.BlockCopy(salt, 0, outputBytes, 13, salt.Length); 154Buffer.BlockCopy(subkey, 0, outputBytes, 13 + saltSize, subkey.Length); 174if (decodedHashedPassword.Length == 0) 228if (hashedPassword.Length != 1 + SaltSize + Pbkdf2SubkeyLength) 234Buffer.BlockCopy(hashedPassword, 1, salt, 0, salt.Length); 237Buffer.BlockCopy(hashedPassword, 1 + salt.Length, expectedSubkey, 0, expectedSubkey.Length); 268Buffer.BlockCopy(hashedPassword, 13, salt, 0, salt.Length); 271int subkeyLength = hashedPassword.Length - 13 - salt.Length; 277Buffer.BlockCopy(hashedPassword, 13 + salt.Length, expectedSubkey, 0, expectedSubkey.Length);
Rfc6238AuthenticationService.cs (4)
60var offset = hash[hash.Length - 1] & 0xf; 61Debug.Assert(offset + 4 < hash.Length); 72var combined = new byte[checked(input.Length + modifierBytes.Length)]; 74Buffer.BlockCopy(modifierBytes, 0, combined, input.Length, modifierBytes.Length);
UserManager.cs (1)
2064uint range = (uint)AllowedChars.Length - 1;
Microsoft.Extensions.Localization (1)
artifacts\obj\Microsoft.Extensions.Localization\Release\net9.0\Microsoft.Extensions.Localization.Resources.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.Extensions.Localization.RootNamespace.Tests (1)
artifacts\obj\Microsoft.Extensions.Localization.RootNamespace.Tests\Release\net9.0\LocalizationTest.Abc.Resources.Controllers.ValuesController.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
Microsoft.Extensions.Localization.Tests (2)
LocalizationServiceCollectionExtensionsTest.cs (2)
53if (matches.Length == 0) 59else if (matches.Length > 1)
Microsoft.Extensions.Logging (9)
Logger.cs (7)
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++) 295int count = _disposable.Length;
LoggerFactory.cs (2)
186int newLoggerIndex = loggerInformation.Length; 187Array.Resize(ref loggerInformation, loggerInformation.Length + 1);
Microsoft.Extensions.Logging.Abstractions (9)
FormattedLogValues.cs (1)
33if (values != null && values.Length != 0 && format != null)
LogValuesFormatter.cs (6)
142for (int i = 0; i < values.Length; i++) 148formattedValues = new object[values.Length]; 151for (; i < values.Length; i++) 168for (int i = 0; i < values.Length; i++) 244var valueArray = new KeyValuePair<string, object?>[values.Length + 1]; 250valueArray[valueArray.Length - 1] = new KeyValuePair<string, object?>("{OriginalFormat}", OriginalFormat);
src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (2)
63ProcessGenericType(builder, type, genericArguments, genericArguments.Length, options); 133offset = type.DeclaringType!.GetGenericArguments().Length;
Microsoft.Extensions.Logging.Console (10)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (10)
49Debug.Assert(_index <= _rentedBuffer.Length); 68return _rentedBuffer.Length; 77return _rentedBuffer.Length - _index; 99Debug.Assert(_index <= _rentedBuffer.Length); 134Debug.Assert(_index <= _rentedBuffer.Length - count); 179int currentLength = _rentedBuffer.Length; 208Debug.Assert(oldBuffer.Length >= _index); 209Debug.Assert(_rentedBuffer.Length >= _index); 217Debug.Assert(_rentedBuffer.Length - _index > 0); 218Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
Microsoft.Extensions.Logging.EventSource (3)
LoggingEventSource.cs (3)
372if (ruleStrings.Length > 0 && ruleStrings[0].Equals(UseAppFilters, StringComparison.OrdinalIgnoreCase)) 382for (int i = ruleStringsStartIndex; i < ruleStrings.Length; i++) 398if (parts.Length == 2)
Microsoft.Extensions.ObjectPool.Tests (3)
ThreadingTest.cs (3)
34for (var i = 0; i < threads.Length; i++) 39for (var i = 0; i < threads.Length; i++) 48for (var i = 0; i < threads.Length; i++)
Microsoft.Extensions.Options (1)
OptionsFactory.cs (1)
74if (_validations.Length > 0)
Microsoft.Extensions.Options.DataAnnotations (1)
DataAnnotationValidateOptions.cs (1)
99if (propertyInfo.GetMethod is null || propertyInfo.GetMethod.GetParameters().Length > 0)
Microsoft.Extensions.Options.SourceGeneration (5)
Emitter.cs (4)
161for (var i = 0; i < staticValidationAttributes.Length; i++) 183if (i != staticValidationAttributes.Length - 1) 786for (var i = 0; i < propertiesOrderedByKey.Length; i++) 789var notLast = i != propertiesOrderedByKey.Length - 1;
EmitterBase.cs (1)
31for (int i = 0; i < padding.Length; i++)
Microsoft.Extensions.Primitives (10)
StringValues.cs (10)
109return Unsafe.As<string?[]>(value).Length; 195return values.Length switch 207for (int i = 0; i < values.Length; i++) 227for (int i = 0; i < strings.Length; i++) 317for (int i = 0; i < values.Length; i++) 363Array.Copy(values, 0, array, arrayIndex, values.Length); 377if (array.Length - arrayIndex < 1) 431return values.Length switch 748for (int i = 0; i < values.Length; i++) 806if ((uint)index < (uint)values.Length)
Microsoft.Extensions.SecretManager.Tools.Tests (4)
InitCommandTest.cs (2)
106var lineCountWithoutSecret = projectDocumentWithoutSecret.ToString().Split(Environment.NewLine).Length; 111var lineCountWithSecret = projectDocumentWithSecret.ToString().Split(Environment.NewLine).Length;
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (2)
47Debug.Assert(tfms.Length > 0); 52propertySpec.Name = tfms.Length == 1
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
66if (optionKeyAndValue.Length != 2 || optionKeyAndValue[1].Length < 3)
Microsoft.Interop.JavaScript.JSImportGenerator (41)
JSGeneratorFactory.cs (37)
172case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes.Length == 0 && jsTypeArguments[0] == JSTypeFlags.Void: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Void)); 173case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Byte)); 174case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Boolean && jsTypeArguments[0] == JSTypeFlags.Boolean: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Boolean)); 175case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Char && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Char)); 176case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int16 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Int16)); 177case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Int32)); 178case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int64 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Int52)); 179case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int64 && jsTypeArguments[0] == JSTypeFlags.BigInt: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.BigInt64)); 180case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.IntPtr && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.IntPtr)); 181case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Double)); 182case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Single && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Single)); 183case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.JSObject)); 184case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.String)); 185case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Exception && jsTypeArguments[0] == JSTypeFlags.Error: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Exception)); 186case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.DateTime && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.DateTime)); 187case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.DateTimeOffset && jsTypeArguments[0] == JSTypeFlags.Date: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.DateTimeOffset)); 188case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Object)); 191case KnownManagedType.Task when jsType == JSTypeFlags.Missing && argumentTypes.Length == 0: return ResolvedGenerator.Resolved(new TaskJSGenerator(MarshalerType.Void)); 211case KnownManagedType.Task when jsType == JSTypeFlags.Promise && jsTypeArguments.Length == 1: 215case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Byte && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(MarshalerType.Byte)); 216case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.String && jsTypeArguments[0] == JSTypeFlags.String: return ResolvedGenerator.Resolved(new ArrayJSGenerator(MarshalerType.String)); 217case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Double && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(MarshalerType.Double)); 218case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Int32 && jsTypeArguments[0] == JSTypeFlags.Number: return ResolvedGenerator.Resolved(new ArrayJSGenerator(MarshalerType.Int32)); 219case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.JSObject && jsTypeArguments[0] == JSTypeFlags.Object: return ResolvedGenerator.Resolved(new ArrayJSGenerator(MarshalerType.JSObject)); 220case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1 && argumentTypes[0] == KnownManagedType.Object && jsTypeArguments[0] == JSTypeFlags.Any: return ResolvedGenerator.Resolved(new ArrayJSGenerator(MarshalerType.Object)); 228case KnownManagedType.Array when jsType == JSTypeFlags.Array && jsTypeArguments.Length == 1: 236case KnownManagedType.Span when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0: 252case KnownManagedType.ArraySegment when jsType == JSTypeFlags.MemoryView && jsTypeArguments.Length != 0: 267case KnownManagedType.Function when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length: 268case KnownManagedType.Action when jsType == JSTypeFlags.Function && jsTypeArguments.Length == argumentTypes.Length: 270for (int i = 0; i < argumentTypes.Length; i++) 272var isReturn = marshaledType == KnownManagedType.Function && i == jsTypeArguments.Length - 1; 289if (argsMarshallerTypes.Length > maxArgs) 301for (int i = 0; i < argumentTypes.Length; i++)
Marshaling\FuncJSGenerator.cs (4)
78for (int i = 0; i < info.ArgsTypeInfo.Length; i++) 81if (!_isAction && i + 1 == info.ArgsTypeInfo.Length) 100for (int i = 0; i < info.ArgsTypeInfo.Length; i++) 103if (!_isAction && i + 1 == info.ArgsTypeInfo.Length)
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
66if (optionKeyAndValue.Length != 2 || optionKeyAndValue[1].Length < 3)
Microsoft.Interop.SourceGeneration (2)
ManualTypeMarshallingHelper.cs (1)
156if (attrs is null || attrs.Length == 0)
TypeSymbolExtensions.cs (1)
336for (int i = typeNameParts.Length - 1; i >= 0; i--)
Microsoft.JSInterop (17)
Infrastructure\DotNetDispatcher.cs (9)
217if (parameterTypes.Length == 0) 235var suppliedArgs = new object?[parameterTypes.Length]; 238while (index < parameterTypes.Length && reader.Read() && reader.TokenType != JsonTokenType.EndArray) 250if (index < parameterTypes.Length) 253throw new ArgumentException($"The call to '{methodIdentifier}' expects '{parameterTypes.Length}' parameters, but received '{index}'."); 259throw new JsonException($"Unexpected JSON token {reader.TokenType}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters."); 467if (parameters.Length == 0) 472var parameterTypes = new Type[parameters.Length]; 473for (var i = 0; i < parameters.Length; i++)
JSRuntime.cs (1)
126var argsJson = args is not null && args.Length != 0 ?
src\Components\Shared\src\ArrayBuilder.cs (7)
70if (_itemsInUse == _items.Length) 72GrowBuffer(_items.Length * 2); 88if (_items.Length < requiredCapacity) 90var candidateCapacity = Math.Max(_items.Length * 2, _minCapacity); 148if (_itemsInUse == _items.Length) 150GrowBuffer(_items.Length * 2); 180Debug.Assert(newCapacity > _items.Length);
Microsoft.Net.Http.Headers (3)
ContentDispositionHeaderValue.cs (3)
588if (parts.Length != 5 || parts[0] != "\"=" || parts[4] != "=\"" 601output = encoding.GetString(bytes, 0, bytes.Length); 708if (parts.Length != 3)
Microsoft.Net.Http.Headers.Tests (15)
CacheControlHeaderValueTest.cs (12)
137for (int i = 0; i < values.Length; i++) 153for (int i = 0; i < values.Length; i++) 155for (int j = 0; j < values.Length; j++) 177for (int i = 0; i < values.Length; i++) 188for (int i = 0; i < values.Length; i++) 190for (int j = 0; j < values.Length; j++) 251for (int i = 0; i < values.Length; i++) 267for (int i = 0; i < values.Length; i++) 269for (int j = 0; j < values.Length; j++) 291for (int i = 0; i < values.Length; i++) 302for (int i = 0; i < values.Length; i++) 304for (int j = 0; j < values.Length; j++)
RangeItemHeaderValueTest.cs (3)
148Assert.Equal(expectedRanges.Length, ranges.Length); 150for (int i = 0; i < expectedRanges.Length; i++)
Microsoft.NET.Sdk.WebAssembly.Pack.Tasks (11)
ComputeWasmBuildAssets.cs (5)
74if (ProjectAssembly.Length != 1) 80if (ProjectDebugSymbols.Length > 1) 92for (int i = 0; i < Candidates.Length; i++) 194if (ProjectDebugSymbols.Length > 0) 201for (int i = 0; i < ProjectSatelliteAssemblies.Length; i++)
ConvertDllsToWebCil.cs (1)
52for (int i = 0; i < Candidates.Length; i++)
GenerateWasmBootJson.cs (1)
373if (Extensions != null && Extensions.Length > 0)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
src\tasks\WasmAppBuilder\LogAdapter.cs (1)
40if ((o?.Length ?? 0) > 0)
Microsoft.NET.StringTools.net35.UnitTests (3)
SpanBasedStringBuilder_Tests.cs (3)
25bool wrapFirstFragment = datum.Fragments.Length > 0 && datum.Fragments[0] != null; 31for (int i = 1; i < datum.Fragments.Length; i++) 80if (datum.Fragments.Length > 1)
Microsoft.NET.StringTools.UnitTests (3)
SpanBasedStringBuilder_Tests.cs (3)
25bool wrapFirstFragment = datum.Fragments.Length > 0 && datum.Fragments[0] != null; 31for (int i = 1; i < datum.Fragments.Length; i++) 80if (datum.Fragments.Length > 1)
Microsoft.NET.WebAssembly.Webcil (24)
WebcilConverter.cs (1)
255outStream.Write(buffer, 0, buffer.Length);
WebcilReader.cs (17)
62if (_stream.Read(buffer, 0, buffer.Length) != buffer.Length) 140if (_stream.Read(buffer, 0, buffer.Length) != buffer.Length) 148return ReadDebugDirectoryEntries(new BlobReader(p, buffer.Length)); 202if (_stream.Read(buffer, 0, buffer.Length) != buffer.Length) 210return DecodeCodeViewDebugDirectoryData(new BlobReader(p, buffer.Length)); 248if (_stream.Read(buffer, 0, buffer.Length) != buffer.Length) 256return DecodeEmbeddedPortablePdbDirectoryData(new BlobReader(p, buffer.Length)); 310if (_stream.Read(buffer, 0, buffer.Length) != buffer.Length) 318return DecodePdbChecksumDebugDirectoryData(new BlobReader(p, buffer.Length)); 327if (string.IsNullOrEmpty(algorithmName) || checksum == null || checksum.Length == 0) 361if (_stream.Read(buffer, 0, buffer.Length) != buffer.Length)
WebcilWasmWrapper.cs (6)
141dataSectionSize += SegmentCodeSize + (uint)ulebWebcilPayloadSize.Length; 148uint payloadOffset = (uint)s_wasmWrapperPrefix.Length + 1 + (uint)putativeULEBDataSectionSize.Length + dataSectionSize ; 167if (putativeULEBDataSectionSize.Length != ulebSectionSize.Length) 170writer.Write(ulebSectionSize, 0, ulebSectionSize.Length); 186writer.Write(ulebWebcilPayloadSize, 0, ulebWebcilPayloadSize.Length); // segment size: _webcilPayloadSize
Microsoft.VisualBasic.Core (328)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2638TargetType.GetGenericArguments().Length > 0 AndAlso
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (34)
169If arguments.Length = 1 Then 198If arguments.Length = 1 Then 275If arguments.Length = 1 Then 282If(arguments.Length = 1, NoArguments, New Object() {arguments(1)}) 981Array.Resize(packedIndexes, packedIndexes.Length + 1) 982packedIndexes(packedIndexes.Length - 1) = value 992Dim indexValuesPlusValue(indexValues.Length) As Object 994indexValuesPlusValue(indexValues.Length) = value.Value 1002Dim indexesPlusValue(indexes.Length) As Expression 1004indexesPlusValue(indexes.Length) = valueExpression 1054Array.Resize(packedIndexes, packedIndexes.Length + 1) 1055packedIndexes(packedIndexes.Length - 1) = value 1065Dim indexValuesPlusValue(indexValues.Length) As Object 1067indexValuesPlusValue(indexValues.Length) = value.Value 1075Dim indexesPlusValue(indexes.Length) As Expression 1077indexesPlusValue(indexes.Length) = valueExpression 1217Dim argCount As Integer = packedArgs.Length 1241callInfo = New CallInfo(args.Length - valueArgs, argNames) 1243If argNames.Length > 0 Then 1248packedArgs = New Object(args.Length - 1) {} 1253Dim normalArgCount As Integer = args.Length - valueArgs 1255packedArgs(i) = args((i + argNames.Length) Mod normalArgCount) 1258For i As Integer = normalArgCount To args.Length - 1 1281Dim argCount As Integer = packedArgs.Length 1308For i As Integer = 0 To arguments.Length - 1 1343If Not Invokers.TryGetValue(arguments.Length, Invoker) Then 1344Invoker = CreateInvoker(arguments.Length) 1345Invokers.Add(arguments.Length, Invoker) 1373For i As Integer = 2 To CallSiteSignature.Length - 2 ' Arguments: Object& 1376CallSiteSignature(CallSiteSignature.Length - 1) = ObjectType ' Result: Object 1416Select Case arguments.Length 1450Dim delegateArgTypes(arguments.Length + 2) As Type 1452For i As Integer = 1 To delegateArgTypes.Length - 1 1456Dim args(arguments.Length + 1) As Object
Microsoft\VisualBasic\CompilerServices\IOUtils.vb (1)
83If (files Is Nothing) OrElse (files.Length = 0) Then
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (25)
35If mi Is Nothing OrElse mi.Length = 0 Then 114If (args Is Nothing OrElse args.Length = 0) Then 135If objType.IsCOMObject() OrElse ((Not args Is Nothing) AndAlso (args.Length > 0)) Then 316If (args Is Nothing OrElse args.Length = 0) Then 320ElseIf args.Length = 1 Then 345ElseIf args.Length > 1 Then 418If (Not args Is Nothing) AndAlso (args.Length > 1) Then 512If paramnames IsNot Nothing AndAlso paramnames.Length <> 0 Then 522ArgCount = args.Length 561If (args Is Nothing OrElse args.Length = 0) Then 669If (Not attributeList Is Nothing) AndAlso (attributeList.Length <> 0) Then 680If members Is Nothing OrElse members.Length = 0 Then 703If members Is Nothing OrElse members.Length = 0 Then 748If paramnames IsNot Nothing AndAlso paramnames.Length <> 0 Then 759ArgCount = args.Length - 1 813If (args.Length = 1) Then 982If (mi Is Nothing) OrElse (mi.Length = 0) Then 991If (mi.Length = 1 AndAlso (paramnames Is Nothing OrElse paramnames.Length = 0)) Then 1008ArgsLength = args.Length 1009ParametersLength = Parameters.Length 1022If (ca Is Nothing) OrElse (ca.Length = 0) Then 1055For i = 0 To parameters.Length - 1 1115If (Not GetMembersByName Is Nothing) AndAlso (GetMembersByName.Length = 0) Then 1247If Members IsNot Nothing AndAlso Members.Length > 0 Then
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (2)
285Dim LocaleSpecificLigatureTable As Byte() = New Byte(LigatureExpansions.Length - 1) {} 1230PatternGroups.Length > 0 AndAlso
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (54)
124If members Is Nothing OrElse members.Length = 0 Then 179(Arguments IsNot Nothing AndAlso Arguments.Length > 0) _ 245reportErrors OrElse arguments.Length <> 0 OrElse baseReference.IsArray, 296If argumentNames.Length > 0 Then 332reportErrors = reportErrors OrElse arguments.Length <> 0 OrElse baseReference.IsArray 344Return argumentNames.Length = 0 354For index As Integer = 0 To copyBack.Length - 1 433If typeArguments.Length > 0 Then 438If arguments.Length = 0 Then 447If argumentNames.Length > arguments.Length OrElse 448(copyBack IsNot Nothing AndAlso copyBack.Length <> arguments.Length) Then 468ElseIf arguments.Length > 0 AndAlso members.Length = 1 AndAlso IsZeroArgumentCall(members(0)) Then 534If members Is Nothing OrElse members.Length = 0 Then 560If arguments.Length > 0 AndAlso members.Length = 1 AndAlso IsZeroArgumentCall(members(0)) Then 590DirectCast(member, MethodInfo).GetParameters().Length = 0) OrElse 592DirectCast(member, PropertyInfo).GetIndexParameters().Length = 0)) 649If argumentNames.Length > 0 Then 657If argumentNames.Length > arguments.Length Then 661If arguments.Length < 1 Then 743Return argumentNames.Length = 0 750If members Is Nothing OrElse members.Length = 0 Then 964If members.Length = 0 And OptimisticSet Then 970If TypeArguments.Length > 0 Then 974If Arguments.Length = 1 Then 995If ArgumentNames.Length > Arguments.Length Then 1002If TypeArguments.Length = 0 Then 1071If TypeArguments.Length = 0 Then 1108If members Is Nothing OrElse members.Length = 0 Then 1113If arguments.Length = 1 AndAlso rValueBase AndAlso baseReference.IsValueType Then 1189If argumentNames.Length > arguments.Length OrElse 1190(copyBack IsNot Nothing AndAlso copyBack.Length <> arguments.Length) Then 1200If HasFlag(invocationFlags, BindingFlagsSetProperty) AndAlso arguments.Length < 1 Then 1213If members Is Nothing OrElse members.Length = 0 Then 1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members") 1299argumentNames.Length <= arguments.Length, 1320Dim argumentCount As Integer = arguments.Length 1324If arguments.Length = 0 Then 1337System.Array.Copy(savedArguments, arguments, arguments.Length) 1432Dim lastParameter As ParameterInfo = parameters(parameters.Length - 1) 1497Dim callArguments As Object() = New Object(parameters.Length - 1) {} 1500Dim argumentCount As Integer = arguments.Length 1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value") 1507System.Array.Copy(savedArguments, arguments, arguments.Length) 1517Dim lastParameter As ParameterInfo = parameters(parameters.Length - 1) 1518callArguments(parameters.Length - 1) =
Microsoft\VisualBasic\CompilerServices\ObjectFlowControl.vb (2)
119If parameters.Length <> 2 OrElse 130If parameters.Length <> 2 OrElse
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (5)
116Debug.Assert((IsBinaryOperator(op) AndAlso arguments.Length = 2) OrElse 117(IsUnaryOperator(op) AndAlso arguments.Length = 1), 137Debug.Assert(arguments.Length > 1, "unary op on Nothing unexpected here") 146If arguments.Length > 1 Then 267If arguments.Length > 1 Then
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (74)
48If leftSignature.Length >= rightSignature.Length Then 59For index As Integer = shorterSignature.Length To longerSignature.Length - 1 65For i As Integer = 0 To shorterSignature.Length - 1 493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 732typeArgumentCount = typeArguments.Length 735Dim candidates As List(Of Method) = New List(Of Method)(members.Length) 737If members.Length = 0 Then 793candidateSignature = New ParameterInfo(setParameters.Length - 2) {} 794System.Array.Copy(setParameters, candidateSignature, candidateSignature.Length) 894Loop While index < members.Length AndAlso members(index).DeclaringType Is currentScope 896Loop While keepSearching AndAlso index < members.Length 1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length, 1174For index As Integer = 0 To argumentTypeArguments.Length - 1 1385Do While paramIndex < parameters.Length 1432If typeArguments.Length = 0 Then 1449Debug.Assert(arguments.Length <= parameters.Length OrElse 1453Dim argIndex As Integer = argumentNames.Length 1458Do While argIndex < arguments.Length 1497If argIndex = arguments.Length - 1 AndAlso arguments(argIndex) Is Nothing Then 1503Do While argIndex < arguments.Length 1527Debug.Assert(arguments.Length - argIndex <= 1, 1531If arguments.Length - argIndex <> 1 Then 1570If argumentNames.Length > 0 OrElse paramIndex < parameters.Length Then 1571matchedParameters = CreateMatchTable(parameters.Length, paramIndex - 1) 1576If argumentNames.Length > 0 Then 1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1590Dim namedArgumentMapping As Integer() = New Integer(argumentNames.Length - 1) {} 1593Do While argIndex < argumentNames.Length 1646For index As Integer = 0 To matchedParameters.Length - 1 1672Debug.Assert(typeArguments.Length = targetProcedure.TypeParameters.Length, "expected length match") 1676For typeArgumentIndex As Integer = 0 To typeArguments.Length - 1 1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse 1718matchedArguments.Length = parameters.Length + 1, 1720Debug.Assert(arguments.Length <= parameters.Length OrElse 1727If namedArgumentMapping IsNot Nothing Then argIndex = namedArgumentMapping.Length 1732Do While argIndex < arguments.Length 1754Dim remainingArgumentCount As Integer = arguments.Length - argIndex 1762Do While argIndex < arguments.Length 1775Debug.Assert(arguments.Length - argIndex = 1, 1795If namedArgumentMapping IsNot Nothing OrElse paramIndex < parameters.Length Then 1796matchedParameters = CreateMatchTable(parameters.Length, paramIndex - 1) 1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1816Do While argIndex < namedArgumentMapping.Length 1832For index As Integer = 0 To matchedParameters.Length - 1 1857Debug.Assert(arguments.Length <= parameters.Length OrElse 1861Dim argIndex As Integer = argumentNames.Length 1866Do While argIndex < arguments.Length 1895Do While argIndex < arguments.Length 1915Debug.Assert(arguments.Length - argIndex <= 1, 1918If arguments.Length - argIndex <> 1 Then 1940If argumentNames.Length > 0 Then 1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1945Do While argIndex < argumentNames.Length 1995For index As Integer = 0 To copyBack.Length - 1 2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match") 2007Debug.Assert(parameterResults.Length = targetProcedure.Parameters.Length, "parameter arrays must match") 2013If namedArgumentMapping IsNot Nothing Then argIndex = namedArgumentMapping.Length 2018Do While argIndex < arguments.Length 2039Do While argIndex < namedArgumentMapping.Length 2166Dim argIndex As Integer = argumentNames.Length 2167Do While argIndex < arguments.Length 2231Do While argIndex < argumentNames.Length 2825arguments.Length,
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (2)
134If Not attributeList Is Nothing AndAlso attributeList.Length <> 0 Then 186If attributeList Is Nothing OrElse attributeList.Length = 0 Then
Microsoft\VisualBasic\CompilerServices\Symbols.vb (16)
186Dim paramCount As Integer = method.GetParameters.Length 710maximumParameterCount = parameters.Length 861If members Is Nothing OrElse members.Length = 0 Then 868For memberIndex = 0 To members.Length - 1 893parameters = New ParameterInfo(setParameters.Length - 2) {} 894System.Array.Copy(setParameters, parameters, parameters.Length) 911If validMemberCount = members.Length Then 918For memberIndex = 0 To members.Length - 1 991ElseIf result.Length > 1 Then 1031If attributes IsNot Nothing AndAlso attributes.Length > 0 Then 1046If result.Length > 1 Then 1077If result.Length = 0 Then 1089If result.Length = 0 Then 1156If indices.Length <> rank Then 1205If arguments.Length - 1 <> rank Then 1211Dim value As Object = arguments(arguments.Length - 1)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (5)
472Dim totalTypeArgsCount As Integer = typeArgs.Length 476typeArgsCount = typeArgsCount - typ.DeclaringType.GetGenericArguments().Length 656parameters = New ParameterInfo(setParameters.Length - 2) {} 657System.Array.Copy(setParameters, parameters, parameters.Length) 658propertyType = setParameters(setParameters.Length - 1).ParameterType
Microsoft\VisualBasic\CompilerServices\Utils.vb (13)
85lLength = arySrc.Length 98If lLength > aryDest.Length Then 99lLength = aryDest.Length 110For i = 0 To (arySrc.Length \ lenSrcLastRank) - 1 175If method1.GetGenericArguments().Length <> method2.GetGenericArguments().Length Then 188Return pis1.Length = pis2.Length AndAlso 208Return pis1.Length = pis2.Length AndAlso 298If args1.Length = args2.Length Then 337args.Length > position AndAlso
Microsoft\VisualBasic\CompilerServices\VB6File.vb (7)
123If Not attributeList Is Nothing AndAlso attributeList.Length <> 0 Then 133If attributeList Is Nothing OrElse attributeList.Length = 0 Then 164If attributeList Is Nothing OrElse attributeList.Length = 0 Then 246If Not FixedStringAttributeList Is Nothing AndAlso FixedStringAttributeList.Length > 0 Then 253If attributeList Is Nothing OrElse attributeList.Length = 0 Then 270If attributeList Is Nothing OrElse attributeList.Length = 0 Then 2143If (Output Is Nothing) OrElse (Output.Length = 0) Then
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (39)
166If (match Is Nothing) OrElse (match.Length = 0) Then 180If Not names Is Nothing AndAlso names.Length = 0 Then 200SelectedCount = match.Length 290If (Not ca Is Nothing) AndAlso (ca.Length > 0) Then 358ParamArrayIndexList = New Integer(match.Length - 1) {} 383If (Not ca Is Nothing) AndAlso (ca.Length > 0) Then 392If (ParamArrayIndex = PARAMARRAY_NONE) AndAlso (args.Length > Parameters.Length) Then 409If (args.Length < LengthOfNonParamArrayArguments) Then 415For j = args.Length To LengthOfNonParamArrayArguments - 1 441Dim paramOrder As Object() = New Object(match.Length - 1) {} 452If args.Length > Parameters.Length Then 453ArgIndexes = New Integer(args.Length - 1) {} 455ArgIndexes = New Integer(Parameters.Length - 1) {} 524ArgTypes = New Type(args.Length - 1) {} 555If ArgIndexes.Length > Parameters.Length Then 1111If args.Length > 0 Then 1121If ParmIndex < state.m_ByRefFlags.Length Then 1125If ParmIndex < state.m_OriginalParamOrder.Length Then 1161Dim objs() As Object = New Object(parms.Length - 1) {} 1189Dim ParamArrayLength As Integer = args.Length - parms.Length + 1 1220Dim objs() As Object = New Object(parms.Length - 1) {} 1250Return args.Length - 1 1252Return args.Length 1545If p1.Length > p2.Length Then 1553ElseIf p2.Length > p1.Length Then 1877Dim used() As Boolean = New Boolean(pars.Length - 1) {} 1879Dim LastUnnamedIndex As Integer = (args.Length - names.Length - 1) 1897paramOrder(i) = names.Length + i 2042If (Not attributeList Is Nothing) AndAlso (attributeList.Length <> 0) Then 2222If RemovedCount = mi.Length - 1 Then 2232Dim NewSize As Integer = mi.Length - RemovedCount 2236For Index As Integer = 0 To mi.Length - 1
Microsoft\VisualBasic\FileIO\FileSystem.vb (22)
756FileStream.Write(data, 0, data.Length) 1286ByteCount = FileStream.Read(ByteBuffer, 0, ByteBuffer.Length) 1311Dim AdditionalByteCount As Integer = FileStream.Read(ByteBuffer, ByteCount, ByteBuffer.Length - ByteCount) 1313Debug.Assert(ByteCount <= ByteBuffer.Length) 1323ByteCount = FileStream.Read(ByteBuffer, 0, ByteBuffer.Length) 1400If wildcards Is Nothing OrElse wildcards.Length = 0 Then 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 2189ByteBufferStartIndex = m_Preamble.Length 2190Count -= m_Preamble.Length ' Reduce the valid byte count if ByteBuffer was shrunk. 2203Dim CharBuffer(m_PreviousCharBuffer.Length + ExpectedCharCount - 1) As Char 2206destinationArray:=CharBuffer, destinationIndex:=0, length:=m_PreviousCharBuffer.Length) 2210chars:=CharBuffer, charIndex:=m_PreviousCharBuffer.Length) 2214If CharBuffer.Length > m_SearchText.Length Then 2215If m_PreviousCharBuffer.Length <> m_SearchText.Length Then 2218Array.Copy(sourceArray:=CharBuffer, sourceIndex:=(CharBuffer.Length - m_SearchText.Length), 2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer") 2246If BigBuffer.Length < SmallBuffer.Length Or SmallBuffer.Length = 0 Then 2249For i As Integer = 0 To SmallBuffer.Length - 1
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (15)
424Dim Builder As New System.Text.StringBuilder(m_Buffer.Length) 661Dim BufferLength As Integer = m_Buffer.Length 690Debug.Assert(m_Position >= 0 And m_Position <= m_Buffer.Length, "The cursor is out of range") 699Dim CharsRead As Integer = m_Reader.Read(m_Buffer, ContentLength, m_Buffer.Length - ContentLength) 724If m_CharsRead = m_Buffer.Length Then 726Dim BufferSize As Integer = m_Buffer.Length + DEFAULT_BUFFER_LENGTH 734Array.Copy(m_Buffer, TempArray, m_Buffer.Length) 738Dim CharsRead As Integer = m_Reader.Read(m_Buffer, m_CharsRead, m_Buffer.Length - m_CharsRead) 739Debug.Assert(CharsRead <= m_Buffer.Length - m_CharsRead, "We've read more chars than we have space for") 1022Dim Bound As Integer = m_FieldWidths.Length - 1 1119If m_FieldWidths.Length = 0 Then 1123Dim WidthBound As Integer = m_FieldWidths.Length - 1 1152Dim Bound As Integer = Widths.Length - 1 1170If m_Delimiters.Length = 0 Then 1174Dim Length As Integer = m_Delimiters.Length
Microsoft\VisualBasic\FileSystem.vb (1)
553If (FileNumbers Is Nothing) OrElse (FileNumbers.Length = 0) Then
Microsoft\VisualBasic\Interaction.vb (1)
295Elements = VarExpr.Length
Microsoft\VisualBasic\Strings.vb (9)
334lNumElements = Source.Length 363If lResultIndex = TmpResult.Length Then 650Return CharArray.Length 908If cSubStrings + 1 = asSubstrings.Length Then 1027Expression.CopyTo(LastSrcIndex, Output, Output.Length - TextEnum.ElementIndex, TextEnum.ElementIndex - LastSrcIndex) 1711If nfi.NumberGroupSizes Is Nothing OrElse nfi.NumberGroupSizes.Length = 0 Then 1763If GroupDigits = TriState.False OrElse nfi.NumberGroupSizes.Length = 0 Then 1766If nfi.NumberGroupSizes.Length = 1 Then 2244Return (array.Length = 0)
MinimalSample (1)
Program.cs (1)
46Console.WriteLine($"Building filter! Num args: {routeContext.MethodInfo.GetParameters().Length}");
MobileBuildTasks (4)
Android\Ndk\Ndk.cs (1)
116if (parts.Length != 2)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
MonoAOTCompiler (13)
MonoAOTCompiler.cs (10)
320if (Assemblies.Length == 0) 427if (UseDirectPInvoke && (DirectPInvokes.Length > 0 || DirectPInvokeLists.Length > 0)) 432if (UseDirectPInvoke || DirectPInvokes.Length > 0 || DirectPInvokeLists.Length > 0) 708if (DirectPInvokes.Length > 0) 715if (DirectPInvokeLists.Length > 0) 911if (Profilers?.Length > 0) 919if (AotProfilePath?.Length > 0) 928if (MibcProfilePath.Length > 0)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
MonoTargetsTasks (17)
EmitBundleTask\EmitBundleBase.cs (5)
78List<ITaskItem> bundledResources = new(FilesToBundle.Length); 163Parallel.For(0, remainingDestinationFilesToBundle.Length, new ParallelOptions { MaxDegreeOfParallelism = allowedParallelism, CancellationToken = BuildTaskCancelled.Token }, (i, state) => 174Log.LogMessage(MessageImportance.Low, "{0}/{1} Bundling {2} ...", count, remainingDestinationFilesToBundle.Length, registeredName); 413while ((bytesRead = inputStream.Read(buf, 0, buf.Length)) > 0) 419outputUtf8Writer.BaseStream.Write(NewLineAndIndentation, 0, NewLineAndIndentation.Length);
ILStrip\ILStrip.cs (4)
60if (Assemblies.Length == 0) 77int allowedParallelism = DisableParallelStripping ? 1 : Math.Min(Assemblies.Length, Environment.ProcessorCount); 224List<ITaskItem> outItems = new(originalAssemblies.Length); 345Array.Clear(zeroBuffer, 0, zeroBuffer.Length);
JsonToItemsTaskFactory\JsonToItemsTaskFactory.cs (2)
290var items = new ITaskItem[itemModels.Length]; 291for (int i = 0; i < itemModels.Length; i++)
MarshalingPInvokeScanner\MarshalingPInvokeScanner.cs (1)
31if (Assemblies is null || Assemblies!.Length == 0)
NetTraceToMibcConverterTask\NetTraceToMibcConverter.cs (1)
78if (Assemblies.Length == 0)
RuntimeConfigParser\RuntimeConfigParser.cs (1)
62if (RuntimeConfigReservedProperties.Length != 0)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
MSBuild (125)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
CommandLineSwitches.cs (6)
407Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 409Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 412for (int i = 0; i < s_parameterlessSwitchesMap.Length; i++) 418for (int i = 0; i < s_parameterizedSwitchesMap.Length; i++) 532for (int i = 0; i < _parameterlessSwitches.Length; i++) 540for (int i = 0; i < _parameterizedSwitches.Length; i++)
CommunicationsUtilities.cs (3)
463ErrorUtilities.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes"); 465stream.Write(bytes, 0, bytes.Length); 543for (int i = 0; i < bytes.Length; i++)
ErrorUtilities.cs (5)
161if (parameterValue.Length == 0) 586if (parameter1.Length != parameter2.Length) 620VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 622int arrayCapacity = array.Length - arrayIndex;
EventArgsFormatting.cs (2)
351for (int i = 0; i < lines.Length; i++) 360if (i < (lines.Length - 1))
FileUtilities.cs (9)
397var headingSegmentsToRemove = Math.Max(0, segments.Length - trailingSegmentsToKeep); 721Debug.Assert(allowedExtensions?.Length > 0); 1137ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1152while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1157if (index == splitBase.Length && index == splitPath.Length) 1170for (int i = index; i < splitBase.Length; i++) 1174for (int i = index; i < splitPath.Length; i++)
JsonOutputFormatter.cs (4)
30if (propertyNames.Length == 0) 48if (itemNames.Length == 0) 84if (itemNames.Length == 0) 125if (targetNames.Length == 0)
LoadedType.cs (3)
72Properties = new ReflectableTaskPropertyInfo[props.Length]; 75PropertyAssemblyQualifiedNames = new string[props.Length]; 78for (int i = 0; i < props.Length; i++)
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++) 524IAsyncResult result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null); 566if (bytesRead != headerByte.Length) 586CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length); 611result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
OutOfProcTaskAppDomainWrapperBase.cs (1)
364if (value.GetCustomAttributes(typeof(OutputAttribute), true).Length > 0)
OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
ResourceUtilities.cs (1)
230if ((args?.Length > 0))
TaskParameter.cs (6)
133ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 135for (int i = 0; i < inputAsITaskItemArray.Length; i++) 365int length = wrappedItems.Length; 623int length = array.Length; 706int length = array.Length; 824return count + FileUtilities.ItemSpecModifiers.All.Length;
TerminalLogger\NodesFrame.cs (1)
32_nodes = new (NodeStatus, int)[nodes.Length];
TypeLoader.cs (2)
195Dictionary<string, string> assembliesDictionary = new(localAssemblies.Length + runtimeAssemblies.Length);
XMake.cs (73)
357if (parameterSections.Length == 2 && 788&& switchesNotFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0 789&& switchesFromAutoResponseFile[CommandLineSwitches.ParameterizedSwitch.MaxCPUCount].Length == 0 805bool outputPropertiesItemsOrTargetResults = getProperty.Length > 0 || getItem.Length > 0 || getTargetResult.Length > 0; 817getProperty.Length > 0 ? "getProperty" : 818getItem.Length > 0 ? "getItem" : 821else if ((getProperty.Length > 0 || getItem.Length > 0) && (targets is null || targets.Length == 0)) 900if (outputPropertiesItemsOrTargetResults && targets?.Length > 0 && result is not null) 1078if (getProperty.Length == 1 && getItem.Length == 0) 1111else if (getProperty.Length == 1 && getItem.Length == 0 && getTargetResult.Length == 0) 1317if (loggers.Length == 1 && 1550bool restoreOnly = targets.Length == 1 && string.Equals(targets[0], MSBuildConstants.RestoreTargetName, StringComparison.OrdinalIgnoreCase); 2627bool minimizeStdOutOutput = getProperty.Length + getItem.Length + getTargetResult.Length > 0 && getResultOutputFile.Length == 0; 2837if (parameterAndValue[0].Equals("default", StringComparison.InvariantCultureIgnoreCase) && parameterAndValue.Length > 1) 2870terminalLoggerArg = switches[switches.Length - 1]; 2937return terminalLoggerParameters?.Length > 0 ? MSBuildApp.AggregateParameters(string.Empty, terminalLoggerParameters) : string.Empty; 2987ErrorUtilities.VerifyThrow(projectSwitchParameters.Length <= 1, "Expect exactly one project at a time."); 2989if (projectSwitchParameters.Length == 1) 3054if (parameters.Length == 1 && bool.TryParse(parameters[0], out bool boolValue)) 3088if (parameters.Length == 1 && bool.TryParse(parameters[0], out var boolValue)) 3146if (parameters.Length > 0) 3151enableNodeReuse = bool.Parse(parameters[parameters.Length - 1]); 3155CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message); 3159CommandLineSwitchException.Throw("InvalidNodeReuseValue", parameters[parameters.Length - 1], ex.Message); 3179if (parameters.Length > 0) 3183writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 3187CommandLineSwitchException.Throw("InvalidPreprocessPath", parameters[parameters.Length - 1], ex.Message); 3198if (parameters.Length > 0) 3202writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 3206CommandLineSwitchException.Throw("TargetsCouldNotBePrinted", parameters[parameters.Length - 1], ex.Message); 3261if (parameters.Length > 0) 3265value = bool.Parse(parameters[parameters.Length - 1]); 3269CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message); 3273CommandLineSwitchException.Throw(resourceName, parameters[parameters.Length - 1], ex.Message); 3290if (parameters == null || parameters.Length == 0) 3297var profilerFile = parameters[parameters.Length - 1]; 3312CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 3317CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 3322CommandLineSwitchException.Throw("InvalidProfilerValue", parameters[parameters.Length - 1], 3341if (input.Length > 0) 3441if (parameters.Length > 0) 3445cpuCount = int.Parse(parameters[parameters.Length - 1], CultureInfo.InvariantCulture); 3449CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message); 3453CommandLineSwitchException.Throw("InvalidMaxCPUCountValue", parameters[parameters.Length - 1], ex.Message); 3456CommandLineSwitchException.VerifyThrow(cpuCount > 0 && cpuCount <= 1024, "InvalidMaxCPUCountValueOutsideRange", parameters[parameters.Length - 1]); 3474ErrorUtilities.VerifyThrow(parameters.Length <= 1, "Expect exactly one project at a time."); 3479if (parameters.Length == 1) 3606if (projectExtensionsToIgnore?.Length > 0) 3701if (parameters.Length > 0) 3705return parameters[parameters.Length - 1]; 3726Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2), 3730CommandLineSwitchException.VerifyThrow((parameterSections[0].Length > 0) && (parameterSections.Length == 2), 3770if (verbositySwitchParameters.Length > 0) 3773originalVerbosity = ProcessVerbositySwitch(verbositySwitchParameters[verbositySwitchParameters.Length - 1]); 3825for (int i = 0; i < parametersToAggregate.Length; i++) 3850for (int i = 0; i < groupedFileLoggerParameters.Length; i++) 3870if (groupedFileLoggerParameters[i].Length > 0) 3905if (binaryLoggerParameters == null || binaryLoggerParameters.Length == 0) 3910string arguments = binaryLoggerParameters[binaryLoggerParameters.Length - 1]; 3940if ((consoleLoggerParameters?.Length > 0)) 4046if ((fileLoggerParameters?.Length > 0)) 4134value = (nameValuePair.Length > 1) ? nameValuePair[1] : null; 4621if (features.Length == 1)
MSBuildTaskHost (71)
AssemblyNameExtension.cs (3)
795if (aPKT.Length != bPKT.Length) 799for (int i = 0; i < aPKT.Length; ++i)
BinaryTranslator.cs (7)
262length = byteArray.Length; 838int count = array.Length; 897int count = array.Length; 949int count = array.Length; 1186var length = byteArray?.Length ?? 0; 1222int count = array.Length; 1244int count = array.Length;
ChangeWaves.cs (1)
65return AllWaves[AllWaves.Length - 1];
CommunicationsUtilities.cs (3)
463ErrorUtilities.VerifyThrow(bytes.Length == 4, "Int should be 4 bytes"); 465stream.Write(bytes, 0, bytes.Length); 543for (int i = 0; i < bytes.Length; i++)
Concurrent\ConcurrentDictionary.cs (24)
112for (int i = 0; i < locks.Length; i++) 117int[] countPerLock = new int[locks.Length]; 123_budget = buckets.Length / locks.Length; 133int bucketNo = GetBucket(hashcode, tables._buckets.Length); 169GetBucketAndLockNo(hashcode, out bucketNo, out lockNo, tables._buckets.Length, tables._locks.Length); 337for (int i = 0; i < tables._countPerLock.Length; i++) 345if (approxCount < tables._buckets.Length / 4) 365newLength = (tables._buckets.Length * 2) + 1; 400AcquireLocks(1, tables._locks.Length, ref locksAcquired); 405if (_growLockArray && tables._locks.Length < MaxLockNumber) 407newLocks = new object[tables._locks.Length * 2]; 408Array.Copy(tables._locks, 0, newLocks, 0, tables._locks.Length); 409for (int i = tables._locks.Length; i < newLocks.Length; i++) 416int[] newCountPerLock = new int[newLocks.Length]; 419for (int i = 0; i < tables._buckets.Length; i++) 426GetBucketAndLockNo(current._hashcode, out newBucketNo, out newLockNo, newBuckets.Length, newLocks.Length); 440_budget = Math.Max(1, newBuckets.Length / newLocks.Length); 486AcquireLocks(1, _tables._locks.Length, ref locksAcquired); 487Debug.Assert(locksAcquired == _tables._locks.Length);
Concurrent\ConcurrentQueue.cs (4)
316for (int i = 0; i < _slots.Length; i++) 323internal int Capacity => _slots.Length; 326internal int FreezeOffset => _slots.Length * 2; 399Thread.VolatileWrite(ref _slots[slotsIndex].SequenceNumber, currentHead + _slots.Length);
D\a\_work\1\s\bin\repo\msbuild\src\Shared\ErrorUtilities.cs\ErrorUtilities.cs (5)
161if (parameterValue.Length == 0) 586if (parameter1.Length != parameter2.Length) 620VerifyThrowArgumentOutOfRange(arrayIndex >= 0 && arrayIndex < array.Length, arrayIndexParameterName); 622int arrayCapacity = array.Length - arrayIndex;
FileUtilities.cs (8)
721Debug.Assert(allowedExtensions?.Length > 0); 1137ErrorUtilities.VerifyThrow(splitPath.Length > 0, "Cannot call MakeRelative on a path of only slashes."); 1152while (index < splitBase.Length && index < splitPath.Length && splitBase[index].Equals(splitPath[index], PathComparison)) 1157if (index == splitBase.Length && index == splitPath.Length) 1170for (int i = index; i < splitBase.Length; i++) 1174for (int i = index; i < splitPath.Length; i++)
Immutable\ImmutableDictionary.cs (1)
120if (arrayIndex + Count > array.Length)
NodeEndpointOutOfProcBase.cs (5)
398for (int i = 0; i < handshakeComponents.Length; i++) 524IAsyncResult result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null); 566if (bytesRead != headerByte.Length) 586CommunicationsUtilities.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length); 611result = localReadPipe.BeginRead(headerByte, 0, headerByte.Length, null, null);
OutOfProcTaskAppDomainWrapperBase.cs (1)
364if (value.GetCustomAttributes(typeof(OutputAttribute), true).Length > 0)
OutOfProcTaskHostTaskResult.cs (1)
77if (exceptionMessageArgs?.Length > 0)
ResourceUtilities.cs (1)
230if ((args?.Length > 0))
TaskParameter.cs (6)
133ITaskItem[] taskItemArrayParameter = new ITaskItem[inputAsITaskItemArray.Length]; 135for (int i = 0; i < inputAsITaskItemArray.Length; i++) 365int length = wrappedItems.Length; 623int length = array.Length; 706int length = array.Length; 824return count + FileUtilities.ItemSpecModifiers.All.Length;
Traits.cs (1)
576if ((args?.Length > 0))
Mvc.RoutingWebSite (2)
StartupForDynamicOrder.cs (1)
110if (split.Length == 2)
StartupForEndpointFilters.cs (1)
43if (context.MethodInfo.GetParameters().Length >= 1 && context.MethodInfo.GetParameters()[0].ParameterType == typeof(string))
PlaintextApp (1)
Startup.cs (1)
30response.ContentLength = payload.Length;
PortableTask (1)
ShowItems.cs (1)
34else if (Items.Length == 0)
PresentationBuildTasks (137)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (3)
196Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 311Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 731for (int i = 0; i < pItemList.Length; i++)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (23)
125if ((PageMarkup == null || PageMarkup.Length == 0) && 126(ApplicationMarkup == null || ApplicationMarkup.Length == 0)) 164for (int i = 0; i < CompilerAnalyzer.RecompileMarkupPages.Length; i++) 407if (SplashScreen != null && SplashScreen.Length > 0) 907if (PageMarkup != null && PageMarkup.Length > 0) 912if (SplashScreen != null && SplashScreen.Length > 1) 930if (ApplicationMarkup != null && ApplicationMarkup.Length > 0) 946if (ApplicationMarkup != null && ApplicationMarkup.Length > 0) 948if (ApplicationMarkup.Length > 1) 1130if (References != null && References.Length > 0) 1135for (int i = 0; i < References.Length; i++) 1175for (int i = 0; i < CompilerAnalyzer.RecompileMarkupPages.Length; i++) 1313if (PageMarkup != null && PageMarkup.Length > 0) 1421for (int i = 0; i < GeneratedBamlFiles.Length; i++) 1426for (int i = 0; i < GeneratedCodeFiles.Length; i++) 1431for (int i = 0; i < GeneratedLocalizationFiles.Length; i++) 1474for (int i = 0; i < inputXamlItemList.Length; i++) 1511if (!SkipMarkupCompilation && inputLocalRefXamlFileList != null && inputLocalRefXamlFileList.Length > 0) 1513for (int i = 0; i < inputLocalRefXamlFileList.Length; i++) 1542for (int i = 0; i < inputXamlItemList.Length; i++) 1608for (int j = 0; j < listCarryOverAttribute.Length; j++) 1633if (ApplicationMarkup != null && ApplicationMarkup.Length > 0 && ApplicationMarkup[0] != null) 1647for (int i = 0; i < PageMarkup.Length; i++)
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (7)
506if (_localApplicationFile != null || (_localMarkupPages != null && _localMarkupPages.Length > 0)) 590if (_localMarkupPages != null && _localMarkupPages.Length > 0) 592int localFileNum = _localMarkupPages.Length; 608if (References != null && References.Length > 0) 613for (int i = 0; i < References.Length; i++) 742if (_localMarkupPages != null && _localMarkupPages.Length > 0) 745for (int i = 0; i < _localMarkupPages.Length; i++)
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
58if (GeneratedLocalizationFiles.Length > 0)
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (1)
167if (OutputResourcesFile != null && OutputResourcesFile.Length > 1)
Microsoft\Build\Tasks\Windows\UidManager.cs (4)
79if (MarkupFiles == null || MarkupFiles.Length == 0) 356if (_markupFiles.Length > countGoodFiles) 358Log.LogErrorWithCodeFromResources(nameof(SR.FilesFailedUidCheck), _markupFiles.Length - countGoodFiles); 363return _markupFiles.Length == countGoodFiles;
MS\Internal\MarkupCompiler\MarkupCompiler.cs (14)
275for (int i = 0; i < cu.FileList.Length; i++) 294if (!cu.Pass2 && ContentList != null && ContentList.Length > 0) 1469sb.Append(_typeArgsList.Length); 1620for (int i = 1; i < dirs.Length; i++) 1842CodeExpression[] expressions = new CodeExpression[args.Length]; 1849for (int i = 0; i < args.Length; i++) 1867for (int i = 0; i < args.Length; i++) 1905Debug.Assert(pis != null && pis.Length == 2 && KnownTypes.Types[(int)KnownElements.DependencyObject].IsAssignableFrom(pis[0].ParameterType)); 2053for (int i = 0; i < pars.Length; i++) 2184for (int i = 1; i < contexts.Length; ++i) 2254for (int i = 0; i < _typeArgsList.Length; i++) 2388for (int i = 0; i < refTypeParams.Length; i++) 2395Debug.Assert(typeArgsList != null && typeArgsList.Length == refTypeParams.Length);
MS\Internal\MarkupCompiler\ParserExtension.cs (6)
188if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 220bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 255localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 273if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 320if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 462bool isLocal = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly;
MS\Internal\MarkupCompiler\VersionHelper.cs (6)
75hasWildcard = allowWildcard && elements[elements.Length - 1] == "*"; 77if ((hasWildcard && elements.Length < 3) || elements.Length > 4) 84int lastExplicitValue = hasWildcard ? elements.Length - 1 : elements.Length; 152for (int i = lastExplicitValue; i < values.Length; i++)
MS\Internal\Tasks\CompilerLocalReference.cs (2)
220if (LocalMarkupPages != null && LocalMarkupPages.Length > 0) 222for (int i = 0; i < LocalMarkupPages.Length; i++)
MS\Internal\Tasks\CompilerState.cs (5)
96Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 156Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 210if (fileItemList != null && fileItemList.Length > 0) 214int iCount = fileItemList.Length; 242for (int i = 0; i < fileItemList.Length; i++)
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (7)
209for (int i = 0; i < _mcPass1.PageMarkup.Length; i++) 391numLocalTypeXamls = CompilerLocalReference.LocalMarkupPages.Length; 461int count = _mcPass1.PageMarkup.Length; 493int count = _mcPass1.ContentFiles.Length; 533if (_mcPass1.ApplicationMarkup != null && _mcPass1.ApplicationMarkup.Length > 0 && _mcPass1.ApplicationMarkup[0] != null) 562for (int i = 0; i < fileList.Length; i++) 601if (list != null && list.Length > 0)
MS\Internal\Tasks\TaskFileService.cs (1)
171fileChecksummer.CalculateCheckSum(hashGuid, tempBytes.Length, tempBytes, out actualSize);
src\Microsoft.DotNet.Wpf\src\Common\src\System\AppContextDefaultValues.cs (4)
121if (components.Length < 2 || components.Length > 3) 142for (int i = 1; i < components.Length; i++) 147if (keyValuePair.Length != 2)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (2)
69for (int i = 0; i < pairs.Length; i++) 369for (int i = 0; i < _enumNames.Length; i++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (1)
180int end = _knownStrings.Length;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (4)
1202if (AssemblyIds != null && AssemblyIds.Length > 0) 1204count = (short) AssemblyIds.Length; 4728Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4771Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (2)
692if (nsMapEntry != null && nsMapEntry.Length > 0) 695for (int i = 0; i < nsMapEntry.Length; i++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypesHelper.cs (1)
74Array.Clear(_typeTable, 0, _typeTable.Length);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (4)
1213if (parInfo.Length >= maxConstructorArguments) 1215maxConstructorArguments = parInfo.Length; 1312for (int i=0; i<infos.Length; i++) 1316if (paramInfos.Length == numberOfConstructorAttributes)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (5)
165if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 233bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 269localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 286if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 304if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (5)
179if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 266bool localTag = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 305localAttrib = namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly; 322if (namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly) 340if (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (4)
581localAssembly = (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly); 3211if (methodInfo.GetParameters().Length == 1) 3217propertyCanWrite = methodInfo != null && methodInfo.GetParameters().Length == 2; 3525return (methodInfo.GetParameters().Length == 2) ||
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (16)
1306if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1375if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1386if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1465if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1533if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1544if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1962for (int i = 0; i < infos.Length; i++) 2073propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType; 2074propertyCanWrite = parameters.Length == 1 ? false : true; 2543for (int count = 0; count < namespaceMaps.Length;) 2578if (knownTypesOnly && (count == namespaceMaps.Length)) 2846localAssembly = (namespaceMaps != null && namespaceMaps.Length == 1 && namespaceMaps[0].LocalAssembly); 2969namespaceMaps.Length == 1 && 3169result = (namespaceMaps != null && namespaceMaps.Length > 0) || 3250for (int i = 0; i < _namespaceMaps.Length; i++) 3316for (int k = 0; k < _assemblyNames.Length; k++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsCache.cs (4)
309for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 314for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++) 378for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 388for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (3)
637if (_lastDecl == _nsDeclarations.Length - 1) 639NamespaceDeclaration[] new_nsDeclarations = new NamespaceDeclaration[_nsDeclarations.Length * 2]; 641Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
92if (nameFrags.Length == 1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
82if (methodInfo.GetParameters().Length == 1)
PresentationCore (723)
MS\Internal\Automation\TextRangeProviderWrapper.cs (2)
199ITextRangeProvider[] outArray = new ITextRangeProvider[argument.Length]; 200for (int i = 0; i < argument.Length; i++)
MS\Internal\FontCache\BufferCache.cs (4)
173length <= _buffers[index].Length) 205(_buffers[index].Length < buffer.Length && buffer.Length <= MaxBufferLength))
MS\Internal\FontCache\FamilyCollection.cs (2)
141for (int i = 0; i < _legacyArabicFonts.Length; ++i) 271for (int i = 0; i < _systemCompositeFontsNames.Length; ++i)
MS\Internal\FontCache\FontCacheUtil.cs (1)
546for (int i = 0; i < SupportedExtensions.Length; ++i)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (10)
417for (int i = 0; i < fastTextRanges.Length; i++) 420ushort[] glyphIndices = BufferCache.GetUShorts(codepoints.Length); 428CharacterMap.TryGetValues(pCodepoints, checked((uint)codepoints.Length), pGlyphIndices); 433for (int j = 0; j < codepoints.Length; j++) 481for (int i = 0; i < complexScripts.Length && typography != loclBitsTest; i++) 552for (int i = 0; i < complexScripts.Length; i++) 741ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 742ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count); 959for (int i = 0; i < majorLanguages.Length; i++) 981for (int i = 0; i < majorLanguages.Length; i++)
MS\Internal\FontCache\FontSource.cs (2)
394 bits.Length, 395 bits.Length,
MS\Internal\FontFace\CompositeFontInfo.cs (4)
221for (int i = FirstFamilyMapRange; i < familyMapRanges.Length; i += 2) 261if (count + 2 > ranges.Length) 263ushort[] temp = new ushort[ranges.Length * 2 - FirstFamilyMapRange]; 283if (count < ranges.Length)
MS\Internal\FontFace\FontDriver.cs (1)
216for (int i = 0; i < _tableDirectory.Length; ++i)
MS\Internal\FontFace\TypefaceCollection.cs (2)
83ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 84ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
MS\Internal\Ink\ErasingStroke.cs (4)
64_erasingStrokeNodes = new List<StrokeNode>(points.Length); 73_nodeIterator = _nodeIterator.GetIteratorForNextSegment(points.Length > 1 ? FilterPoints(points) : points); 262System.Diagnostics.Debug.Assert(path.Length > 1); 282while (i < path.Length)
MS\Internal\Ink\ExtendedProperty.cs (5)
75if (array1.Length == array2.Length) 77for (int i = 0; i < array1.Length; i++) 208Array newArray = Array.CreateInstance(elementType, ((Array)_value).Length); 209Array.Copy((Array)_value, newArray, ((Array)_value).Length);
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (5)
388uint cRanges = (uint)( enabledGestures.Length ); 505Debug.Assert(propertyGuids.Length == StylusPointDescription.RequiredCountOfProperties); 508packetDescription.cbPacketSize = (uint)(propertyGuids.Length * Marshal.SizeOf(typeof(Int32))); 509packetDescription.cPacketProperties = (uint)propertyGuids.Length; 554int packetCount = rawPackets.Length;
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (13)
37if (input.Length < 3) 53for(; n < input.Length; n++) 63int i = DefaultFirstSquareRoot.Length - 2; 101if (((compressedData.Count - 1/*for the algo byte we just made room for*/) >> 2) > input.Length) 163if (input.Length < 2) 168if (outputBuffer.Length == 0) 208if (input.Length < 3) 225Debug.Assert(outputBufferIndex < outputBuffer.Length); 234Debug.Assert(outputBufferIndex < outputBuffer.Length); 264List<byte> compressedData = new List<byte>(input.Length + 1); //reasonable default based on profiling. 289int unitCount = input.Length; 323if (input.Length < 2) 360int unitsToDecode = ((input.Length - inputIndex << 3) / bitCount) - padCount;
MS\Internal\Ink\InkSerializedFormat\Compress.cs (1)
97size > compressedInput.Length ||
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (20)
37for (int i = 0; i < KnownIdCache.OriginalISFIdTable.Length; i++) 45for (int i = 0; i < KnownIdCache.TabletInternalIdTable.Length; i++) 123for( int i = 0; i < data.Length; i++ ) 130for( int i = 0; i < data.Length; i++ ) 137for( int i = 0; i < data.Length; i++ ) 144for( int i = 0; i < data.Length; i++ ) 151for( int i = 0; i < data.Length; i++ ) 158for( int i = 0; i < data.Length; i++ ) 165for( int i = 0; i < data.Length; i++ ) 172for( int i = 0; i < data.Length; i++ ) 179for( int i = 0; i < data.Length; i++ ) 186for (int i = 0; i < data.Length; i++) 206for( int i = 0; i < data.Length; i++ ) 340cbSize = (uint)data.Length; 370cbWrite += SerializationHelper.Encode(strm, (uint)(compresseddata.Length - 1)); 373strm.Write(compresseddata, 0, (int)compresseddata.Length); 374cbWrite += (uint)compresseddata.Length; 388strm.Write(data, 0, (int)data.Length); 389cbWrite += (uint)data.Length; 946for (int i = 0; i < data.Length; i++)
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (1)
194if (data != null && data.Length > 0)
MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (20)
95if (0 == input.Length) 100testDelDel = testDelDel && (input.Length < 3); 142for (uint dataIndex = startIndex; dataIndex < input.Length; dataIndex++) 196if(0 == input.Length) 201int countOfInts = ((0 == (input.Length & 0x03)) ? input.Length >> 2 : 0); 209int countOfShorts = ((0 == (input.Length & 0x01)) ? input.Length >> 1 : 0); 252for (; n < input.Length; ++n) 268int padCount = ((((~(bitCount * input.Length)) & 0x07) + 1) & 0x07) / bitCount; 359if (index < _gorIndexMap.Length && index >= 0) 395for (int i = startInputIndex; i < input.Length; i++) 407for (int i = startInputIndex; i < input.Length; i++) 512ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(inputIndex, input.Length); 514ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(outputBufferIndex, outputBuffer.Length); 544Debug.Assert(outputBufferIndex < outputBuffer.Length); 546if (outputBufferIndex == outputBuffer.Length) 561Debug.Assert(outputBufferIndex < outputBuffer.Length); 563if (outputBufferIndex == outputBuffer.Length) 573return (uint)((outputBuffer.Length * bitCount + 7) >> 3);
MS\Internal\Ink\InkSerializedFormat\GuidTagList.cs (3)
54for (byte iIndex = 0; iIndex < KnownIdCache.OriginalISFIdTable.Length; ++iIndex) 125if (KnownIdCache.OriginalISFIdTable.Length <= nIndex) 192for (uint i = 0; i < KnownIdCache.OriginalISFIdTable.Length; ++i)
MS\Internal\Ink\InkSerializedFormat\HuffCodec.cs (8)
72for (uint i = 0; i < input.Length; i++) 80for (uint i = 0; i < input.Length; i++) 97Debug.Assert(input.Length >= 2); 100Debug.Assert(outputBuffer.Length != 0); 112Debug.Assert(outputBufferIndex < outputBuffer.Length); 114if (outputBufferIndex == outputBuffer.Length) 127Debug.Assert(outputBufferIndex < outputBuffer.Length); 129if (outputBufferIndex == outputBuffer.Length)
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (14)
102int isfBase64PrefixLength = Base64HeaderBytes.Length; 123byte[] isfData = Convert.FromBase64CharArray(chars, 0, chars.Length); 746if ((uint)isfTag >= KnownIdCache.CustomGuidBaseIndex || ((uint)isfTag >= KnownTagCache.KnownTagCount && ((uint)isfTag < (KnownTagCache.KnownTagCount + KnownIdCache.OriginalISFIdTable.Length)))) 1220requestedCount > buffer.Length) 1660for (int i = 0; i < buttonguids.Length; i++) 2025for (int i = 0; i < strkIds.Length; i++) 2058cbWrote += SerializationHelper.Encode(strm, (uint)(data.Length + SerializationHelper.VarSize((uint)strokes.Count))); 2062strm.Write(data, 0, (int)data.Length); 2063cbWrote += (uint)data.Length; 2087for (int i = 0; i < strkIds.Length; i++) 2117if (data.Length < isfBase64PrefixBytes.Length) 2122for (int x = 0; x < isfBase64PrefixBytes.Length; x++) 2184for (i = 0; i < descriptionGuids.Length; i++) 2741for (int x = 0; x < strokeIds.Length; x++)
MS\Internal\Ink\InkSerializedFormat\LZCodec.cs (2)
45Debug.Assert(input.Length > 1); 46Debug.Assert(inputIndex < input.Length);
MS\Internal\Ink\InkSerializedFormat\MetricEntry.cs (5)
153if( data.Length > MAX_METRIC_DATA_BUFF ) 156_size = (uint)data.Length; 337for( ul = 0; ul < MetricEntry_Never.Length ; ul++ ) 348for( ul = 0; ul<MetricEntry_Must.Length; ul++ ) 365for( ul = 0; ul<MetricEntry_Optional.Length; ul++ )
MS\Internal\Ink\InkSerializedFormat\MultiByteCodec.cs (4)
80Debug.Assert(inputIndex < input.Length); 83uint cb = (input.Length - inputIndex > 5) ? 5 : (uint)(input.Length - inputIndex); 115ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(inputIndex, input.Length);
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (4)
524if (byteCounter != buttonData.Length) 954if (packetdata.Length == 0) 969stream.Write(data, 0, (int)data.Length); 971return (uint)data.Length;
MS\Internal\Ink\StrokeIntersection.cs (6)
192System.Diagnostics.Debug.Assert(intersections.Length > 0); 194List<StrokeFIndices> inFIndices = new List<StrokeFIndices>(intersections.Length); 195for (int j = 0; j < intersections.Length; j++) 224System.Diagnostics.Debug.Assert(intersections.Length > 0); 226List<StrokeFIndices> hitFIndices = new List<StrokeFIndices>(intersections.Length); 227for (int j = 0; j < intersections.Length; j++)
MS\Internal\Ink\StrokeNode.cs (10)
238int maxCount = vertices.Length * 2; 244Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor); 275for (int j = 0; i < maxCount && j < vertices.Length; i++, j++) 278Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor); 358int maxCount = vertices.Length * 2; 363Point point = _thisNode.Position + (vertices[i % vertices.Length] * pressureFactor); 387for (int j = 0; i < maxCount && j < vertices.Length; i++, j++) 390Point point = _thisNode.Position + (vertices[i % vertices.Length] * pressureFactor); 623for (int i = 0; i < vertices.Length; i++) 625Point point = _lastNode.Position + (vertices[i % vertices.Length] * pressureFactor);
MS\Internal\Ink\StrokeNodeOperations.cs (20)
69for (i = 0; (i + 1) < _vertices.Length; i += 2) 73if (i < _vertices.Length) 102for (int i = 0; i < _vertices.Length; i++) 109for (int i = 0; i < _vertices.Length; i++) 130Point vertex = node.Position + (_vertices[_vertices.Length - 1] * node.PressureFactor); 131for (int i = 0; i < _vertices.Length; i++) 142for (int i = 0, count = _vertices.Length; i < count; i++) 211int count = _vertices.Length; 358int i = 0, count = _vertices.Length; 383count = _vertices.Length; 386i = (i + 1) % _vertices.Length; 417count = _vertices.Length; 420i = (i + 1) % _vertices.Length; 697Vector lastVertex = _vertices[_vertices.Length - 1]; 707for (int k = 0, count = _vertices.Length; k < count || (k == count && testNextEdge); k++) 1081int i = 0, count = _vertices.Length; 1096count = _vertices.Length; 1107i = (i + 1) % _vertices.Length; 1147count = _vertices.Length; 1150i = (i + 1) % _vertices.Length;
MS\Internal\Ink\StrokeNodeOperations2.cs (2)
44System.Diagnostics.Debug.Assert((null != vertices) && (2 < vertices.Length)); 47int count = vertices.Length;
MS\Internal\Ink\StylusShape.cs (15)
113vertices = new Vector[m_vertices.Length]; 117for (int i = 0; i < vertices.Length; i++) 124for (int i = 0; i < vertices.Length; i++) 140vertices = new Vector[p.Length]; 141for (int i = 0; i < vertices.Length; i++) 234System.Diagnostics.Debug.Assert(vertices.Length == 4); 236Point prevVertex = (Point)vertices[vertices.Length - 1]; 239for (int i = 0; i < vertices.Length; i++) 245double det = Vector.Determinant(edge, (Point)vertices[(i + 1) % vertices.Length] - (Point)vertex); 259System.Diagnostics.Debug.Assert(clockWiseIndex == vertices.Length || counterClockIndex == vertices.Length); 261if (counterClockIndex == vertices.Length) 264int lastIndex = vertices.Length -1; 265for (int j = 0; j < vertices.Length/2; j++) 316for (int i = 0; i < controlPoints.Length; i++)
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (6)
243int[,] outByteRanges = new int[(inByteRanges.Length / 2),2]; 245for (int i=0, j=0; i < inByteRanges.Length; ++i, ++j) 271int[] outByteRanges = new int[inByteRanges.Length]; 702if (byteRanges.Length < 2 || (byteRanges.Length % 2) != 0) 707for (int i = 0; i < byteRanges.Length; i++)
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (4)
294int guidBytePosition = _guid.Length - ((int) readPosition % _guid.Length) - 1; 300guidBytePosition = _guid.Length - 1; 341for (int i = 0; i < guidBytes.Length; i++)
MS\Internal\IO\Packaging\NetStream.cs (4)
147if (offset + count > buffer.Length) 344while (Read(buf, 0, buf.Length) > 0) 491_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this); 1022_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this);
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (17)
249for (int i = 0; i < visCorners.Length; i++) 302for (int i = 0; i < visualTexCoordBounds.Length; i++) 492Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match"); 498for (int i = 0; i < visualTexCoordBounds.Length; i++) 501Point visEdgeEnd = visualTexCoordBounds[(i + 1) % visualTexCoordBounds.Length]; 509for (int j = 0; j < uv.Length; j++) 512Point uv2 = uv[(j + 1) % uv.Length]; 514Point3D p3D2 = p[(j + 1) % p.Length]; 845for (int i = 0; i < p.Length; i++) 849Point3D p3D2 = p[(i + 1) % p.Length]; 860uv2 = uv[(i + 1) % p.Length]; 866uv1 = uv[(i + 1) % p.Length]; 929for (int i = 0; i < bounds.Length; i++) 932Point visEdgeEnd = bounds[(i + 1) % bounds.Length]; 1013for (int i = 0; i < polygon.Length; i++) 1015double crossProduct = Vector.CrossProduct(polygon[(i + 1) % polygon.Length] - polygon[i],
MS\Internal\Media3D\M3DUtil.cs (1)
352for(int i = 1; i < points.Length; i++)
MS\Internal\PartialArray.cs (4)
37Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length); 48public PartialArray(T[] array) : this(array, 0, array.Length) 150if (arrayIndex >= array.Length) 160if ((array.Length - Count - arrayIndex) < 0)
MS\Internal\Resources\ContentFileHelper.cs (3)
64if (assemblyAttributes != null && assemblyAttributes.Length > 0) 66contentFiles = new HashSet<string>(assemblyAttributes.Length, StringComparer.OrdinalIgnoreCase); 68for (int i=0; i<assemblyAttributes.Length; i++)
MS\Internal\Shaping\OpenTypeCommon.cs (5)
968for(int j = 0; j < featureTagsList.Length; j++) 1277for(int j = 0; !complexFeatureFound && j < featureTagsList.Length; j++) 1307if (complexLanguages.Length == complexLanguageCount) 1310new WritingSystem[complexLanguages.Length * 3 /2]; 1312for(int i = 0; i < complexLanguages.Length; i++)
MS\Internal\Shaping\OpenTypeLayout.cs (6)
129m_length = (uint)data.Length; 1216_lookupUsageFlags.Length < requiredLookupUsageArraySize) 1250if (flagByte >= _lookupUsageFlags.Length) 1266if (flagByte >= _lookupUsageFlags.Length) 1293if (_cachePointers != null && _cachePointers.Length >= glyphRunLength) return; 1319if (_cachePointers.Length < newLength)
MS\Internal\Shaping\OpenTypeLayoutCache.cs (1)
1078if (recordCount == records.Length)
MS\Internal\Shaping\ShaperBuffers.cs (6)
233newSize > _features.Length || 264_features.Length != 0 && 266_features.Length >= keepCount) 270ushort currentLength = (ushort)_features.Length; 326if ( _featuresCount == _features.Length ) 348if ( _featuresCount == _features.Length )
MS\Internal\Shaping\TypefaceMap.cs (2)
887for (int i = 0; i < familyList.Length; i++) 949i = familyList.Length;
MS\Internal\Shaping\UshortList2.cs (6)
190get { return _array.Length; } 208((index + count) <= _array.Length ? count : _array.Length) * sizeof(ushort) 218if (newLength > _array.Length) 223int extra = newLength - _array.Length; 224int newArraySize = _array.Length + ((extra - 1) / _leap + 1) * _leap;
MS\Internal\TextFormatting\FormattedTextSymbols.cs (11)
169int[] nominalAdvances = new int[charArray.Length]; 345_glyphAdvances = new double[glyphAdvances.Length]; 349for (int i = 0; i < glyphAdvances.Length; i++) 361_glyphOffsets = new PartialArray<Point>(new Point[glyphOffsets.Length]); 363for (int i = 0; i < glyphOffsets.Length; i++) 372Debug.Assert(glyphAdvances.Length <= glyphIndices.Length); 374if (glyphAdvances.Length != glyphIndices.Length) 376_glyphIndices = new ushort[glyphAdvances.Length]; 378for (int i = 0; i < glyphAdvances.Length; i++)
MS\Internal\TextFormatting\FullTextLine.cs (3)
724if (collapsingPropertiesList == null || collapsingPropertiesList.Length == 0) 2467subLineInfo.Length, 2524subLineInfo.Length,
MS\Internal\TextFormatting\FullTextState.cs (1)
533rawText.Length,
MS\Internal\TextFormatting\LineServicesCallbacks.cs (1)
1788for (int i = 0; i < lsruns.Length; i++)
MS\Internal\TextFormatting\LineServicesRun.cs (5)
921Debug.Assert(lsruns != null && lsruns.Length > 0 && lsruns[0] != null); 929for (int i = 1; i < lsruns.Length; i++) 944fontFeatures = new DWriteFontFeature[lsruns.Length][]; 945fontFeatureRanges = new uint[lsruns.Length]; 947for (int i = 0; i < lsruns.Length; i++)
MS\Internal\TextFormatting\SimpleTextLine.cs (13)
587if (_runs.Length <= 0) 667for(int i = 0; i < _runs.Length; i++) 898TextSpan<TextRun>[] textRunSpans = new TextSpan<TextRun>[_runs.Length]; 900for (int i = 0; i < _runs.Length; i++) 914List<IndexedGlyphRun> indexedGlyphRuns = new List<IndexedGlyphRun>(_runs.Length); 928displayGlyphAdvances = new ThousandthOfEmRealDoubles(run.EmSize, run.NominalAdvances.Length); 937displayGlyphAdvances = new List<double>(run.NominalAdvances.Length); 938for (int i = 0; i < run.NominalAdvances.Length; i++) 1215while (runIndex < _runs.Length) 1282while (runIndex < _runs.Length && cpRunStart + _runs[runIndex].Length <= cp) 1770displayGlyphAdvances = new ThousandthOfEmRealDoubles(EmSize, NominalAdvances.Length); 1779displayGlyphAdvances = new List<double>(NominalAdvances.Length); 1780for (int i = 0; i < NominalAdvances.Length; i++)
MS\Internal\TextFormatting\TextMarkerSource.cs (3)
154if (textSourceCharacterIndex < _characterArray.Length) 160_characterArray.Length - textSourceCharacterIndex, 184Math.Min(_characterArray.Length, textSourceCharacterIndexLimit)
MS\Internal\TextFormatting\TextRunCacheImp.cs (1)
330for (int i = 0; i < textRunList.Length; i++)
MS\Internal\TextFormatting\TextShapeableCharacters.cs (4)
148caretStops = new bool[clusterMap.Length + 1]; 152caretStops[clusterMap.Length] = true; 156for (int i = 1; i < clusterMap.Length; i++) 236characterString.Length
MS\Internal\TextFormatting\TextStore.cs (6)
333|| cchResolved <= bidiLevels.Length) 525int effectedRangeEnd = Math.Min(cpFetched - offset + runInfo.Length, bounds[bounds.Length - 1].Position); 529for (int i = 0; i < bounds.Length && currentPosition < effectedRangeEnd; i++) 565if (currentEffectsCount == 0 && i < bounds.Length - 1) 990Invariant.Assert(resolvedLength <= bidiLevels.Length); 2306stringBuilder.CopyTo(0, rawText, 0, rawText.Length);
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (8)
77return _shortList.Length; 81return _doubleList.Length; 120_doubleList = new double[_shortList.Length]; 121for (int i = 0; i < _shortList.Length; i++) 159for (int i = 0; i < _shortList.Length; i++) 166for (int i = 0; i < _doubleList.Length; i++) 192if (arrayIndex >= array.Length) 202if ((array.Length - Count - arrayIndex) < 0)
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (2)
135if (arrayIndex >= array.Length) 145if ((array.Length - Count - arrayIndex) < 0)
src\Microsoft.DotNet.Wpf\src\Common\src\System\AppContextDefaultValues.cs (4)
121if (components.Length < 2 || components.Length > 3) 142for (int i = 1; i < components.Length; i++) 147if (keyValuePair.Length != 2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (4)
203get { return _characterArray.Length; } 251Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 254|| characterOffset + characterLength > _characterArray.Length) 256characterLength = _characterArray.Length - characterOffset;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (4)
36_bufferLengthInBits = (uint)buffer.Length * (uint)Native.BitsPerByte; 49ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, buffer.Length); 53_bufferLengthInBits = (uint)(buffer.Length - startIndex) * (uint)Native.BitsPerByte; 65if (bufferLengthInBits > (buffer.Length * Native.BitsPerByte))
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\LegacyPriorityQueue.cs (1)
145if (_count == _heap.Length)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (4)
143for (int i = assemblies.Length - 1; i >= 0; i--) 266if (reqKeyToken.Length == curKeyToken.Length) 270for (int i = 0; i < reqKeyToken.Length; i++)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SequentialUshortCollection.cs (2)
67ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 68ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Automation\Peers\AutomationPeer.cs (1)
493for(int i = 0; i < roots.Length; i++)
System\Windows\ClassHandlersStore.cs (1)
61int length = handlers.Handlers.Length;
System\Windows\clipboard.cs (1)
649for (int i = 0; i < formats.Length; i++)
System\Windows\dataobject.cs (33)
1272for (int i=0; i<formats.Length; i++) 1294for (int i=0; i<ALLOWED_TYMEDS.Length; i++) 1398if (buffer != null && buffer.Length != 0) 1400hEnhancedMetafile = NativeMethods.SetEnhMetaFileBits((uint)buffer.Length, buffer); 1800if (files == null || files.Length < 1) 1821for (int i = 0; i < files.Length; i++) 1846Marshal.Copy(structData, 0, currentPtr, structData.Length); 1855for (int i = 0; i < files.Length; i++) 1922UnsafeNativeMethods.CopyMemoryW(ptr, chars, chars.Length * 2); 1931*(char*)(IntPtr)((ulong)ptr + (ulong)chars.Length * 2) = '\0'; 1960Win32WideCharToMultiByte(str, str.Length, strBytes, strBytes.Length); 2269_formats = new FORMATETC[formats == null ? 0 : formats.Length]; 2273for (int i = 0; i < formats.Length; i++) 2329for (int i = 0; i < celt && _current < _formats.Length; i++) 2350return (_current < _formats.Length) ? NativeMethods.S_OK : NativeMethods.S_FALSE; 2504for (int i=0; i<mappedFormats.Length; i++) 2517for (int formatetcIndex = 0; formatetcIndex < formatetc.Length; formatetcIndex++) 2607for (int i = 0; i < mappedFormats.Length; i++) 2654for (int i = 0; i < mappedFormats.Length; i++) 3000if (size > _serializedObjectID.Length) 3003for(int i = 0; i < _serializedObjectID.Length; i++) 3016index = _serializedObjectID.Length; 3024return new MemoryStream(bytes, index, bytes.Length - index); 3222for (int i=0; i<ALLOWED_TYMEDS.Length; i++) 3378for (int baseFormatIndex = 0; baseFormatIndex < baseVar.Length; baseFormatIndex++) 3386for (int dataStoreIndex = 0; dataStoreIndex < entries.Length; dataStoreIndex++) 3400for (int mappedFormatIndex = 0; mappedFormatIndex < cur.Length; mappedFormatIndex++) 3406dataStoreIndex < entries.Length; 3510for (int i = 0; i < mappedFormats.Length; i++) 3565for (int i = 0; i < entries.Length; i++) 3599for (int i = 0; i < formats.Length; i++) 3626newlist = (DataStoreEntry[])Array.CreateInstance(typeof(DataStoreEntry), datalist.Length + 1); 3648for (int i = 0; i < dataStoreEntries.Length; i++)
System\Windows\DataObjectPastingEventArgs.cs (1)
136if (availableFormats == null || availableFormats.Length == 0)
System\Windows\DragDrop.cs (1)
1419for (int i = 0; i < formats.Length; i++)
System\Windows\FreezableCollection.cs (2)
395ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 505ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Generated\ContentElement.cs (1)
657for(int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Generated\TextDecorationCollection.cs (2)
296ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 406ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Generated\UIElement.cs (1)
657for(int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Generated\UIElement3D.cs (1)
454for(int i = 0; i < classListeners.Handlers.Length; i++)
System\Windows\Ink\IncrementalHitTester.cs (1)
684System.Diagnostics.Debug.Assert(stroke != null && hitFragments != null && hitFragments.Length > 0);
System\Windows\Ink\Stroke.cs (15)
731System.Diagnostics.Debug.Assert(cutAt.Length != 0); 741if (cutAt.Length == 0) 746if ((cutAt.Length == 1) && cutAt[0].IsFull) 762System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 763Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) > sourceStylusPoints.Count - 1)); 765for (int i = 0; i < cutAt.Length; i++) 793System.Diagnostics.Debug.Assert(cutAt.Length != 0); 804if ((cutAt.Length == 0) || ((cutAt.Length == 1) && cutAt[0].IsFull)) 818System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 819Math.Ceiling(cutAt[cutAt.Length - 1].EndFIndex) > sourceStylusPoints.Count - 1)); 829for (; i < cutAt.Length; i++) 1012if (fragments.Length == 0) 1016if (fragments.Length == 1) 1022for (int x = 0; x < fragments.Length; x++)
System\Windows\Ink\Stroke2.cs (3)
627if(cutAt.Length == 0) 651if (cutAt.Length == 0) 661if (inSegments.Length == 0)
System\Windows\Ink\StrokeCollection.cs (5)
411for ( int x = indexes.Length - 1; x >= 0; x-- ) 529for ( int x = indexes.Length - 1; x >= 0; x-- ) 759for ( int x = 0; x < indexes.Length; x++ ) 789for ( int y = 0; y < indexes.Length; y++ ) 796for ( int i = indexes.Length - 1; i > y; i-- )
System\Windows\Input\Cursor.cs (1)
241for (dataSize = cursorData.Length;
System\Windows\Input\CursorConverter.cs (1)
76for(int num1 = 0; num1 < infoArray1.Length; num1++)
System\Windows\Input\InputManager.cs (4)
720for(int i = (handlers.Length - 1); i >= 0; i--) 743for(int i = (handlers.Length - 1); i >= 0; i--) 843for(int i = (handlers.Length - 1); i >= 0; i--) 909for(int i = (handlers.Length - 1); i >= 0; i--)
System\Windows\Input\InputMethod.cs (2)
1454for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++) 1478for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++)
System\Windows\Input\InputMethodStateTypeInfo.cs (1)
94for (int i = 0; i < _iminfo.Length; i++)
System\Windows\Input\InputProcessorProfiles.cs (1)
127for (i = 0; (i < hklList.Length) && (i < count); i++)
System\Windows\Input\Stylus\Common\RawStylusInputReport.cs (1)
280int lastXIndex = _data.Length - packetLength;
System\Windows\Input\Stylus\Common\StylusPoint.cs (8)
128if (additionalValues.Length != expectedAdditionalValues) 310int buttonData = _additionalValues[_additionalValues.Length - 1]; 403int buttonData = _additionalValues[_additionalValues.Length - 1]; 416_additionalValues[_additionalValues.Length - 1] = buttonData; 529for (int x = 0; x < stylusPoint1._additionalValues.Length; x++) 603for (int x = 0; x < _additionalValues.Length; x++) 638count += _additionalValues.Length; 655for (int x = 0; x < _additionalValues.Length; x++)
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (5)
152int logicalPointCount = rawPacketData.Length / lengthPerPoint; 153Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 541Debug.Assert(additionalData.Length == countToCopy); 618additionalData.Length -1 == countToCopy : 619additionalData.Length == countToCopy);
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (20)
139get { return _stylusPointPropertyInfos.Length; } 188Guid[] ret = new Guid[_stylusPointPropertyInfos.Length]; 189for (int x = 0; x < ret.Length; x++) 203int propertyLength = (_stylusPointPropertyInfos.Length - _buttonCount) + buttonLength; 218int expectedLength = ((_stylusPointPropertyInfos.Length - _buttonCount) + buttonLength) - 3 /*x, y, p*/; 258for (int x = _stylusPointPropertyInfos.Length - _buttonCount; //start of the buttons 259x < _stylusPointPropertyInfos.Length; x++) 308Debug.Assert( stylusPointDescription1._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 313Debug.Assert( stylusPointDescription2._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 318if (stylusPointDescription1._stylusPointPropertyInfos.Length != stylusPointDescription2._stylusPointPropertyInfos.Length) 322for (int x = RequiredCountOfProperties; x < stylusPointDescription1._stylusPointPropertyInfos.Length; x++) 350Debug.Assert(stylusPointDescription._stylusPointPropertyInfos.Length >= 3 && 355Debug.Assert(stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length >= 3 && 368for (int x = RequiredCountOfProperties; x < stylusPointDescription._stylusPointPropertyInfos.Length; x++) 370for (int y = RequiredCountOfProperties; y < stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length; y++) 393if (stylusPointDescriptionSuperset._stylusPointPropertyInfos.Length < _stylusPointPropertyInfos.Length) 401for (int x = 0; x < _stylusPointPropertyInfos.Length; x++) 418for (int x = 0; x < _stylusPointPropertyInfos.Length; x++)
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (4)
169if (!elementHasCapture && inputReport.Data != null && inputReport.Data.Length >= pointLength) 172System.Diagnostics.Debug.Assert(data.Length % pointLength == 0); 173Point ptTablet = new Point(data[data.Length - pointLength], data[data.Length - pointLength + 1]);
System\Windows\Input\Stylus\Wisp\PenContext.cs (1)
459int itemsPerPacket = data.Length / numPackets;
System\Windows\Input\Stylus\Wisp\PenContexts.cs (12)
180for (int i = 0; i < _contexts.Length; i++) 196for (int i = 0; i < _contexts.Length; i++) 227if (_contexts != null && index <= _contexts.Length && _inputSource.Value.CriticalHandle != IntPtr.Zero) 229PenContext[] ctxs = new PenContext[_contexts.Length + 1]; 231uint postCopyCount = (uint)_contexts.Length - index; 252if (_contexts != null && index < _contexts.Length) 256PenContext[] ctxs = new PenContext[_contexts.Length - 1]; 258uint postCopyCount = (uint)_contexts.Length - index - 1; 505if (!elementHasCapture && inputReport.Data != null && inputReport.Data.Length >= pointLength) 508System.Diagnostics.Debug.Assert(data.Length % pointLength == 0); 509Point ptTablet = new Point(data[data.Length - pointLength], data[data.Length - pointLength + 1]);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (10)
770_cachedMoveData = new int [data0.Length + data.Length]; 772data.CopyTo(_cachedMoveData, data0.Length); 1013for (i=0; i<_penContexts.Length; i++) 1072for (i=0; i<_penContexts.Length; i++) 1184for (int j=0; j<workerOps.Length; j++) 1207if (_handles.Length == 1) 1221_handles.Length, _handles, _pimcResetHandle.Value, 1257for (int i = 0; i < _penContexts.Length; i++) 1286for (int i = 0; i < _pimcContexts.Length; i++)
System\Windows\Input\Stylus\Wisp\WispLogic.cs (4)
212int[] mergedData = new int[oldData.Length + newData.Length]; 215newData.CopyTo(mergedData, oldData.Length); 3484return tabletdevices.Length;
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
45int count = tabletInfo.StylusDevicesInfo.Length; 104int cCursors = stylusDevicesInfo.Length;
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (16)
266PenThread penThread = _tablets.Length > 0 ? _tablets[0].As<WispTabletDevice>().PenThread : 280for (uint i = 0; i < tabletdevices.Length; i++) 295for (uint k = 0; k < tabletdevices.Length; k++) 304for (uint iTablet = 0; iTablet < tabletdevices.Length; iTablet++) 314if (tabletsIndex < _tablets.Length && _tablets[tabletsIndex] != null && _tablets[tabletsIndex].Id == id) 324for (uint i = 0; i < _tablets.Length; i++) 363if (unchangedTabletCount == _tablets.Length && 414PenThread penThread = _tablets.Length > 0 ? _tablets[0].As<WispTabletDevice>().PenThread : 441for (uint i = 0; i < _tablets.Length; i++) 467if (tabletIndex <= _tablets.Length) 528if (tabletIndex >= _tablets.Length) 550uint postCopyCount = (uint)_tablets.Length - index; 568TabletDevice[] tablets = new TabletDevice[_tablets.Length - 1]; 571uint postCopyCount = (uint)_tablets.Length - index - 1; 596for (int iTablet = 0, cTablets = _tablets.Length; iTablet < cTablets; iTablet++) 612for (int iTablet = 0, cTablets = _tablets.Length; iTablet < cTablets; iTablet++)
System\Windows\Input\TextCompositionManager.cs (1)
401bytes, bytes.Length,
System\Windows\Input\TextServicesCompartmentContext.cs (1)
58for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++)
System\Windows\InterOp\HwndMouseInputProvider.cs (1)
250for (int i = 0; i < n && cpt < points.Length; i++)
System\Windows\InterOp\HwndPointerInputProvider.cs (4)
146int pointerPropertyCount = tabletDevice.DeviceInfo.SupportedPointerProperties.Length; 165int numButtons = tabletDevice.DeviceInfo.SupportedPointerProperties.Length - tabletDevice.DeviceInfo.SupportedButtonPropertyIndex; 176for (int i = 0, j = rawPointerData.Length - pointerPropertyCount; i < data.Length; i += rawDataPointSize, j -= pointerPropertyCount)
System\Windows\InterOp\HwndSource.cs (2)
245for (int i = handlers.Length -1; i >= 0; --i) 1654for (int i = handlers.Length -1; i >= 0; --i)
System\Windows\LayoutManager.cs (4)
598for(int i=0; i<copy.Length; i++) 701for(int i=0; i<copy.Length; i++) 752AutomationPeer[] peers = new AutomationPeer[copy.Length]; 755for(int i=0; i<copy.Length; i++)
System\Windows\Media\Animation\Clock.cs (1)
4247for (int index = 0; index < idTable.Length; index++)
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 824int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\TimelineCollection.cs (2)
306ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 416ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (2)
348Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 916int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\Media\Animation\TimeIntervalCollection.cs (5)
228if (_nodeTime != null && _nodeTime.Length > _minimumCapacity) 1246projection.EnsureAllocatedCapacity(this._nodeTime.Length); 1630Debug.Assert(_nodeTime.Length >= _minimumCapacity); // Assert that we indeed have memory allocated 1786else if (_nodeTime.Length < requiredCapacity) // We may need to grow by up to 2 units 1791int newCapacity = _nodeTime.Length << 1; // Dynamically grow by a factor of 2
System\Windows\Media\Animation\Timeline.cs (1)
1008for (int index = 0; index < idTable.Length; index++)
System\Windows\Media\ByteStreamGeometryContext.cs (1)
762if (chunk.Length == c_defaultChunkSize)
System\Windows\Media\CharacterMetricsDictionary.cs (8)
138if (index >= array.Length) 146for (int i = 0; i < pageTable.Length; ++i) 151for (int j = 0; j < page.Length; ++j) 156if (k >= array.Length) 195if (index >= array.Length) 198if (Count > array.Length - index) 460for (int i = 0; i < pageTable.Length; ++i) 465for (int j = 0; j < page.Length; ++j)
System\Windows\Media\ColorContext.cs (3)
140_colorContextHandle, sRGBProfile, (uint)sRGBProfile.Length)) 148FromRawBytes(sRGBProfile, sRGBProfile.Length, /* dontThrowException = */ true); 645Invariant.Assert(dataLength <= data.Length);
System\Windows\Media\ColorContextHelper.cs (1)
96Invariant.Assert(buffer == null || bufferSize <= buffer.Length);
System\Windows\Media\ColorTransformHelper.cs (2)
100(UInt32)handles.Length, 102(UInt32)dwIntents.Length,
System\Windows\Media\CultureSpecificStringDictionary.cs (4)
127if (index >= array.Length) 130if (_innerDictionary.Count > array.Length - index) 161if (index >= array.Length) 164if (_innerDictionary.Count > array.Length - index)
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (2)
302ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 412ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Effects\PixelShader.cs (1)
286destinationBytecode = new byte[sourceBytecode.Length];
System\Windows\Media\EllipseGeometry.cs (1)
276for (int i=0; i<points.Length; i++)
System\Windows\Media\FamilyMap.cs (2)
112for (int i = 0; i < _ranges.Length; ++i) 346for(int i = 0; i < _ranges.Length; i++)
System\Windows\Media\FamilyMapCollection.cs (5)
89if (index >= array.Length) 92if (_count > array.Length - index) 110if (index >= array.Length) 113if (_count > array.Length - index) 283else if (_count == _items.Length)
System\Windows\Media\FamilyTypefaceCollection.cs (3)
262else if (_count == _items.Length) 389if (index >= array.Length) 392if (_count > array.Length - index)
System\Windows\Media\Fonts.cs (2)
336ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 337ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Media\FormattedText.cs (2)
995return _that._maxTextWidths[Math.Min(line, _that._maxTextWidths.Length - 1)]; 1317if (maxTextWidths == null || maxTextWidths.Length <= 0)
System\Windows\Media\Generated\DoubleCollection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\DrawingCollection.cs (2)
318ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 428ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GeneralTransformCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GeometryCollection.cs (2)
318ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 428ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\GradientStopCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\Int32Collection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PathFigureCollection.cs (2)
305ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 415ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PathSegmentCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\PointCollection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\RenderData.cs (3)
556Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1125Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1465Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length));
System\Windows\Media\Generated\TextEffectCollection.cs (2)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 414ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\TransformCollection.cs (2)
318ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 428ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Generated\VectorCollection.cs (2)
255ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 378ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media\Geometry.cs (3)
953if ((SerializedData == null) || (SerializedData.Length <= 0)) 977if ((SerializedData == null) || (SerializedData.Length <= 0)) 989Invariant.Assert(size <= (uint)SerializedData.Length);
System\Windows\Media\GlyphTypeface.cs (5)
1235Invariant.Assert(glyphsLength <= glyphs.Length); 1833ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 1834ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count); 1918ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(arrayIndex, array.Length); 1919ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - Count);
System\Windows\Media\GuidelineCollection.cs (2)
57Debug.Assert(!isDynamic || guidelinesX.Length % 2 == 0); 66Debug.Assert(!isDynamic || guidelinesY.Length % 2 == 0);
System\Windows\Media\ImageSourceConverter.cs (1)
291return new MemoryStream(rawData, i, rawData.Length - i);
System\Windows\Media\Imaging\BitmapDecoder.cs (1)
961Invariant.Assert(colorContextPtrs == null || numContexts <= colorContextPtrs.Length);
System\Windows\Media\Imaging\BitmapFrameDecode.cs (1)
235Invariant.Assert(colorContextPtrs == null || numContexts <= colorContextPtrs.Length);
System\Windows\Media\Imaging\BitmapSource.cs (1)
681int destBufferSize = checked(elementSize * (pixels.Length - offset));
System\Windows\Media\Imaging\CachedBitmap.cs (1)
153int destBufferSize = elementSize * pixels.Length;
System\Windows\Media\Imaging\PropVariant.cs (7)
150int length = array.Length; 195int length = value.Length; 276for (int i=0; i<charArray.Length; i++) 326short[] array = new short[boolArray.Length]; 328for (int i=0; i<boolArray.Length; i++) 413pclsidVal = Marshal.AllocCoTaskMem(guid.Length); 414Marshal.Copy(guid, 0, pclsidVal, guid.Length);
System\Windows\Media\MatrixStack.cs (3)
46if (_size == _items.Length) 192Debug.Assert(_highWaterMark <= _items.Length); 198if (newSize * (s_shrinkFactor) <= _items.Length)
System\Windows\Media\Parsers.cs (1)
146if (result.ColorContext.NumChannels != values.Length)
System\Windows\Media\PathGeometry.cs (9)
141Invariant.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHGEOMETRY)); 159Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHFIGURE)); 179Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT)); 189Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 204Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 221Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 237Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 258Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 270Debug.Assert(pathData.SerializedData.Length >=
System\Windows\Media\PixelFormat.cs (5)
97int leftNumChannels = left._mask != null ? left._mask.Length : 0; 98int rightNumChannels = right._mask != null ? right._mask.Length : 0; 142for (int i = 0, count = _mask.Length; i < count; ++i) 547Debug.Assert(cbBytes == channelMask.Length); 701return GetPixelFormat( (PixelFormatEnum)guidBytes[guidBytes.Length-1] );
System\Windows\Media\RectangleGeometry.cs (1)
335for (int i=0; i<points.Length; i++)
System\Windows\Media\RenderData.cs (8)
103if ((_buffer == null) || (newOffset > _buffer.Length)) 110Debug.Assert((_buffer != null) && (_buffer.Length >= newOffset)); 113Debug.Assert(_buffer.Length > 0); 479Debug.Assert(_buffer.Length < cbRequiredSize); 485int newSize = Math.Max((_buffer.Length << 1) - (_buffer.Length >> 1), cbRequiredSize); 498Buffer.MemoryCopy(pBuffer, pNewBuffer, _buffer.Length, _buffer.Length);
System\Windows\Media\StreamGeometry.cs (16)
83if ((_data == null) || (_data.Length <= 0)) 90Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 113Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 137Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 157Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 217Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 241Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 263Invariant.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 497if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 499_data = new byte[sourceStream._data.Length]; 512if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 514_data = new byte[sourceStream._data.Length]; 528if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 530_data = new byte[sourceStream._data.Length]; 544if ((sourceStream._data != null) && (sourceStream._data.Length > 0)) 546_data = new byte[sourceStream._data.Length];
System\Windows\Media\VisualCollection.cs (6)
198ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _size); 221ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _size); 257return _items != null ? _items.Length : 0; 261int currentCapacity = _items != null ? _items.Length : 0; 472if ((_items == null) || (_size == _items.Length)) 718if ((_items == null) || (_size == _items.Length))
System\Windows\Media\VisualProxy.cs (5)
76int tailLength = _tail.Length; 186else if (count > _tail.Length) 321else if (count == _tail.Length) 574int newLength = _tail.Length + delta; 580Array.Copy(_tail, reallocatedTail, Math.Min(_tail.Length, newLength));
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (2)
300ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 410ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\MaterialCollection.cs (2)
314ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 424ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
314ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 424ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Point3DCollection.cs (2)
251ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 374ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
314ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 424ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
251ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count); 374ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - _collection.Count);
System\Windows\Media3D\Matrix3D.cs (3)
527for(int i = 0; i < points.Length; i++) 553for(int i = 0; i < points.Length; i++) 579for(int i = 0; i < vectors.Length; i++)
System\Windows\Media3D\Visual3DCollection.cs (4)
152ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, array.Length); 153ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - Count); 168ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, array.Length); 169ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length - Count);
System\Windows\Navigation\BaseUriHelper.cs (2)
290int count = assemblyInfo.Length; 341int count = assemblyInfo.Length;
System\Windows\PresentationSource.cs (2)
604if (visuals == null || visuals.Length == 0) 611int count = visuals.Length;
System\Windows\TextDecorationCollectionConverter.cs (2)
132i < TextDecorationNames.Length 137if (i < TextDecorationNames.Length)
PresentationFramework (913)
Microsoft\Win32\CommonItemDialog.cs (3)
478if (_itemNames?.Length > 0) 617string[] names = new string[items.Length]; 618for (int i = 0; i < items.Length; i++)
Microsoft\Win32\FileDialog.cs (10)
141string[] safeFileNames = new string[unsafeFileNames.Length]; 143for (int i = 0; i < unsafeFileNames.Length; i++) 335if (formats.Length % 2 != 0) 510if (filterItems.Length > 0) 512dialog.SetFileTypes((uint)filterItems.Length, filterItems); 596for (int i = 0; i < MutableItemNames.Length; i++) 604for (int j = 0; j < extensions.Length; j++) 682if (0 == tokens.Length % 2) 684for (int i = 1; i < tokens.Length; i += 2) 752if (indexOfExtension >= tokens.Length)
Microsoft\Win32\OpenFileDialog.cs (2)
104Stream[] streams = new Stream[cachedFileNames.Length]; 107for (int i = 0; i < cachedFileNames.Length; i++)
Microsoft\Win32\OpenFolderDialog.cs (2)
131string[] safeFolderNames = new string[unsafeFolderNames.Length]; 133for (int i = 0; i < unsafeFolderNames.Length; i++)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (1)
512if (values.Length != 4)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
611if (realLocator != null && prefixes != null && prefixes.Length > 0)
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (1)
450if (values.Length != 2)
MS\Internal\Annotations\ObservableDictionary.cs (1)
193ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, target.Length);
MS\Internal\AppModel\IconHelper.cs (1)
241Marshal.Copy(colorArray, 0, bits, colorArray.Length);
MS\Internal\AppModel\OleCmdHelper.cs (1)
137Invariant.Assert(args.Length == 3);
MS\Internal\AppModel\ResourceContainer.cs (1)
282for (int i = 0; i < reqKeyToken.Length; i++)
MS\Internal\AppModel\ReturnEventSaver.cs (3)
63list = _returnList = new ReturnEventSaverInfo[delegates.Length]; 65for (int i = 0; i < delegates.Length; i++) 115for (int i = 0; i < list.Length; i++)
MS\Internal\Commands\CommandHelpers.cs (1)
112for (int i = 0; i < inputGestures.Length; i++)
MS\Internal\Controls\EnumUnknown.cs (1)
34this.size = (arr == null) ? 0 : arr.Length;
MS\Internal\Data\AccessorTable.cs (2)
71if (age >= _ages.Length) 156for (int i=0; i<_ages.Length; ++i)
MS\Internal\Data\ClrBindingWorker.cs (1)
108if (path.SVI.Length > 0)
MS\Internal\Data\DefaultValueConverter.cs (4)
492for (int i = 0; i < SupportedTypes.Length; ++i) 497for (; i < SupportedTypes.Length; ++i) 506for (; i < SupportedTypes.Length; ++i) 519for (int i = 0; i < CharSupportedTypes.Length; ++i)
MS\Internal\Data\IndexedEnumerable.cs (3)
323if (index < array.Length) 501for (int i = 0; i <= defaultMembers.Length - 1; i++) 507if (indexerParameters.Length == 1)
MS\Internal\Data\LiveShapingList.cs (3)
263Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos"); 264int n = _compInfos.Length; 480for (int k = 0; k < infos.Length; ++k)
MS\Internal\Data\PropertyPathWorker.cs (32)
55for (int i = _arySVS.Length - 1; i >= 0; --i) 184if (args != null && args.Length == 1 && 249bool indexerIsNext = (level + 1 < SVI.Length && SVI[level + 1].type == SourceValueType.Indexer); 276if (args != null && args.Length == 1 && 343int level = _arySVS.Length - 1; 415for (int k = 1; k < _arySVS.Length; ++k) 440for (int k = 0; k < _arySVS.Length; ++k) 490for (int k = 0; k < _arySVS.Length; ++k) 507UpdateSourceValueState(_arySVS.Length, null, BindingExpression.NullDataItem, isASubPropertyChange); 513for (k = 0; k < _arySVS.Length; ++k) 551result = (pi != null) && pi.GetIndexParameters().Length > 0; 621Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 626for (++k; k < _arySVS.Length; ++k) 661if (initialLevel < _arySVS.Length) 666_arySVS.Length > 0 && 667SVI[_arySVS.Length - 1].type != SourceValueType.Direct && 668!(_arySVS[_arySVS.Length - 1].info is DependencyProperty) && 669typeof(DependencyObject).IsAssignableFrom(_arySVS[_arySVS.Length - 1].type); 672if (!suppressTransfer && _arySVS.Length > 0 && 673_arySVS[_arySVS.Length - 1].info == FrameworkElement.DataContextProperty && 1184if (aryInfo.Length == 1 && 1195args = new object[aryInfo.Length]; 1203for (int ii = 0; info == null && ii < aryMembers.Length; ++ii) 1210for (int jj = 0; jj < defaultMembers.Length; ++jj) 1231info = SystemCoreHelper.GetIndexerAccessor(args.Length); 1281int len1 = (args != null) ? args.Length : 0; 1282int len2 = (svs.args != null) ? svs.args.Length : 0; 1361if (aryPI != null && aryPI.Length != aryInfo.Length) 1365for (int i = 0; i < args.Length; ++i) 1452if (isIList && aryPI.Length == 1 && aryPI[0].ParameterType == typeof(int)) 1520if (k >= _arySVS.Length)
MS\Internal\Data\RBTree.cs (1)
579if (arrayIndex + Count > array.Length)
MS\Internal\Data\SortFieldComparer.cs (3)
61for (int k = 0; k < _fields.Length; ++k) 94int nFields = sfc._fields.Length; 221if (++index < _values.Length)
MS\Internal\Data\StaticPropertyChangedEventManager.cs (1)
464for (int i = keys.Length - 1; i >= 0; --i)
MS\Internal\Data\ValueChangedEventManager.cs (3)
92if (handler.GetInvocationList().Length != 1) 104if (handler.GetInvocationList().Length != 1) 160for (int i = keys.Length - 1; i >= 0; --i)
MS\Internal\Data\ValueTable.cs (1)
289for (int i = localKeys.Length - 1; i >= 0; --i)
MS\Internal\Data\XDeferredAxisSource.cs (2)
80Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer"); 81PropertyInfo pi = (aryMembers.Length > 0) ? aryMembers[0] as PropertyInfo : null;
MS\Internal\Documents\ContentElementCollection.cs (4)
81if (array.Length - index < Size) 113if (array.Length - index < Size) 755return (Items.Length); 759if (value != Items.Length)
MS\Internal\Documents\MultiPageTextView.cs (1)
1114for (i = 0; i < textViewProximities.Length; i++)
MS\Internal\Documents\TableColumnCollectionInternal.cs (2)
43if (Size == Items.Length) 108if (Size == Items.Length)
MS\Internal\Documents\TableTextElementCollectionInternal.cs (1)
357if (Size == Items.Length)
MS\Internal\Documents\TextBoxLine.cs (2)
490int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 491Invariant.Assert(charactersCopied == textBuffer.Length);
MS\Internal\Documents\TextContainerHelper.cs (4)
57Invariant.Assert(other._ranges.Length >= (other._size * 2)); 59for (int i = 0; i < _ranges.Length; i++) 265if (_ranges.Length < (_size + 1) * 2) 267int[] ranges = new int[_ranges.Length * 2];
MS\Internal\Globalization\BamlTreeMap.cs (8)
406for (int i = 0; i < comment.LocalizationAttributes.Length; i++) 424for (int i = 0; i < comment.LocalizationComments.Length; i++) 583for (int i = 0; i < _comments.Length; i++) 618i < node.Children.Count && (comment.LocalizationComments.Length == 0 || comment.LocalizationAttributes.Length == 0); 627&& comment.LocalizationComments.Length == 0) 633&& comment.LocalizationAttributes.Length == 0) 644_commentsIndex = (_commentsIndex + 1) % _comments.Length;
MS\Internal\Globalization\BamlTreeUpdater.cs (2)
638for (int i = 0; i < tokens.Length; i++) 841if (contentPropertyAttributes.Length > 0)
MS\Internal\Globalization\LocalizationComments.cs (2)
69for (int i = 0; i < pairs.Length; i++) 369for (int i = 0; i < _enumNames.Length; i++)
MS\Internal\Helper.cs (4)
663Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 897for (int j = 0; j < dpIndices.Length; j++) 999for (int i = 0; i < dpIndices.Length; i++) 1054for (int j=0; j<dpIndices.Length; j++)
MS\Internal\Ink\LassoHelper.cs (2)
176int marginCount = (points.Length * percentIntersect) / 100; 178if ((0 == marginCount) || (50 <= ((points.Length * percentIntersect) % 100)))
MS\Internal\Ink\LassoSelectionBehavior.cs (2)
194if ( 0 != lassoPoints.Length ) 623if ( 0 != lassoPoints.Length )
MS\Internal\Interop\InternalDispatchObject.cs (1)
64_dispId2MethodMap = new Dictionary<int, MethodInfo>(methods.Length);
MS\Internal\IO\Packaging\ByteStream.cs (2)
282if (!((buffer.Length > 0) && ((buffer.Length - offset) >= count)))
MS\Internal\IO\Packaging\CorePropertiesFilter.cs (3)
270if (attributes != null && attributes.Length > 0) 343while (_currentIndex < _attributes.Length) 406if (_currentIndex < 0 || _currentIndex >= _attributes.Length)
MS\Internal\IO\Packaging\PackageFilter.cs (4)
542for (int keyNameIndex = 0; keyNameIndex < keyPath.Length; ++keyNameIndex) 618for (int i = 0; i < path.Length; ++i) 622Debug.Assert(stopGaps.Length > nextStopGapToUse); 630Debug.Assert(stopGaps.Length == nextStopGapToUse);
MS\Internal\IO\Packaging\XamlFilter.cs (2)
176if (aAttributes != null && aAttributes.Length > 0) 180for (int i = 0; i < aAttributes.Length; i++)
MS\Internal\IO\Packaging\XmlFixedPageInfo.cs (2)
63if (position < 0 || position >= GlyphRunList.Length) 89return GlyphRunList.Length;
MS\Internal\Printing\PrintDlgExMarshaler.cs (9)
377Marshal.Copy(pDevMode, devModeData, 0, devModeData.Length); 725int cbDevNames = checked(((printer.Length + 3) * Marshal.SystemDefaultCharSize) + 740devNames.wDriverOffset = checked((ushort)(devNames.wDeviceOffset + printer.Length + 1)); 753checked((IntPtr)((long)offsetName + (printer.Length * Marshal.SystemDefaultCharSize))); 764Array.Clear(nulls, 0, nulls.Length); 769printer.Length); 774nulls.Length); 818IntPtr hDevMode = Marshal.AllocHGlobal(devModeData.Length); 819Marshal.Copy(devModeData, 0, hDevMode, devModeData.Length);
MS\Internal\PtsHost\CellParaClient.cs (4)
85&& (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length); 365&& (Cell.ColumnIndex + Cell.ColumnSpan) <= calculatedColumns.Length); 461_columnWidths = new double[tpc.CalculatedColumns.Length]; 463for(int index = 0; index < tpc.CalculatedColumns.Length; index++)
MS\Internal\PtsHost\ContainerParaClient.cs (3)
293for (int i = 0; i < arrayParaDesc.Length; i++) 345List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 346for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\DtrList.cs (6)
130if (_count == _dtrs.Length) { Resize(); } 140if (_count == _dtrs.Length) { Resize(); } 304if (_count == _dtrs.Length) { Resize(); } 315Debug.Assert(_dtrs.Length > 0); 318DirtyTextRange [] newdtrs = new DirtyTextRange[_dtrs.Length * 2]; 319Array.Copy(_dtrs, newdtrs, _dtrs.Length);
MS\Internal\PtsHost\FigureParaClient.cs (16)
124for (int index = 0; index < arrayColumnDesc.Length; index++) 173emptySubpage = (arrayColumnDesc.Length == 0); 176for (int index = 0; index < arrayColumnDesc.Length; index++) 264for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 323for (int index = 0; index < arrayColumnDesc.Length; index++) 423emptySubpage = (arrayColumnDesc.Length == 0); 453for (int index = 0; index < arrayColumnDesc.Length; index++) 458ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 460for (int index = 0; index < arrayColumnDesc.Length; index++) 523Invariant.Assert(arrayColumnDesc.Length == 1); 526for (int index = 0; index < arrayColumnDesc.Length; index++) 587paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 588for (int i = 0; i < arrayParaDesc.Length; i++) 612Debug.Assert(arrayColumnDesc.Length == 1); 627paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 628for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\FloaterParaClient.cs (15)
108for (int index = 0; index < arrayColumnDesc.Length; index++) 157emptySubpage = (arrayColumnDesc.Length == 0); 160for (int index = 0; index < arrayColumnDesc.Length; index++) 268for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 327for (int index = 0; index < arrayColumnDesc.Length; index++) 429emptySubpage = (arrayColumnDesc.Length == 0); 459for (int index = 0; index < arrayColumnDesc.Length; index++) 464ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 466for (int index = 0; index < arrayColumnDesc.Length; index++) 531for (int index = 0; index < arrayColumnDesc.Length; index++) 595paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 596for (int i = 0; i < arrayParaDesc.Length; i++) 620Debug.Assert(arrayColumnDesc.Length == 1); 635paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 636for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\FlowDocumentPage.cs (4)
495for (int i = 0; i < arrayColumnDesc.Length; i++) 554for (int i = 0; i < arrayParaDesc.Length; i++) 589List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 590for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\LineBase.cs (2)
127int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 187run = new TextCharacters(textBuffer, 0, textBuffer.Length, textProps);
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (2)
253for (int i = 0; i < RomanNumericSizeIncrements.Length; i++) 265if (i < RomanNumericSizeIncrements.Length - 1)
MS\Internal\PtsHost\PtsContext.cs (9)
121for (index = 0; index < _unmanagedHandles.Length; ++index) 138for (int i = 0; i < _unmanagedHandles.Length; ++i) 214Invariant.Assert(handleLong > 0 && handleLong < _unmanagedHandles.Length, "Invalid object handle."); 232if (handleLong < 0 || handleLong >= _unmanagedHandles.Length) 251Invariant.Assert(handleLong > 0 && handleLong < _unmanagedHandles.Length, "Invalid object handle."); 434while (freeIndex < _unmanagedHandles.Length) 448int freeIndex = _unmanagedHandles.Length; 451HandleIndex[] newItems = new HandleIndex[_unmanagedHandles.Length * 2]; 452Array.Copy(_unmanagedHandles, newItems, _unmanagedHandles.Length);
MS\Internal\PtsHost\PtsHelper.cs (9)
161for (int index = 0; index < arrayParaDesc.Length; index++) 258for (int index = 0; index < arrayParaDesc.Length; index++) 302if (arrayParaDesc.Length < visualCollection.Count) 304visualCollection.RemoveRange(arrayParaDesc.Length, visualCollection.Count - arrayParaDesc.Length); 349for (int index = 0; index < arrayParaDesc.Length; index++) 414for (int index = 0; index < arrayParaDesc.Length && ie == null; index++) 493for (int index = 0; index < arrayParaDesc.Length; index++) 749for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\PtsPage.cs (14)
543for (int index = 0; index < arraySectionDesc.Length; index++) 588for (int index = 0; index < arraySectionDesc.Length; index++) 938for (int index = 0; index < arrayColumnDesc.Length; index++) 986for (int index = 0; index < arrayColumnDesc.Length; index++) 1074emptyPage = (arraySectionDesc.Length == 0); 1077ErrorHandler.Assert(arraySectionDesc.Length == 1, ErrorHandler.NotSupportedMultiSection); 1148emptySection = (arrayColumnDesc.Length == 0); 1159for (int index = 0; index < arrayColumnDesc.Length; index++) 1164ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 1165for (int index = 0; index < arrayColumnDesc.Length; index++) 1239for (int index = 0; index < arraySectionDesc.Length && ie == null; index++) 1293for (int index = 0; index < arraySectionDesc.Length; index++) 1352for (int index = 0; index < arrayColumnDesc.Length; index++) 1414for (int index = 0; index < arrayColumnDesc.Length; index++)
MS\Internal\PtsHost\RowParagraph.cs (9)
51for(int index = 0; index < _cellParagraphs.Length; index++) 251Invariant.Assert(cCells == i + _spannedCells.Length); // Protect against buffer overflow 254if (_spannedCells.Length > 0) 258for (int j = 0; j < _spannedCells.Length; ++j) 314_spannedCells = new CellParagraph[Row.SpannedCells.Length]; 321for(int index = 0; index < _spannedCells.Length; index++) 335(isLastRowOfRowGroup && _spannedCells.Length > 0)) 393for(int index = 0; index < _cellParagraphs.Length; index++) 403for(int index = 0; index < previousRow._spannedCells.Length; index++)
MS\Internal\PtsHost\SectionVisual.cs (7)
48if (arrayColumnDesc.Length > 1) 53rulePositions = new Point[(arrayColumnDesc.Length - 1)*2]; 54for (int index = 1; index < arrayColumnDesc.Length; index++) 71int prevSize = _rulePositions == null ? 0 : _rulePositions.Length; 72int newSize = rulePositions == null ? 0 : rulePositions.Length; 75for (int index = 0; index < rulePositions.Length; index++) 115for (int index = 0; index < rulePositions.Length; index += 2)
MS\Internal\PtsHost\SubpageParaClient.cs (14)
137for (int index = 0; index < arrayColumnDesc.Length; index++) 200for (int index = 0; index < arrayColumnDesc.Length && ie == null; index++) 258for (int index = 0; index < arrayColumnDesc.Length; index++) 356emptySubpage = (arrayColumnDesc.Length == 0); 386for (int index = 0; index < arrayColumnDesc.Length; index++) 391ErrorHandler.Assert(visualChildren.Count == arrayColumnDesc.Length, ErrorHandler.ColumnVisualCountMismatch); 392for (int index = 0; index < arrayColumnDesc.Length; index++) 451emptySubpage = (arrayColumnDesc.Length == 0); 454for (int index = 0; index < arrayColumnDesc.Length; index++) 505for (int index = 0; index < arrayColumnDesc.Length; index++) 585for (int i = 0; i < arrayColumnDesc.Length; i++) 624List<ParagraphResult> paragraphResults = new List<ParagraphResult>(arrayParaDesc.Length); 625for (int i = 0; i < arrayParaDesc.Length; i++) 660for (int i = 0; i < arrayParaDesc.Length; i++)
MS\Internal\PtsHost\TableParaClient.cs (48)
107for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 131for (int iC = 0; iC < arrayFsCell.Length; ++iC) 242for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 290CalculatedColumns.Length, 311if (rowVisualsCollection.Count > arrayTableRowDesc.Length) 314arrayTableRowDesc.Length, 315rowVisualsCollection.Count - arrayTableRowDesc.Length); 333for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 345for (int iC = 0; iC < arrayFsCell.Length; ++iC) 379for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 393for (int iC = 0; iC < arrayFsCell.Length; ++iC) 457for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 467for (int iC = 0; iC < arrayFsCell.Length; ++iC) 529for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 558for (int iC = 0; iC < arrayFsCell.Length; ++iC) 622for (int iR = 0; iR < arrayTableRowDesc.Length && cpcFound == null; ++iR) 634for (int iC = 0; iC < arrayFsCell.Length && cpcFound == null; ++iC) 704for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 755for (int iC = 0; iC < arrayFsCell.Length; ++iC) 839for (int iR = 0; iR < arrayTableRowDesc.Length && !passedEndPosition; ++iR) 851for (int iC = 0; iC < arrayFsCell.Length; ++iC) 906for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 918for (int iC = 0; iC < arrayFsCell.Length; ++iC) 963for (int iR = arrayTableRowDesc.Length - 1; iR >= 0; --iR) 978for (int iC = arrayFsCell.Length - 1; iC >= 0; --iC) 1042for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1057for (int iC = arrayFsCell.Length - 1; iC >= 0; --iC) 1137for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1281for (int i = 0; i < cols.Length; i++) 1353row = ((RowParagraph)(PtsContext.HandleToObject(arrayTableRowDesc[arrayTableRowDesc.Length - 1].fsnmRow))).Row; 1357arrayTableRowDesc[arrayTableRowDesc.Length - 1].pfstablerow, 1551for (int iC = 0; iC < arrayFsCell.Length; ++iC) 1670for (int iC = 0; iC < arrayFsCell.Length; ++iC) 1695for (int columnIndex = 0; columnIndex < arrayCellParaClients.Length; ++columnIndex) 1765for (int iC = CalculatedColumns.Length-1; iC >= 0; iC--) 1784for (int iC = 0; iC < CalculatedColumns.Length; iC++) 1815if(IsLastChunk && rowIndex == arrayTableRowDesc.Length - 1) 1840if(arrayTableRowDesc.Length > 0) 1845for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1895for (int iR = 0; iR < arrayTableRowDesc.Length; ++iR) 1927else if (_calculatedColumns.Length != columns) 1934Math.Min(_calculatedColumns.Length, columns)); 1939if (_calculatedColumns.Length > 0) 1943while (i < _calculatedColumns.Length && i < Table.Columns.Count) 1949while (i < _calculatedColumns.Length) 1958for (int i = 0; i < _calculatedColumns.Length; ++i) 2045for (int i = 0; i < _calculatedColumns.Length; ++i) 2331for (int i = 0; i < _calculatedColumns.Length; ++i)
MS\Internal\PtsHost\TableParagraph.cs (2)
518for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++) 536for(int iCell = 0; iCell < rowParagraph.Cells.Length; iCell++)
MS\Internal\PtsHost\TextParaClient.cs (87)
179for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 274for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 403floaters = new List<ParagraphResult>(arrayAttachedObjectDesc.Length); 406for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 440figures = new List<ParagraphResult>(arrayAttachedObjectDesc.Length); 443for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 547for (index = 0; index < arrayLineDesc.Length; index++) 571for (index = 0; index < arrayLineDesc.Length; index++) 581for (elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 596if (elIndex < arrayLineElement.Length) 1006for (index = 0; index < arrayLineDesc.Length; index++) 1031for (index = 0; index < arrayLineDesc.Length; index++) 1041for (elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1058if (elIndex < arrayLineElement.Length) 1263for (int index = 0; index < arrayLineDesc.Length; index++) 1289for (int index = 0; index < arrayLineDesc.Length; index++) 1297for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1327for (int index = 0; index < arrayAttachedObjectDesc.Length; index++) 1532List<LineResult> lines = new List<LineResult>(arrayLineDesc.Length); 1535for (int index = 0; index < arrayLineDesc.Length; index++) 1584List<LineResult> lines = new List<LineResult>(arrayLineDesc.Length); 1587for (int index = 0; index < arrayLineDesc.Length; index++) 1596for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1654for (int index = 0; index < arrayLineDesc.Length; index++) 1663|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 1742for (int index = 0; index < arrayLineDesc.Length; index++) 1751for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 1760|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 1837int lineCount = arrayLineDesc.Length; 1875|| ( (lineIndex == arrayLineDesc.Length - 1) 1886if ( (handleEndOfPara && lineIndex == (arrayLineDesc.Length - 1)) 1943for (int lineIndex = 0; lineIndex < arrayLineDesc.Length; ++lineIndex) 1955for (int elemIndex = 0; elemIndex < arrayLineElement.Length; ++elemIndex) 1986&& (elemIndex == arrayLineElement.Length - 1) 1987&& (lineIndex == arrayLineDesc.Length - 1) ) ) 1996if ( (handleEndOfPara && lineIndex == (arrayLineDesc.Length - 1)) 2340for (int index = 0; index < arrayAttachedObjectDesc.Length; ++index) 2386for (int index = 0; index < arrayLineDesc.Length; index++) 2393|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2396if (dcp >= lineDesc.dcpLim - 1 && index == arrayLineDesc.Length - 1) 2478for (int index = 0; index < arrayLineDesc.Length; index++) 2490for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 2497|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 2500if (dcp >= element.dcpLim - 1 && elIndex == arrayLineElement.Length - 1 && index == arrayLineDesc.Length - 1) 2540element = arrayLineElement[arrayLineElement.Length - 1]; 2605for (int index = 0; index < arrayLineDesc.Length; index++) 2612|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2632if (index == arrayLineDesc.Length - 1) 2671if (index == arrayLineDesc.Length - 1) 2730for (int index = 0; index < arrayLineDesc.Length; index++) 2739for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 2746|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 2783element = arrayLineElement[arrayLineElement.Length - 1]; 2793Debug.Assert(elIndex == arrayLineElement.Length - 1); 2794Debug.Assert(index == arrayLineDesc.Length - 1); 2797else if (dcp == element.dcpLim - 1 && elIndex == arrayLineElement.Length - 1 && index == arrayLineDesc.Length - 1) 2834if (index == arrayLineDesc.Length - 1) 2895for (int index = 0; index < arrayLineDesc.Length; index++) 2902|| ((lineDesc.dcpLim == dcp) && (index == arrayLineDesc.Length - 1))) 2987for (int index = 0; index < arrayLineDesc.Length; index++) 2996for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3003|| ((element.dcpLim == dcp) && (elIndex == arrayLineElement.Length - 1) && (index == arrayLineDesc.Length - 1))) 3040element = arrayLineElement[arrayLineElement.Length - 1]; 3111for (int index = 0; index < arrayLineDesc.Length; index++) 3164for (int index = 0; index < arrayLineDesc.Length; index++) 3173for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3234for (int index = 0; index < arrayLineDesc.Length; index++) 3306for (int index = textDetails.cLinesBeforeChange + textDetails.cLinesChanged; index < arrayLineDesc.Length; index++) 3409for (lineIndex = 0; lineIndex < arrayLineDesc.Length; lineIndex++) 3424for (lineIndex = lineIndexFirstVisible; lineIndex < arrayLineDesc.Length; lineIndex++) 3605for (int index = 0; index < arrayLineDesc.Length; index++) 3628for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3697for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 3725for (int index = textDetails.cLinesBeforeChange + textDetails.cLinesChanged; index < arrayLineDesc.Length; index++) 3758for (index = 0; index < arrayAttachedObjectDesc.Length; index++) 3799for (int index = 0; index < arrayLineDesc.Length; index++) 3887for (int index = 0; index < arrayLineDesc.Length; index++) 3979for (int index = 0; index < arrayLineDesc.Length; index++) 3992for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++) 4064for (int index = 0; index < arrayLineDesc.Length; index++) 4111for (int elIndex = 0; elIndex < arrayLineElement.Length; elIndex++)
MS\Internal\PtsHost\TextParagraph.cs (1)
1433for(int index = 0; arrayAttachedObjectDesc != null && index < arrayAttachedObjectDesc.Length; index++)
MS\Internal\PtsTable\RowSpanVector.cs (5)
99if (_size == _entries.Length) 249Debug.Assert( _entries.Length > 0 250&& _size <= _entries.Length ); 252Entry[] newEntries = new Entry[_entries.Length * 2]; 253Array.Copy(_entries, newEntries, _entries.Length);
MS\Internal\Text\ComplexLine.cs (2)
373int charactersCopied = position.GetTextInRun(LogicalDirection.Forward, textBuffer, 0, textBuffer.Length); 406run = new TextCharacters(textBuffer, 0, textBuffer.Length, textProps);
MS\Internal\TraceData.cs (1)
98for( int i = start; i < parameters.Length; i++ )
MS\Internal\UncommonValueTable.cs (2)
48int n = _table.Length; 71int n = _table.Length - 1;
MS\Internal\WeakDictionary.cs (1)
304ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - count);
MS\Internal\WeakHashSet.cs (1)
51ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length - count);
MS\Internal\WindowsRuntime\Generated\WinRT\IInspectable.cs (1)
59iidCount = (uint)iids.Length;
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (18)
150var length = array.Length; 171return (m._marshalers?.Length ?? 0, m._array); 217var length = array.Length; 239DisposeAbiArrayElements((array.Length, data)); 244var length = array.Length; 295return (((Array)m._gchandle.Target).Length, m._gchandle.AddrOfPinnedObject()); 315var length = array.Length; 328var length = array.Length; 468int length = array.Length; 492return (m._marshalers?.Length ?? 0, m._array); 548int length = array.Length; 573DisposeAbiArrayElements((array.Length, data)); 578int length = array.Length; 650int length = array.Length; 672return (m._marshalers?.Length ?? 0, m._array); 708int length = array.Length; 731DisposeAbiArrayElements((array.Length, data)); 736int length = array.Length;
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (2)
160var newArguments = new Type[genericArguments.Length]; 161for (int i = 0; i < genericArguments.Length; i++)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IEnumerable.cs (2)
396while (index < items.Length && HasCurrent) 408for (int i = index; i < items.Length; ++i)
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (2)
190uint itemCount = Math.Min((uint)items.Length, (uint)_list.Count - startIndex); 202for (uint i = itemCount; i < items.Length; ++i)
src\Microsoft.DotNet.Wpf\src\Common\src\System\AppContextDefaultValues.cs (4)
121if (components.Length < 2 || components.Length > 3) 142for (int i = 1; i < components.Length; i++) 147if (keyValuePair.Length != 2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (3)
266if (reqKeyToken.Length == curKeyToken.Length) 270for (int i = 0; i < reqKeyToken.Length; i++)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\ItemMap.cs (2)
42if ((Count + 1) > Entries.Length) 44destEntries = new Entry[Entries.Length * 2];
System\Windows\Annotations\Annotation.cs (2)
638if (typeName.Length == 1) 648else if (typeName.Length == 2)
System\Windows\Annotations\AnnotationService.cs (2)
1043for (int i = 0; i < adorners.Length; i++) 1336List<AttachedAnnotationChangedEventArgs> eventsToFire = new List<AttachedAnnotationChangedEventArgs>(list.Length);
System\Windows\Application.cs (2)
2363int l = bamlConvertUriSegments.Length; 2364int m = curUriSegments.Length;
System\Windows\BroadcastEventHelper.cs (4)
51Debug.Assert(loadedPending.Length == 3); 99Debug.Assert(unloadedPending.Length == 3); 172Debug.Assert(loadedPending != null && loadedPending.Length == 3, 209Debug.Assert(unloadedPending != null && unloadedPending.Length == 3,
System\Windows\Controls\BorderGapMaskConverter.cs (1)
41values.Length != 3 ||
System\Windows\Controls\ColumnDefinition.cs (5)
97if (array.Length - index < _size) 119if (array.Length - index < _size) 644else if (_size == _items.Length) 646PrivateSetCapacity(Math.Max(_items.Length * 2, c_defaultCapacity)); 714else if (_items == null || value != _items.Length)
System\Windows\Controls\DataGridCell.cs (1)
435for (int i = 0; i < bindingExpressionsCopy.Length; i++)
System\Windows\Controls\DataGridClipboardHelper.cs (1)
86int bytecountEndOfFragment = bytecountPrefixContext + destinationBytes.Length;
System\Windows\Controls\DataGridHelper.cs (2)
540for (int i = 0; i < bindingExpressionsCopy.Length; i++) 656for (int i = 0; i < bindingExpressionsCopy.Length; i++)
System\Windows\Controls\DataGridLengthConverter.cs (2)
219int numUnitStrings = _unitStrings.Length; 237numUnitStrings = _nonStandardUnitStrings.Length;
System\Windows\Controls\DateTimeHelper.cs (2)
257if (monthNames != null && monthNames.Length > 0) 259result = monthNames[(date.Value.Month - 1) % monthNames.Length];
System\Windows\Controls\DocumentViewer.cs (3)
1207(_zoomLevelIndex < DocumentViewer._zoomLevelCollection.Length - 1)) 2294if ((_zoomLevelIndex < 0) || (_zoomLevelIndex >= _zoomLevelCollection.Length)) 2316for (loopIndex = 0; loopIndex < _zoomLevelCollection.Length - 1; loopIndex++)
System\Windows\Controls\Grid.cs (66)
396Array.Clear(_definitionIndices, 0, _definitionIndices.Length); 404Array.Clear(_roundingErrors, 0, _roundingErrors.Length); 424Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 593bool canResolveStarsU = extData.CellGroup2 > PrivateCells.Length; 683Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 694for (int currentCell = 0; currentCell < PrivateCells.Length; ++currentCell) 782value = definitions[(columnIndex + 1) % definitions.Length].FinalOffset; 804value = definitions[(rowIndex + 1) % definitions.Length].FinalOffset; 900for (int i = PrivateCells.Length - 1; i >= 0; --i) 917cell.ColumnIndex = Math.Min(GetColumn(child), DefinitionsU.Length - 1); 920cell.RowIndex = Math.Min(GetRow(child), DefinitionsV.Length - 1); 925cell.ColumnSpan = Math.Min(GetColumnSpan(child), DefinitionsU.Length - cell.ColumnIndex); 929cell.RowSpan = Math.Min(GetRowSpan(child), DefinitionsV.Length - cell.RowIndex); 931Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length); 932Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length); 1030Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0); 1077Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0); 1092for (int i = 0; i < definitions.Length; ++i) 1136double[] minSizes = isRows ? new double[DefinitionsV.Length] : new double[DefinitionsU.Length]; 1138for (int j=0; j<minSizes.Length; j++) 1156} while (i < PrivateCells.Length); 1163for (int i=0; i<minSizes.Length; i++) 1208if (cellsHead >= PrivateCells.Length) 1261} while (i < PrivateCells.Length); 1390Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1417Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1445Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length); 1647for (int i = 0; i < definitions.Length; ++i) 1743int defCount = definitions.Length; 2041for (int i = 0; i < definitions.Length; ++i) 2077int nonStarIndex = definitions.Length; // traverses from the last entry down 2093for (int i = 0; i < definitions.Length; ++i) 2221Array.Sort(definitionIndices, 0, definitions.Length, new DistributionOrderIndexComparer(definitions)); 2224for (int i = 0; i < definitions.Length; ++i) 2227double final = definitions[definitionIndex].SizeCache + (sizeToDistribute / (definitions.Length - i)); 2252for (int i = 0; i < definitions.Length; ++i) 2259Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2265int i = definitions.Length - 1; 2282while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length) 2299for (int i = 0; i < definitions.Length; ++i) 2301definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache; 2322int defCount = definitions.Length; 2668for (int i = 0; i < definitions.Length; ++i) 2722for (int i = 0; i < definitions.Length; ++i) 2728Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2734int i = definitions.Length - 1; 2751while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length) 2769for (int i = 0; i < definitions.Length; ++i) 2771definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache; 2878Array.Clear(extData.TempDefinitions, 0, Math.Max(DefinitionsU.Length, DefinitionsV.Length)); 3083int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length) * 2; 3086|| extData.TempDefinitions.Length < requiredLength ) 3098|| extData.TempDefinitions.Length < requiredLength ) 3116int requiredLength = Math.Max(Math.Max(DefinitionsU.Length, DefinitionsV.Length), 1) * 2; 3118if (_definitionIndices == null || _definitionIndices.Length < requiredLength) 3134int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length); 3140else if (_roundingErrors == null || _roundingErrors.Length < requiredLength) 4008for (int i = 1; i < grid.DefinitionsU.Length; ++i) 4016for (int i = 1; i < grid.DefinitionsV.Length; ++i)
System\Windows\Controls\GridViewHeaderRowPresenter.cs (3)
1381for (int i = 0, n = s_DPList[0].Length; i < n; i++) 1704for (int i = 0; i < s_DPList.Length; i++) 1706for (int j = 0; j < s_DPList[i].Length; j++)
System\Windows\Controls\MenuScrollingVisibilityConverter.cs (1)
50values.Length != 4 ||
System\Windows\Controls\Panel.cs (1)
1042if (_zLut == null || _zLut.Length != count)
System\Windows\Controls\PopupControlService.cs (3)
1548for (int i=0, N=_points.Length; i<N; ++i) 1658for (int i = 0, N = _points.Length; i < N; ++i) 1678for (int i = 0, N = _points.Length; i < N; ++i)
System\Windows\Controls\Primitives\CalendarItem.cs (3)
1027if (daytitle != null && shortestDayNames != null && shortestDayNames.Length > 0) 1031daytitle.DataContext = shortestDayNames[(childIndex + (int)this.Owner.FirstDayOfWeek) % shortestDayNames.Length]; 1035daytitle.DataContext = shortestDayNames[(childIndex + (int)DateTimeHelper.GetDateFormat( DateTimeHelper.GetCulture(this)).FirstDayOfWeek) % shortestDayNames.Length];
System\Windows\Controls\Primitives\Popup.cs (3)
2036positions = customPlacements == null ? 0 : customPlacements.Length; 2455for (int i = 1; i < interestPoints.Length; i++) 2780if (UnsafeNativeMethods.GetBitmapBits(iconInfo.hbmMask.MakeHandleRef(null), curMask.Length, curMask) != 0)
System\Windows\Controls\Primitives\TabPanel.cs (4)
270bool lastHeaderInRow = isMultiRow && (separatorIndex < solution.Length && solution[separatorIndex] == childIndex || childIndex == _numHeaders - 1); 326if (solution.Length > 0) 340if (activeRow < solution.Length && solution[activeRow] == childIndex) 393int numHeaders = headerWidth.Length;
System\Windows\Controls\RichTextBox.cs (4)
639for (int i = 0; i < inheritableFormattingProperties.Length; i++) 647for (int i = 0; i < inheritableBehavioralProperties.Length; i++) 666for (int i = 0; i < inheritableFormattingProperties.Length; i++) 680for (int i = 0; i < inheritableBehavioralProperties.Length; i++)
System\Windows\Controls\RowDefinition.cs (5)
97if (array.Length - index < _size) 119if (array.Length - index < _size) 644else if (_size == _items.Length) 646PrivateSetCapacity(Math.Max(_items.Length * 2, c_defaultCapacity)); 714else if (_items == null || value != _items.Length)
System\Windows\Controls\SinglePageViewer.cs (3)
845for (index = 0; index < pageRects.Length; index++) 853if (index >= pageRects.Length) 857for (index = 1; index < pageRects.Length; index++)
System\Windows\Controls\TextBlock.cs (1)
326for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Controls\TextBox.cs (1)
68for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Controls\TextRangeAdaptor.cs (2)
1819double[] asDoubles = new double[rects.Length * 4]; 1820for (int i = 0; i < rects.Length; i++)
System\Windows\Controls\VirtualizingStackPanel.cs (3)
12031if (a.Length > 1) 12040if (a.Length > 2) 12280int length = (args != null) ? args.Length : 0;
System\Windows\Controls\WebBrowser.cs (2)
309dp.cArgs = (uint)((args == null) ? 0 : args.Length); 340UnsafeNativeMethods.ArrayToVARIANTHelper.FreeVARIANTVector(dp.rgvarg, args.Length);
System\Windows\Data\BindingExpressionBase.cs (6)
460int n = (_sources != null) ? _sources.Length : 0; 2468for (int i=0; i < commonSources.Length; ++i) 2480int m = (sources == null) ? 0 : sources.Length; 2896sources = new DependencySource[newSources.Length]; 2898for (int i = 0; i < newSources.Length; ++i) 2909if (n < newSources.Length)
System\Windows\Data\BindingGroup.cs (3)
1178for (int i=_proposedValueBindingExpressions.Length-1; i>=0; --i) 1211for (int i=_proposedValueBindingExpressions.Length-1; i>=0; --i) 1468for (int i=0, n=_proposedValueBindingExpressions.Length; i<n; ++i)
System\Windows\Data\CollectionView.cs (4)
1403object[] newArray = new object[array.Length + 1]; 1405newArray[array.Length] = value; 1522for (int i=0; i<interfaces.Length; ++i) 1530if (typeParameters.Length == 1)
System\Windows\Data\MultiBindingExpression.cs (18)
550for (int i=0; i<values.Length; ++i) 563if (values.Length != count && TraceData.IsEnabled) 566traceParameters: new object[] { Converter.GetType().Name, count, values.Length, TraceData.DescribeTarget(target, TargetProperty) }); 570if (values.Length < count) 571count = values.Length; 612Array.Clear(_tempTypes, 0, _tempTypes.Length); 667for (int i=0; i<values.Length; ++i) 699if (values.Length < count) 700count = values.Length; 764if (values.Length < count) 765count = values.Length; 808if (values.Length < count) 809count = values.Length; 900if (convertedValues.Length < count) 901count = convertedValues.Length; 1057for (int j = 0; j < sources.Length; ++j) 1206for (int i=0; i<_tempValues.Length; ++i) 1271Array.Clear(_tempValues, 0, _tempValues.Length);
System\Windows\Data\ObjectDataProvider.cs (1)
399if (ciAry.Length != 0)
System\Windows\Data\PriorityBindingExpression.cs (1)
594for (int j=0; j<sources.Length; ++j)
System\Windows\Data\XmlNamespaceMappingCollection.cs (1)
139int maxLength = array.Length;
System\Windows\DataTrigger.cs (1)
190Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\Documents\AdornerLayer.cs (3)
421for (int i = 0; i < zOrderMapEntries.Length; i++) 455for (int i = 0; i < zOrderMapEntries.Length; i++) 796for (int i = 0; i < keys.Length; i++)
System\windows\Documents\CaretElement.cs (1)
562for (int i = 0; i < adorners.Length; i++)
System\Windows\Documents\DocumentSequenceTextPointer.cs (4)
670if (startIndex > textBuffer.Length) 672throw new ArgumentException(SR.Format(SR.StartIndexExceedsBufferSize, startIndex, textBuffer.Length)); 678if (count > textBuffer.Length - startIndex) 680throw new ArgumentException(SR.Format(SR.MaxLengthExceedsBufferSize, count, textBuffer.Length, startIndex));
System\Windows\Documents\FixedLineResult.cs (1)
110return _nodes[_nodes.Length - 1];
System\Windows\Documents\FixedNode.cs (8)
98int[] completePath = new int[childPath.Length + 1]; 135Debug.Assert(path != null && path.Length >= 2); // At least a page index and an element index 200for (int i = 0; i < childPath.Length && i < _path.Length - 1; i++) 290for (int i = 1; i < _path.Length; i++) 342Debug.Assert(level < _path.Length); 353Debug.Assert(_path.Length >= 2); 354return _path.Length - 1;
System\Windows\Documents\FixedPage.cs (1)
167if (adorners != null && adorners.Length > 0)
System\Windows\Documents\FixedPageStructure.cs (9)
121while (line < _lineResults.Length - 1 && count > 0) 138line = Math.Max(0, Math.Min(line, _lineResults.Length - 1)); 230for (int line = 0; line < _lineResults.Length; line++) 255int lineCount = _lineResults.Length; 559ft = new FormattedText($"{fn}-{(int)(fn.Cookie)}-{somElements.Length}", 649for (int i=0; i<_lineResults.Length; i++) 697if (_lineResults.Length > 0) 699return _lineResults[_lineResults.Length - 1].Nodes; 709if (_lineResults.Length > 0)
System\Windows\Documents\FixedSchema.cs (1)
94predefinedNamespaces = new string[_predefinedNamespaces.Length + 1];
System\Windows\Documents\FixedTextBuilder.cs (9)
419int loIndex = 0, hiIndex = fixes.Length - 1; 487if (flowNodes.Length <= 0) 494FlowNode flowEnd = flowNodes[flowNodes.Length - 1]; 513Debug.Assert(fixes.Length == 1); 556if (somElements.Length == 0) 808int[] newPath = new int[pathPrefix.Length + 1]; 810newPath[newPath.Length - 1] = childIndex; 1015newPathPrefix = new int[pathPrefix.Length + 1]; 1020newPathPrefix[newPathPrefix.Length - 1] = childIndex;
System\Windows\Documents\FixedTextContainer.cs (2)
425for(int i=0; i<elements.Length; i++) 468if (i == elements.Length - 1)
System\Windows\Documents\FixedTextView.cs (4)
609FixedNode lastNode = fixedNodes[fixedNodes.Length - 1]; 827if (fixedNodes != null && fixedNodes.Length > 0) 898if (fixedNodes != null && fixedNodes.Length > 0) 916for (int i = fixedNodes.Length - 1; i >= 0; i--)
System\Windows\Documents\FlowDocument.cs (1)
85for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Documents\FlowNode.cs (1)
171if (this.FixedSOMElements != null && this.FixedSOMElements.Length > 0)
System\Windows\Documents\FlowPosition.cs (1)
258if (elements != null && elements.Length > 0)
System\Windows\Documents\Glyphs.cs (9)
237if (glyphRunProperties.clusterMap != null && glyphRunProperties.clusterMap.Length != 0) 238caretStopCount = glyphRunProperties.clusterMap.Length + 1; 242caretStopCount = glyphRunProperties.glyphIndices.Length + 1; 269if (i >= caretStops.Length) 276if (i >= caretStops.Length) 283if (i >= caretStops.Length) 290if (i >= caretStops.Length) 299while (i < caretStops.Length) 474if (index < 0 || index >= clusterMap.Length)
System\Windows\Documents\ImmComposition.cs (9)
935int compositionLength = compositionChars == null ? 0 : compositionChars.Length; 936resultLength = resultChars == null ? 0 : resultChars.Length; 956int originalLength = (compositionText == null) ? 0 : compositionText.Length; 969(caretOffset < attributes.Length) && 973((caretOffset - 1) < attributes.Length) && 1179for (int i = 0; i < attributes.Length; i++) 1181if ((i + 1) < attributes.Length) 1423int copied = navigator.GetTextInRun(LogicalDirection.Backward, buffer, 0, buffer.Length); 1475int copied = navigator.GetTextInRun(LogicalDirection.Forward, buffer, 0, buffer.Length);
System\Windows\Documents\NaturalLanguageHyphenator.cs (3)
113&& characterSource.Length > 0 115&& length <= characterSource.Length 137isHyphenPositions.Length
System\Windows\Documents\RangeContentEnumerator.cs (2)
306else if (_buffer.Length < size) 308newBuffer = new char[Math.Max(2*_buffer.Length, size)];
System\Windows\Documents\RtfToXamlLexer.cs (12)
66if (_rtfIndex >= _rtfBytes.Length) 99if (_rtfIndex >= _rtfBytes.Length) 226if (_rtfIndex + skip < _rtfBytes.Length) 232_rtfIndex = _rtfBytes.Length - 1; 353while (e < _rtfBytes.Length) 358&& e + 3 < _rtfBytes.Length 435while (_rtfIndex < _rtfBytes.Length && IsControlCharValid(CurByte)) 453if (_rtfIndex < _rtfBytes.Length) 473while (_rtfIndex < _rtfBytes.Length && IsParameterFollow(CurByte)) 482if (_rtfIndex < _rtfBytes.Length && CurByte == ' ') 561_rtfControlTable = new Hashtable(controlWordInfoTable.Length); 563for (int i = 0; i < controlWordInfoTable.Length; i++)
System\Windows\Documents\RtfToXamlReader.cs (1)
3389for (int i = 0; i < CodePageList.Length; i++)
System\Windows\Documents\RubberbandSelector.cs (1)
278while (nodesInLine != null && nodesInLine.Length > 0)
System\windows\Documents\SelectionWordBreaker.cs (7)
55if (position == text.Length) 70if (position == text.Length || IsWhiteSpace(text[position], classes[position])) 146Invariant.Assert(text.Length == classes.Length); 148(index > 0 && index + 1 < classes.Length) && 204CharClass[] classes = new CharClass[text.Length]; 206for (int i = 0; i < text.Length; i++)
System\Windows\Documents\Speller.cs (1)
1718runCount = Math.Min(runCount, _text.Length - _textLength);
System\Windows\Documents\TableRow.cs (1)
258_formatCellCount += _spannedCells.Length;
System\Windows\Documents\TextContainer.cs (4)
1079UpdateContainerSymbolCount(elementNode.GetContainingNode(), /* symbolCount */ elementText == null ? 2 : elementText.Length, deltaCharCount + formerFirstIMEVisibleNodeCharDelta + newFirstIMEVisibleNodeCharDelta); 1122AddChange(startEdgePosition, elementText == null ? 2 : elementText.Length, deltaCharCount, PrecursorTextChangeType.ContentAdded); 1546length = ((char[])text).Length; 2480Invariant.Assert(elementText.Length == elementNode.SymbolCount);
System\Windows\Documents\TextElement.cs (1)
49for (int i = 0; i < typographyProperties.Length; i++)
System\Windows\Documents\TextElementCollection.cs (3)
610if (arrayIndex > array.Length) 615if (array.Length < arrayIndex + count) 617throw new ArgumentException(SR.Format(SR.TextElementCollection_CannotCopyToArrayNotSufficientMemory, count, arrayIndex, array.Length));
System\Windows\Documents\TextElementCollectionHelper.cs (3)
43for (int i = 0; i < _cleanParentList.Length; i++) 71index = firstFreeIndex >= 0 ? firstFreeIndex : _cleanParentList.Length - 1; 130for (int i = 0; i < _cleanParentList.Length; i++)
System\Windows\Documents\TextFindEngine.cs (12)
240int textStartIndex = matchLast ? findText.Length - findTextLength : 0; 250GetContextualInformation(startFindTextPosition, matchLast ? -findTextPositionMap[findTextPositionMap.Length - findTextLength - 1] : findTextPositionMap[findTextLength], 293navigator.MoveByOffset(matchLast ? - findTextPositionMap[findText.Length - findTextLength + findPattern.Length] : findTextPositionMap[findTextLength - findPattern.Length]); 662findTextPositionMap[findTextPositionMap.Length - 1] = 0; 671runCount = Math.Min(runCount, findText.Length - findTextLength); 689findText.Length - findTextLength - runCount, 694int mapIndex = findText.Length - findTextLength - 1; 730findText[findText.Length - findTextLength] = '\n'; 731findTextPositionMap[findText.Length - findTextLength] = findTextLength + inlineCount; 751findText[findText.Length - findTextLength] = '\xf8ff'; 752findTextPositionMap[findText.Length - findTextLength] = findTextLength + inlineCount; 759if (findTextLength >= findText.Length)
System\Windows\Documents\TextPointer.cs (4)
1760if (startIndex > textBuffer.Length) 1762throw new ArgumentException(SR.Format(SR.StartIndexExceedsBufferSize, startIndex, textBuffer.Length)); 1768if (count > textBuffer.Length - startIndex) 1770throw new ArgumentException(SR.Format(SR.MaxLengthExceedsBufferSize, count, textBuffer.Length, startIndex));
System\Windows\Documents\TextRangeBase.cs (4)
877else if (charArray.Length < textLength) 879int newLength = charArray.Length * 2; 941textBuffer.Append(charArray, 0, charArray.Length); 1384int length = textParagraphs.Length;
System\Windows\Documents\TextRangeEdit.cs (11)
96for (int i = 0; i < inheritableProperties.Length; i++) 137for (int i = 0; i < noninheritableProperties.Length; i++) 349for (int i = 0; i < inheritableProperties.Length; i++) 374for (int i = 0; i < nonInheritableProperties.Length; i++) 495for (int i = 0; i < nonFormattingCharacterProperties.Length; i++) 1784for (int i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1816for (i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1823return (i < TextSchema.StructuralCharacterProperties.Length); 1831for (i = 0; i < TextSchema.StructuralCharacterProperties.Length; i++) 1838return (i < TextSchema.StructuralCharacterProperties.Length); 2326for (int i = 0; i < _ranges.Length; i++)
System\Windows\Documents\TextRangeEditTables.cs (7)
1136for (int i = 0; i < spannedCells.Length; i++) 1313for (int i = 0; i < spannedCells.Length; i++) 1673while (table.Columns.Count < columnWidths.Length) 2301for (int i = 0; i < nonInheritableProperties.Length; i++) 2310for (int i = 0; i < inheritableProperties.Length; i++) 2385for (int i = 0; i < spannedCells.Length; i++) 2469for (int i = 0; i < spannedCells.Length; i++)
System\Windows\Documents\TextRangeSerialization.cs (8)
733for (int i = 0; i < inheritableProperties.Length; i++) 782for (int i = 0; i < inheritableProperties.Length; i++) 842for (int i = 0; i < elementProperties.Length; i++) 1042for (int i = 0; i < inheritableProperties.Length; i++) 1050for (int i = 0; i < nonInheritableProperties.Length; i++) 1126for (int i = 0; i < elementProperties.Length; i++) 1178for (int i = 0; i < imageProperties.Length; i++) 1777Invariant.Assert(text.Length >= length, "Asserting that text.Length >= length");
System\Windows\Documents\TextSchema.cs (22)
56_inheritableTextElementProperties = new DependencyProperty[textElementPropertyList.Length + Typography.TypographyPropertiesList.Length]; 57Array.Copy(textElementPropertyList, 0, _inheritableTextElementProperties, 0, textElementPropertyList.Length); 58Array.Copy(Typography.TypographyPropertiesList, 0, _inheritableTextElementProperties, textElementPropertyList.Length, Typography.TypographyPropertiesList.Length); 68_inheritableBlockProperties = new DependencyProperty[blockPropertyList.Length + _inheritableTextElementProperties.Length]; 69Array.Copy(blockPropertyList, 0, _inheritableBlockProperties, 0, blockPropertyList.Length); 70Array.Copy(_inheritableTextElementProperties, 0, _inheritableBlockProperties, blockPropertyList.Length, _inheritableTextElementProperties.Length); 79_inheritableTableCellProperties = new DependencyProperty[tableCellPropertyList.Length + _inheritableTextElementProperties.Length]; 80Array.Copy(tableCellPropertyList, _inheritableTableCellProperties, tableCellPropertyList.Length); 81Array.Copy(_inheritableTextElementProperties, 0, _inheritableTableCellProperties, tableCellPropertyList.Length, _inheritableTextElementProperties.Length); 662for (int i = 0; i < _inheritableBlockProperties.Length; i++) 671for (int i = 0; i < _paragraphProperties.Length; i++) 687for (int i = 0; i < _inheritableTextElementProperties.Length; i++) 696for (int i = 0; i < _inlineProperties.Length; i++) 711for (int i = 0; i < _nonFormattingCharacterProperties.Length; i++) 742for (i = 0; i < _structuralCharacterProperties.Length; i++) 748return (i < _structuralCharacterProperties.Length);
System\windows\Documents\TextSelection.cs (3)
1492for (int i = 0; i < inheritableProperties.Length; i++) 1503for (int i = 0; i < noninheritableProperties.Length; i++) 1699(keyboardListIndex < keyboardList.Length) && (keyboardListIndex < keyboardListCount);
System\Windows\Documents\TextStore.cs (9)
533change.newEnd = endIndex + text.Length - (endIndex - startIndex); 1508navigator.GetTextInRun(LogicalDirection.Forward, nextChars, 0, nextChars.Length); 2479runCount = TextPointerBase.GetTextWithLimit(navigator, LogicalDirection.Forward, text, charsCopied, Math.Min(cchReq, text.Length - charsCopied), limit); 2482hitLimit = (text.Length == charsCopied) || (limit != null && navigator.CompareTo(limit) == 0); 2595hitLimit = (text.Length == charsCopied) || (limit != null && navigator.CompareTo(limit) == 0); 2795for (i = 0; i < _supportingattributes.Length; i++) 4391for (int i = units.Length - 1; i >= 0; i--) 4706if (a.Length > 1) 4877int length = (args != null) ? args.Length : 0;
System\Windows\Documents\TextTreeDeleteContentUndoUnit.cs (1)
119for (int columnIndex = 0; columnIndex < savedColumns.Length; columnIndex++)
System\Windows\Documents\TextTreeTextBlock.cs (9)
89if (_text.Length < MaxBlockSize && count > _gapSize) 97rightOfGapLength = _text.Length - (_gapOffset + _gapSize); 98Array.Copy(_text, _gapOffset + _gapSize, newText, newText.Length - rightOfGapLength, rightOfGapLength); 99_gapSize += newText.Length - _text.Length; 144Invariant.Assert(_text.Length == MaxBlockSize, "Splitting non-max sized block!"); 233Invariant.Assert(_gapOffset + _gapSize <= _text.Length); 264copyCount = Math.Min(count, _text.Length - logicalOffset); 431return (_text.Length - _gapSize);
System\Windows\Documents\TextTreeUndoUnit.cs (1)
179for (i = 0; i < records.Length; i++)
System\Windows\Documents\WinRTSpellerInterop.cs (1)
578if (matches.Length != 3)
System\Windows\Documents\XamlToRtfWriter.cs (1)
3467for (int i = 0; i < entries.Length; i++)
System\Windows\FrameworkElement.cs (1)
3052for (int i=0; i<handlers.Length; i++)
System\Windows\Interop\DynamicScriptObject.cs (6)
132if (indexes.Length != 1) 160if (indexes.Length != 1) 336for (int i = 0; i < args.Length; i++) 370dp.cArgs = (uint)args.Length; 437UnsafeNativeMethods.ArrayToVARIANTHelper.FreeVARIANTVector(dp.rgvarg, args.Length); 540HRESULT hr = _scriptObject.GetIDsOfNames(ref guid, names, dispids.Length, Thread.CurrentThread.CurrentCulture.LCID, dispids);
System\Windows\LengthConverter.cs (1)
195for (int i = 0; i < PixelUnitStrings.Length; i++)
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
2595if (bytes.Length == 2)
System\Windows\Markup\Baml2006\SharedStream.cs (2)
170ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(offset, buffer.Length); 171ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length - count);
System\Windows\Markup\Baml2006\WpfKnownTypeInvoker.cs (2)
24if ((arguments == null || arguments.Length == 0) && _type.DefaultConstructor != null) 31if(!_type.Constructors.TryGetValue(arguments.Length, out ctorInfo))
System\Windows\Markup\BamlMapTable.cs (2)
180int end = _knownStrings.Length; 620Debug.Assert(-id <= _knownStrings.Length);
System\Windows\Markup\BamlReader.cs (1)
1021for (int i = 0; i < infos.Length; i++)
System\Windows\Markup\BamlRecordReader.cs (4)
1506for (int i=0; i<infos.Length; i++) 1510if (paramInfos.Length == paramCount) 1512object[] paramArray = new object[paramInfos.Length]; 1534for (int j=0; j<paramInfos.Length; j++)
System\Windows\Markup\BamlRecords.cs (4)
1202if (AssemblyIds != null && AssemblyIds.Length > 0) 1204count = (short) AssemblyIds.Length; 4728Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4771Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlWriter.cs (3)
1148if(pi.GetIndexParameters().Length == 0) 1220if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1232if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1)
System\Windows\Markup\DependencyPropertyConverter.cs (1)
125if (bytes.Length == 2)
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (2)
287if (arrayIndex >= array.Length) 299if (Count > (array.Length - arrayIndex))
System\Windows\Markup\MarkupExtensionParser.cs (2)
1213if (parInfo.Length >= maxConstructorArguments) 1215maxConstructorArguments = parInfo.Length;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (2)
272if (parameters.Length == 1) 394if (ctorParameters != null && ctorParameters.Length == instanceDescriptor.Arguments.Count)
System\Windows\Markup\SetterTriggerConditionValueConverter.cs (1)
164if (bytes != null && bytes.Length == 1)
System\Windows\Markup\XamlFigureLengthSerializer.cs (3)
210for (i = 1; i < UnitStrings.Length; ++i) 225if (i >= UnitStrings.Length) 227for (i = 0; i < PixelUnitStrings.Length; ++i)
System\Windows\Markup\XamlGridLengthSerializer.cs (3)
211for (i = 1; i < UnitStrings.Length; ++i) 226if (i >= UnitStrings.Length) 228for (i = 0; i < PixelUnitStrings.Length; ++i)
System\Windows\Markup\XamlTypeMapper.cs (23)
901if (attachedPropertyInfo != null && attachedPropertyInfo.GetParameters().Length == paramCount) 1306if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1375if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1386if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1465if (pis == null || pis.Length != 2 || !dependencyObjectType.IsAssignableFrom(pis[0].ParameterType)) 1533if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 2) 1544if (memberInfo != null && ((MethodInfo)memberInfo).GetParameters().Length != 1) 1709count < namespaceMaps.Length && !foundNamespaceMatch; 1962for (int i = 0; i < infos.Length; i++) 2073propertyType = parameters.Length == 1 ? methodInfo.ReturnType : parameters[1].ParameterType; 2074propertyCanWrite = parameters.Length == 1 ? false : true; 2232for (int i = 0; i < namespaces.Length; i++) 2543for (int count = 0; count < namespaceMaps.Length;) 2578if (knownTypesOnly && (count == namespaceMaps.Length)) 3169result = (namespaceMaps != null && namespaceMaps.Length > 0) || 3201if (assemblyIds != null && assemblyIds.Length > 0) 3203asmNameList = new string[assemblyIds.Length]; 3205for (int i = 0; i < assemblyIds.Length; i++) 3250for (int i = 0; i < _namespaceMaps.Length; i++) 3316for (int k = 0; k < _assemblyNames.Length; k++) 3690_parameters = new ParameterInfo[_constructors.Length][]; 3765if (trimAttribute.Length > 0) 3767Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute");
System\Windows\Markup\XmlnsCache.cs (6)
177Assembly[] asmList = new Assembly[asmNameList.Length]; 178for (int i = 0; i < asmNameList.Length; i++) 348for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 353for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++) 378for(int asmIdx=0; asmIdx<asmList.Length; asmIdx++) 388for(int attrIdx=0; attrIdx<attributes.Length; attrIdx++)
System\Windows\Markup\XmlnsDictionary.cs (3)
637if (_lastDecl == _nsDeclarations.Length - 1) 639NamespaceDeclaration[] new_nsDeclarations = new NamespaceDeclaration[_nsDeclarations.Length * 2]; 641Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (2)
347Int32 keyFrameCount = _sortedResolvedKeyFrames.Length; 915int maxKeyFrameIndex = _sortedResolvedKeyFrames.Length - 1;
System\Windows\MultiDataTrigger.cs (3)
111for (int i = 0; i < TriggerConditions.Length; ++i) 151bool retVal = (TriggerConditions.Length > 0); 153for( int i = 0; retVal && i < TriggerConditions.Length; i++ )
System\Windows\MultiTrigger.cs (3)
106for (int i = 0; i < TriggerConditions.Length; i++) 130bool retVal = (TriggerConditions.Length > 0); 132for( int i = 0; retVal && i < TriggerConditions.Length; i++ )
System\Windows\Navigation\JournalEntryListConverter.cs (1)
116if (values != null && values.Length == 2)
System\Windows\PropertyPath.cs (7)
87if (pathParameters != null && pathParameters.Length > 0) 155internal int Length { get { return _arySVI.Length; } } 374if (_arySVI.Length == 0) 393for (int i=0; i<_arySVI.Length; ++i) 435Debug.Assert(aryIPI.Length > 0); 454if (j < aryIPI.Length) 709for (int i = 0; i < args.Length; ++i)
System\Windows\StartupEventArgs.cs (3)
63Invariant.Assert(args.Length >= 1); 65int newLength = args.Length - 1; 70for (int i = 1; i < args.Length; i++)
System\Windows\Style.cs (1)
771for (int k=0; k<conditions.Length; k++)
System\Windows\StyleHelper.cs (10)
563for (int i = 0; i < propertyValue.Conditions.Length; i++) 607for (int i = 0; i < propertyValue.Conditions.Length; i++) 937for (int k=0; k<conditions.Length; k++) 3081for (int j = 0; j < conditions.Length; j++) 4863Debug.Assert( conditions != null && conditions.Length == 1, 4893Debug.Assert( conditions != null && conditions.Length == 1, 4922for( int i = 0; i < conditions.Length; i++ ) 5795if( Conditions.Length == other.Conditions.Length ) 5798for( int i = 0; i < Conditions.Length; i++ )
System\Windows\SystemParameters.cs (2)
83for (int i=0; i<propertyNames.Length; ++i) 5067for (int i = 0; i < param.Length; i++)
System\Windows\Trigger.cs (1)
239Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\TriggerBase.cs (1)
241for (int j = 0; j < propertyValue.Conditions.Length; j++)
System\Windows\VisualStateGroup.cs (1)
117for (int index = 0; index < newStoryboards.Length; ++index)
System\Windows\Window.cs (2)
6614HRESULT hr = _taskbarList.ThumbBarAddButtons(CriticalHandle, (uint)nativeButtons.Length, nativeButtons); 6725return _taskbarList.ThumbBarUpdateButtons(CriticalHandle, (uint)nativeButtons.Length, nativeButtons);
PresentationFramework.Aero (1)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (1)
36values.Length != 3 ||
PresentationFramework.Aero2 (1)
Microsoft\Windows\Themes\ProgressBarHighlightConverter.cs (1)
36values.Length != 3 ||
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\ProgressBarBrushConverter.cs (1)
36values.Length != 5 ||
PresentationFramework-SystemCore (5)
DynamicAccessorImpl.cs (5)
110int rank = args.Length; 121int rank = args.Length; 134if (_accessors.Length < rank || _accessors[rank-1] == null) 138if (_accessors.Length < rank) 141Array.Copy(_accessors, 0, newAccessors, 0, _accessors.Length);
PresentationUI (7)
MS\Internal\Documents\PeoplePickerWrapper.cs (4)
226List<String> addresses = new List<String>(paths.Length); 228for (int i = 0; i < paths.Length; i++) 323_ptrToDsObjectNames = Marshal.AllocHGlobal(data.Length); 327Marshal.Copy(data, 0, _ptrToDsObjectNames, data.Length);
MS\Internal\Documents\RightsManagementResourceHelper.cs (1)
122_brushResources = new DrawingBrush[statusList.Length];
MS\Internal\Documents\RMPublishingDialog.cs (1)
698if (userNames != null && userNames.Length > 0)
MS\Internal\Documents\SignatureResourceHelper.cs (1)
149_brushResources = new DrawingBrush[statusList.Length];
RazorWebSite (2)
artifacts\obj\RazorWebSite\Release\net9.0\RazorWebSite.Resources.Models.ModelEnum.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
artifacts\obj\RazorWebSite\Release\net9.0\RazorWebSite.Resources.SingleType.cs (1)
22for (var i = 0; i < formatterNames.Length; i++)
ReachFramework (61)
AlphaFlattener\Optimizer.cs (1)
175for (int primIndex = 0; primIndex < addedPrimitives.Length; primIndex++)
AlphaFlattener\SegmentTree.cs (4)
155int len = values.Length; 230_xCount = _xCoord.Length; 233_yCount = _yCoord.Length; 289SegmentTree st = new SegmentTree(uniqueY, 0, uniqueY.Length);
MS\Internal\Printing\Configuration\DevMode.cs (7)
389this.Size = (ushort)this._byteData.Length; 477Array.Copy(ticketDevMode.ByteData, this.dmFieldsByteOffset, this.ByteData, this.dmFieldsByteOffset, this.ByteData.Length - this.dmFieldsByteOffset); 526if (byteOffset >= data.Length) 537if (byteOffset >= data.Length) 548if (byteOffset >= data.Length) 560if (byteOffset >= data.Length) 708int byteDataLength = this.ByteData.Length;
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (2)
30SafeMemoryHandle buffer = SafeMemoryHandle.Create(devMode.ByteData.Length); 31buffer.CopyFromArray(devMode.ByteData, 0, devMode.ByteData.Length);
PrintConfig\FallbackPTProvider.cs (4)
448for (int i = 0; i < originalDevMode.ByteData.Length; i++) 509using (SafeMemoryHandle buffer = SafeMemoryHandle.Create(devModeBytes.Length)) 511buffer.CopyFromArray(devModeBytes, 0, devModeBytes.Length); 527outPtr.CopyToArray(devModeBytes, 0, devModeBytes.Length);
PrintConfig\PageMediaSize.cs (1)
474for (int i = 0; i < PrintSchema.StdMediaSizeTable.Length; i++)
PrintConfig\PrintSchema.cs (3)
2295for (int i=0; i < map.Length; i++) 2325for (int i=1; i < enumNames.Length; i++) 2410for (int i=1; i < enumNames.Length; i++)
PrintConfig\PrtCap_Builder.cs (2)
441for (int i=0; i<handlersTable.Length; i++) 478for (int i=0; i<handlersTable.Length; i++)
PrintConfig\PrtCap_Public.cs (2)
62_countRootFeatures = Enum.GetNames(typeof(CapabilityName)).Length; 63_countLocalParamDefs = Enum.GetNames(typeof(PrintSchemaLocalParameterDefs)).Length;
PrintConfig\PrtTicket_Base.cs (2)
97for (int i=0; i<_propertyMaps.Length; i++) 366for (int i=0; i<_propertyMaps.Length; i++)
PrintConfig\PTProvider.cs (9)
400IntPtr umDevMode = Marshal.AllocCoTaskMem(devMode.Length); 404Marshal.Copy(devMode, 0, umDevMode, devMode.Length); 410(uint)devMode.Length, 644CopyIStreamToArray(stream, result, (uint)result.Length); 660Invariant.Assert(src.Length >= byteCount); 684int bytesToWrite = Math.Min(data.Length, (int)(byteCount - totalBytesWritten)); 718Invariant.Assert(dst.Length >= byteCount); 738int bytesToRead = Math.Min(data.Length, (int)(byteCount - totalBytesRead)); 740Array.Clear(data, 0, data.Length);
Serialization\Crc32.cs (1)
102int bytes = data.Length;
Serialization\Manager\MetroSerializationManager.cs (7)
559int[] serializableIndeces = new int[clrProperties.Length]; 568indexInClrProperties < clrProperties.Length; 603indexInClrProperties < clrProperties.Length; 632int[] serializableIndeces = new int[dependencyProperties.Length]; 641indexInDependencyProperties < dependencyProperties.Length; 679indexInDependencyProperties < dependencyProperties.Length; 843i<properties.Length && propertyInfo == null;
Serialization\Manager\ReachSerializableProperties.cs (2)
239indexInClrSerializableProperties < clrProperties.Length; 289indexInSerializableDependencyProperties < dependencyProperties.Length;
Serialization\Manager\ReachSerializationCacheItems.cs (5)
105int[] propertiesIndex = new int[properties.Length]; 106TypePropertyCache[] cachedProperties = new TypePropertyCache[properties.Length]; 110indexInProperties < properties.Length; 228numberOfAttributes < attributes.Length; 502numberOfAttributes < attributes.Length;
Serialization\Manager\ReachSerializationUtils.cs (2)
176if ((Count + delta) > List.Length) 178System.Windows.DependencyProperty[] newList = new System.Windows.DependencyProperty[Math.Max(List.Length * 2, Count + delta)];
Serialization\Manager\XpsSerializationManager.cs (6)
1302IndexInTypes < ReachSerializationServices._xpsTypesRequiringXMLNS.Length; 1328numberOfDependencyPropertiesInFixedPage < _fixedPageDependencyProperties.Length; 1345numberOfDependencyPropertiesInFixedDocument < _fixedDocumentDependencyProperties.Length; 1362numberOfDependencyPropertiesInFixedDS < _fixedDocumentSequenceDependencyProperties.Length; 1392numberOfClrPropertiesInFixedDocument < _fixedDocumentExcludedClrProperties.Length; 1409numberOfClrPropertiesInFixedDS < _fixedDocumentSequenceExcludedClrProperties.Length;
Serialization\XpsFontSubsetter.cs (1)
605stream.Write(fontData, 0, fontData.Length);
ResultsOfTGenerator (4)
Program.cs (4)
20if (args.Length > 0) 22if (args.Length != 2) 31GenerateClassFile(classTargetFilePath, TYPE_ARG_COUNT, args.Length == 0); 33GenerateTestFiles(testsTargetFilePath, TYPE_ARG_COUNT, args.Length == 0);
RoutingSandbox (3)
HelloExtension\HelloMiddleware.cs (1)
33var payloadLength = _helloPayload.Length;
Program.cs (1)
21if (args.Length == 0)
UseEndpointRoutingStartup.cs (1)
58var payloadLength = _plainTextPayload.Length;
RoutingWebSite (4)
HelloExtension\HelloMiddleware.cs (1)
33var payloadLength = _helloPayload.Length;
Program.cs (1)
23if (args.Length == 0)
UseEndpointRoutingStartup.cs (2)
60var payloadLength = _plainTextPayload.Length; 133var hostsDisplay = (hosts == null || hosts.Length == 0)
SignalR.Client.FunctionalTestApp (1)
Program.cs (1)
13for (var i = 0; i < args.Length; i++)
SocialWeather (5)
Pipe\PipeWeatherStreamFormatter.cs (4)
24var zipCode = tokens.Length > 3 ? tokens[3] : string.Empty; 26if (tokens.Length == 0 || !int.TryParse(tokens[0], out temperature)) 31if (tokens.Length < 2 || !Enum.TryParse<Weather>(tokens[1], out weather)) 36if (tokens.Length < 3 || !long.TryParse(tokens[2], out reportTime))
SocialWeatherConnectionHandler.cs (1)
45await stream.WriteAsync(data, 0, data.Length);
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
Sockets.FunctionalTests (63)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
104var task = _reader.ReadAsync(actual, offset, actual.Length - offset);
src\Servers\Kestrel\shared\test\StreamExtensions.cs (7)
22read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 24} while (read != 0 && offset < buffer.Length); 41read = await stream.ReadAsync(buffer, offset, buffer.Length - offset, cancellationToken); 43} while (read != 0 && offset < buffer.Length); 45Assert.True(offset >= buffer.Length); 57var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken); 84var read = await stream.ReadAsync(buffer, 0, buffer.Length, cancellationToken);
src\Servers\Kestrel\shared\test\TestApp.cs (10)
20if (buffer.Length > 0) 23await response.Body.WriteAsync(buffer, 0, buffer.Length); 35response.Headers.ContentLength = bytes.Length; 36await response.Body.WriteAsync(bytes, 0, bytes.Length); 50if (buffer.Length > 0) 54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 69response.Headers.ContentLength = bytes.Length; 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length);
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (15)
71for (var i = 1; i < _requestLines.Length - 1; i++) 141await WritePostRequestHeaders(stream, data.Length); 147while (bytesWritten < data.Length) 149var size = Math.Min(data.Length - bytesWritten, maxSendSize); 155Assert.Equal(data.Length, bytesWritten); 172var maximumExpectedBytesWritten = data.Length - 1; 205await AssertStreamContains(stream, $"bytesRead: {data.Length}"); 234await WritePostRequestHeaders(stream, data.Length); 240while (bytesWritten < data.Length) 242var size = Math.Min(data.Length - bytesWritten, maxSendSize); 262var maximumExpectedBytesWritten = data.Length - 1; 344var buffer = new byte[expectedBody.Length]; 346while (bytesRead < buffer.Length) 348bytesRead += await context.Request.Body.ReadAsync(buffer, bytesRead, buffer.Length - bytesRead); 401var exptectedLength = expectedBytes.Length;
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (8)
90while ((received = await context.Request.Body.ReadAsync(receivedBytes, 0, receivedBytes.Length)) > 0) 124for (var i = 0; i < contentBytes.Length; i++) 130for (var i = 0; i < contentLength / contentBytes.Length; i++) 1009$"Content-Length: {scratchBuffer.Length}", 1013var ignore = connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 1062$"Content-Length: {scratchBuffer.Length * 2}", 1068await connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 1128var expectedLength = expectedBytes.Length;
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (19)
63for (int i = 0; i < bytes.Length; i++) 68context.Response.ContentLength = bytes.Length * 1024; 72await context.Response.BodyWriter.WriteAsync(new Memory<byte>(bytes, 0, bytes.Length)); 92var count = await responseBody.ReadAsync(bytes, 0, bytes.Length); 100count = await responseBody.ReadAsync(bytes, 0, bytes.Length); 309await context.Response.BodyWriter.WriteAsync(new Memory<byte>(scratchBuffer, 0, scratchBuffer.Length), context.RequestAborted); 331$"Content-Length: {scratchBuffer.Length}", 335var ignore = connection.Stream.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 372await context.Response.Body.WriteAsync(scratchBuffer, 0, scratchBuffer.Length); 390await connection.Stream.ReadAsync(scratchBuffer, 0, scratchBuffer.Length); 523await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 659await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 687await sslStream.WriteAsync(request, 0, request.Length); 807await connection.Stream.WriteAsync(buffer, 0, buffer.Length); 869await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 1030await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 1077var bytes = await stream.ReadAsync(receiveBuffer, 0, receiveBuffer.Length).DefaultTimeout(); 1103var received = await stream.ReadAsync(receiveBuffer, 0, Math.Min(receiveBuffer.Length, expectedBytes - totalReceived)); 1127received = await stream.ReadAsync(receiveBuffer, 0, receiveBuffer.Length);
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (3)
104var buffer = new byte[data.Length]; 106while (read < data.Length) 108var bytesReceived = await socket.ReceiveAsync(buffer.AsMemory(read, buffer.Length - read), SocketFlags.None).DefaultTimeout();
StringTools.Benchmark (1)
SpanBasedStringBuilder_Benchmark.cs (1)
31for (int i = 0; i < _subStrings.Length; i++)
Swaggatherer (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
System.Collections (86)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
54if (count == arr.Length)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (2)
26var items = new DebugViewDictionaryItem<TKey, TValue>[keyValuePairs.Length]; 27for (int i = 0; i < items.Length; i++)
System\Collections\BitArray.cs (28)
80if (bytes.Length > int.MaxValue / BitsPerByte) 85m_array = new int[GetInt32ArrayLengthFromByteLength(bytes.Length)]; 86m_length = bytes.Length * BitsPerByte; 88uint totalCount = (uint)bytes.Length / 4; 122m_array = new int[GetInt32ArrayLengthFromBitLength(values.Length)]; 123m_length = values.Length; 127if (values.Length < Vector256<byte>.Count) 139for (; i <= (uint)values.Length - Vector512<byte>.Count; i += (uint)Vector512<byte>.Count) 151for (; i <= (uint)values.Length - Vector256<byte>.Count; i += (uint)Vector256<byte>.Count) 162for (; i <= (uint)values.Length - Vector128<byte>.Count * 2u; i += (uint)Vector128<byte>.Count * 2u) 177for (; i < (uint)values.Length; i++) 202if (values.Length > int.MaxValue / BitsPerInt32) 207m_array = new int[values.Length]; 208Array.Copy(values, m_array, values.Length); 209m_length = values.Length * BitsPerInt32; 227Debug.Assert(bits.m_array.Length <= arrayLength); 329if (Length != value.Length || (uint)count > (uint)thisArray.Length || (uint)count > (uint)valueArray.Length) 402if (Length != value.Length || (uint)count > (uint)thisArray.Length || (uint)count > (uint)valueArray.Length) 475if (Length != value.Length || (uint)count > (uint)thisArray.Length || (uint)count > (uint)valueArray.Length) 723if (newints > m_array.Length || newints + _ShrinkThreshold < m_array.Length) 759if (array.Length - index < GetInt32ArrayLengthFromBitLength(m_length)) 777if ((array.Length - index) < arrayLength) 802Debug.Assert(m_array.Length > quotient); 824if (array.Length - index < m_length)
System\Collections\Generic\LinkedList.cs (4)
200if (index > array.Length) 205if (array.Length - index < Count) 363for (int i = 0; i < array.Length; i++) 463if (array.Length - index < Count)
System\Collections\Generic\PriorityQueue.cs (13)
202if (_nodes.Length == currentSize) 403if (collection is not null && (count = collection.Count) > _nodes.Length - _size) 423if (nodes.Length == i) 466(count = collection.Count) > _nodes.Length - _size) 479if (nodes.Length == i) 580if (_nodes.Length < capacity) 586return _nodes.Length; 599int threshold = (int)(_nodes.Length * 0.9); 612Debug.Assert(_nodes.Length < minCapacity); 617int newcapacity = GrowFactor * _nodes.Length; 624newcapacity = Math.Max(newcapacity, _nodes.Length + MinimumGrow); 949if (index < 0 || index > array.Length) 954if (array.Length - index < _queue._size)
System\Collections\Generic\SortedDictionary.cs (4)
548if (array.Length - index < Count) 572if (array.Length - index < _dictionary.Count) 709if (array.Length - index < Count) 733if (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; 658if (_size == keys.Length) EnsureCapacity(_size + 1); 735int threshold = (int)(keys.Length * 0.9);
System\Collections\Generic\SortedSet.cs (4)
521if (count > array.Length - index) 556if (array.Length - index < Count) 1152Debug.Assert(count >= 0 && count <= other.Length); 1575for (int i = 0; i < items.Length; i++)
System\Collections\Generic\Stack.cs (18)
63public int Capacity => _array.Length; 101if (arrayIndex < 0 || arrayIndex > array.Length) 106if (array.Length - arrayIndex < _size) 134if (arrayIndex < 0 || arrayIndex > array.Length) 139if (array.Length - arrayIndex < _size) 167int threshold = (int)(_array.Length * 0.9); 184if (capacity == _array.Length) 197if ((uint)size >= (uint)array.Length) 210if ((uint)size >= (uint)array.Length) 229if ((uint)size >= (uint)array.Length) 249if ((uint)size >= (uint)array.Length) 271if ((uint)size < (uint)array.Length) 287Debug.Assert(_size == _array.Length); 305if (_array.Length < capacity) 310return _array.Length; 315Debug.Assert(_array.Length < capacity); 317int newcapacity = _array.Length == 0 ? DefaultCapacity : 2 * _array.Length;
System.Collections.Concurrent (69)
System\Collections\Concurrent\BlockingCollection.cs (16)
767Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 809Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 1024for (int i = 0; i < collections.Length; i++) 1051List<WaitHandle> handlesList = new List<WaitHandle>(collections.Length + 1); // + 1 for the external token handle to be added 1052List<CancellationToken> tokensList = new List<CancellationToken>(collections.Length + 1); // + 1 for the external token 1058for (int i = 0; i < collections.Length; i++) 1070for (int i = 0; i < collections.Length; i++) 1168Debug.Assert(returnValue >= 0 && returnValue < collections.Length, 1316for (int i = 0; i < collections.Length; i++) 1401if (collections.Length != handles.Count - 1) // -1 because of the combined token handle 1403for (int i = 0; i < collections.Length; i++) 1566Array.Copy(collectionSnapShot, 0, array, index, collectionSnapShot.Length); 1657if (collections.Length < 1) 1662if ((collections.Length > 63) || 1663((collections.Length == 63) && (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA))) 1670for (int i = 0; i < collections.Length; ++i)
System\Collections\Concurrent\ConcurrentBag.cs (10)
295if (index > array.Length - count) 791var newArray = new T[_array.Length << 1]; 795Array.Copy(_array, newArray, _array.Length); 799Array.Copy(_array, headIdx, newArray, 0, _array.Length - headIdx); 800Array.Copy(_array, 0, newArray, _array.Length - headIdx, headIdx); 1030Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1039Debug.Assert(arrayIndex <= array.Length - count); 1101if (_index < _array.Length) 1107_index = _array.Length + 1; 1117if (_index == 0 || _index == _array.Length + 1)
System\Collections\Concurrent\ConcurrentDictionary.cs (33)
182for (int i = 1; i < locks.Length; i++) 187var countPerLock = new int[locks.Length]; 223_budget = buckets.Length / locks.Length; 302_budget = tables._buckets.Length / tables._locks.Length; 680var newTables = new Tables(new VolatileNode[HashHelpers.GetPrime(DefaultCapacity)], tables._locks, new int[tables._countPerLock.Length], tables._comparer); 682_budget = Math.Max(1, newTables._buckets.Length / newTables._locks.Length); 718if (array.Length - count < index) 872if ((uint)i < (uint)buckets.Length) 1854if (array.Length - count < index) 1936int newLength = tables._buckets.Length; 1951if (upgradeComparer is null && GetCountNoLocks() < tables._buckets.Length / 4) 1963if ((newLength = tables._buckets.Length * 2) < 0 || 1980if (_growLockArray && tables._locks.Length < MaxLockNumber) 1982newLocks = new object[tables._locks.Length * 2]; 1983Array.Copy(tables._locks, newLocks, tables._locks.Length); 1984for (int i = tables._locks.Length; i < newLocks.Length; i++) 1991var newCountPerLock = new int[newLocks.Length]; 2020_budget = Math.Max(1, newBuckets.Length / newLocks.Length); 2043CDSCollectionETWBCLProvider.Log.ConcurrentDictionary_AcquiringAllLocks(_tables._buckets.Length); 2049Debug.Assert(locksAcquired == _tables._locks.Length); 2082for (int i = 1; i < locks.Length; i++) 2088Debug.Assert(locksAcquired == locks.Length); 2212return buckets[HashHelpers.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier)]._node; 2216return buckets[(uint)hashcode % (uint)buckets.Length]._node; 2229bucketNo = HashHelpers.FastMod((uint)hashcode, (uint)buckets.Length, tables._fastModBucketsMultiplier); 2233bucketNo = (uint)hashcode % (uint)buckets.Length; 2235lockNo = bucketNo % (uint)tables._locks.Length; // doesn't use FastMod, as it would require maintaining a different multiplier 2264_fastModBucketsMultiplier = HashHelpers.GetFastModMultiplier((uint)buckets.Length);
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 (134)
System\Collections\Frozen\FrozenDictionary.cs (10)
339Debug.Assert(keys.Length == values.Length); 341for (int i = 0; i < keys.Length; i++) 362if ((uint)index > (uint)array.Length) 367if (array.Length - index < Count) 576Debug.Assert(keys.Length == values.Length); 586if ((uint)_index < (uint)_keys.Length) 591_index = _keys.Length; 600if ((uint)_index >= (uint)_keys.Length)
System\Collections\Frozen\FrozenHashTable.cs (7)
30Debug.Assert(hashCodes.Length != 0); 31Debug.Assert(buckets.Length != 0); 87for (int bucketNum = 0; bucketNum < hashtableBuckets.Length; bucketNum++) 112Debug.Assert(count == hashtableHashcodes.Length); 129ref Bucket b = ref buckets[HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 134public int Count => HashCodes.Length; 226Array.Clear(seenBuckets, 0, Math.Min(numBuckets, seenBuckets.Length));
System\Collections\Frozen\FrozenSet.cs (4)
256Array.Copy(items, 0, array!, index, items.Length); 413if ((uint)_index < (uint)_entries.Length) 418_index = _entries.Length; 427if ((uint)_index >= (uint)_entries.Length)
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (4)
29_values = new TValue[entries.Length]; 31int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length); 32Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length); 33for (int i = 0; i < entries.Length; i++)
System\Collections\Frozen\ItemsFrozenSet.cs (4)
24_items = new T[entries.Length]; 26int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length); 27Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length); 28for (int i = 0; i < entries.Length; i++)
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (5)
25_keys = new TKey[entries.Length]; 26_values = new TValue[entries.Length]; 28int[] arrayPoolHashCodes = ArrayPool<int>.Shared.Rent(entries.Length); 29Span<int> hashCodes = arrayPoolHashCodes.AsSpan(0, entries.Length); 30for (int i = 0; i < entries.Length; i++)
System\Collections\Frozen\SmallFrozenDictionary.cs (2)
34private protected override int CountCore => _keys.Length; 41for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\SmallFrozenSet.cs (2)
25private protected override int CountCore => _items.Length; 30for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (3)
38_max = _keys[_keys.Length - 1]; 44private protected override int CountCore => _keys.Length; 52for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (3)
35_max = _items[_items.Length - 1]; 40private protected override int CountCore => _items.Length; 47for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (2)
33private protected override int CountCore => _keys.Length; 39for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenSet.cs (2)
29private protected override int CountCore => _items.Length; 34for (int i = 0; i < items.Length; i++)
System\Collections\Frozen\String\LengthBuckets.cs (2)
25if (keys.Length / spread > MaxPerLength) 51for (int i = 0; i < keys.Length; i++)
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.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.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 (10)
188if (items == null || items.Length == 0) 197var tmp = new T[items.Length]; 198Array.Copy(items, tmp, items.Length); 215Requires.Range(start >= 0 && start <= items.Length, nameof(start)); 216Requires.Range(length >= 0 && start + length <= items.Length, nameof(length)); 225for (int i = 0; i < array.Length; i++) 286for (int i = 0; i < array.Length; i++) 320for (int i = 0; i < array.Length; i++) 351for (int i = 0; i < array.Length; i++) 386for (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)); 702Requires.Range(index >= 0 && index + this.Count <= array.Length, nameof(index)); 728Requires.Range(destinationIndex >= 0 && destinationIndex + length <= destination.Length, nameof(destinationIndex)); 738if (_elements.Length < capacity) 740int newCapacity = Math.Max(_elements.Length * 2, capacity); 1093Array.Copy(_elements, copied + removed, _elements, copied, _elements.Length - (copied + removed));
System\Collections\Immutable\ImmutableArray_1.cs (8)
455Requires.Range(length >= 0 && length <= items.Length, nameof(length)); 457if (items.Length == 0 || length == 0) 485if (items.Length == 0) 490T[] tmp = new T[self.Length + items.Length]; 492Array.Copy(items, 0, tmp, self.Length, items.Length); 760for (int i = 0; i < self.array!.Length; i++) 870if (self.array == null || self.array.Length == 0) 934if (items.Length == 0)
System\Collections\Immutable\ImmutableArray_1.Enumerator.cs (4)
64return ++_index < _array.Length; 111if (unchecked((uint)_index) < (uint)_array.Length) 136int length = _array.Length; 173if (array.Length != 0)
System\Collections\Immutable\ImmutableArray_1.Minimal.cs (4)
157get { return this.array!.Length == 0; } 174return this.array!.Length; 196return self.array == null || self.array.Length == 0; 419_ = this.array!.Length;
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (1)
347Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableDictionary_2.cs (2)
613Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 753Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (2)
103Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 120Array.Copy(sourceArray, 0, array, arrayIndex, sourceArray.Length);
System\Collections\Immutable\ImmutableHashSet_1.Builder.cs (1)
397Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableHashSet_1.cs (2)
508Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 553Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableList_1.Node.cs (4)
857Requires.Range(array.Length >= this.Count, nameof(array)); 882Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 913Requires.Range(arrayIndex + count <= array.Length, nameof(arrayIndex)); 933Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
533Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (2)
243Requires.Range(array.Length >= arrayIndex + dictionarySize, nameof(arrayIndex)); 258Requires.Range(array.Length >= arrayIndex + dictionarySize, nameof(arrayIndex));
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (2)
342Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 356Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Collections\Immutable\KeysOrValuesCollectionAccessor.cs (2)
94Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex)); 135Requires.Range(array.Length >= arrayIndex + this.Count, nameof(arrayIndex));
System\Linq\ImmutableArrayExtensions.cs (2)
368return immutableArray.array!.Length > 0 ? immutableArray.array[0] : default; 621if (immutableArray.array!.Length == 0)
System.Collections.NonGeneric (30)
System\Collections\Queue.cs (20)
87int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy; 91Array.Copy(_array, 0, q._array, _array.Length - _head, numToCopy); 113Array.Clear(_array, _head, _array.Length - _head); 136int arrayLen = array.Length; 143int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy; 147Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy); 154if (_size == _array.Length) 156int newcapacity = (int)((long)_array.Length * (long)_growFactor / 100); 157if (newcapacity < _array.Length + MinimumGrow) 159newcapacity = _array.Length + MinimumGrow; 165_tail = (_tail + 1) % _array.Length; 187_head = (_head + 1) % _array.Length; 234index = (index + 1) % _array.Length; 242return _array[(_head + i) % _array.Length]; 261Array.Copy(_array, _head, arr, 0, _array.Length - _head); 262Array.Copy(_array, 0, arr, _array.Length - _head, _tail); 282Array.Copy(_array, _head, newarray, 0, _array.Length - _head); 283Array.Copy(_array, 0, newarray, _array.Length - _head, _tail);
System\Collections\SortedList.cs (7)
163for (int i = 0; i < keys.Length; i++) 193return keys.Length; 202if (value != keys.Length) 341if (array.Length - arrayIndex < Count) 371int newCapacity = keys.Length == 0 ? 16 : keys.Length * 2; 497if (_size == keys.Length) EnsureCapacity(_size + 1);
System\Collections\Stack.cs (3)
121if (array.Length - index < _size) 177if (_size == _array.Length) 179object[] newArray = new object[2 * _array.Length];
System.Collections.Specialized (5)
System\Collections\Specialized\ListDictionary.cs (1)
210if (array.Length - index < count)
System\Collections\Specialized\NameObjectCollectionBase.cs (2)
382if (array.Length - index < _entriesArray.Count) 606if (array.Length - index < _coll.Count)
System\Collections\Specialized\NameValueCollection.cs (2)
173for (int j = 0; j < values.Length; j++) 207if (dest.Length - index < Count)
System.ComponentModel.Annotations (10)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (1)
58if (newMetadata.Length > 0)
System\ComponentModel\DataAnnotations\CompareAttribute.cs (1)
41if (otherPropertyInfo.GetIndexParameters().Length > 0)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (3)
260if (parameterInfos.Length == 0 || parameterInfos[0].ParameterType.IsByRef) 268_isSingleArgumentMethod = (parameterInfos.Length == 1); 272if ((parameterInfos.Length != 2) || (parameterInfos[1].ParameterType != typeof(ValidationContext)))
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (5)
83_inputControlParameters = new object[controlParameters.Length]; 84Array.Copy(controlParameters, _inputControlParameters, controlParameters.Length); 168if (inputControlParameters == null || inputControlParameters.Length == 0) 172if (inputControlParameters.Length % 2 != 0) 177for (int i = 0; i < inputControlParameters.Length; i += 2)
System.ComponentModel.Composition (71)
Microsoft\Internal\Collections\CollectionServices.cs (3)
229if (thisArray.Length != thatArray.Length) 234for (int i = 0; i < thisArray.Length; i++)
System\ComponentModel\Composition\AttributedModel\AttributedModelDiscovery.cs (3)
134bool isPrerequisite = member.GetAttributes<ExportAttribute>().Length > 0; 154if (imports.Length == 0) 159if (imports.Length > 1)
System\ComponentModel\Composition\AttributedModel\AttributedPartCreationInfo.cs (4)
199if (constructors.Length == 0) 205if (constructors.Length == 1 && constructors[0].GetParameters().Length == 0) 231if (constructor.GetParameters().Length == 0)
System\ComponentModel\Composition\ContractNameServices.cs (5)
94for (int i = 0; i < parameters.Length; i++) 304WriteTypeArgumentsString(typeName, types.Length, false, typeArguments, formatGenericName); 340return type.GetGenericArguments().Length; 346int delclaringTypeGenericArguments = type.DeclaringType.GetGenericArguments().Length; 347int typeGenericArguments = type.GetGenericArguments().Length;
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (2)
44copiedProviders = new ExportProvider[providers.Length]; 45for (int i = 0; i < providers.Length; i++)
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (1)
303if (_values == null || _valueCount == _values.Length)
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (4)
168if ((providers != null) && (providers.Length > 0)) 171if (providers.Length > 1) 194int exportProviderCount = 1 + ((catalog != null) ? 1 : 0) + ((providers != null) ? providers.Length : 0); 207for (int i = 0; i < providers.Length; i++)
System\ComponentModel\Composition\Hosting\CompositionServices.cs (8)
74if (typeGenericArguments.Length == metadataTypeGenericArguments.Length) 214dictionary.Add(CompositionConstants.GenericPartArityMetadataName, genericArguments.Length); 218object?[] genericParameterConstraints = new object?[genericArguments.Length]; 219GenericParameterAttributes[] genericParameterAttributes = new GenericParameterAttributes[genericArguments.Length]; 220for (int i = 0; i < genericArguments.Length; i++) 225if (constraints.Length == 0) 439for (int i = 0; i < array.Length; i++)
System\ComponentModel\Composition\MetadataViewGenerator.cs (3)
154if (attrs.Length > 0) 244if (attrs.Length > 0) 267if (attrs.Length > 0)
System\ComponentModel\Composition\Primitives\ExportedDelegate.cs (3)
50Type[] parameterTypes = new Type[parameters.Length + 1]; 51parameterTypes[parameters.Length] = _method.ReturnType; 52for (int i = 0; i < parameters.Length; i++)
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (5)
74for (int i = 0; i < genericParametersOrder.Length; i++) 83T[] genericSpecialization = new T[genericParametersOrder.Length]; 84for (int i = 0; i < genericParametersOrder.Length; i++) 120Type[] subSpecialization = new Type[typeGenericArguments.Length]; 122for (int i = 0; i < typeGenericArguments.Length; i++)
System\ComponentModel\Composition\ReflectionModel\GenericSpecializationPartCreationInfo.cs (8)
41_specializationIdentities = new string[_specialization.Length]; 42for (int i = 0; i < _specialization.Length; i++) 221MemberInfo[] accessors = new MemberInfo[genericAccessors.Length]; 223for (int i = 0; i < genericAccessors.Length; i++) 446metadata[CompositionConstants.GenericContractMetadataName] = GenericServices.GetGenericName(originalImport.ContractName, importParametersOrder, _specialization.Length); 551if (partArity != specialization.Length) 565if ((genericParameterConstraints != null) && (genericParameterConstraints.Length != partArity)) 570if ((genericParameterAttributes != null) && (genericParameterAttributes.Length != partArity))
System\ComponentModel\Composition\ReflectionModel\ImportingItem.cs (4)
53Array array = Array.CreateInstance(elementType, exports.Length); 55for (int i = 0; i < array.Length; i++) 69if (exports.Length >= 2) 74if (exports.Length == 0)
System\ComponentModel\Composition\ReflectionModel\ImportType.cs (3)
152if (arguments.Length == 2) 187if (arguments.Length == 1) 195else if (arguments.Length == 2)
System\ComponentModel\Composition\ReflectionModel\LazyMemberInfo.cs (4)
170if (accessors.Length != 2) 185if (accessors.Length != 3) 201(accessors.Length != 1) || 202((accessors.Length == 1) && (accessors[0].MemberType != memberType)))
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (1)
315object?[] arguments = new object?[parameterImports.Length];
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePartDefinition.cs (4)
270if ((genericParametersOrder != null) && (genericParametersOrder.Length == genericParameters.Length)) 284genericTypeParameters = new Type[genericParametersAsArray.Length]; 285for (int i = 0; i < genericParametersAsArray.Length; i++)
System\ComponentModel\Composition\ReflectionModel\ReflectionExtensions.cs (2)
18if (accessors.Length != 1) 25if (accessors.Length != 2)
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (2)
367if (constructors.Length == 1) 371else if (constructors.Length == 0)
System\ComponentModel\Composition\ReflectionModel\ReflectionProperty.cs (2)
103if (parameters.Length == 0) 107return parameters[parameters.Length - 1].ParameterType;
System.ComponentModel.Composition.Registration (3)
System\ComponentModel\Composition\Registration\PartBuilder.cs (3)
371if (attributes.Length != 0) 546int length = candidateConstructor.GetParameters().Length; 565int length = candidateConstructor.GetParameters().Length;
System.ComponentModel.TypeConverter (127)
System\ComponentModel\AttributeCollection.cs (10)
48for (int idx = 0; idx < _attributes.Length; idx++) 67Attribute[] newArray = new Attribute[existing.Count + newAttributes.Length]; 71for (int idx = 0; idx < newAttributes.Length; idx++) 96if (actualCount < newArray.Length) 117public int Count => Attributes.Length; 172int count = Attributes.Length; 228for (int i = 0; i < attributes.Length; i++) 299for (int i = 0; i < Attributes.Length; i++) 320for (int i = 0; i < attributes.Length; i++) 342public void CopyTo(Array array, int index) => Array.Copy(Attributes, 0, array, index, Attributes.Length);
System\ComponentModel\Container.cs (2)
60if (_sites.Length == _siteCount) 226for (int i = 0; i < Math.Min(_siteCount, _sites!.Length); i++)
System\ComponentModel\CultureInfoConverter.cs (4)
184Debug.Assert(invariantIndex >= 0 && invariantIndex < installedCultures.Length); 186array = new CultureInfo[installedCultures.Length]; 190array = new CultureInfo[installedCultures.Length + 1]; 193Array.Copy(installedCultures, array, installedCultures.Length);
System\ComponentModel\Design\DesignerVerbCollection.cs (1)
28for (int i = 0; i < value.Length; i++)
System\ComponentModel\Design\PropertyTabAttribute.cs (14)
103_tabClasses = new Type[_tabClassNames.Length]; 104for (int i = 0; i < _tabClassNames.Length; i++) 158if (other.TabClasses.Length != TabClasses.Length || other.TabScopes.Length != TabScopes.Length) 161for (int i = 0; i < TabClasses.Length; i++) 196if (tabScopes != null && tabClasses.Length != tabScopes.Length) 204if (tabScopes != null && tabClassNames.Length != tabScopes.Length) 218for (int i = 0; i < tabScopes.Length; i++) 229TabScopes = new PropertyTabScope[tabClasses!.Length]; 231for (int i = 0; i < TabScopes.Length; i++)
System\ComponentModel\Design\Serialization\InstanceDescriptor.cs (3)
59if (Arguments.Count != ci.GetParameters().Length) 70if (Arguments.Count != mi.GetParameters().Length) 120for (int i = 0; i < translatedArguments.Length; i++)
System\ComponentModel\Design\ServiceContainer.cs (1)
175for (int idx = 0; idx < defaults.Length; idx++)
System\ComponentModel\EnumConverter.cs (4)
183long[] ulValues = new long[objValues.Length]; 184for (int idx = 0; idx < objValues.Length; idx++) 261if (fields != null && fields.Length > 0) 263objValues = new ArrayList(fields.Length);
System\ComponentModel\EventDescriptorCollection.cs (10)
40Count = events.Length; 145if (sizeNeeded <= _events.Length) 150if (_events.Length == 0) 159int newSize = Math.Max(sizeNeeded, _events.Length * 2); 253if (_events.Length == Count) 305if (_events.Length == 0) 312if (names != null && names.Length > 0) 316int eventCount = _events.Length; 318for (int i = 0; i < names.Length; i++) 422Debug.Assert(array == null || count <= array.Length, "Trying to enumerate more than the array contains");
System\ComponentModel\ListSortDescriptionCollection.cs (1)
21for (int i = 0; i < sorts.Length; i++)
System\ComponentModel\MemberDescriptor.cs (3)
289if (_attributes.Length != mdObj._attributes!.Length) 293for (int i = 0; i < _attributes.Length; i++)
System\ComponentModel\PropertyDescriptor.cs (5)
291if (_editorCount >= _editorTypes.Length) 293Type[] newTypes = new Type[_editorTypes.Length * 2]; 294object[] newEditors = new object[_editors!.Length * 2]; 295Array.Copy(_editorTypes, newTypes, _editorTypes.Length); 296Array.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)
830if (milist.Length > 0 && milist[0] != null)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (22)
269argTypes = new Type[args.Length]; 270for (int idx = 0; idx < args.Length; idx++) 548if (extenders.Length == 0) 574for (int idx = 0; idx < extenders.Length; idx++) 578propertyList ??= new List<PropertyDescriptor>(propertyArray.Length * extenders.Length); 580for (int propIdx = 0; propIdx < propertyArray.Length; propIdx++) 690for (curIdx = 0; curIdx < currentExtenders.Length; curIdx++) 698if (!newExtenders && (idx >= existingExtenders!.Length || currentExtenders[curIdx] != existingExtenders[idx++])) 715if (!newExtenders && (idx >= existingExtenders!.Length || prov != existingExtenders[idx++])) 723if (existingExtenders != null && extenderCount != existingExtenders.Length) 729if (currentExtenders == null || extenderCount != currentExtenders.Length) 738while (curIdx < currentExtenders.Length) 1073events = new EventDescriptor[eventInfos.Length]; 1076for (int idx = 0; idx < eventInfos.Length; idx++) 1095if (eventCount != events.Length) 1204properties = new PropertyDescriptor[extendedProperties.Length]; 1205for (int idx = 0; idx < extendedProperties.Length; idx++) 1251properties = new PropertyDescriptor[propertyInfos.Length]; 1255for (int idx = 0; idx < propertyInfos.Length; idx++) 1261if (propertyInfo.GetIndexParameters().Length > 0) 1287if (propertyCount != properties.Length)
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (4)
99for (int idx = 0; idx < interfaces.Length; idx++) 124for (int ifaceSkipIdx = 0; ifaceSkipIdx < s_skipInterfaceAttributeList.Length; ifaceSkipIdx++) 366if (_editorTypes == null || _editorTypes.Length == _editorCount) 368int newLength = (_editorTypes == null ? 4 : _editorTypes.Length * 2);
System\ComponentModel\TypeConverter.cs (1)
450return _valueArray.Length;
System\ComponentModel\TypeDescriptor.cs (16)
311for (int idx = attrs.Length - 1; idx >= 0; idx--) 429if (argTypes.Length != args.Length) 510for (int attrIdx = 0; attrIdx < attributes.Length; attrIdx++) 1006if (attributes != null && attributes.Length > 0) 1234if (attributes != null && attributes.Length > 0) 1699if (filter == null || filter.Length == 0) 2191for (int idx = 0; idx < s_pipelineFilterKeys.Length; idx++) 2740Attribute[] newArray = new Attribute[existing.Count + newAttrs.Length]; 2744for (int idx = 0; idx < newAttrs.Length; idx++) 2768if (actualCount < newArray.Length) 2801if (_filter.Length != filter.Length) return false; 2803for (int idx = 0; idx < filter.Length; idx++) 3075if (argTypes.Length != args.Length)
System\ComponentModel\TypeListConverter.cs (2)
98objTypes = new object[_types.Length]; 99Array.Copy(_types, objTypes, _types.Length);
System\Drawing\PointConverter.cs (3)
40int[] values = new int[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 48if (values.Length == 2)
System\Drawing\RectangleConverter.cs (3)
40int[] values = new int[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 48if (values.Length != 4)
System\Drawing\SizeConverter.cs (3)
40int[] values = new int[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 48if (values.Length != 2)
System\Drawing\SizeFConverter.cs (3)
40float[] values = new float[tokens.Length]; 42for (int i = 0; i < values.Length; i++) 47if (values.Length != 2)
System.Composition.Convention (4)
System\Composition\Convention\PartConventionBuilder.cs (4)
607if (attributes.Length != 0) 686&& mi.GetParameters().Length == 0) 834int length = candidateConstructor.GetParameters().Length; 853int length = candidateConstructor.GetParameters().Length;
System.Composition.Hosting (9)
System\Composition\Hosting\Core\DependencyAccessor.cs (4)
31var result = new CompositionDependency[all.Length]; 32for (var i = 0; i < all.Length; ++i) 64if (all.Length == 0) 70if (all.Length != 1)
System\Composition\Hosting\Core\ExportDescriptorRegistry.cs (2)
40if (allForExport.Length == 0) 48if (allForExport.Length != 1)
System\Composition\Hosting\Core\LifetimeContext.cs (1)
217if (_sharingBoundaries.Length == 0)
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (2)
31return ci.IsPublic && ps.Length == 1 && ps[0].ParameterType == typeof(IDictionary<string, object>); 43var parameterlessConstructor = ti.DeclaredConstructors.SingleOrDefault(ci => ci.IsPublic && ci.GetParameters().Length == 0);
System.Composition.TypedParts (10)
System\Composition\TypedParts\ActivationFeatures\OnImportsSatisfiedFeature.cs (1)
47m.IsGenericMethodDefinition || m.GetParameters().Length != 0)
System\Composition\TypedParts\ActivationFeatures\PropertyInjectionFeature.cs (1)
37if (imports.Length == 0)
System\Composition\TypedParts\Discovery\DiscoveredPart.cs (5)
106_constructor ??= _partType.DeclaredConstructors.FirstOrDefault(ci => ci.IsPublic && !(ci.IsStatic || ci.GetParameters().Length != 0)); 117for (var i = 0; i < cps.Length; ++i) 172Expression[] paramActivatorCalls = new Expression[cps.Length]; 178for (var i = 0; i < cps.Length; ++i) 224for (int index = 0; index < _partType.GenericTypeParameters.Length; index++)
System\Composition\TypedParts\Discovery\TypeInspector.cs (3)
134var newArray = Array.CreateInstance(valueType, existingArray.Length + 1); 135Array.Copy(existingArray, newArray, existingArray.Length); 136newArray.SetValue(value, existingArray.Length);
System.Console (14)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
80if (TryGetHomeDirectoryFromPasswd(buf, heapBuf.Length, out userHomeDirectory))
System\IO\StdInReader.cs (2)
76int spaceRemaining = _unprocessedBufferToBeRead.Length - _endIndex; 79Array.Resize(ref _unprocessedBufferToBeRead, _unprocessedBufferToBeRead.Length * 2);
System\IO\SyncTextReader.cs (2)
124if (buffer.Length - index < count) 136if (buffer.Length - index < count)
System\TermInfo.cs (4)
272if (args.Length > 0) 275if (args.Length > 1) 382Interop.Sys.SNPrintF(ptr, bytes.Length, format, stringArg) : 383Interop.Sys.SNPrintF(ptr, bytes.Length, format, (int)arg);
System\TermInfo.Database.cs (4)
169if (extendedBeginning + ExtendedHeaderSize >= data.Length) 214if (extendedStringTableEnd > data.Length) 229if (offset < 0 || offset >= data.Length) 307return i >= 0 ? pos + i : buffer.Length;
System.Data.Common (684)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
480internal static bool IsEmptyArray([NotNullWhen(false)] string?[]? array) => (null == array) || (0 == array.Length);
src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (1)
51int limit = ary.Length;
System\Data\ColumnTypeConverter.cs (4)
85for (int i = 0; i < s_types.Length; i++) 115for (int i = 0; i < s_types.Length; i++) 140objTypes = new object[s_types.Length]; 141Array.Copy(s_types, objTypes, s_types.Length);
System\Data\Common\AdapterUtil.Common.cs (6)
58if (0 == value.Length) 766if (index == dataRows.Length) 782Dictionary<string, int> hash = new Dictionary<string, int>(columnNameArray.Length); 784int startIndex = columnNameArray.Length; // lowest non-unique index 785for (int i = columnNameArray.Length - 1; 0 <= i; --i) 805for (int i = startIndex; i < columnNameArray.Length; ++i)
System\Data\Common\BooleanStorage.cs (3)
31for (int i = 0; i < records.Length; i++) 47for (int i = 0; i < records.Length; i++) 62if (records.Length > 0)
System\Data\Common\ByteStorage.cs (3)
103for (int i = 0; i < records.Length; i++) 119for (int i = 0; i < records.Length; i++) 134if (records.Length > 0)
System\Data\Common\CharStorage.cs (3)
30for (int i = 0; i < records.Length; i++) 46for (int i = 0; i < records.Length; i++) 61if (records.Length > 0)
System\Data\Common\DataAdapter.cs (7)
424if ((null == dataTables) || (0 == dataTables.Length) || (null == dataTables[0])) 432if ((1 < dataTables.Length) && ((0 != startRecord) || (0 != maxRecords))) 447for (int i = 0; i < dataTables.Length; ++i) 769for (int i = 0; i < tables.Length; ++i) 776DataTable[] newTables = new DataTable[tables.Length + 1]; // add unique data table 777for (int i = 0; i < tables.Length; ++i) 781newTables[tables.Length] = newTable;
System\Data\Common\DataRecordInternal.cs (14)
33return _schemaInfo.Length; 44int copyLen = (values.Length < _schemaInfo.Length) ? values.Length : _schemaInfo.Length; 112cbytes = data.Length; 144cbytes = data.Length; 152if (bufferIndex < 0 || bufferIndex >= buffer.Length) 164if (cbytes + bufferIndex > buffer.Length) 182int cchars = data.Length; 220cchars = data.Length; 228if (bufferIndex < 0 || bufferIndex >= buffer.Length) 230throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex)); 240if (cchars + bufferIndex > buffer.Length)
System\Data\Common\DataStorage.cs (3)
184for (int i = 0; i < recordNos.Length; i++) 360for (int i = 0; i < s_storageClassType.Length; ++i) 398for (int i = (int)StorageType.SqlBinary; i < s_storageClassType.Length; ++i)
System\Data\Common\DataTableMapping.cs (1)
35if ((null != columnMappings) && (0 < columnMappings.Length))
System\Data\Common\DateTimeOffsetStorage.cs (4)
30for (int i = 0; i < records.Length; i++) 47for (int i = 0; i < records.Length; i++) 63if (records.Length > 0) 71for (int i = 0; i < records.Length; i++)
System\Data\Common\DateTimeStorage.cs (6)
30for (int i = 0; i < records.Length; i++) 47for (int i = 0; i < records.Length; i++) 63if (records.Length > 0) 71for (int i = 0; i < records.Length; i++) 270for (int i = 0; i < _values.Length; i++) 280for (int i = 0; i < _values.Length; i++)
System\Data\Common\DBCommandBuilder.cs (18)
42_baseParameterNames = new string[schemaRows.Length]; 43_originalParameterNames = new string[schemaRows.Length]; 44_nullParameterNames = new string[schemaRows.Length]; 45_isMutatedName = new bool[schemaRows.Length]; 46_count = schemaRows.Length; 57for (int i = 0; i < schemaRows.Length; i++) 110for (int i = 0; i < schemaRows.Length; i++) 170for (int i = 0; i < _baseParameterNames.Length; i++) 223for (int i = 0; i < _baseParameterNames.Length; i++) 257for (int i = 0; i < _baseParameterNames.Length; i++) 632string[] srcColumnNames = new string[schemaRows.Length]; 633for (int i = 0; i < schemaRows.Length; ++i) 659if ((null == rows) || (0 == rows.Length)) 669for (int i = 0; i < rows.Length; ++i) 828string[] parameterName = new string[schemaRows.Length]; 829for (int i = 0; i < schemaRows.Length; ++i) 918for (int i = 0; i < schemaRows.Length; ++i) 1007for (int i = 0; i < schemaRows.Length; ++i)
System\Data\Common\DbConnectionStringBuilder.cs (2)
247for (int i = 0; i < values.Length; ++i) 543if ((null == attributes) || (0 == attributes.Length))
System\Data\Common\DbDataAdapter.cs (16)
581if ((null == dataTables) || (0 == dataTables.Length) || (null == dataTables[0])) 593if ((1 < dataTables.Length) && ((0 != startRecord) || (0 != maxRecords))) 601if (1 == dataTables.Length) 858else if (0 != dataRows.Length) 861for (int i = 0; i < dataRows.Length; ++i) 966Debug.Assert((null != dataRows) && (0 < dataRows.Length), "Update: bad dataRows"); 987int maxBatchCommands = Math.Min(UpdateBatchSize, dataRows.Length); 991maxBatchCommands = dataRows.Length; 1177for (int i = 0; i < batchCommands.Length; ++i) 1256for (int i = 0; i < batchCommands.Length; ++i) 1280for (int i = 0; i < batchCommands.Length; ++i) 1302if (commandCount < rowBatch.Length) 1332for (int i = 0; i < batchCommands.Length; ++i) 1351for (int i = 0; i < connections.Length; ++i) 1453rowUpdatedEvent.Errors = ADP.UpdateConcurrencyViolation(StatementType.Batch, commandCount - rowsInError.Length, commandCount, rowsInError); 1487if ((null != dataRows) && (0 < dataRows.Length))
System\Data\Common\DbDataReader.cs (1)
221bytesRead = GetBytes(ordinal, bytesReadTotal, buffer, 0, buffer.Length);
System\Data\Common\DbEnumerator.cs (2)
66object[] values = new object[_schemaInfo.Length]; 96for (int i = 0; i < si.Length; i++)
System\Data\Common\DBSchemaRow.cs (2)
35DbSchemaRow[] schemaRows = new DbSchemaRow[dataRows.Length]; 37for (int i = 0; i < dataRows.Length; ++i)
System\Data\Common\DBSchemaTable.cs (1)
59private readonly DataColumn?[] _columnCache = new DataColumn[s_DBCOLUMN_NAME.Length];
System\Data\Common\DecimalStorage.cs (3)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0)
System\Data\Common\DoubleStorage.cs (3)
103for (int i = 0; i < records.Length; i++) 119for (int i = 0; i < records.Length; i++) 134if (records.Length > 0)
System\Data\Common\FieldNameLookup.cs (2)
92int length = _fieldNames.Length; 107int length = _fieldNames.Length;
System\Data\Common\Int16Storage.cs (4)
107for (int i = 0; i < records.Length; i++) 124for (int i = 0; i < records.Length; i++) 140if (records.Length > 0) 148for (int i = 0; i < records.Length; i++)
System\Data\Common\Int32Storage.cs (4)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\Int64Storage.cs (3)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0)
System\Data\Common\ObjectStorage.cs (8)
154if (arr1.Length > arr2.Length) 156else if (arr1.Length < arr2.Length) 160for (int i = 0; i < arr1.Length; i++) 310Array.Copy(_values, newValues, Math.Min(capacity, _values.Length)); 375if (_typename.Length == 2) 538for (int i = 0; i < _values.Length; i++)
System\Data\Common\RowUpdatedEventArgs.cs (2)
91return ((null != dataRows) ? dataRows.Length : ((null != _dataRow) ? 1 : 0)); 138if ((null != dataRows) && (1 == dataRows.Length))
System\Data\Common\SByteStorage.cs (3)
103for (int i = 0; i < records.Length; i++) 119for (int i = 0; i < records.Length; i++) 134if (records.Length > 0)
System\Data\Common\SingleStorage.cs (3)
104for (int i = 0; i < records.Length; i++) 120for (int i = 0; i < records.Length; i++) 135if (records.Length > 0)
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (2)
29if (records.Length > 0) 37for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (4)
32for (int i = 0; i < records.Length; i++) 48for (int i = 0; i < records.Length; i++) 63if (records.Length > 0) 71for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLBytesStorage.cs (2)
30if (records.Length > 0) 38for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLByteStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLCharsStorage.cs (2)
30if (records.Length > 0) 38for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (4)
32for (int i = 0; i < records.Length; i++) 49for (int i = 0; i < records.Length; i++) 65if (records.Length > 0) 73for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 145for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLGuidStorage.cs (2)
30if (records.Length > 0) 38for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLInt16Storage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLInt32Storage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLInt64Storage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 122for (int i = 0; i < records.Length; i++) 138if (records.Length > 0) 146for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLSingleStorage.cs (4)
105for (int i = 0; i < records.Length; i++) 121for (int i = 0; i < records.Length; i++) 136if (records.Length > 0) 144for (int i = 0; i < records.Length; i++)
System\Data\Common\SQLTypes\SQLStringStorage.cs (5)
32for (i = 0; i < recordNos.Length; i++) 41for (i++; i < recordNos.Length; i++) 57for (i = 0; i < recordNos.Length; i++) 66for (i++; i < recordNos.Length; i++) 79for (i = 0; i < recordNos.Length; i++)
System\Data\Common\StringStorage.cs (6)
27for (i = 0; i < recordNos.Length; i++) 36for (i++; i < recordNos.Length; i++) 51for (i = 0; i < recordNos.Length; i++) 60for (i++; i < recordNos.Length; i++) 73for (i = 0; i < recordNos.Length; i++) 185Array.Copy(_values, newValues, Math.Min(capacity, _values.Length));
System\Data\Common\TimeSpanStorage.cs (3)
30for (int i = 0; i < records.Length; i++) 46for (int i = 0; i < records.Length; i++) 61if (records.Length > 0)
System\Data\Common\UInt16Storage.cs (4)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\UInt32Storage.cs (4)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0) 147for (int i = 0; i < records.Length; i++)
System\Data\Common\UInt64Storage.cs (3)
106for (int i = 0; i < records.Length; i++) 123for (int i = 0; i < records.Length; i++) 139if (records.Length > 0)
System\Data\ConstraintCollection.cs (11)
97if (1 < _table.NestedParentRelations.Length) 224for (int i = 0; i < columns.Length; i++) 491if (array.Length - index < _list.Count) 539if ((null != constraint) && (constraint.Key.ColumnsReference.Length == 1) && (constraint.Key.ColumnsReference[0] == column)) 565if (a1.Length != a2.Length) 569for (i = 0; i < a1.Length; i++) 572for (j = 0; j < a2.Length; j++) 753for (int i = 0; i < _delayLoadingConstraints.Length; i++) 766colCount = constr._columnNames.Length; 803colCount = constr._parentColumnNames.Length;
System\Data\DataColumn.cs (5)
1236if ((null != o) && (o.ColumnsReference.Length == 1) && (o.ColumnsReference[0] == this)) 1566for (int i = 0; i < parentRelations.Length; i++) 1570if (key.ColumnsReference.Length == 1 && key.ColumnsReference[0] == this) 1717for (int i = 0; i < rows.Length; i++) 1723return (rows.Length > 0);
System\Data\DataColumnCollection.cs (5)
662if (array.Length - index < _list.Count) 929DataColumn[] tempColumns = new DataColumn[columns.Length + 1]; 931tempColumns[columns.Length] = dataColumn; 938DataColumn[] tempColumns = new DataColumn[columns.Length - 1]; 939for (int i = 0, j = 0; i < columns.Length; i++)
System\Data\DataColumnPropertyDescriptor.cs (1)
28attrs[attrs.Length - 1] = new ListBindableAttribute(false);
System\Data\DataError.cs (1)
139if (_count >= _errorList!.Length)
System\Data\DataException.cs (5)
432for (int i = 0; i < keys.Length; i++) 434values += Convert.ToString(keys[i], null) + (i < keys.Length - 1 ? ", " : string.Empty); 441if (columns.Length > 1) 444for (int i = 0; i < columns.Length; i++) 446columnNames += columns[i].ColumnName + (i < columns.Length - 1 ? ", " : "");
System\Data\DataKey.cs (21)
21if (columns.Length == 0) 26if (columns.Length > maxColumns) 31for (int i = 0; i < columns.Length; i++) 39for (int i = 0; i < columns.Length; i++) 53_columns = new DataColumn[columns.Length]; 54for (int i = 0; i < columns.Length; i++) 79for (int i = 1; i < _columns.Length; i++) 106else if (column1.Length != column2.Length) 113for (i = 0; i < column1.Length; i++) 116for (j = 0; j < column2.Length; j++) 135for (int i = 0; i < _columns.Length; i++) 179string[] values = new string[_columns.Length]; 180for (int i = 0; i < _columns.Length; ++i) 189IndexField[] indexDesc = new IndexField[_columns.Length]; 190for (int i = 0; i < _columns.Length; i++) 199object[] values = new object[_columns.Length]; 200for (int i = 0; i < _columns.Length; i++) 217for (int i = 0; i < _columns.Length; i++) 229DataColumn[] values = new DataColumn[_columns.Length]; 230for (int i = 0; i < _columns.Length; ++i)
System\Data\DataRelation.cs (8)
205for (int i = 0; i < values.Length; i++) 651for (int i = 0; i < _parentKey.ColumnsReference.Length; i++) 689if (parentColumns.Length != childColumns.Length) 694for (int i = 0; i < parentColumns.Length; i++) 720int keyLength = _parentKey.ColumnsReference.Length; 778if (0 < ChildTable.NestedParentRelations.Length) 781if (childCols.Length != 1 || !IsAutoGenerated(childCols[0]))
System\Data\DataRelationCollection.cs (3)
295if (array.Length - index < alist.Count) 875for (int i = 0; i < _delayLoadingRelations.Length; i++) 884colCount = rel._parentColumnNames.Length;
System\Data\DataRow.cs (5)
426for (int i = 0; i < values.Length; i++) 440if (_columns.Count < value.Length) 451for (int i = 0; i < value.Length; ++i) 1126for (int i = 0; i < columns.Length; i++) 1241for (int i = 0; i < keyValues.Length; i++)
System\Data\DataRowCollection.cs (1)
73if (_table.NestedParentRelations.Length > 0)
System\Data\DataRowComparer.cs (7)
57(a.Length != b.Length)) 83int length = index1 + a.Length; 99Debug.Assert(a.Length == b.Length); 101for (int i = 0; i < a.Length; ++i) 201else if (array.Length > 0)
System\Data\DataSet.cs (18)
541int[] parentInfo = new int[rel.ParentColumns.Length + 1]; 544for (int j = 1; j < parentInfo.Length; j++) 549int[] childInfo = new int[rel.ChildColumns.Length + 1]; 551for (int j = 1; j < childInfo.Length; j++) 584DataColumn[] parentkeyColumns = new DataColumn[parentInfo.Length - 1]; 585for (int i = 0; i < parentkeyColumns.Length; i++) 591DataColumn[] childkeyColumns = new DataColumn[childInfo.Length - 1]; 592for (int i = 0; i < childkeyColumns.Length; i++) 788if ((dt.NestedParentRelations.Length == 0) || 789(dt.NestedParentRelations.Length == 1 && dt.NestedParentRelations[0].ChildTable == dt)) 1329for (int i = 0; i < bitMatrix.Length; ++i) 1338for (int i = 0; i < bitMatrix.Length; ++i) 1381for (int tableIndex = 0; tableIndex < bitMatrix.Length; ++tableIndex) 3344if (props.Length < propStart + 1) 3583var dataTables = new DataTable[tables.Length]; 3584for (int i = 0; i < tables.Length; i++) 3617if (dataTables.Length == 0) 3622for (int i = 0; i < dataTables.Length; i++)
System\Data\DataTable.cs (61)
531int[] colInfo = new int[uc.Columns.Length]; 532for (int j = 0; j < colInfo.Length; j++) 554int[] parentInfo = new int[fk.RelatedColumns.Length + 1]; 556for (int j = 1; j < parentInfo.Length; j++) 561int[] childInfo = new int[fk.Columns.Length + 1]; 563for (int j = 1; j < childInfo.Length; j++) 604DataColumn[] keyColumns = new DataColumn[keyColumnIndexes.Length]; 605for (int i = 0; i < keyColumnIndexes.Length; i++) 630DataColumn[] parentkeyColumns = new DataColumn[parentInfo.Length - 1]; 631for (int i = 0; i < parentkeyColumns.Length; i++) 638DataColumn[] childkeyColumns = new DataColumn[childInfo.Length - 1]; 639for (int i = 0; i < childkeyColumns.Length; i++) 904if (dcArr.Length > 0) 906int[] columnsInError = new int[dcArr.Length]; 907string[] columnErrors = new string[dcArr.Length]; 908for (int i = 0; i < dcArr.Length; i++) 940Debug.Assert(columnsInError.Length == columnErrors.Length); 941for (int i = 0; i < columnsInError.Length; i++) 1564Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken"); 1565for (int i = 0; i < nRel.Length; i++) 1648if ((value != null) && (value.Length != 0)) 1651for (int i = 0; i < value.Length; i++) 1666if (count != value.Length) 1733for (int i = 0; i < key.ColumnsReference.Length; i++) 1790if (nestedRelations.Length == 0) 1855if (nestedRelations.Length > 0) 1857for (int i = 0; i < nestedRelations.Length; i++) 1868while (j < nestedRelations.Length && ((nestedRelations[j].ParentTable == this) || (visitedTables.Contains(nestedRelations[j].ParentTable)))) 1872if (j < nestedRelations.Length) 2119for (int i = 0; i < keyValues.Length; i++) 2266for (int i = 0; i < cols.Length; i++) 2299for (int i = 0; i < oldRows.Length; ++i) 2437if (pkey.Length > 0) 2439DataColumn[] key = new DataColumn[pkey.Length]; 2440for (int i = 0; i < pkey.Length; i++) 3006for (int i = 0; i < cols.Length; i++) 3266for (int i = 0; i < cols.Length; i++) 3370IndexField[] newIndexDesc = new IndexField[indexDesc.Length]; 3371Array.Copy(indexDesc, newIndexDesc, indexDesc.Length); 3385if (colCount < value.Length) 3392for (int i = 0; i < value.Length; i++) 3403for (int i = value.Length; i < colCount; i++) 3706indexDesc = new IndexField[split.Length]; 3708for (int i = 0; i < split.Length; i++) 3785Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same"); 3786Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 3973for (int i = 0; i < oldRows.Length; i++) 4834if (pkey.Length == 1) 4863if (pkey.Length == 0) 4974if (PrimaryKey.Length == 0) 5013primaryKeyIndex = new int[_primaryKey.ColumnsReference.Length]; 5014for (int i = 0; i < _primaryKey.ColumnsReference.Length; i++) 5020object[] keys = new object[primaryKeyIndex.Length]; 5021for (int i = 0; i < primaryKeyIndex.Length; i++) 5040for (int count = 0; count < values.Length; count++) 5047for (int count = values.Length; count < _columnCollection.Count; count++) 5521for (int j = 0; j < dependency.Length; j++) 6596for (int j = 0; j < dependency.Length; j++)
System\Data\DataTableCollection.cs (1)
559if (array.Length - index < _list.Count)
System\Data\DataTableReader.cs (23)
47if (dataTables.Length == 0) 52_tables = new DataTable[dataTables.Length]; 53for (int i = 0; i < dataTables.Length; i++) 143if ((_tableCounter == _tables.Length - 1)) 364return tempBuffer.Length; 368int byteCount = Math.Min(tempBuffer.Length - srcIndex, length); 371throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, nameof(dataIndex)); 373else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length)) 375throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex)); 427return tempBuffer.Length; 431int charCount = Math.Min(tempBuffer.Length - srcIndex, length); 434throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, nameof(dataIndex)); 436else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length)) 438throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, nameof(bufferIndex)); 680Array.Copy(_currentDataRow!.ItemArray, values, _currentDataRow.ItemArray.Length > values.Length ? values.Length : _currentDataRow.ItemArray.Length); 681return (_currentDataRow.ItemArray.Length > values.Length ? values.Length : _currentDataRow.ItemArray.Length); 826for (int j = 0; j < dependency.Length; j++)
System\Data\DataView.cs (16)
416if (_sort.Length == 0 && _applyDefaultSort && _table != null && _table._primaryIndex.Length > 0) 775for (int i = 0; i < rows.Length; i++) 955if (_table != null && _index != null && _index._indexFields.Length == 1) 962ListSortDirection IBindingList.SortDirection => (_index!._indexFields.Length == 1 && _index._indexFields[0].IsDescending) ? 1126if (_table != null && _index != null && _index._indexFields.Length > 0) 1128sortDescArray = new ListSortDescription[_index._indexFields.Length]; 1129for (int i = 0; i < _index._indexFields.Length; i++) 1158if (listAccessors == null || listAccessors.Length == 0) 1182if (listAccessors == null || listAccessors.Length == 0) 1693if (columnNames.Length == 0) 1696for (int i = 0; i < columnNames.Length; i++) 1702int[] columnIndexes = new int[columnNames.Length]; 1706for (int i = 0; i < columnNames.Length; i++) 1719object[] o = new object[columnNames.Length]; 1721for (int j = 0; j < columnIndexes.Length; j++) 1741for (int j = 0; j < objectArray.Length; j++)
System\Data\DataViewManager.cs (2)
267if (listAccessors == null || listAccessors.Length == 0) 290if (listAccessors == null || listAccessors.Length == 0)
System\Data\DBConcurrencyException.cs (2)
53return (((null != rows) && (0 < rows.Length)) ? rows[0] : null); 66return ((null != dataRows) ? dataRows.Length : 0);
System\Data\FillErrorEventArgs.cs (2)
37object?[] copy = new object?[_values.Length]; 38for (int i = 0; i < _values.Length; ++i)
System\Data\Filter\AggregateNode.cs (1)
199for (int i = 0; i < rows.Length; i++)
System\Data\Filter\ExpressionParser.cs (11)
1059if (_pos + 1 < text.Length && charsToEscape.Contains(text[_pos + 1])) 1065} while (_pos < text.Length && text[_pos] != chEnd); 1067if (_pos >= text.Length) 1086do _pos++; while (_pos < text.Length && text[_pos] != '#'); 1088if (_pos >= text.Length || text[_pos] != '#') 1091if (_pos >= text.Length) 1121int hi = s_reservedwords.Length - 1; 1153while (_pos < text.Length) 1157if (ch == escape && _pos < text.Length && text[_pos] == escape) 1165if (_pos >= text.Length) 1184while (_pos < text.Length && IsWhiteSpace(text[_pos]))
System\Data\Filter\FunctionNode.cs (3)
52for (int i = 0; i < s_funcs.Length; i++) 76else if (_argumentCount == _arguments.Length) 123Debug.Assert(_info < s_funcs.Length && _info >= 0, "Invalid function info.");
System\Data\Filter\Operators.cs (1)
222if ((uint)op < (uint)s_looks.Length)
System\Data\ForeignKeyConstraint.cs (30)
161for (int i = 0; i < values.Length; i++) 179for (int i = 0; i < uniqueChildKeys.Length; i++) 189for (int j = 0; j < rows.Length; j++) 211for (int i = 0; i < uniqueChildKeys.Length; i++) 301for (int j = 0; j < rows.Length; j++) 314object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 315for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 321for (int j = 0; j < rows.Length; j++) 333object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 334for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 340for (int j = 0; j < rows.Length; j++) 376for (int j = 0; j < rows.Length; j++) 442for (int j = 0; j < rows.Length; j++) 454object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 455for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 461for (int j = 0; j < rows.Length; j++) 472object[] proposedKey = new object[_childKey.ColumnsReference.Length]; 473for (int i = 0; i < _childKey.ColumnsReference.Length; i++) 479for (int j = 0; j < rows.Length; j++) 512if (DataRelation.GetChildRows(ParentKey, ChildKey, row, DataRowVersion.Default).Length > 0) 603for (lo = 0; lo < childValues.Length; lo++) 612if (lo == childValues.Length) 636for (int i = 0; i < _parentKey.ColumnsReference.Length; i++) 720int keys = Columns.Length; 760int keys = Columns.Length; 798if (parentColumns.Length == 0 || childColumns.Length == 0) 802if (parentColumns.Length != childColumns.Length) 807for (int i = 0; i < parentColumns.Length; i++)
System\Data\LinqDataView.cs (2)
153else if (base.SortComparison != null && key.Length != sortExpressionBuilder!.Count) 193else if (base.SortComparison != null && key.Length != sortExpressionBuilder!.Count)
System\Data\Merger.cs (16)
244for (int i = 0; i < rows.Length; i++) 405if (targetPKey.Length != tablePKey.Length) 409if (targetPKey.Length == 0) 411DataColumn[] key = new DataColumn[tablePKey.Length]; 412for (int i = 0; i < tablePKey.Length; i++) 418else if (tablePKey.Length != 0) 425for (int i = 0; i < targetPKey.Length; i++) 536if (relation.ParentKey.ColumnsReference.Length != destRelation.ParentKey.ColumnsReference.Length) 542for (int i = 0; i < relation.ParentKey.ColumnsReference.Length; i++) 578DataColumn[] parentColumns = new DataColumn[relation.ParentKey.ColumnsReference.Length]; 579DataColumn[] childColumns = new DataColumn[relation.ParentKey.ColumnsReference.Length]; 580for (int i = 0; i < relation.ParentKey.ColumnsReference.Length; i++) 637DataColumn[] srcColumns = new DataColumn[dstColumns.Length]; 638for (int j = 0; j < dstColumns.Length; j++)
System\Data\ProviderBase\SchemaMapping.cs (28)
201bool[] readOnly = new bool[mapped.Length]; 202for (int i = 0; i < readOnly.Length; ++i) 212for (int i = 0; i < readOnly.Length; ++i) 220for (int i = 0; i < mapped.Length; ++i) 232for (int i = 0; i < readOnly.Length; ++i) 284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length"); 299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length"); 314for (int i = 0; i < _xmlMap.Length; ++i) 390for (int i = 0; i < _readerDataValues!.Length; ++i) 439for (int i = 0; i < _chapterMap!.Length; ++i) 458int rowLength = _chapterMap!.Length; 513for (int i = 0; i < fieldNames.Length; ++i) 524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray"); 657for (int x = 0; x < _xmlMap.Length; ++x) 770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount"); 772if (0 == schemaRows.Length) 780bool addPrimaryKeys = (((0 == _dataTable.PrimaryKey.Length) && ((4 <= (int)_loadOption) || (0 == _dataTable.Rows.Count))) 803for (int sortedIndex = 0; sortedIndex < schemaRows.Length; ++sortedIndex) 825chapterIndexMap = new bool[schemaRows.Length]; 834_xmlMap = new int[schemaRows.Length]; 843_xmlMap = new int[schemaRows.Length]; 859columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex); 891for (int x = 0; x < _xmlMap.Length; ++x) 1022keys ??= new DataColumn[schemaRows.Length]; 1039columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex); 1076if (keyCount < keys.Length) 1112dataValues = SetupMapping(schemaRows.Length, columnCollection, chapterColumn, chapterValue);
System\Data\RbTree.cs (14)
125_pageTableMap = new int[(_pageTable.Length + TreePage.slotLineSize - 1) / TreePage.slotLineSize]; // Ceiling(size) 165TreePage[] newPageTable = new TreePage[_pageTable.Length * 2]; 166Array.Copy(_pageTable, newPageTable, _pageTable.Length); 167int[] newPageTableMap = new int[(newPageTable.Length + TreePage.slotLineSize - 1) / TreePage.slotLineSize]; 168Array.Copy(_pageTableMap, newPageTableMap, _pageTableMap.Length); 170_nextFreePageLine = _pageTableMap.Length; 171freePageIndex = _pageTable.Length; 262else if (page.InUseCount == page._slots.Length - 1) 277while (pageTableMapPos < _pageTableMap.Length) 1636if (array.Length - index < Count) 1660if (array.Length - index < Count) 1979if (_inUseCount < _slots.Length) 1982while (segmentPos < _slotMap.Length) 1993if (_inUseCount == _slots.Length) // mark page as full
System\Data\RecordManager.cs (5)
39Array.Copy(_rows, newRows, Math.Min(_lastFreeRecord, _rows.Length)); 185Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 190Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 197for (int i = 0; i < keyValues.Length; i++) 263_lastFreeRecord = _rows.Length;
System\Data\RelatedView.cs (3)
127if (value1.Length != value2.Length) 131for (int i = 0; i < value1.Length; i++)
System\Data\Select.cs (20)
185if (fields.Length < _indexFields.Length) 188for (int i = 0; i < fields.Length && j < _indexFields.Length; i++) 201return j == _indexFields.Length; 239int count = (fields.Length < _nCandidates ? fields.Length : _nCandidates); 303for (int i = 0; i < depColumns.Length; i++) 328int lenCanColumns = _candidateColumns.Length; 329int lenIndexDesc = _indexFields.Length; 380for (i = 0; i < _candidateColumns.Length; i++) 442for (i = 0; i < _candidateColumns.Length; i++) 479int lenId = fields.Length; 490int lenCanColumns = _candidateColumns.Length; 526for (int i = 0; i < _candidateColumns.Length; i++) 545if (_index == null && (_indexFields.Length > 0 || _linearExpression == _expression)) 583_recordCount = _records.Length; 595for (int i = 0; i < newRows.Length; i++) 797Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 864int lenIndexDesc = _indexFields.Length;
System\Data\Selection.cs (22)
102for (int i = 0; i < fields.Length; ++i) 146_indexFields.Length != indexDesc.Length || 153for (int loop = 0; loop < _indexFields.Length; loop++) 310if (0 < _indexFields.Length) 312for (int i = 0; i < _indexFields.Length; i++) 354for (int i = 0; i < _indexFields.Length; i++) 388for (int i = 0; i < _indexFields.Length; i++) 495if (_indexFields == null || _indexFields.Length == 0) 539if (_indexFields.Length != 1) 541throw ExceptionBuilder.IndexKeyLength(_indexFields.Length, 1); 579c = ((null != originalKey) ? originalKey.Length : 0); 580if (originalKey is null || 0 == c || _indexFields.Length != c) 582throw ExceptionBuilder.IndexKeyLength(_indexFields.Length, c); 590object?[] key = new object?[originalKey.Length]; 591for (int i = 0; i < originalKey.Length; ++i) 704if (0 < newRows.Length) 707for (int i = 0; i < newRows.Length && iterator.MoveNext(); i++) 721bool append = (0 == _indexFields.Length); 793if ((0 == _indexFields.Length) && (null != _table)) 1016object[] element = new object[_indexFields.Length]; // number of columns in PK 1017for (int j = 0; j < element.Length; ++j)
System\Data\SQLTypes\SQLBinary.cs (19)
32_value = new byte[value.Length]; 66var value = new byte[_value.Length]; 95return _value.Length; 118public override string ToString() => _value is null ? SQLResource.NullString : $"SqlBinary({_value.Length})"; 134byte[] rgbResult = new byte[x.Value.Length + y.Value.Length]; 136y.Value.CopyTo(rgbResult, x.Value.Length); 147int len = (x.Length < y.Length) ? x.Length : y.Length; 161if (x.Length == y.Length) 169if (x.Length < y.Length) 172for (i = len; i < y.Length; ++i) 181for (i = len; i < x.Length; ++i) 379Debug.Assert(rgbValue.Length >= length); 405int cbLen = _value.Length;
System\Data\SQLTypes\SQLBytes.cs (13)
78_lCurLen = _rgbBuf.Length; 153_ => (_rgbBuf == null) ? -1L : _rgbBuf.Length, 269ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _rgbBuf.Length); 311ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 349if (offset > _rgbBuf.Length) 352if (buffer.Length > _rgbBuf.Length - offset) 377if (offset > _rgbBuf.Length) 381ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length); 384ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 386if (count > _rgbBuf.Length - offset) 468Debug.Assert(FStream() || (_rgbBuf != null && _lCurLen <= _rgbBuf.Length)); 484if (_rgbBuf == null || _rgbBuf.Length < lStreamLen) 508_lCurLen = (_rgbBuf == null) ? x_lNull : _rgbBuf.Length;
System\Data\SQLTypes\SQLChars.cs (17)
72_lCurLen = _rgchBuf.Length; 152_ => (_rgchBuf == null) ? -1L : _rgchBuf.Length, 274ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _rgchBuf.Length); 300ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length); 304ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 348if (offset > _rgchBuf.Length) 352ArgumentOutOfRangeException.ThrowIfGreaterThan(offsetInBuffer, buffer.Length); 355ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offsetInBuffer); 357if (count > _rgchBuf.Length - offset) 433Debug.Assert(FStream() || (_rgchBuf != null && _lCurLen <= _rgchBuf.Length)); 436Debug.Assert(_rgchWorkBuf == null || _rgchWorkBuf.Length == 1); 456if (_rgchBuf == null || _rgchBuf.Length < lStreamLen) 473_lCurLen = (_rgchBuf == null) ? x_lNull : _rgchBuf.Length; 650ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 652ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset); 666ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 668ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Data\SQLTypes\SQLDecimal.cs (2)
588if (bits.Length != 4) 1002int cwchStr = rgwchStr.Length;
System\Data\SQLTypes\SQLGuid.cs (1)
33if (value == null || value.Length != SizeOfGuid)
System\Data\SQLTypes\SQLString.cs (5)
140: this(lcid, compareOptions, data, 0, data.Length, fUnicode) 156: this(lcid, compareOptions, data, 0, data.Length, true) 723int cbX = rgDataX.Length; 724int cbY = rgDataY.Length; 917return SqlBinary.HashByteArray(rgbSortKey, rgbSortKey.Length);
System\Data\SQLTypes\SqlXml.cs (4)
399ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 401ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset); 435ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 437ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Data\TypeLimiter.cs (1)
248for (int i = 0; i < appDomainAllowedTypes.Length; i++)
System\Data\UniqueConstraint.cs (8)
143DataColumn[] sortIndexColumns = new DataColumn[_constraintIndex._indexFields.Length]; 144for (int i = 0; i < sortIndexColumns.Length; i++) 226for (int i = 0; i < uniqueKeys.Length; i++) 233for (int j = 0; j < rows.Length; j++) 292int keys = ColumnsReference.Length; 317int keys = ColumnsReference.Length; 377for (int i = 0; i < columns.Length; i++) 410if (_key.ColumnsReference.Length == 1)
System\Data\XDRSchema.cs (2)
273for (int i = 1; i < s_mapNameTypeXdr.Length; ++i) 592int keyLength = list.Length;
System\Data\XmlDataLoader.cs (3)
819for (int i = foundColumns.Length - 1; i >= 0; --i) 1059for (int i = foundColumns.Length - 1; i >= 0; --i) 1086for (int i = foundColumns.Length - 1; i >= 0; --i)
System\Data\xmlsaver.cs (24)
662if (top.Length == 0 || _schFormat == SchemaFormat.WebServiceSkipSchema || _schFormat == SchemaFormat.RemotingSkipSchema) 695for (int i = 0; i < top.Length; i++) 782for (int i = 0; i < rels.Length; ++i) 1167if (1 < key.Length) 1171for (int i = 1; i < key.Length; i++) 1181if (1 < key.Length) 1192for (int i = 1; i < key.Length; i++) 1391if (nestedParentRelations.Length != 0) 1393for (int i = 0; i < nestedParentRelations.Length; i++) 1636if (rel.ChildColumnsReference.Length != 1) 1642if (rel.ParentColumnsReference.Length != 1) 1668if (unique.Key.ColumnsReference.Length != 1) 1704if (fk.RelatedColumnsReference.Length != 1) 1740if (nestedParentRelations.Length == 0) 1746for (int i = 0; i < nestedParentRelations.Length; i++) 1799if (childRelations[j].Nested && childRelations[j].ParentKey.ColumnsReference.Length == 1 && childRelations[j].ParentKey.ColumnsReference[0] == col) 2024if (0 < fields.Length) 2027for (int k = 0; k < fields.Length; k++) 2092if (0 < fields.Length) 2095for (int k = 0; k < fields.Length; k++) 2176if (0 < fields.Length) 2179for (int k = 0; k < fields.Length; k++) 2496if ((state == DataRowState.Deleted) && (row.Table.NestedParentRelations.Length != 0)) 2836int countTopTable = _topLevelTables.Length;
System\Data\XMLSchema.cs (21)
265for (int i = 0; i < attrs.Length; i++) 325for (int i = 0; i < attrs.Length; i++) 366for (int i = 0; i < attrs.Length; i++) 386for (int i = 0; i < nodeAttributes.Length; i++) 470keyLength = parentNames.Length; 471if (keyLength != childNames.Length) 810if (dt.NestedParentRelations.Length == 0 && dt.Namespace == ds.Namespace) 865for (int i = 0; i < relations.Length; i++) 1178colName = split[split.Length - 1]; 1410if (0 < key.Length) 1428for (int i = 0; i < key.Length; i++) 1779for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 1845for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 1893for (int i = 1; i < s_mapNameTypeXsd.Length; ++i) 2024for (int i = 0; i < attrs.Length; i++) 2137for (int i = 0; i < attrs.Length; i++) 2734for (int i = 0; i < qualifiedNames.Length; i++) 2750for (int i = 0; i < qualifiedNames.Length; i++) 2766string QualifiedTableName = split[split.Length - 1]; //get the last string after '/' and ':' 2785string tableName = split[split.Length - 1]; //get the last string after '/' and ':' 2802for (int i = 0; i < attribs.Length; i++)
System\Xml\XmlDataDocument.cs (4)
829if (relations.Length == 0) 1259for (int i = 0; i < orderedTables.Length; i++) 1734for (int i = 0; i < columns.Length; i++) 2959if (relations.Length != 0 && relations[0].ParentTable == parentRow.Table) // just backward compatible
System.Diagnostics.DiagnosticSource (25)
System\Diagnostics\DiagnosticSourceEventSource.cs (1)
1109if (property.GetMethod == null || property.GetMethod!.GetParameters().Length > 0)
System\Diagnostics\Metrics\AggregatorStore.cs (5)
337switch (instructions.Length) 381string[] labelNames = new string[instructions.Length]; 382for (int i = 0; i < instructions.Length; i++) 453for (int i = 0; i < _instructions.Length; i++) 503for (int i = 0; i < labels.Length; i++)
System\Diagnostics\Metrics\CounterAggregator.cs (1)
41% deltas.Length];
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (3)
98QuantileValue[] quantiles = new QuantileValue[_config.Quantiles.Length]; 100if (nextQuantileIndex == _config.Quantiles.Length) 120if (nextQuantileIndex == _config.Quantiles.Length)
System\Diagnostics\Metrics\Measurement.cs (1)
46_tags = new KeyValuePair<string, object?>[tags.Length];
System\Diagnostics\Metrics\MetricsEventSource.cs (4)
724for (int i = 0; i < labels.Length; i++) 727if (i != labels.Length - 1) 738for (int i = 0; i < quantiles.Length; i++) 745if (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\StringSequence.netcore.cs (1)
48for (int i = 0; i < _values.Length; i++)
System\Diagnostics\Metrics\TagList.cs (5)
118Debug.Assert(index < _overflowTags.Length); 147Debug.Assert(index < _overflowTags.Length); 184if (_tagsCount == _overflowTags.Length) 268if ((uint)arrayIndex >= array.Length) 303if (_tagsCount == _overflowTags.Length)
System.Diagnostics.Process (18)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (2)
166if (bytesConsumed < bytes.Length) 346if (postSeparatorlineParts.Length < 3)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (4)
130int read = fileStream.Read(bytes, count, bytes.Length - count); 138if (count >= bytes.Length) 140byte[] temp = ArrayPool<byte>.Shared.Rent(bytes.Length * 2); 141Array.Copy(bytes, temp, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (5)
31setUser ? 1 : 0, userId, groupId, pGroups, groups?.Length ?? 0, 38FreeArray(envpPtr, envp.Length); 39FreeArray(argvPtr, argv.Length); 52nuint arrLength = (nuint)arr.Length + 1; // +1 is for null termination 63for (int i = 0; i < arr.Length; i++)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
System\Diagnostics\Process.cs (2)
1100Process[] processes = new Process[processInfos.Length]; 1101for (int i = 0; i < processInfos.Length; i++)
System\Diagnostics\Process.Linux.cs (1)
168_processInfo.HandleCount = Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly).Length;
System\Diagnostics\Process.Unix.cs (1)
1008if (TryGetPasswd(userName, buf, heapBuf.Length, out passwd))
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\DelimitedListTraceListener.cs (1)
149for (int i = 0; i < data.Length; i++)
System\Diagnostics\XmlWriterTraceListener.cs (2)
94WriteEscaped(args != null && args.Length != 0 ? string.Format(CultureInfo.InvariantCulture, format!, args) : format); 136for (int i = 0; i < data.Length; i++)
System.Diagnostics.TraceSource (2)
System\Diagnostics\TraceListeners.cs (1)
90for (int i = 0; ((i) < (value.Length)); i = ((i) + (1)))
System\Diagnostics\TraceUtils.cs (1)
25for (int i = 0; i < supportedAttributes.Length; i++)
System.Formats.Asn1 (11)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
System\Formats\Asn1\AsnCharacterStringEncodings.cs (5)
115new Span<byte>(bytes, byteIndex, bytes.Length - byteIndex), 150new Span<char>(chars, charIndex, chars.Length - charIndex), 232if (c >= isAllowed.Length) 265if ((uint)c >= (uint)_isAllowed.Length || !_isAllowed[c]) 293if ((uint)b >= (uint)_isAllowed.Length || !_isAllowed[b])
System\Formats\Asn1\AsnDecoder.BitString.cs (1)
297ret[ret.Length - 1] = normalizedLastByte;
System\Formats\Asn1\AsnDecoder.Oid.cs (2)
143Array.Clear(tmpBytes, 0, tmpBytes.Length); 175int bytesWritten = tmpBytes.Length - writeSpan.Length;
System\Formats\Asn1\AsnWriter.Boolean.cs (1)
35Debug.Assert(_offset < _buffer.Length);
System\Formats\Asn1\AsnWriter.cs (1)
268if (_buffer == null || _buffer.Length - _offset < pendingCount)
System.Formats.Cbor (1)
System\Formats\Cbor\Writer\CborWriter.cs (1)
238int currentCapacity = _buffer.Length;
System.Formats.Tar (3)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
17if (buffer.Length < min) 19int newCapacity = buffer.Length * 2;
System.IO.Compression (58)
System\IO\Compression\Crc32Helper.ZLib.cs (1)
14Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0) && (offset <= buffer.Length - length));
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (3)
125int bytes = _stream!.Read(_buffer, 0, _buffer.Length); 130else if (bytes > _buffer.Length) 217else if (bytesRead > _buffer.Length)
System\IO\Compression\DeflateManaged\HuffmanTree.cs (9)
49codeLengths.Length == MaxLiteralTreeElements || 50codeLengths.Length == MaxDistTreeElements || 51codeLengths.Length == NumberOfCodeLengthTreeElements, 55if (_codeLengthArray.Length == MaxLiteralTreeElements) 71_left = new short[2 * _codeLengthArray.Length]; 72_right = new short[2 * _codeLengthArray.Length]; 135for (int i = 0; i < _codeLengthArray.Length; i++) 155short avail = (short)_codeLengthArray.Length; 157for (int ch = 0; ch < _codeLengthArray.Length; ch++)
System\IO\Compression\DeflateManaged\InputBuffer.cs (2)
166Debug.Assert(offset <= output.Length - length); 205Debug.Assert(offset <= buffer.Length - length);
System\IO\Compression\DeflateZLib\Deflater.cs (5)
172Debug.Assert(outputBuffer?.Length > 0); 179_zlibStream.AvailOut = (uint)outputBuffer.Length; 182bytesRead = outputBuffer.Length - (int)_zlibStream.AvailOut; 192Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 204Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!");
System\IO\Compression\DeflateZLib\DeflateStream.cs (10)
279int n = _stream.Read(_buffer, 0, _buffer.Length); 293else if (n > _buffer.Length) 424int n = await _stream.ReadAsync(new Memory<byte>(_buffer, 0, _buffer.Length), cancellationToken).ConfigureAwait(false); 438else if (n > _buffer.Length) 905int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length); 918await _deflateStream._stream.CopyToAsync(this, _arrayPoolBuffer.Length, _cancellationToken).ConfigureAwait(false); 941int bytesRead = _deflateStream._inflater.Inflate(_arrayPoolBuffer, 0, _arrayPoolBuffer.Length); 954_deflateStream._stream.CopyTo(this, _arrayPoolBuffer.Length); 975else if (count > buffer.Length - offset) 1024else if (count > buffer.Length - offset)
System\IO\Compression\DeflateZLib\Inflater.cs (1)
187Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length);
System\IO\Compression\ZipArchiveEntry.cs (14)
143if (_storedEntryNameBytes.Length > ushort.MaxValue) 464Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 537writer.Write((ushort)_storedEntryNameBytes.Length); // File Name Length (2 bytes) 540Debug.Assert(_fileComment.Length <= ushort.MaxValue); 542writer.Write((ushort)_fileComment.Length); 556if (_fileComment.Length > 0) 582for (int i = 0; i < _compressedBytes.Length - 1; i++) 586_compressedBytes[_compressedBytes.Length - 1] = new byte[_compressedSize % MaxSingleBufferSize]; 590for (int i = 0; i < _compressedBytes.Length - 1; i++) 594ZipHelper.ReadBytes(_archive.ArchiveStream, _compressedBytes[_compressedBytes.Length - 1], (int)(_compressedSize % MaxSingleBufferSize)); 849Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 934writer.Write((ushort)_storedEntryNameBytes.Length); 984_archive.ArchiveStream.Write(compressedBytes, 0, compressedBytes.Length); 1059+ _storedEntryNameBytes.Length + Zip64ExtraField.OffsetToFirstField,
System\IO\Compression\ZipBlocks.cs (3)
609Debug.Assert(archiveComment.Length <= ZipFileCommentMaxLength); 611writer.Write((ushort)archiveComment.Length); // zip file comment length 612if (archiveComment.Length > 0)
System\IO\Compression\ZipHelper.cs (10)
123Debug.Assert(bufferPointer < buffer.Length); 138bytesRead += buffer.Length; 162int numBytesToSkip = (int)Math.Min(numBytesLeft, buffer.Length); 174if (stream.Position >= buffer.Length) 176stream.Seek(-buffer.Length, SeekOrigin.Current); 177ReadBytes(stream, buffer, buffer.Length); 178stream.Seek(-buffer.Length, SeekOrigin.Current); 179bufferPointer = buffer.Length - 1; 229Debug.Assert(totalCodePoints <= bytes.Length); 235return maxBytes < bytes.Length ? bytes[0..maxBytes] : bytes;
System.IO.Compression.Brotli (3)
System\IO\Compression\dec\BrotliStream.Decompress.cs (3)
66int bytesRead = _stream.Read(_buffer, _bufferCount, _buffer.Length - _bufferCount); 77if (_bufferCount > _buffer.Length) 165if (_bufferCount > _buffer.Length)
System.IO.Compression.ZipFile (2)
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
17if (buffer.Length < min) 19int newCapacity = buffer.Length * 2;
System.IO.FileSystem.DriveInfo (2)
System\IO\DriveInfo.UnixOrDefault.cs (2)
16DriveInfo[] info = new DriveInfo[mountPoints.Length]; 17for (int i = 0; i < info.Length; i++)
System.IO.FileSystem.Watcher (11)
System\IO\FileSystemWatcher.cs (5)
395if (filters.Length == 0) 727ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)index, (uint)items.Length, nameof(index)); 738public int Count => Items.Length; 761string[] newItems = new string[items.Length + 1]; 777string[] newItems = new string[items.Length - 1];
System\IO\FileSystemWatcher.Linux.cs (6)
286Debug.Assert(_buffer != null && _buffer.Length > (c_INotifyEventSize + NAME_MAX + 1)); 789Debug.Assert(_buffer.Length > 0); 790Debug.Assert(_bufferAvailable >= 0 && _bufferAvailable <= _buffer.Length); 804_bufferAvailable = Interop.CheckIo(Interop.Sys.Read(_inotifyHandle, buf, this._buffer.Length)); 805Debug.Assert(_bufferAvailable <= this._buffer.Length); 856Debug.Assert(nameLength >= 0 && (position + nameLength) <= _buffer.Length);
System.IO.Hashing (1)
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (1)
114int read = stream.Read(buffer, 0, buffer.Length);
System.IO.IsolatedStorage (9)
src\libraries\Common\src\System\Security\IdentityHelper.cs (3)
37if (publicKey == null || publicKey.Length == 0) 79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 84l = buff.Length;
System\IO\IsolatedStorage\IsolatedStorageFile.cs (6)
693if (dirs.Length > 1 || (dirs.Length > 0 && !IsMatchingScopeDirectory(dirs[0]))) 699if (files.Length == 0) 707return ((files.Length > 1) || !IsIdFile(files[0])); 709return (files.Length > 2 || 712(files.Length == 2 && !IsIdFile(files[1]) && !IsInfoFile(files[1]))
System.IO.Pipelines (3)
System\IO\Pipelines\BufferSegmentStack.cs (3)
30if ((uint)size >= (uint)array.Length) 48if ((uint)size < (uint)array.Length) 63Array.Resize(ref _array, 2 * _array.Length);
System.IO.Pipes (1)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
System.Linq (81)
System\Linq\AppendPrepend.SpeedOpt.cs (1)
247index = array.Length;
System\Linq\Chunk.cs (10)
53return array.Length != 0 ? 64while (index < source.Length) 66TSource[] chunk = new ReadOnlySpan<TSource>(source, index, Math.Min(size, source.Length - index)).ToArray(); 67index += chunk.Length; 92if (size != array.Length) 97if (i >= array.Length) 99arraySize = (int)Math.Min((uint)size, 2 * (uint)array.Length); 111Debug.Assert(local.Length == size); 112for (; (uint)i < (uint)local.Length && e.MoveNext(); i++) 118if (i != array.Length)
System\Linq\Concat.SpeedOpt.cs (2)
79secondCollection.CopyTo(result, result.Length - secondCount); 236int arrayIndex = array.Length; // We start copying in collection-sized chunks from the end of the array.
System\Linq\DebugView.cs (1)
40if (array.Length == 0)
System\Linq\DefaultIfEmpty.cs (1)
21if (source is TSource[] { Length: > 0 })
System\Linq\DefaultIfEmpty.SpeedOpt.cs (1)
16return array.Length == 0 ? [_default] : array;
System\Linq\Enumerable.cs (1)
25source is TSource[] { Length: 0 };
System\Linq\Grouping.cs (2)
372if (_elements.Length == _count) 383if (_elements.Length != _count)
System\Linq\Lookup.cs (6)
207for (Grouping<TKey, TElement>? g = _groupings[(uint)hashCode % _groupings.Length]; g is not null; g = g._hashNext) 217if (_count == _groupings.Length) 222int index = hashCode % _groupings.Length; 270ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length); 271ArgumentOutOfRangeException.ThrowIfLessThan(array.Length - arrayIndex, Count, nameof(arrayIndex)); 318ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length);
System\Linq\OrderedEnumerable.cs (11)
18private protected int[] SortedMap(TElement[] buffer) => GetEnumerableSorter().Sort(buffer, buffer.Length); 21GetEnumerableSorter().Sort(buffer, buffer.Length, minIdx, maxIdx); 132Debug.Assert(_map.Length == _buffer.Length); 136if ((uint)i < (uint)map.Length) 146if (buffer.Length != 0) 207if ((uint)i < (uint)buffer.Length) 217if (buffer.Length != 0) 405for (int i = 0; i < keys.Length; i++) 516while (i < map.Length && CompareKeys(x, map[i]) > 0) 586while (i < map.Length && CompareKeys(x, map[i]) > 0)
System\Linq\OrderedEnumerable.SpeedOpt.cs (21)
18if (buffer.Length <= 1) 23TElement[] array = new TElement[buffer.Length]; 32List<TElement> list = new(buffer.Length); 33if (buffer.Length >= 2) 35Fill(buffer, SetCountAndGetSpan(list, buffer.Length)); 37else if (buffer.Length == 1) 67if (buffer.Length <= minIdx) 72if (buffer.Length <= maxIdx) 74maxIdx = buffer.Length - 1; 79return [GetEnumerableSorter().ElementAt(buffer, buffer.Length, minIdx)]; 92if (buffer.Length <= minIdx) 97if (buffer.Length <= maxIdx) 99maxIdx = buffer.Length - 1; 104return new List<TElement>(1) { GetEnumerableSorter().ElementAt(buffer, buffer.Length, minIdx) }; 154if (index < buffer.Length) 157return GetEnumerableSorter().ElementAt(buffer, buffer.Length, index); 222if (minIdx < buffer.Length) 225return (maxIdx < buffer.Length - 1) ? 226GetEnumerableSorter().ElementAt(buffer, buffer.Length, maxIdx) : 241for (int i = 1; i < items.Length; ++i) 483int count = buffer.Length;
System\Linq\Reverse.cs (1)
64_state = buffer.Length + 2;
System\Linq\Reverse.SpeedOpt.cs (2)
45if (index < array.Length) 48return array[array.Length - index - 1];
System\Linq\Select.cs (4)
35if (array.Length == 0) 163Debug.Assert(source.Length > 0); // Caller should check this beforehand and return a cached result 168private int CountForDebugger => _source.Length; 176if ((uint)index < (uint)source.Length)
System\Linq\Select.SpeedOpt.cs (11)
139Debug.Assert(source.Length > 0); 141var results = new TResult[source.Length]; 150Debug.Assert(source.Length > 0); 152var results = new List<TResult>(source.Length); 153Fill(source, SetCountAndGetSpan(results, source.Length), _selector); 179return _source.Length; 185if (count >= _source.Length) 196return count >= _source.Length ? 204if ((uint)index < (uint)source.Length) 216Debug.Assert(_source.Length > 0); // See assert in constructor 224Debug.Assert(_source.Length > 0); // See assert in constructor
System\Linq\Where.cs (5)
31if (array.Length == 0) 160Debug.Assert(source is not null && source.Length > 0); 174while ((uint)index < (uint)source.Length) 263Debug.Assert(source is not null && source.Length > 0); 279while ((uint)index < (uint)source.Length)
System\Linq\Where.SpeedOpt.cs (1)
237for (int i = source.Length - 1; i >= 0; i--)
System.Linq.Expressions (301)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
System\Dynamic\BinaryOperationBinder.cs (1)
66ContractUtils.Requires(args.Length == 1, nameof(args));
System\Dynamic\ConvertBinder.cs (1)
66ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\DeleteMemberBinder.cs (1)
71ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\DynamicMetaObject.cs (2)
258Expression[] res = new Expression[objects.Length]; 259for (int i = 0; i < objects.Length; i++)
System\Dynamic\DynamicMetaObjectBinder.cs (5)
55ArgumentOutOfRangeException.ThrowIfZero(args.Length); 57ArgumentOutOfRangeException.ThrowIfNotEqual(args.Length, parameters.Count); 140if (args.Length != 1) 142mos = new DynamicMetaObject[args.Length - 1]; 143for (int i = 1; i < args.Length; i++)
System\Dynamic\DynamicObject.cs (3)
443var paramArgs = new Expression[args.Length]; 445for (int i = 0; i < args.Length; i++) 461for (int i = 0; i < args.Length; i++)
System\Dynamic\ExpandoClass.cs (6)
68if (string.Equals(klass._keys[klass._keys.Length - 1], newKey, StringComparison.Ordinal)) 76string[] keys = new string[_keys.Length + 1]; 77Array.Copy(_keys, keys, _keys.Length); 78keys[_keys.Length] = newKey; 123for (int i = 0; i < _keys.Length; i++) 153for (int i = _keys.Length - 1; i >= 0; i--)
System\Dynamic\ExpandoObject.cs (15)
405for (int i = 0; i < data.Class.Keys.Length; i++) 437for (int i = 0, n = _expandoData.Class.Keys.Length; i < n; i++) 534for (int i = 0; i < data.Class.Keys.Length; i++) 555for (int i = 0; i < data.Class.Keys.Length; i++) 588for (int i = 0; i < data.Class.Keys.Length; i++) 693for (int i = 0, n = data.Class.Keys.Length; i < n; i++) 753for (int i = 0; i < data.Class.Keys.Length; i++) 907for (int i = 0; i < klass.Keys.Length; i++) 1064internal int Length => _dataArray.Length; 1095if (_dataArray.Length >= newClass.Keys.Length) 1098this[newClass.Keys.Length - 1] = ExpandoObject.Uninitialized; 1104int oldLength = _dataArray.Length; 1105object[] arr = new object[GetAlignedSize(newClass.Keys.Length)]; 1106Array.Copy(_dataArray, arr, _dataArray.Length);
System\Dynamic\GetMemberBinder.cs (1)
71ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\SetIndexBinder.cs (2)
46ContractUtils.Requires(args.Length >= 2, nameof(args)); 48DynamicMetaObject value = args[args.Length - 1];
System\Dynamic\SetMemberBinder.cs (1)
54ContractUtils.Requires(args.Length == 1, nameof(args));
System\Dynamic\UnaryOperationBinder.cs (1)
76ContractUtils.Requires(args == null || args.Length == 0, nameof(args));
System\Dynamic\UpdateDelegates.Generated.cs (40)
35for (int i = 0; i < applicable.Length; i++) 73for (int i = 0; i < applicable.Length; i++) 181for (int i = 0; i < applicable.Length; i++) 219for (int i = 0; i < applicable.Length; i++) 327for (int i = 0; i < applicable.Length; i++) 365for (int i = 0; i < applicable.Length; i++) 473for (int i = 0; i < applicable.Length; i++) 511for (int i = 0; i < applicable.Length; i++) 619for (int i = 0; i < applicable.Length; i++) 657for (int i = 0; i < applicable.Length; i++) 765for (int i = 0; i < applicable.Length; i++) 803for (int i = 0; i < applicable.Length; i++) 911for (int i = 0; i < applicable.Length; i++) 949for (int i = 0; i < applicable.Length; i++) 1057for (int i = 0; i < applicable.Length; i++) 1095for (int i = 0; i < applicable.Length; i++) 1203for (int i = 0; i < applicable.Length; i++) 1241for (int i = 0; i < applicable.Length; i++) 1349for (int i = 0; i < applicable.Length; i++) 1387for (int i = 0; i < applicable.Length; i++) 1494for (int i = 0; i < applicable.Length; i++) 1532for (int i = 0; i < applicable.Length; i++) 1639for (int i = 0; i < applicable.Length; i++) 1677for (int i = 0; i < applicable.Length; i++) 1784for (int i = 0; i < applicable.Length; i++) 1822for (int i = 0; i < applicable.Length; i++) 1929for (int i = 0; i < applicable.Length; i++) 1967for (int i = 0; i < applicable.Length; i++) 2074for (int i = 0; i < applicable.Length; i++) 2112for (int i = 0; i < applicable.Length; i++) 2219for (int i = 0; i < applicable.Length; i++) 2257for (int i = 0; i < applicable.Length; i++) 2364for (int i = 0; i < applicable.Length; i++) 2402for (int i = 0; i < applicable.Length; i++) 2509for (int i = 0; i < applicable.Length; i++) 2547for (int i = 0; i < applicable.Length; i++) 2654for (int i = 0; i < applicable.Length; i++) 2692for (int i = 0; i < applicable.Length; i++) 2799for (int i = 0; i < applicable.Length; i++) 2837for (int i = 0; i < applicable.Length; i++)
System\Dynamic\Utils\CollectionExtensions.cs (8)
23T[] res = new T[array.Length + 1]; 31T[] res = new T[array.Length + 1]; 33res[array.Length] = item; 39T[] result = new T[array.Length - 1]; 40Array.Copy(array, 1, result, 0, result.Length); 46T[] result = new T[array.Length - 1]; 47Array.Copy(array, result, result.Length); 73if (array.Length != 0)
System\Dynamic\Utils\DelegateHelpers.cs (13)
132if (parameters.Length > 2) 151int thunkTypeArgCount = parameters.Length; 156for (int i = 0; i < parameters.Length; i++) 165thunkTypeArgs[thunkTypeArgs.Length - 1] = returnType; 166uninstantiatedMethod = s_FuncThunks[parameters.Length]; 170uninstantiatedMethod = s_ActionThunks[parameters.Length]; 173return (thunkTypeArgs.Length > 0) ? 234Type[] paramTypes = new Type[parameters.Length + 1]; 246for (int i = 0; i < parameters.Length; i++) 261if (parameters.Length == 0) 267ilgen.Emit(OpCodes.Ldc_I4, parameters.Length); 274for (int i = 0; i < parameters.Length; i++) 315for (int i = 0; i < parameters.Length; i++)
System\Dynamic\Utils\ExpressionUtils.cs (2)
109for (int i = 0, n = pis.Length; i < n; i++) 136if (pis.Length != count)
System\Dynamic\Utils\ListArgumentProvider.cs (1)
98if (index + n > array.Length)
System\Dynamic\Utils\TypeExtensions.cs (3)
49if (ps.Length != argTypes.Length) 54for (int i = 0; i < ps.Length; i++)
System\Dynamic\Utils\TypeUtils.cs (8)
448if (destParams.Length != 1) 475if (sourceParams.Length != 1) 550Debug.Assert(genericParameters.Length == sourceArguments.Length); 551Debug.Assert(genericParameters.Length == destArguments.Length); 553for (int iParam = 0; iParam < genericParameters.Length; ++iParam) 728if (pis.Length == 1 && AreEquivalent(pis[0].ParameterType, typeFrom))
System\Linq\Expressions\BinaryExpression.cs (7)
636if (pms.Length != 2) 803if (pms.Length != 2) 846if (pmsOpTrue.Length != 1) 1400Debug.Assert(pms.Length == conversion.ParameterCount); 1401if (pms.Length != 1) 1552Debug.Assert(pms.Length == conversion.ParameterCount); 1553if (pms.Length != 1)
System\Linq\Expressions\BlockExpression.cs (8)
242Debug.Assert(args.Length == 2); 308Debug.Assert(args.Length == 3); 380Debug.Assert(args.Length == 4); 458Debug.Assert(args.Length == 5); 594Debug.Assert(args.Length == 1); 633Debug.Assert(args.Length == ExpressionCount); 658Debug.Assert(args.Length == ExpressionCount); 771if (index + n > array.Length)
System\Linq\Expressions\Compiler\DelegateHelpers.cs (6)
68for (int i = 0; i < args.Length; i++) 87Type[] paramTypes = new Type[args.Length + 2]; 89paramTypes[paramTypes.Length - 1] = returnType; 90for (int i = 0; i < args.Length; i++) 117Type returnType = types[types.Length - 1]; 125TypeBuilder builder = AssemblyGen.DefineDelegateType("Delegate" + types.Length);
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (11)
26for (int i = 0; i < types.Length; i++) 100if (types.Length < 3 || types[0].IsByRef || types[1] != typeof(object) || types[types.Length - 1] != typeof(object)) 106for (int i = 2; i < types.Length - 2; ++i) 115switch (types.Length - 1) 136Debug.Assert(types != null && types.Length > 0); 142if (types.Length > MaximumArity) 150for (int i = 0; i < types.Length; i++) 174if (types[types.Length - 1] == typeof(void)) 190switch (types.Length) 235switch (types.Length)
System\Linq\Expressions\Compiler\ILGen.cs (1)
962for (int i = 0; i < types.Length; i++)
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (4)
516Debug.Assert(args.ArgumentCount + skipParameters == pis.Length); 519for (int i = skipParameters, n = pis.Length; i < n; i++) 1129for (int i = 0, n = paramList.Length; i < n; i++) 1215for (int i = 0, n = paramList.Length; i < n; i++)
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (1)
624Debug.Assert(slot == jmpLabels.Length);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (1)
309Debug.Assert(pis != null && pis.Length == 1);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (5)
335for (int i = 0, n = parameters.Length; i < n; i++) 353_byRefs ??= new bool[_expressions.Length]; 408index += _expressions.Length; 442last += _expressions.Length; 448if (count == _expressions.Length)
System\Linq\Expressions\Compiler\TypeInfoExtensions.cs (1)
25paramTypes[paramTypes.Length - 1] = retType;
System\Linq\Expressions\DynamicExpression.cs (6)
516Debug.Assert(args.Length == ((IArgumentProvider)this).ArgumentCount); 574Debug.Assert(args.Length == 1); 643Debug.Assert(args.Length == 2); 718Debug.Assert(args.Length == 3); 799Debug.Assert(args.Length == 4); 1016if (pi.Length == 0 || pi[0].ParameterType != typeof(CallSite)) throw Error.FirstArgumentMustBeCallSite();
System\Linq\Expressions\ElementInit.cs (1)
106if (pis.Length == 0)
System\Linq\Expressions\IndexExpression.cs (16)
123Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 242if (arguments == null || arguments.Length == 0) 258for (int i = 0; i < arguments.Length; i++) 314if (parms.Length == 0) 323return parms.Length == 0; 326if (parms.Length != args.Length) 328for (int i = 0; i < args.Length; i++) 408if (setParameters.Length == 0) 414Type valueType = setParameters[setParameters.Length - 1].ParameterType; 434if (getParameters!.Length != setParameters.Length - 1) 439for (int i = 0; i < getParameters.Length; i++) 491if (indexes.Length > 0) 493if (indexes.Length != arguments.Count) 498for (int i = 0, n = indexes.Length; i < n; i++)
System\Linq\Expressions\Interpreter\ArrayOperations.cs (1)
149frame.Push(((Array)obj).Length);
System\Linq\Expressions\Interpreter\CallInstruction.cs (6)
38int argumentCount = parameters.Length; 184if (index < pi.Length) 190if (target.ReturnType == typeof(void) || index > pi.Length) 202return pi.Length != index || (pi.Length == index && !target.IsStatic); 361for (int i = 0; i < args.Length; i++)
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
137Debug.Assert(pi.Length == 2); 169switch (arrTypes.Length) 192switch (arrTypes.Length)
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (1)
29if (cache != null && offset >= 0 && offset < cache.Length)
System\Linq\Expressions\Interpreter\InstructionList.cs (16)
378if (_objects.Count < s_loadObjectCached!.Length) 432if (index < s_loadLocal.Length) 451if (index < s_loadLocalBoxed.Length) 465if (index < s_loadLocalFromClosure.Length) 479if (index < s_loadLocalFromClosureBoxed.Length) 493if (index < s_assignLocal.Length) 507if (index < s_storeLocal.Length) 526if (index < s_assignLocalBoxed.Length) 545if (index < s_storeLocalBoxed.Length) 559if (index < s_assignLocalToClosure.Length) 794Emit(new NewInstruction(constructorInfo, parameters.Length)); 799Emit(new ByRefNewInstruction(constructorInfo, parameters.Length, updaters)); 902Emit(new ByRefMethodInfoCallInstruction(method, method.IsStatic ? parameters.Length : parameters.Length + 1, byrefArgs)); 907Emit(NullableMethodCallInstruction.Create(method.Name, parameters.Length, method)); 932result[result.Length - 1] = new RuntimeLabel(Interpreter.RethrowOnReturn, 0, 0);
System\Linq\Expressions\Interpreter\Interpreter.cs (1)
60while (index < instructions.Length)
System\Linq\Expressions\Interpreter\LightCompiler.cs (7)
1043Debug.Assert(parameters.Length == 1); 2154Debug.Assert(parameters.Length == arguments.ArgumentCount); 2395for (int i = 0; i < parameters.Length; i++) 3262var args = new object?[_args.Length + 1]; 3263for (int i = 0; i < args.Length - 1; i++) 3267args[args.Length - 1] = value; 3289for (int i = 0; i < _args.Length; i++)
System\Linq\Expressions\Interpreter\LightLambda.cs (6)
145for (int i = 0; i < instructions.Length; i++) 173EmitExits(sb, instructions.Length); 409for (int i = 0; i < arguments.Length; i++) 420for (int i = 0; i < arguments.Length; i++) 433for (int i = 0; i < arguments.Length; i++) 444for (int i = 0; i < arguments.Length; i++)
System\Linq\Expressions\Interpreter\LocalAccess.cs (1)
468for (int i = ret.Length - 1; i >= 0; i--)
System\Linq\Expressions\Interpreter\NewInstruction.cs (1)
54for (int i = 0; i < args.Length; i++)
System\Linq\Expressions\Interpreter\RuntimeVariables.cs (1)
17int IRuntimeVariables.Count => _boxes.Length;
System\Linq\Expressions\Interpreter\TypeOperations.cs (2)
32for (int i = closure.Length - 1; i >= 0; i--) 581for (int i = 0; i < indexes.Length; i++)
System\Linq\Expressions\Interpreter\Utilities.cs (6)
186for (int i = 0; i < _keysAndValues.Length; i++) 209for (int i = 0; i < _keysAndValues.Length; i++) 232for (int i = 0; i < keysAndValues.Length; i++) 258for (int i = 0; i < _keysAndValues.Length; i++) 296for (int i = 0; i < _keysAndValues.Length; i++) 322for (int i = 0; i < _keysAndValues.Length; i++)
System\Linq\Expressions\InvocationExpression.cs (7)
147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 175Debug.Assert(arguments == null || arguments.Length == 0); 208Debug.Assert(arguments == null || arguments.Length == 1); 248Debug.Assert(arguments == null || arguments.Length == 2); 291Debug.Assert(arguments == null || arguments.Length == 3); 337Debug.Assert(arguments == null || arguments.Length == 4); 386Debug.Assert(arguments == null || arguments.Length == 5);
System\Linq\Expressions\LambdaExpression.cs (9)
378Debug.Assert(parameters == null || parameters.Length == 0); 422Debug.Assert(parameters == null || parameters.Length == 1); 484Debug.Assert(parameters == null || parameters.Length == 2); 552Debug.Assert(parameters == null || parameters.Length == 3); 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count); 938if (pis.Length > 0) 940if (pis.Length != parameters.Count) 945for (int i = 0, n = pis.Length; i < n; i++) 998for (int i = 0; i < typeArgs.Length; i++)
System\Linq\Expressions\MemberExpression.cs (2)
264else if (mi.GetParametersCached().Length != 1) 269else if (mi.GetParametersCached().Length != 0)
System\Linq\Expressions\MethodCallExpression.cs (7)
1331if (typeArgs != null && typeArgs.Length > 0) 1350if (parms.Length != arguments.Length) 1352for (int i = 0; i < arguments.Length; i++) 1375if (typeArgs == null || typeArgs.Length == 0) 1382if (m.IsGenericMethodDefinition && m.GetGenericArguments().Length == typeArgs.Length)
System\Linq\Expressions\NewExpression.cs (3)
207ConstructorInfo? ci = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).SingleOrDefault(c => c.GetParametersCached().Length == 0); 223if ((pis = constructor.GetParametersCached()).Length > 0) 225if (arguments.Count != pis.Length)
System\Linq\Expressions\SwitchExpression.cs (1)
201if (pms.Length != 2)
System\Linq\Expressions\UnaryExpression.cs (5)
262Debug.Assert(i == temps.Length); 268Debug.Assert(i == temps.Length); 271Debug.Assert(i == block.Length); 385if (pms.Length != 1) 431if (pms.Length != 1)
System\Runtime\CompilerServices\CallSite.cs (13)
250if (rules.Length < (MaxRules - 1)) 252temp = new T[rules.Length + 1]; 253Array.Copy(rules, 0, temp, 1, rules.Length); 272if (i < rules.Length) 311method = typeof(UpdateDelegates).GetMethod("UpdateAndExecuteVoid" + args.Length, BindingFlags.NonPublic | BindingFlags.Static); 312noMatchMethod = typeof(UpdateDelegates).GetMethod("NoMatchVoid" + args.Length, BindingFlags.NonPublic | BindingFlags.Static); 319method = typeof(UpdateDelegates).GetMethod("UpdateAndExecute" + (args.Length - 1), BindingFlags.NonPublic | BindingFlags.Static); 320noMatchMethod = typeof(UpdateDelegates).GetMethod("NoMatch" + (args.Length - 1), BindingFlags.NonPublic | BindingFlags.Static); 337ContractUtils.Requires(pis.Length > 0 && pis[0].ParameterType == typeof(CallSite), nameof(T)); 339Type[] args = new Type[invoke.ReturnType != typeof(void) ? pis.Length : pis.Length - 1]; 342for (int i = 1; i < pis.Length; i++) 353args[args.Length - 1] = invoke.ReturnType;
System\Runtime\CompilerServices\CallSiteBinder.cs (2)
65var @params = new ParameterExpression[pis.Length - 1]; 66for (int i = 0; i < @params.Length; i++)
System\Runtime\CompilerServices\ReadOnlyCollectionBuilder.cs (8)
79get { return _items.Length; } 84if (value != _items.Length) 129if (_size == _items.Length) 192if (_size == _items.Length) 415if (_size == _items.Length) 432if (_items.Length < min) 435if (_items.Length > 0) 437newCapacity = _items.Length * 2;
System\Runtime\CompilerServices\RuleCache.cs (4)
40int count = _rules.Length - i; 47int max = Math.Min(_rules.Length, i + count); 81if (rules.Length < InsertPosition) 88int newLength = rules.Length + 1;
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
136for (int i = 0; i < indexes.Length; i++)
System\Runtime\CompilerServices\RuntimeOps.MergedRuntimeVariables.cs (1)
28public int Count => _indexes.Length;
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariableList.cs (1)
83public int Count => _indexes.Length;
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariables.cs (1)
17int IRuntimeVariables.Count => _boxes.Length;
System.Linq.Parallel (97)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (7)
161(consumerIndex == 0 && producerIndex == _buffer.Length - 1); 305Interlocked.Exchange(ref _producerBufferIndex, (bufferIndex + 1) % _buffer.Length); 419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 425if (_consumerChunkIndex == _consumerChunk.Length) 497Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 502if (_consumerChunkIndex == _consumerChunk.Length) 621Interlocked.Exchange(ref _consumerBufferIndex, (consumerBufferIndex + 1) % _buffer.Length);
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (15)
55_done = new bool[_channels.Length]; // Initialized to { false }, i.e. no channels done. 71if (_channelIndex == -1 || _channelIndex == _channels.Length) 98if (index == _channels.Length) 106_channelIndex = (index + 1) % _channels.Length; 127while ((currChannelIndex = _channelIndex) < _channels.Length) 137_channelIndex = (currChannelIndex + 1) % _channels.Length; 170if (++doneChannels == _channels.Length) 173_channelIndex = currChannelIndex = _channels.Length; 179_channelIndex = currChannelIndex = (currChannelIndex + 1) % _channels.Length; 194for (int i = 0; i < _channels.Length; i++) 210if (++doneChannels == _channels.Length) 214_channelIndex = currChannelIndex = _channels.Length; 221if (currChannelIndex == _channels.Length) 252for (int i = 0; i < _channels.Length; i++) 271Debug.Assert(currChannelIndex == _channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (4)
86Debug.Assert(_asyncChannels == null || _asyncChannels.Length == partitions.PartitionCount); 87Debug.Assert(_syncChannels == null || _syncChannels.Length == partitions.PartitionCount); 146for (int i = 0; i < _syncChannels.Length; i++) 154for (int i = 0; i < _syncChannels.Length; i++)
System\Linq\Parallel\Merging\MergeExecutor.cs (2)
166for (int i = 0; i < channels.Length; i++) 193for (int i = 0; i < channels.Length; i++)
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (2)
362for (int i = 0; i < locks.Length; i++) 482int partitionCount = _mergeHelper._buffers.Length;
System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs (3)
59if (_channelIndex == -1 || _channelIndex == _channels.Length) 87while (_channelIndex < _channels.Length) 109Debug.Assert(_channelIndex == _channels.Length);
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (1)
75Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)");
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (1)
77Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)");
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (9)
138Debug.Assert(partitions.Length == partitionCount); 245_elementCount = data.Length; 348int smallerChunkSize = data.Length / partitionCount; 349int biggerChunkCount = data.Length % partitionCount; 627Debug.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length); 641Debug.Assert(0 <= mutables._nextChunkMaxSize && mutables._nextChunkMaxSize <= chunkBuffer.Length); 684if (mutables._nextChunkMaxSize < chunkBuffer.Length) 689if (mutables._nextChunkMaxSize > chunkBuffer.Length) 691mutables._nextChunkMaxSize = chunkBuffer.Length;
System\Linq\Parallel\Partitioning\PartitionedStream.cs (3)
58Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 65Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 79return _partitions.Length;
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (9)
70Debug.Assert(producerWaiting != null && producerWaiting.Length == consumerWaiting.Length); 71Debug.Assert(producerDone != null && producerDone.Length == consumerWaiting.Length); 72Debug.Assert(buffers != null && buffers.Length == consumerWaiting.Length); 73Debug.Assert(partitionIndex >= 0 && partitionIndex < consumerWaiting.Length); 155Debug.Assert(producerDone != null && producerDone.Length == partitions.PartitionCount); 156Debug.Assert(buffers != null && buffers.Length == partitions.PartitionCount);
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (1)
115for (int i = 0; i < sortHelpers.Length; i++)
System\Linq\Parallel\Scheduling\SpoolingTask.cs (2)
36Debug.Assert(partitions.PartitionCount == channels.Length); 92Debug.Assert(partitions.PartitionCount == channels.Length);
System\Linq\Parallel\Utils\ExchangeUtilities.cs (1)
46else if (enumerators.Length != partitionCount)
System\Linq\Parallel\Utils\FixedMaxHeap.cs (2)
57get { return _elements.Length; } 102if (_count < _elements.Length)
System\Linq\Parallel\Utils\GrowingArray.cs (4)
47if (_count >= _array.Length) 49GrowArray(2 * _array.Length); 56Debug.Assert(newSize > _array.Length); 66if (_count + otherCount > _array.Length)
System\Linq\Parallel\Utils\HashLookup.cs (3)
81for (int i = buckets[(uint)hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) 108if (count == slots.Length) Resize(); 113int bucket = hashCode % buckets.Length;
System\Linq\Parallel\Utils\ListChunk.cs (2)
44if (tail._chunkCount == tail._chunk.Length) 81Debug.Assert(curr._chunkCount == curr._chunk.Length || curr._nextChunk == null);
System\Linq\Parallel\Utils\Sorting.cs (26)
68Debug.Assert(sharedIndices.Length <= sharedkeys.Length); 69Debug.Assert(sharedIndices.Length == sharedValues.Length); 86Debug.Assert(_sharedKeys.Length >= _sharedValues.Length); 128for (int i = 0; i < sharedBarriers.Length; i++) 131for (int j = 0; j < sharedBarriers[i].Length; j++) 166for (int i = 0; i < _sharedBarriers.Length; i++) 168for (int j = 0; j < _sharedBarriers[i].Length; j++) 273for (int i = 0; i < indices.Length; i++) 279if (indices.Length > 1 282QuickSort(0, indices.Length - 1, keys.InternalArray, indices, _groupState.CancellationState.MergedCancellationToken); 290for (int i = 0; i < indices.Length; i++) 361int phaseCount = _sharedBarriers.Length; 405int leftCount = myValues.Length; 406int rightCount = rightValues.Length; 502int leftCount = leftValues.Length; 503int rightCount = myValues.Length; 551if (!isLastPhase && myValues.Length > 0) 553mergedKeys.CopyFrom(myKeysArr, myValues.Length); 554Array.Copy(myValues, 0, mergedValues, leftCount, myValues.Length); 585Debug.Assert(keys.Length >= indices.Length); 587Debug.Assert(0 <= left && left < keys.Length); 588Debug.Assert(0 <= right && right < keys.Length);
System.Linq.Queryable (16)
System\Linq\EnumerableRewriter.cs (16)
66if (pis.Length > 0) 69for (int i = 0, n = pis.Length; i < n; i++) 176.Where(i => i.IsGenericType && i.GenericTypeArguments.Length == 1) 227Debug.Assert(matchingMethods.Length > 0, "All static methods with arguments on Queryable have equivalents on Enumerable."); 229if (matchingMethods.Length > 1) 247Debug.Assert(matchingMethods.Length > 1); 254for (int i = 0; i < matchingMethods.Length; i++) 257for (int j = 0; j < matchingMethods.Length; j++) 278Debug.Assert(left.Length == right.Length); 282for (int i = 0; i < left.Length; i++) 316if (mParams.Length != args.Count) 318if (!m.IsGenericMethod && typeArgs != null && typeArgs.Length > 0) 328if (typeArgs == null || typeArgs.Length == 0) 330if (m.GetGenericArguments().Length != typeArgs.Length)
System.Memory (12)
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (8)
73public int Capacity => _buffer.Length; 78public int FreeCapacity => _buffer.Length - _index; 95Debug.Assert(_buffer.Length >= _index); 131if (_index > _buffer.Length - count) 132ThrowInvalidOperationException_AdvancedTooFar(_buffer.Length); 164Debug.Assert(_buffer.Length > _index); 195Debug.Assert(_buffer.Length > _index); 211int currentLength = _buffer.Length;
System\Buffers\ReadOnlySequence.cs (3)
121_endInteger = ReadOnlySequence.ArrayToSequenceEnd(array.Length); 130(uint)start > (uint)array.Length || 131(uint)length > (uint)(array.Length - start))
System\ThrowHelper.cs (1)
86else if ((uint)start > (uint)array.Length)
System.Net.Http (116)
src\libraries\Common\src\System\CharArrayHelpers.cs (2)
16Debug.Assert(startIndex <= array.Length - length, $"Expected {startIndex} to be <= {array.Length} - {length}, got {startIndex}");
src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
46Debug.Assert(buffer.Length > 0); 87public int AvailableLength => _bytes.Length - _availableStart; 92public int Capacity => _bytes.Length; 129if (_bytes.Length == 0) 149int newSize = _bytes.Length; 183if (_usePool && buffer.Length > 0)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs (4)
44index += _buffer.Length; 72_insertIndex = (_insertIndex + 1) % _buffer.Length; 83int headCount = Math.Min(_buffer.Length - _removeIndex, _count); 110_removeIndex = (_removeIndex + 1) % _buffer.Length;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs (1)
10public static int Count => s_staticDecoderTable.Length;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs (2)
37public int Length => GetLength(Name.Length, Value.Length);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (5)
566_headerNameLength = _headerName.Length; 573if (length > _stringOctets.Length) 580_stringOctets = new byte[Math.Max(length, Math.Min(_stringOctets.Length * 2, _maxHeadersLength))]; 627if (dst.Length < stringLength) 629dst = new byte[Math.Max(stringLength, Math.Min(dst.Length * 2, _maxHeadersLength))];
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (3)
530int valueLength = checked((values.Length - 1) * separator.Length); 564destination = destination.Slice(separator.Length); 579destination = destination.Slice(separator.Length);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.Http3.cs (1)
46public static int Count => s_staticTable.Length;
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs (3)
17Debug.Assert(name.Length > 0); 27public int Length => GetLength(Name.Length, Value.Length);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (1)
674else if (buffer.Length < requiredLength)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (3)
237int valueLength = separator.Length * (values.Length - 1); 269buffer = buffer.Slice(separator.Length); 284buffer = buffer.Slice(separator.Length);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (9)
48for (int i = 0; i < _blocks.Length; i++) 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 187uint blockArraySize = (uint)_blocks.Length; 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 272for (uint i = firstUnallocatedBlock; i < _blocks.Length; i++) 310Debug.Assert(start + length <= blocks.Length * BlockSize); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (1)
39Debug.Assert(properties.Length == 13);
System\Net\Http\ByteArrayContent.cs (3)
22_count = content.Length; 30ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, content.Length); 33ArgumentOutOfRangeException.ThrowIfGreaterThan(count, content.Length - offset);
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (1)
489output = encoding.GetString(bytes, 0, bytes.Length);
System\Net\Http\Headers\HeaderDescriptor.cs (3)
108Debug.Assert(qpackStaticTable.Length == 99); 112if (uindex < (uint)qpackStaticTable.Length) 144for (int i = 0; i < knownValues.Length; i++)
System\Net\Http\Headers\HeaderStringValues.cs (2)
39string[] values => values.Length, 102if ((uint)index < (uint)values.Length)
System\Net\Http\Headers\HeaderUtilities.cs (1)
340for (int i = 0; i < headers.Length; i++)
System\Net\Http\Headers\HttpHeaders.cs (16)
263Debug.Assert(multiValue is not null && multiValue.Length > 0); 265for (int i = 1; i < multiValue.Length; i++) 539if (_headerStore is not HeaderEntry[] entries || entries.Length < _count) 541entries = new HeaderEntry[sourceEntries.Length]; 545for (int i = 0; i < _count && i < sourceEntries.Length; i++) 1140if (values.Length == 0) 1154if (values.Length < length) 1372for (int i = 0; i < _count && i < entries.Length; i++) 1394for (int i = 0; i < _count && i < entries.Length; i++) 1404if ((uint)count < (uint)entries.Length) 1429if (entries.Length == ArrayThreshold) 1435Array.Resize(ref entries, entries.Length << 1); 1437ref HeaderEntry firstNewEntry = ref entries[entries.Length >> 1]; 1475if ((uint)count < (uint)entries.Length) 1511for (int i = 0; i < _count && i < entries.Length; i++) 1515while (i + 1 < _count && (uint)(i + 1) < (uint)entries.Length)
System\Net\Http\Headers\HttpHeadersNonValidated.cs (1)
140if (_entries is HeaderEntry[] entries && index < _numberOfEntries && (uint)index < (uint)entries.Length)
System\Net\Http\Headers\HttpHeaderValueCollection.cs (3)
87ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length); 103if (arrayIndex == array.Length) 117if (arrayIndex == array.Length)
System\Net\Http\Headers\KnownHeader.cs (2)
33asciiBytesWithColonSpace[asciiBytesWithColonSpace.Length - 2] = (byte)':'; 34asciiBytesWithColonSpace[asciiBytesWithColonSpace.Length - 1] = (byte)' ';
System\Net\Http\Headers\ObjectCollection.cs (4)
64if ((uint)size < (uint)array.Length) 73Debug.Assert(_size == array.Length); 75var newItems = new T[array.Length * 2]; 104if (array is null || _size > array.Length - arrayIndex)
System\Net\Http\HttpContent.cs (14)
89Debug.Assert(preambleLength == actualPreamble.Length, 91$"Expected (constant): {preambleLength}, Actual (Encoding.GetPreamble().Length): {actualPreamble.Length}"); 93Debug.Assert(actualPreamble.Length >= 2); 100Debug.Assert(preamble.Length == actualPreamble.Length, 104for (int i = 0; i < preamble.Length; i++) 761return BufferHasPrefix(buffer, preamble) ? preamble.Length : 0; 817if (prefix == null || byteArray == null || prefix.Length > buffer.Count || prefix.Length == 0) 820for (int i = 0, j = buffer.Offset; i < prefix.Length; i++, j++) 856return TryGetBuffer(out buffer) && buffer.Offset == 0 && buffer.Count == buffer.Array!.Length ? 973else if (value > _buffer.Length) 981Debug.Assert(value > _buffer.Length); 992uint twiceLength = 2 * (uint)currentBuffer.Length;
System\Net\Http\Metrics\MetricsHandler.cs (3)
156Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError."); 220return (uint)statusCode < (uint)boxes.Length 232return (uint)index < (uint)strings.Length
System\Net\Http\MultipartContent.cs (6)
475if (_next >= _streams.Length) 511if (_next >= _streams.Length) 556if (_next >= _streams.Length) 573for (int i = 0; i < _streams.Length; i++) 585for (; i < _streams.Length; i++) 598_next = _streams.Length;
System\Net\Http\SocketsHttpHandler\ConnectionPool\RequestQueue.cs (7)
37if (_size == _array.Length) 84if (tmp == _array.Length) 93var newArray = new QueueItem[Math.Max(4, _array.Length * 2)]; 103Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 104Array.Copy(_array, 0, newArray, _array.Length - _head, _tail); 172if (index >= _array.Length) 174index -= _array.Length;
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (2)
18Debug.Assert(valuesArray.Length > 0, "No values for header??"); 22for (int i = 0; i < valuesArray.Length; i++)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
1946Debug.Assert(origReadBuffer.Length > 0);
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (3)
58int idx = uris.Length; 159if (_currentIndex == _uris.Length) 167isFinalProxy = _currentIndex == _uris.Length;
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (1)
260if (addresses.Length == 0)
System.Net.HttpListener (46)
src\libraries\Common\src\System\Net\CookieParser.cs (2)
485for (int i = 0; i < s_recognizedServerAttributes.Length; ++i) 495for (int i = 0; i < s_recognizedAttributes.Length; ++i)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\libraries\Common\src\System\Net\WebHeaderEncoding.cs (2)
23Debug.Assert(bytes != null && (uint)byteIndex <= (uint)bytes.Length && (uint)(byteIndex + byteCount) <= (uint)bytes.Length);
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (5)
44if (validStates != null && validStates.Length > 0) 127if (arraySegment.Offset < 0 || arraySegment.Offset > arraySegment.Array.Length) 131if (arraySegment.Count < 0 || arraySegment.Count > (arraySegment.Array.Length - arraySegment.Offset)) 142ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 145ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Net\HttpListenerPrefixCollection.cs (4)
42if (Count > array.Length) 46ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, array.Length - Count); 58if (Count > array.Length) 62ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, array.Length - Count);
System\Net\HttpRequestStream.cs (2)
20if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset); 34if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
System\Net\HttpResponseStream.cs (2)
47if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset); 61if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, "buffer.Length:" + buffer.Length + " count:" + count + " offset:" + offset);
System\Net\Managed\ChunkStream.cs (5)
66int nread = (size > Bytes.Length - Offset) ? Bytes.Length - Offset : size; 116if (chunk.Offset == chunk.Bytes.Length) 202if (ch.Bytes.Length > 0 && ch.Offset < ch.Bytes.Length)
System\Net\Managed\HttpListener.Managed.cs (3)
224for (int i = all.Length - 1; i >= 0; i--) 234for (int i = conns.Length - 1; i >= 0; i--) 241for (int i = ctxs.Length - 1; i >= 0; i--)
System\Net\Managed\HttpListenerRequest.Managed.cs (2)
204output.InternalWrite(s_100continue, 0, s_100continue.Length); 296if (errors != null && errors.Length > 0)
System\Net\Managed\HttpListenerResponse.Managed.cs (5)
120ContentLength64 = responseEntity.Length; 127OutputStream.Write(responseEntity, 0, responseEntity.Length); 136OutputStream.BeginWrite(responseEntity, 0, responseEntity.Length, iar => 274ms.Write(statusDescriptionBytes, 0, statusDescriptionBytes.Length); 303for (int j = 0; j < values.Length; j++)
System\Net\Managed\HttpRequestStream.Managed.cs (2)
80if (_offset > _buffer.Length - size) 82size = Math.Min(size, _buffer.Length - _offset);
System\Net\Managed\HttpResponseStream.Managed.cs (7)
72ms.Write(bytes, 0, bytes.Length); 80InternalWrite(bytes, 0, bytes.Length); 106ms.Write(bytes, 0, bytes.Length); 181ms.Write(bytes, 0, bytes.Length); 195InternalWrite(bytes, 0, bytes.Length); 225ms.Write(bytes, 0, bytes.Length); 235InternalWrite(bytes, 0, bytes.Length);
System\Net\WebSockets\HttpWebSocket.cs (2)
64for (int i = 0; i < requestProtocols.Length; i++) 142isSecWebSocketKeyInvalid = Convert.FromBase64String(secWebSocketKey!).Length != 16;
System.Net.Mail (42)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
System\Net\BufferBuilder.cs (5)
23if (count > _buffer.Length - _offset) 25byte[] newBuffer = new byte[((_buffer.Length * 2) > (_buffer.Length + count)) ? (_buffer.Length * 2) : (_buffer.Length + count)];
System\Net\BufferedReadStream.cs (2)
118if (_storedBuffer == null || _storedBuffer.Length < count) 133else if (count <= _storedBuffer!.Length - _storedLength + _storedOffset)
System\Net\Mail\MailHeaderInfo.cs (1)
75for (int i = 0; i < s_headerInfo.Length; i++)
System\Net\Mail\MailPriority.cs (1)
509for (int j = 0; j < values.Length; j++)
System\Net\Mail\SmtpCommands.cs (5)
207if (lines == null || lines.Length == 0) 211System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command"); 357if (lines == null || lines.Length == 0) 370string[] extensions = new string[lines.Length - 1]; 371for (int i = 1; i < lines.Length; i++)
System\Net\Mail\SmtpConnection.cs (2)
250for (int i = 0; i < _authenticationModules.Length; i++) 727while (++_currentModule < _connection._authenticationModules.Length)
System\Net\Mail\SmtpFailedRecipientsException.cs (2)
41base(message, innerExceptions.Length > 0 ? innerExceptions[0].FailedRecipient : null, innerExceptions.Length > 0 ? innerExceptions[0] : null)
System\Net\Mail\SmtpReplyReaderFactory.cs (5)
78while (0 != Read(caller, _byteBuffer, 0, _byteBuffer.Length)) ; 93if (info != null && info.Length > 0) 288if (info != null && info.Length > 0) 319read = _bufferedStream.Read(_byteBuffer, 0, _byteBuffer.Length); 413IAsyncResult result = _parent._bufferedStream.BeginRead(_parent._byteBuffer!, 0, _parent._byteBuffer!.Length, s_readCallback, this);
System\Net\Mime\ByteEncoder.cs (1)
63return EncodeBytes(buffer, 0, buffer.Length, true, true);
System\Net\Mime\EightBitStream.cs (1)
108for (int i = offset; (i < offset + count) && (i < buffer.Length); i++)
System\Net\Mime\MimeBasePart.cs (2)
67if ((subStrings.Length != 5 || subStrings[0] != "=" || subStrings[4] != "=")) 79newLength = s.DecodeBytes(buffer, 0, buffer.Length);
System\Net\Mime\MimePart.cs (2)
227IAsyncResult readResult = Stream!.BeginRead(context._buffer, 0, context._buffer.Length, _readCallback, context); 262IAsyncResult readResult = Stream!.BeginRead(context._buffer, 0, context._buffer.Length, _readCallback, context);
System\Net\Mime\QuotedPrintableStream.cs (6)
215if (WriteState.Buffer.Length - WriteState.Length < SizeOfSoftCRLF) 230if (WriteState.Buffer.Length - WriteState.Length < (_encodeCRLF ? SizeOfEncodedCRLF : SizeOfNonEncodedCRLF)) 251if (WriteState.Buffer.Length - WriteState.Length < SizeOfSoftCRLF) 265if (WriteState.Buffer.Length - WriteState.Length < 1) 274if (WriteState.Buffer.Length - WriteState.Length < SizeOfEncodedChar) 298return EncodeBytes(buffer, 0, buffer.Length);
System\Net\Mime\WriteStateInfoBase.cs (5)
46internal int FooterLength => _footer!.Length; 57int newsize = Buffer.Length; 63if (newsize > Buffer.Length) 107if (Header != null && Header.Length != 0) 115if (Footer != null && Footer.Length != 0)
System.Net.NameResolution (7)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
System\Net\Dns.cs (4)
50if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries"); 86if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostNameOrAddress, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries"); 126NetEventSource.Info(hostNameOrAddress, $"{t.Result} with {t.Result.AddressList.Length} entries"); 160if (NetEventSource.Log.IsEnabled()) NetEventSource.Info((IPAddress)s, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
System\Net\NameResolutionPal.Unix.cs (1)
107for (int i = 0; i < localAliases.Length; i++)
System.Net.NetworkInformation (28)
System\Net\NetworkInformation\LinuxIPv4InterfaceProperties.cs (1)
46for (int i = 0; i < paths.Length; i++)
System\Net\NetworkInformation\NetworkInterfacePal.Linux.cs (1)
39for (int i = 0; i < interfaces.Length; i++)
System\Net\NetworkInformation\PhysicalAddress.cs (5)
28int size = _address.Length & ~3; 35if ((_address.Length & 3) != 0) 40for (; i < _address.Length; ++i) 62_address.Length == other._address.Length &&
System\Net\NetworkInformation\StringParsingHelpers.Addresses.cs (1)
61if (token.Length > 9 && token[4] != "00000000000000000000000000000000")
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (20)
52if (v4connections.Length > 0) 54count += v4connections.Length - 1; 57if (v6connections.Length > 0) 59count += v6connections.Length - 1; 68for (int i = 1; i < v4connections.Length; i++) // Skip first line header. 83for (int i = 1; i < v6connections.Length; i++) // Skip first line header. 99Array.Resize(ref connections, connections.Length - skip); 132if (v4connections.Length > 0) 134count += v4connections.Length - 1; 137if (v6connections.Length > 0) 139count += v6connections.Length - 1; 148for (int i = 1; i < v4connections.Length; i++) // Skip first line header. 163for (int i = 1; i < v6connections.Length; i++) // Skip first line header. 179Array.Resize(ref endPoints, endPoints.Length - skip); 212if (v4connections.Length > 0) 214count += v4connections.Length - 1; 217if (v6connections.Length > 0) 219count += v6connections.Length - 1; 226for (int i = 1; i < v4connections.Length; i++) // Skip first line header. 234for (int i = 1; i < v6connections.Length; i++) // Skip first line header.
System.Net.Ping (7)
System\Net\NetworkInformation\Ping.cs (1)
50if (buffer.Length > MaxBufferSize)
System\Net\NetworkInformation\Ping.PingUtility.cs (1)
41string processArgs = UnixCommandLinePing.ConstructCommandLine(buffer.Length, timeout, address.ToString(), isIpv4, options?.Ttl ?? 0, fragmentOption);
System\Net\NetworkInformation\Ping.RawSocket.cs (5)
38totalLength = sizeof(IpHeader) + checked(sizeof(IcmpHeader) + buffer.Length); 230Buffer.BlockCopy(receiveBuffer, dataOffset, dataBuffer, 0, dataBuffer.Length); 252byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length]; 326byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length]; 440int packetSize = totalLength != 0 ? totalLength : checked(icmpHeaderSize + payload.Length);
System.Net.Primitives (14)
src\libraries\Common\src\System\Net\CookieParser.cs (2)
485for (int i = 0; i < s_recognizedServerAttributes.Length; ++i) 495for (int i = 0; i < s_recognizedAttributes.Length; ++i)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\SocketAddress.cs (1)
42ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _buffer.Length);
System\Net\Cookie.cs (2)
596int[] parsedPorts = new int[ports.Length]; 598for (int i = 0; i < ports.Length; ++i)
System\Net\CookieContainer.cs (2)
443for (int i = 0; i < cookies.Length; ++i) 690for (int i = 0; i < s_headerInfo.Length; ++i)
System\Net\IPAddress.cs (5)
154Debug.Assert(numbers.Length == NumberOfLabels); 202for (int i = 0; i < numbers.Length; i++) 305Debug.Assert(numbers != null && numbers.Length == NumberOfLabels); 317for (int i = 0; i < numbers.Length; i++) 345Debug.Assert(_numbers != null && _numbers.Length == NumberOfLabels);
System.Net.Quic (24)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
85bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
164int ret = method(handle, bytes, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
39ErrErrorStringN(error, buf, buffer.Length);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
46Debug.Assert(buffer.Length > 0); 87public int AvailableLength => _bytes.Length - _availableStart; 92public int Capacity => _bytes.Length; 129if (_bytes.Length == 0) 149int newSize = _bytes.Length; 183if (_usePool && buffer.Length > 0)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (9)
48for (int i = 0; i < _blocks.Length; i++) 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 187uint blockArraySize = (uint)_blocks.Length; 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 272for (uint i = firstUnallocatedBlock; i < _blocks.Length; i++) 310Debug.Assert(start + length <= blocks.Length * BlockSize); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
43hostNameMatch = Interop.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length);
System\Net\Quic\Internal\MsQuicConfiguration.cs (1)
272Asn1BlobLength = (uint)certificateData.Length,
System\Net\Quic\NetEventSource.Quic.Counters.cs (1)
225uint size = (uint)s_counters.Length * sizeof(long);
System\Net\Quic\QuicConnection.cs (1)
319if (addresses.Length == 0)
System.Net.Requests (19)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
System\Net\Authorization.cs (1)
37set { _protectionRealm = value != null && value.Length != 0 ? value : null; }
System\Net\CommandStream.cs (9)
190while (_index < _commands!.Length) 215BeginWrite(sendBuffer, 0, sendBuffer.Length, s_writeCallbackDelegate, this); 219Write(sendBuffer, 0, sendBuffer.Length); 281if (index < 0 || index >= commands!.Length || 291if (_index >= _commands!.Length) 520BeginRead(state.Buffer, 0, state.Buffer.Length, s_readCallbackDelegate, state); 525bytesRead = Read(state.Buffer, 0, state.Buffer.Length); 630BeginRead(state.Buffer, 0, state.Buffer.Length, s_readCallbackDelegate, state); 635bytesRead = Read(state.Buffer, 0, state.Buffer.Length);
System\Net\FtpControlStream.cs (7)
788for (int i = address.IsIPv4MappedToIPv6 ? 12 : 0; i < localAddressInBytes.Length; i++) 880if (parsedList.Length < 2) 972baseUri.Segments.Length != newUri.Segments.Length - 1) 1031if (parsedList.Length <= 7) 1036int index = parsedList.Length - 1; 1061if (parsedList.Length < 4)
System.Net.Security (71)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (3)
22Debug.Assert((offset >= 0 && offset < destination.Length) || destination.Length == 0, $"invalid offset {offset}"); 31int destinationAvailable = destination.Length - offset; // amount of space in the given buffer
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
85bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
164int ret = method(handle, bytes, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
39ErrErrorStringN(error, buf, buffer.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
145Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0));
src\libraries\Common\src\System\Net\ArrayBuffer.cs (6)
46Debug.Assert(buffer.Length > 0); 87public int AvailableLength => _bytes.Length - _availableStart; 92public int Capacity => _bytes.Length; 129if (_bytes.Length == 0) 149int newSize = _bytes.Length; 183if (_usePool && buffer.Length > 0)
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
77ReportDownloadStop(ret?.Length ?? 0);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
43hostNameMatch = Interop.Crypto.CheckX509IpAddress(certHandle, addressBytes, addressBytes.Length, hostName, hostName.Length);
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
22Debug.Fail($"Convert.TryToBase64 failed with {input.Length} bytes to a {base64.Length} buffer");
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (5)
543if (targetInfoOffset == targetInfoBuffer.Length) 613targetInfoBuffer.Length + 616s_workstation.Length + 650Debug.Assert(payloadOffset == sizeof(AuthenticateMessage) + ChallengeResponseLength + sizeof(NtChallengeResponse) + targetInfoBuffer.Length); 697Debug.Assert(payloadOffset == responseBytes.Length);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (2)
321if (blob?.Length > 0) 332if (response?.Length > 0)
System\Net\NegotiateAuthenticationPal.Unix.cs (3)
311_tokenBuffer.Length == resultBlobLength ? _tokenBuffer : 636resultBlobLength = resultBlob?.Length ?? 0; 712resultBlobLength = resultBlob.Length;
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (6)
93policy.Pal._tls13CipherSuites.Length != 0 && 94policy.Pal._tls13CipherSuites[policy.Pal._tls13CipherSuites.Length - 1] == 0, 98return policy.Pal._tls13CipherSuites.Length == 1; 110policy.Pal._cipherSuites.Length != 0 && 111policy.Pal._cipherSuites[policy.Pal._cipherSuites.Length - 1] == 0, 115return policy.Pal._cipherSuites.Length == 1;
System\Net\Security\NegotiateAuthentication.cs (1)
264if (decodedOutgoingBlob != null && decodedOutgoingBlob.Length > 0)
System\Net\Security\NegotiateStream.cs (3)
386if (_readBuffer.Length < readBytes) 874if (message.Length >= sizeof(long)) 886if (HandshakeComplete && message.Length > 0)
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (2)
24Debug.Assert(certHashBytes.Length <= CertHashMaxSize); 26int length = certHashBytes.Length;
System\Net\Security\SslApplicationProtocol.cs (6)
32if (protocol.Length == 0 || protocol.Length > 255) 68for (int i = 0; i < arr.Length; i++) 91char[] byteChars = new char[arr.Length * 5]; 94for (int i = 0; i < byteChars.Length; i += 5) 104return new string(byteChars, 0, byteChars.Length - 1);
System\Net\Security\SslSessionsCache.cs (4)
59if (_thumbPrint.Length > 3) 82thumbPrint.Length == otherThumbPrint.Length && 211for (int i = 0; i < toRemoveAttempt.Length; ++i)
System\Net\Security\SslStream.cs (1)
824public void Write(byte[] buffer) => Write(buffer, 0, buffer.Length);
System\Net\Security\SslStream.Protocol.cs (4)
397if (issuers == null || issuers.Length == 0) 403NetEventSource.Log.LookForMatchingCerts(issuers.Length, this); 413if (issuers != null && issuers.Length != 0) 1392internal int Available => Payload == null ? 0 : Payload.Length - Size;
System\Net\Security\SslStreamCertificateContext.Linux.cs (6)
246X509Certificate2? caCert = _privateIntermediateCertificates.Length > 0 ? _privateIntermediateCertificates[0] : _rootCertificate; 266IntPtr[] issuerHandles = ArrayPool<IntPtr>.Shared.Rent(_privateIntermediateCertificates.Length + 1); 267for (int i = 0; i < _privateIntermediateCertificates.Length; i++) 271issuerHandles[_privateIntermediateCertificates.Length] = _rootCertificate.Handle; 298if (!Interop.Crypto.X509DecodeOcspToExpiration(ret, ocspRequest, subject, issuerHandles.AsSpan(0, _privateIntermediateCertificates.Length + 1), out DateTimeOffset expiration)) 320NetEventSource.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.Sockets (45)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]"; 181for (int i = 0; i < formattedArgs.Length; i++)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
54int bufferLength = arg3.Length;
src\libraries\Common\src\System\Net\RangeValidationHelpers.cs (1)
22if (segment.Offset < 0 || segment.Count < 0 || segment.Count > (segment.Array.Length - segment.Offset))
System\Net\Sockets\SendPacketsElement.cs (3)
65this(buffer, 0, (buffer != null ? buffer.Length : 0), false) 76ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 77ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)count, (uint)(buffer.Length - offset), nameof(count));
System\Net\Sockets\Socket.cs (10)
898if (addresses.Length == 0) 1062return Send(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags); 1067return Send(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None); 1317return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, remoteEP); 1322return SendTo(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, remoteEP); 1424return Receive(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags); 1429return Receive(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None); 1785return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, socketFlags, ref remoteEP); 1790return ReceiveFrom(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None, ref remoteEP); 2107int optionLength = optionValue != null ? optionValue.Length : 0;
System\Net\Sockets\Socket.Tasks.cs (6)
167if (addresses.Length == 0) 785SendPacketsElement[] sendPacketsElements = saea.SendPacketsElements?.Length == packetsCount 816ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 817ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)size, (uint)(buffer.Length - offset), nameof(size)); 824if ((uint)buffer.Offset > (uint)buffer.Array.Length) 828if ((uint)buffer.Count > (uint)(buffer.Array.Length - buffer.Offset))
System\Net\Sockets\SocketAsyncEngine.Unix.cs (1)
102int engineIndex = Math.Abs(Interlocked.Increment(ref s_allocateFromEngine) % s_engines.Length);
System\Net\Sockets\SocketAsyncEventArgs.cs (3)
368ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)offset, (uint)buffer.Length, nameof(offset)); 369ArgumentOutOfRangeException.ThrowIfGreaterThan((uint)count, (long)(buffer.Length - offset), nameof(count)); 564if (_acceptBuffer == null || _acceptBuffer.Length < _acceptAddressBufferCount)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (2)
242SafeFileHandle[] fileHandles = new SafeFileHandle[elements.Length]; 248for (int i = 0; i < elements.Length; i++)
System\Net\Sockets\SocketPal.Unix.cs (7)
1366if (optionOutValue == null || optionOutValue.Length < sizeof(int)) 1461Interop.Error err = Interop.Sys.SetSockOpt(handle, optionLevel, optionName, pinnedValue, optionValue != null ? optionValue.Length : 0); 1592if (optionValue == null || optionValue.Length == 0) 1597else if (optionName == SocketOptionName.Error && optionValue.Length >= sizeof(int)) 1930Debug.Assert(elements.Length == fileHandles.Length); 1931for (int i = 0; i < elements.Length; i++)
System\Net\Sockets\UDPClient.cs (4)
316ArgumentOutOfRangeException.ThrowIfGreaterThan(bytes, datagram.Length); 339for (; i < addresses.Length && !IsAddressFamilyCompatible(addresses[i].AddressFamily); i++) 343if (addresses.Length == 0 || i == addresses.Length)
System\Net\Sockets\UnixDomainSocketEndPoint.cs (4)
74for (int i = 0; i < _encodedPath.Length; i++) 80int length = _encodedPath.Length; 104for (int index = 0; index < _encodedPath.Length; index++) 168private static bool IsAbstract(byte[] encodedPath) => encodedPath.Length > 0 && encodedPath[0] == 0;
System\Net\Sockets\UnixDomainSocketEndPoint.Unix.cs (1)
34new SocketAddress(AddressFamily.Unix, s_nativePathOffset + _encodedPath.Length);
System.Net.WebClient (24)
src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (3)
29Debug.Assert(chunk._next == null || chunk._freeOffset == chunk._buffer.Length); 47int remaining = _currentChunk._buffer.Length - _currentChunk._freeOffset; 87int nextChunkLength = _currentChunk != null ? _currentChunk._buffer.Length * 2 : InitialChunkDefaultSize;
System\Net\WebClient.cs (21)
459_contentLength = data.Length; 526_contentLength = fs.Length + formHeaderBytes.Length + boundaryBytes.Length; 614_contentLength = buffer.Length; 841writeStream.SetLength(copyBuffer.Length); 849while ((bytesRead = readStream.Read(copyBuffer, 0, copyBuffer.Length)) != 0) 888writeStream.SetLength(copyBuffer.Length); 958writeStream.Write(header, 0, header.Length); 967int bytesRead = readStream.Read(buffer, 0, buffer.Length); 976for (int pos = 0; pos < buffer.Length;) 978int toWrite = buffer.Length - pos; 990writeStream.Write(footer, 0, footer.Length); 1026_progress.BytesSent += header.Length; 1047for (int pos = 0; pos < buffer.Length;) 1049int toWrite = buffer.Length - pos; 1064_progress.BytesSent += footer.Length; 1162return enc.GetString(data, bomLengthInData, data.Length - bomLengthInData); 1380_contentLength = requestData.Length; 1428_contentLength = data.Length; 1435chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, data.Length); 1511chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, buffer.Length);
System.Net.WebHeaderCollection (2)
System\Net\WebHeaderCollection.cs (2)
224for (int i = 0; i < values.Length; i++) 241valueList.RemoveRange(i, values.Length - i);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
138for (int i = 0; i < regexBypassList.Length; i++)
System.Net.WebSockets (12)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (5)
44if (validStates != null && validStates.Length > 0) 127if (arraySegment.Offset < 0 || arraySegment.Offset > arraySegment.Array.Length) 131if (arraySegment.Count < 0 || arraySegment.Count > (arraySegment.Array.Length - arraySegment.Offset)) 142ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 145ArgumentOutOfRangeException.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)
629Debug.Assert(sendBuffer.Length >= MaxMessageHeaderLength, $"Expected {nameof(sendBuffer)} to be at least {MaxMessageHeaderLength}, got {sendBuffer.Length}"); 1478Debug.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 (6)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (5)
44if (validStates != null && validStates.Length > 0) 127if (arraySegment.Offset < 0 || arraySegment.Offset > arraySegment.Array.Length) 131if (arraySegment.Count < 0 || arraySegment.Count > (arraySegment.Array.Length - arraySegment.Offset)) 142ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, buffer.Length); 145ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - offset);
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
154if (subprotocolArray.Length > 0 && !string.IsNullOrEmpty(subprotocolArray[0]))
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 (1643)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (4)
130int read = fileStream.Read(bytes, count, bytes.Length - count); 138if (count >= bytes.Length) 140byte[] temp = ArrayPool<byte>.Shared.Rent(bytes.Length * 2); 141Array.Copy(bytes, temp, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetCwd.cs (1)
35result = GetCwdHelper(ptr, buf.Length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
27if (capacity > version.Length)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (8)
85int tail2 = (last + 1) & (array.Length - 1); 111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize); 143segment._state._first = (first + 1) & (array.Length - 1); 209segment._state._first = (first + 1) & (segment._array.Length - 1); 233segment._state._first = (first + 1) & (array.Length - 1); 281segment._state._first = (first + 1) & (segment._array.Length - 1); 327pt = (pt + 1) & (segment._array.Length - 1)) 346int arraySize = segment._array.Length;
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
54if (count == arr.Length)
src\libraries\Common\src\System\Number.Formatting.Common.cs (4)
485int groupSizeLen = groupDigits.Length; // The length of groupDigits array. 764if (groupDigits.Length != 0) // You can pass in 0 length arrays 777if (groupSizeIndex < groupDigits.Length - 1) 810if (groupSizeIndex < groupDigits.Length - 1)
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (3)
62if (pkt.Length > PUBLIC_KEY_TOKEN_LEN) 66if (pkt.Length == 0) 72HexConverter.EncodeToUtf16(pkt, vsb.AppendSpan(pkt.Length * 2), HexConverter.Casing.Lower);
src\libraries\System.Private.CoreLib\src\Internal\Console.Unix.cs (2)
16Interop.Sys.Log(pBytes, bytes.Length); 27Interop.Sys.LogError(pBytes, bytes.Length);
src\libraries\System.Private.CoreLib\src\System\Activator.RuntimeType.cs (1)
33if (activationAttributes?.Length > 0)
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (9)
123base(message ?? SR.AggregateException_ctor_DefaultMessage, innerExceptions.Length > 0 ? innerExceptions[0] : null) 125_innerExceptions = cloneExceptions ? new Exception[innerExceptions.Length] : innerExceptions; 127for (int i = 0; i < _innerExceptions.Length; i++) 172for (int i = 0; i < _innerExceptions.Length; i++) 269for (int i = 0; i < _innerExceptions.Length; i++) 345if (_innerExceptions.Length == 0) 353for (int i = 0; i < _innerExceptions.Length; i++) 373for (int i = 0; i < _innerExceptions.Length; i++) 397internal int InnerExceptionCount => _innerExceptions.Length;
src\libraries\System.Private.CoreLib\src\System\ApplicationId.cs (1)
57HexConverter.EncodeToUtf16(_publicKeyToken, sb.AppendSpan(2 * _publicKeyToken.Length), HexConverter.Casing.Upper);
src\libraries\System.Private.CoreLib\src\System\Array.cs (103)
38return array.Length == 0 ? 55if (larray.Length != newSize) 67(uint)Math.Min(newSize, larray.Length)); 126if (lengths.Length == 0) 137for (int i = 0; i < lengths.Length; i++) 142return InternalCreate(t, lengths.Length, pLengths, null); 152if (lengths.Length != lowerBounds.Length) 154if (lengths.Length == 0) 165for (int i = 0; i < lengths.Length; i++) 171return InternalCreate(t, lengths.Length, pLengths, pLowerBounds); 179int[] intLengths = new int[lengths.Length]; 181for (int i = 0; i < lengths.Length; ++i) 256if (t.GetArrayRank() != lengths.Length) 263for (int i = 0; i < lengths.Length; i++) 268return InternalCreateFromArrayType(t, lengths.Length, pLengths, null); 302if (lengths.Length != lowerBounds.Length) 312if (t.GetArrayRank() != lengths.Length) 322for (int i = 0; i < lengths.Length; i++) 328return InternalCreateFromArrayType(t, lengths.Length, pLengths, pLowerBounds); 428if (Rank != indices.Length) 486if (Rank != indices.Length) 534if (Rank != indices.Length) 537int[] intIndices = new int[indices.Length]; 539for (int i = 0; i < indices.Length; ++i) 594if (Rank != indices.Length) 597int[] intIndices = new int[indices.Length]; 599for (int i = 0; i < indices.Length; ++i) 626int ICollection.Count => Length; 702if (o == null || this.Length != o.Length) 710while (i < o.Length && c == 0) 734if (!(other is Array o) || o.Length != this.Length) 740while (i < o.Length) 762for (int i = (this.Length >= 8 ? this.Length - 8 : 0); i < this.Length; i++) 787return BinarySearch(array, array.GetLowerBound(0), array.Length, value, null); 826return BinarySearch(array, array.GetLowerBound(0), array.Length, value, comparer); 853if (array.Length - (index - lb) < length) 994return BinarySearch(array, 0, array.Length, value, null); 1001return BinarySearch(array, 0, array.Length, value, comparer); 1018if (array.Length - index < length) 1036TOutput[] newArray = new TOutput[array.Length]; 1037for (int i = 0; i < array.Length; i++) 1056Copy(this, GetLowerBound(0), array!, index, Length); 1094for (int i = 0; i < array.Length; i++) 1112if ((uint)startIndex > (uint)array.Length) 1117if ((uint)count > (uint)(array.Length - startIndex)) 1148for (int i = 0; i < array.Length; i++) 1171for (int i = 0; i < array.Length; i++) 1188return FindIndex(array, 0, array.Length, match); 1198return FindIndex(array, startIndex, array.Length - startIndex, match); 1208if (startIndex < 0 || startIndex > array.Length) 1213if (count < 0 || startIndex > array.Length - count) 1244for (int i = array.Length - 1; i >= 0; i--) 1261return FindLastIndex(array, array.Length - 1, array.Length, match); 1286if (array.Length == 0) 1297if (startIndex < 0 || startIndex >= array.Length) 1332for (int i = 0; i < array.Length; i++) 1346return IndexOf(array, value, array.GetLowerBound(0), array.Length); 1360return IndexOf(array, value, startIndex, array.Length - startIndex + lb); 1377if (startIndex < lb || startIndex > array.Length + lb) 1379if (count < 0 || count > array.Length - startIndex + lb) 1489return IndexOf(array, value, 0, array.Length); 1499return IndexOf(array, value, startIndex, array.Length - startIndex); 1509if ((uint)startIndex > (uint)array.Length) 1514if ((uint)count > (uint)(array.Length - startIndex)) 1571return LastIndexOf(array, value, array.Length - 1 + lb, array.Length); 1598if (array.Length == 0) 1603if (startIndex < lb || startIndex >= array.Length + lb) 1715return LastIndexOf(array, value, array.Length - 1, array.Length); 1725return LastIndexOf(array, value, startIndex, (array.Length == 0) ? 0 : (startIndex + 1)); 1735if (array.Length == 0) 1755if ((uint)startIndex >= (uint)array.Length) 1826Reverse(array, array.GetLowerBound(0), array.Length); 1845if (array.Length - (index - lowerBound) < length) 1907if (array.Length > 1) 1908SpanHelpers.Reverse(ref MemoryMarshal.GetArrayDataReference(array), (nuint)array.Length); 1919if (array.Length - index < length) 1936Sort(array, null, array.GetLowerBound(0), array.Length, null); 1949Sort(keys, items, keys.GetLowerBound(0), keys.Length, null); 1982Sort(array, null, array.GetLowerBound(0), array.Length, comparer); 1997Sort(keys, items, keys.GetLowerBound(0), keys.Length, comparer); 2033if (keys.Length - (index - keysLowerBound) < length || (items != null && (index - keysLowerBound) > items.Length - length)) 2128if (array.Length > 1) 2130var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2139Sort(keys, items, 0, keys.Length, null); 2156Sort(array, 0, array.Length, comparer); 2163Sort(keys, items, 0, keys.Length, comparer); 2174if (array.Length - index < length) 2192if (keys.Length - index < length || (items != null && index > items.Length - length)) 2221var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length); 2237for (int i = 0; i < array.Length; i++) 2254/// <see cref="Length"/> property may return larger value than this property for multi-dimensional arrays.</para> 2692new Span<T>(ref Unsafe.As<byte, T>(ref MemoryMarshal.GetArrayDataReference(array)), array.Length).Slice(adjustedIndex, length);
src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (1)
115Debug.Assert(array == null || endIndex == array.Length);
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (4)
51_count = array.Length; 59if (array == null || (uint)offset > (uint)array.Length || (uint)count > (uint)(array.Length - offset)) 293Debug.Assert(arraySegment.Offset + arraySegment.Count <= arraySegment.Array.Length);
src\libraries\System.Private.CoreLib\src\System\Attribute.cs (5)
37for (int i = 0; i < thisFields.Length; i++) 64for (int i = 0; i < fields.Length; i++) 109if (thisValueArray.Length != thatValueArray.Length) 117for (int j = 0; j < thisValueArray.Length; j++)
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (15)
424if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 426if (startIndex > value.Length - sizeof(short)) 462if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 464if (startIndex > value.Length - sizeof(int)) 500if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 502if (startIndex > value.Length - sizeof(long)) 538if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 540if (startIndex > value.Length - Int128.Size) 664if (unchecked((uint)startIndex) >= unchecked((uint)value.Length)) 666if (startIndex > value.Length - UInt128.Size) 792if (startIndex < 0 || startIndex >= value.Length && startIndex > 0) 795if (startIndex > value.Length - length) 839return ToString(value, 0, value.Length); 857return ToString(value, startIndex, value.Length - startIndex); 874if (startIndex >= value.Length)
src\libraries\System.Private.CoreLib\src\System\Buffers\ConfigurableArrayPool.cs (14)
43for (int i = 0; i < buckets.Length; i++) 70if (index < _buckets.Length) 84log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, _buckets[i].Id); 89while (++i < _buckets.Length && i != index + MaxBucketsToTry); 105log.BufferRented(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId); 106log.BufferAllocated(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId, index >= _buckets.Length ? 118if (array.Length == 0) 126int bucket = Utilities.SelectBucketIndex(array.Length); 129bool haveBucket = bucket < _buckets.Length; 149log.BufferReturned(bufferId, array.Length, Id); 152log.BufferDropped(bufferId, array.Length, Id, ArrayPoolEventSource.NoBucketId, ArrayPoolEventSource.BufferDroppedReason.Full); 196if (_index < buffers.Length) 234if (array.Length != _bufferLength)
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (27)
61if (tlsBuckets is not null && (uint)bucketIndex < (uint)tlsBuckets.Length) 69log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex); 77if ((uint)bucketIndex < (uint)perCoreBuckets.Length) 87log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex); 114log.BufferRented(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId); 115log.BufferAllocated(bufferId, buffer.Length, Id, ArrayPoolEventSource.NoBucketId, bucketIndex >= _buckets.Length ? 130int bucketIndex = Utilities.SelectBucketIndex(array.Length); 140if ((uint)bucketIndex < (uint)tlsBuckets.Length) 151if (array.Length != Utilities.GetMaxSizeForBucket(bucketIndex)) 171if (log.IsEnabled() && array.Length != 0) 173log.BufferReturned(array.GetHashCode(), array.Length, Id); 176log.BufferDropped(array.GetHashCode(), array.Length, Id, 197for (int i = 0; i < perCoreBuckets.Length; i++) 222for (int i = 0; i < buckets.Length; i++) 226log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id); 247for (int i = 0; i < buckets.Length; i++) 268log.BufferTrimmed(buffer.GetHashCode(), buffer.Length, Id); 327for (int i = 0; i < partitions.Length; i++) 345for (int i = 0; i < partitions.Length; i++) 348if (++index == partitions.Length) index = 0; 365for (int i = 0; i < partitions.Length; i++) 368if (++index == partitions.Length) index = 0; 376for (int i = 0; i < partitions.Length; i++) 399if ((uint)count < (uint)arrays.Length) 423if ((uint)count < (uint)arrays.Length) 482log.BufferTrimmed(array.GetHashCode(), array.Length, id);
src\libraries\System.Private.CoreLib\src\System\Collections\ArrayList.cs (10)
73get => _items.Length; 83if (value != _items.Length) 155if (_size == _items.Length) EnsureCapacity(_size + 1); 279if (_items.Length < min) 281int newCapacity = _items.Length == 0 ? _defaultCapacity : _items.Length * 2; 389if (_size == _items.Length) EnsureCapacity(_size + 1); 825if (array.Length - arrayIndex < count) 2284if (array.Length - index < _baseSize) 2299if (array.Length - arrayIndex < count)
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (4)
359return head < tail ? tail - head : s._slots.Length - head + tail; 390head._slots.Length - headHead + headTail; 455if (index > array.Length - count) 565for (int i = headHead; i < head._slots.Length; i++) yield return GetItemWhenAvailable(head, i);
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueueSegment.cs (4)
70for (int i = 0; i < _slots.Length; i++) 77internal int Capacity => _slots.Length; 80internal int FreezeOffset => _slots.Length * 2; 149Volatile.Write(ref slots[slotsIndex].SequenceNumber, currentHead + slots.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (2)
76Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 327Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (2)
94if (list._items.Length - list._size < source.Length) 126if (list._items.Length - list._size < source.Length)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (38)
131Debug.Assert(_entries.Length >= source.Count); 214public int Capacity => _entries?.Length ?? 0; 349if ((uint)index > (uint)array.Length) 354if (array.Length - index < Count) 387info.AddValue(HashSizeName, _buckets == null ? 0 : _buckets.Length); // This is the length of the bucket array 422if ((uint)i >= (uint)entries.Length) 436} while (collisionCount <= (uint)entries.Length); 453if ((uint)i >= (uint)entries.Length) 467} while (collisionCount <= (uint)entries.Length); 536while ((uint)i < (uint)entries.Length) 557if (collisionCount > (uint)entries.Length) 568while ((uint)i < (uint)entries.Length) 589if (collisionCount > (uint)entries.Length) 609if (count == entries.Length) 632Resize(entries.Length, true); 677while ((uint)i < (uint)entries.Length) 689if (collisionCount > (uint)entries.Length) 700while ((uint)i < (uint)entries.Length) 712if (collisionCount > (uint)entries.Length) 732if (count == entries.Length) 755dictionary.Resize(entries.Length, true); 802for (int i = 0; i < array.Length; i++) 828Debug.Assert(newSize >= _entries.Length); 929if (collisionCount > (uint)entries.Length) 1004if (collisionCount > (uint)entries.Length) 1055if ((uint)index > (uint)array.Length) 1060if (array.Length - index < Count) 1119int currentCapacity = _entries == null ? 0 : _entries.Length; 1168int currentCapacity = oldEntries == null ? 0 : oldEntries.Length; 1322return ref buckets[HashHelpers.FastMod(hashCode, (uint)buckets.Length, _fastModMultiplier)]; 1484if (index < 0 || index > array.Length) 1489if (array.Length - index < _dictionary.Count) 1544if ((uint)index > (uint)array.Length) 1549if (array.Length - index < _dictionary.Count) 1679if ((uint)index > array.Length) 1684if (array.Length - index < _dictionary.Count) 1738if ((uint)index > (uint)array.Length) 1743if (array.Length - index < _dictionary.Count)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (18)
113if (_count > 0 && _entries!.Length / _count > ShrinkThreshold) 155int capacity = source._buckets!.Length; 243if (collisionCount > (uint)entries.Length) 265if (collisionCount > (uint)entries.Length) 283return ref buckets[HashHelpers.FastMod((uint)hashCode, (uint)buckets.Length, _fastModMultiplier)]; 341if (collisionCount > (uint)entries.Length) 359public int Capacity => _entries?.Length ?? 0; 390info.AddValue(CapacityName, _buckets == null ? 0 : _buckets.Length); 435for (int i = 0; i < array.Length; i++) 872if (arrayIndex > array.Length || count > array.Length - arrayIndex) 945int currentCapacity = _entries == null ? 0 : _entries.Length; 968Debug.Assert(newSize >= _entries.Length); 1027int currentCapacity = oldEntries == null ? 0 : oldEntries.Length; 1124if (collisionCount > (uint)entries.Length) 1148if (collisionCount > (uint)entries.Length) 1167if (count == entries.Length) 1192Resize(entries.Length, forceNewHashCodes: true);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\IDictionaryDebugView.cs (2)
26var items = new DebugViewDictionaryItem<TKey, TValue>[keyValuePairs.Length]; 27for (int i = 0; i < items.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (13)
99get => _items.Length; 107if (value != _items.Length) 201if ((uint)size < (uint)array.Length) 216Debug.Assert(_size == _items.Length); 255if (_items.Length - _size < count) 439if (_items.Length < capacity) 444return _items.Length; 490Debug.Assert(_items.Length < capacity); 492int newCapacity = _items.Length == 0 ? DefaultCapacity : 2 * _items.Length; 777if (_size == _items.Length) 826if (_items.Length - _size < count) 1161int threshold = (int)(((double)_items.Length) * 0.9);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (26)
52if (_size != _array.Length) _tail = _size; 60public int Capacity => _array.Length; 80Array.Clear(_array, _head, _array.Length - _head); 99if (arrayIndex < 0 || arrayIndex > array.Length) 104if (array.Length - arrayIndex < _size) 112int firstPart = Math.Min(_array.Length - _head, numToCopy); 117Array.Copy(_array, 0, array, arrayIndex + _array.Length - _head, numToCopy); 135int arrayLen = array.Length; 151int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy; 157Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy); 169if (_size == _array.Length) 278Array.IndexOf(_array, item, _head, _array.Length - _head) >= 0 || 301Array.Copy(_array, _head, arr, 0, _array.Length - _head); 302Array.Copy(_array, 0, arr, _array.Length - _head, _tail); 322Array.Copy(_array, _head, newarray, 0, _array.Length - _head); 323Array.Copy(_array, 0, newarray, _array.Length - _head, _tail); 340if (tmp == _array.Length) 355int threshold = (int)(_array.Length * 0.9); 372if (capacity == _array.Length) 387if (_array.Length < capacity) 392return _array.Length; 397Debug.Assert(_array.Length < capacity); 402int newcapacity = GrowFactor * _array.Length; 409newcapacity = Math.Max(newcapacity, _array.Length + MinimumGrow); 462uint capacity = (uint)array.Length;
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (39)
430for (int i = 0; i < _buckets.Length; i++) 454int bucket = lbuckets.Length; 483uint hashcode = InitHash(key, lbuckets.Length, out uint seed, out uint incr); 487int bucketNumber = (int)(seed % (uint)lbuckets.Length); 498bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length); 499} while (b.hash_coll < 0 && ++ntry < lbuckets.Length); 513for (int i = _buckets.Length; --i >= 0;) 521for (int i = _buckets.Length; --i >= 0;) 540for (int i = lbuckets.Length; --i >= 0;) 559for (int i = lbuckets.Length; --i >= 0;) 579if (array.Length - arrayIndex < Count) 590for (int i = lbuckets.Length; --i >= 0;) 611for (int i = lbuckets.Length; --i >= 0;) 632uint hashcode = InitHash(key, lbuckets.Length, out uint seed, out uint incr); 636int bucketNumber = (int)(seed % (uint)lbuckets.Length); 677bucketNumber = (int)(((long)bucketNumber + incr) % (uint)lbuckets.Length); 678} while (b.hash_coll < 0 && ++ntry < lbuckets.Length); 694int rawsize = HashHelpers.ExpandPrime(_buckets.Length); 701rehash(_buckets.Length); 726for (nb = 0; nb < _buckets.Length; nb++) 845uint hashcode = InitHash(key, _buckets.Length, out uint seed, out uint incr); 849int bucketNumber = (int)(seed % (uint)_buckets.Length); 912bucketNumber = (int)(((long)bucketNumber + incr) % (uint)_buckets.Length); 913} while (++ntry < _buckets.Length); 943uint incr = unchecked((uint)(1 + ((seed * HashHelpers.HashPrime) % ((uint)newBuckets.Length - 1)))); 944int bucketNumber = (int)(seed % (uint)newBuckets.Length); 960bucketNumber = (int)(((long)bucketNumber + incr) % (uint)newBuckets.Length); 975uint hashcode = InitHash(key, _buckets.Length, out uint seed, out uint incr); 979int bn = (int)(seed % (uint)_buckets.Length); // bucketNumber 1003bn = (int)(((long)bn + incr) % (uint)_buckets.Length); 1004} while (b.hash_coll < 0 && ++ntry < _buckets.Length); 1065info.AddValue(HashSizeName, _buckets.Length); // This is the length of the bucket array. 1160if (serKeys.Length != serValues.Length) 1164for (int i = 0; i < serKeys.Length; i++) 1196if (array.Length - arrayIndex < _hashtable._count) 1231if (array.Length - arrayIndex < _hashtable._count) 1411_bucket = hashtable._buckets.Length; 1490_bucket = _hashtable._buckets.Length;
src\libraries\System.Private.CoreLib\src\System\Collections\ListDictionaryInternal.cs (2)
157if (array.Length - index < this.Count) 310if (array.Length - index < list.Count)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (1)
192if (array.Length - index < Count)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (2)
25ArgumentOutOfRangeException.ThrowIfGreaterThan(index, array.Length); 27if (array.Length - index < sourceCount)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (1)
122if (array.Length - index < Count)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (7)
2338ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 2396int inArrayLength = inArray.Length; 2404int outArrayLength = outArray.Length; 2799ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 2801if (inArray.Length == 0) 3060ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length); 3137ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, inArray.Length - length);
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (1)
562for (int i = 0; i < formats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (60)
35if (match == null || match.Length == 0) 51int[][] paramOrder = new int[candidates.Length][]; 53for (i = 0; i < candidates.Length; i++) 58paramOrder[i] = new int[(par.Length > args.Length) ? par.Length : args.Length]; 76Type[] paramArrayTypes = new Type[candidates.Length]; 78Type[] argTypes = new Type[args.Length]; 83for (i = 0; i < args.Length; i++) 99for (i = 0; i < candidates.Length; i++) 113if (args.Length != 0) 126else if (par.Length > args.Length) 131for (j = args.Length; j < par.Length - 1; j++) 152else if (par.Length < args.Length) 187int argsToCheck = (paramArrayType != null) ? par.Length - 1 : args.Length; 200if (index < args.Length) 255for (; j < args.Length; j++) 283if (j == args.Length) 303state = new BinderState((int[])paramOrder[0].Clone(), args.Length, paramArrayTypes[0] != null); 311if (parms.Length == args.Length) 323else if (parms.Length > args.Length) 330if (k < args.Length) 356objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[0], args.Length - paramArrayPos); 357Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 394state = new BinderState((int[])paramOrder[currentMin].Clone(), args.Length, paramArrayTypes[currentMin] != null); 401if (parameters.Length == args.Length) 413else if (parameters.Length > args.Length) 417for (i = 0; i < args.Length; i++) 441objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[currentMin], args.Length - paramArrayPos); 442Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 469for (i = 0; i < candidates.Length; i++) 545Type[] realTypes = new Type[types.Length]; 546for (i = 0; i < types.Length; i++) 555if (match == null || match.Length == 0) 563for (i = 0; i < candidates.Length; i++) 566if (par.Length != types.Length) 568for (j = 0; j < types.Length; j++) 598if (j == types.Length) 609int[] paramOrder = new int[types.Length]; 610for (i = 0; i < types.Length; i++) 645if (match == null || match.Length == 0) 654int indexesLength = (indexes != null) ? indexes.Length : 0; 655for (i = 0; i < candidates.Length; i++) 660if (par.Length != indexesLength) 761int paramArrayPos = args.Length - 1; 762if (args.Length == binderState._originalSize) 769object[] newArgs = new object[args.Length]; 771for (int i = paramArrayPos, j = 0; i < newArgs.Length; i++, j++) 780if (args.Length > binderState._originalSize) 795MethodBase[] aExactMatches = new MethodBase[match.Length]; 798for (int i = 0; i < match.Length; i++) 806for (j = 0; j < types.Length; j++) 814if (j < types.Length) 838int typesLength = (types != null) ? types.Length : 0; 839for (int i = 0; i < match.Length; i++) 877for (int i = 0; i < types.Length; i++) 1162object?[] varsCopy = new object[vars.Length]; 1163for (int i = 0; i < vars.Length; i++) 1168for (int i = 0, j = 0; i < vars.Length; j++) 1170if (paramOrder[j] < vars.Length) 1192for (int i = 0; i < names.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackFrame.cs (1)
218while (k < typars.Length)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (1)
269while (k < typars.Length)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (2)
118else if (eventSourceIndex >= s_counterGroups.Length) 121Array.Copy(s_counterGroups, newCounterGroups, s_counterGroups.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (3)
39for (int i = 0; i < bufferedValues.Length; i++) 156if (_bufferedValues.Length <= i) 177for (int i = 0; i < _bufferedValues.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (4)
120Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length); 125for (int i = 0; i < providers.Length; i++) 138for (int i = 0; i < providers.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
23EventParameterInfo[] eventParams = new EventParameterInfo[parameters.Length]; 24for (int i = 0; i < parameters.Length; i++) 51EventParameterInfo[] eventParams = new EventParameterInfo[typeInfos.Length]; 52for (int i = 0; i < typeInfos.Length; i++) 91if ((parameters.Length == 1) && (parameters[0].ParameterType == typeof(EmptyStruct))) 166WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length); 195WriteToBuffer(pMetadata, totalMetadataLength, ref offset, (uint)parameters.Length); 276EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length); 329EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length); 422EventPipeMetadataGenerator.WriteToBuffer(pMetadataBlob, blobSize, ref offset, (uint)properties.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs (2)
18object[] decodedFields = new object[parameters.Length]; 19for (int i = 0; i < parameters.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (9)
279*(int*)dataBuffer = blobRet.Length; 287dataDescriptor->Size = (uint)blobRet.Length; 474int argCount = eventPayload.Length; 506for (index = 0; index < eventPayload.Length; index++) 518if (eventPayload.Length + idx + 1 - index > EtwMaxNumberArguments) 1339while (idx < buffer.Length && buffer[idx] != 0) 1356while (dataStart < data.Length) 1361if (valueEnd < data.Length) 1385Marshal.Copy((IntPtr)(void*)filterData->Ptr, data, 0, data.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (63)
390return (manifestBytes == null) ? null : Encoding.UTF8.GetString(manifestBytes, 0, manifestBytes.Length); 470for (int i = 0; i < m_traits.Length - 1; i += 2) 717int cnt = m_eventData.Length; 725uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0; 1057if (arg1 == null || arg1.Length == 0) 1070int blobSize = arg1.Length; 1095if (arg2 == null || arg2.Length == 0) 1108int blobSize = arg2.Length; 1396var argValues = new object?[args.Length]; 1397for (int i = 0; i < args.Length; i++) 1576if (m_traits != null && m_traits.Length % 2 != 0) 1704for (int i = 0; i < decodedObjects.Length; i++, data++) 1854Marshal.Copy(data->DataPointer, blob, 0, blob.Length); 2014int paramCount = Math.Min(eventTypes.typeInfos.Length, args.Length); // parameter count mismatch get logged in LogEventArgsMismatches 2015var eventData = new object?[eventTypes.typeInfos.Length]; 2034if (args.Length != infos.Length) 2036ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventId, args.Length, infos.Length)); 2040for (int i = 0; i < args.Length; i++) 2065ReportOutOfBandMessage(SR.Format(SR.EventSource_EventParametersMismatch, eventCallbackArgs.EventId, eventDataCount, metadata.Parameters.Length)); 2075args = new object?[Math.Min(eventDataCount, metadata.Parameters.Length)]; 2079for (int i = 0; i < args.Length; i++, data++) 2088for (int i = 0; i < args.Length; i++, data++) 2212uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0; 2259for (int evtId = 0; evtId < dispatcher.m_EventEnabled.Length; ++evtId) 2311if (eventChannel != EventChannel.None && this.m_channelData != null && this.m_channelData.Length > (int)eventChannel) 2474var names = new string[parameters.Length]; 2475for (int i = 0; i < names.Length; i++) 2494var types = new Type[parameters.Length]; 2495for (int i = 0; i < types.Length; i++) 2613for (int i = 0; i < m_eventData.Length; i++) 2686for (int i = 0; i < m_eventData.Length; i++) 2755if (eventId >= m_eventData.Length) 2769if (eventId >= dispatcher.m_EventEnabled.Length) 2785for (int i = 0; i < m_eventData.Length; i++) 2827dispatcher.m_EventEnabled ??= new bool[m_eventData.Length]; 2859int dataLeft = rawManifest.Length; 3087eventData = new EventMetadata[methods.Length + 1]; 3161for (int i = 0; i < methods.Length; i++) 3252if (eventData != null && startEventId < eventData.Length) 3284for (int fieldIdx = 0; fieldIdx < args.Length; fieldIdx++) 3336bNeedsManifest = (flags & EventManifestOptions.OnlyIfNeededForRegistration) == 0 || manifest.GetChannelData().Length > 0; 3343res = (res.Length > 0) ? res : null; 3382if (args.Length > 0 && args[0].ParameterType == typeof(Guid) && 3385var newargs = new ParameterInfo[args.Length - 1]; 3386Array.Copy(args, 1, newargs, 0, args.Length - 1); 3434if (eventData.Length <= eventAttribute.EventId) 3436EventMetadata[] newValues = new EventMetadata[Math.Max(eventData.Length + 16, eventAttribute.EventId + 1)]; 3437Array.Copy(eventData, newValues, eventData.Length); 3463int eventListenerParameterCount = eventParameters.Length; 3501int idx = eventData.Length; 3508if (eventData.Length - idx > 2) // allow one wasted slot. 3511Array.Copy(eventData, newValues, newValues.Length); 3524enabledArray = new bool[m_eventData.Length]; 3544if (evtId < eventData.Length && eventData[evtId].Descriptor.EventId != 0) 3552for (int idx = 0; idx < eventData.Length; ++idx) 3643for (int idx = 0; idx < instrs.Length;) 3697for (int search = idx + 1; search < instrs.Length; search++) 3733if (idx >= instrs.Length || instrs[idx] >= 6) 4261for (int i = 0; i < eventDispatcher.m_EventEnabled.Length; ++i) 4468for (int i = 0; i < eventSourcesSnapshot.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.cs (1)
54if (eventID >= m_eventData!.Length)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs (4)
34count = array.Length; 35for (int i = 0; i < array.Length; i++) 48var serializedArray = new object?[array.Length]; 49for (int i = 0; i < array.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ConcurrentSet.cs (3)
33int hi = oldItems.Length; 78int hi = oldItems.Length; 100int oldLength = oldItems.Length;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (3)
281if (this.buffer == null || this.buffer.Length < required) 290if (this.buffer == null || this.buffer.Length < required) 298int newSize = this.buffer == null ? 64 : this.buffer.Length;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (3)
19Debug.Assert(payloadNames.Length == payloadValues.Length); 81public int Count => m_names.Length;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (1)
87checked((ushort)(custom == null ? 0 : custom.Length)),
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\InvokeTypeInfo.cs (4)
28if (typeAnalysis.properties.Length != 0) 73var membersNames = new string[this.properties.Length]; 74var membersValues = new object?[this.properties.Length]; 75for (int i = 0; i < this.properties.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\NameInfo.cs (1)
91uint metadataLength = (metadata != null) ? (uint)metadata.Length : 0;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (2)
339if (attributes.Length != 0) 351if (attributes.Length != 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingDataCollector.cs (1)
95DataCollector.ThreadInstance.AddArray(array, array == null ? 0 : array.Length, elementSize);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (4)
29if (eventID >= 0 && eventID < innerTable.Length) 43if (eventID >= m_innerTable.Length) 45int newSize = m_innerTable.Length * 2; 52Array.Copy(m_innerTable, newTable, m_innerTable.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (11)
442descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1); 443descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1); 455for (int i = 0; i < eventTypes.typeInfos.Length; i++) 537int descriptorsLength = eventTypes.dataCount + eventTypes.typeInfos.Length * 2 + 3; 549descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1); 550descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1); 553for (int i = 0; i < eventTypes.typeInfos.Length; i++) 620descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1); 621descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1); 746for (int i = 0; i < m_traits.Length - 1; i += 2) 773int startPos = providerMetadata.Length - traitMetaData.Count;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventTypes.cs (10)
97for (int i = 0; i < typeInfos.Length; ++i) 171this.nameInfos.GetOrAdd(new NameInfo(name, tags, this.typeMetadata.Length)); 178var recursionCheck = new List<Type>(paramInfos.Length); 179var result = new TraceLoggingTypeInfo[paramInfos.Length]; 180for (int i = 0; i < paramInfos.Length; ++i) 193var recursionCheck = new List<Type>(types.Length); 194var result = new TraceLoggingTypeInfo[types.Length]; 195for (int i = 0; i < types.Length; i++) 215string[] paramNames = new string[paramInfos.Length]; 216for (int i = 0; i < paramNames.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TypeAnalysis.cs (1)
38propertyInfo.GetIndexParameters().Length != 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
153HexConverter.EncodeToUtf16(byteArray, builder.AppendSpan(byteArray.Length * 2));
src\libraries\System.Private.CoreLib\src\System\Enum.cs (19)
189if (uint32Value < (uint)names.Length) 197if (ulong.CreateTruncating(value) < (ulong)names.Length) 208if ((uint)index < (uint)names.Length) 295var result = new TEnum[values.Length]; 296Array.Copy(values, result, values.Length); 504return ulong.CreateTruncating(value) < (ulong)values.Length; 536return values.Length <= NumberOfValuesThreshold ? 1085for (int i = 0; i < enumNames.Length; i++) 1097for (int i = 0; i < enumNames.Length; i++) 1935Debug.Assert(names.Length == values.Length); 1970Debug.Assert(names.Length == values.Length); 2034return values.Length > 0 && values[0] == TStorage.Zero ? 2043for (i = values.Length - 1; (uint)i < (uint)values.Length; i--) 2073if ((uint)index >= (uint)values.Length) 2273for (int i = 0; i < values.Length; i++) 2286for (int i = 1; i < values.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (7)
149if (this.saMonthGenitiveNames == null || this.saMonthGenitiveNames.Length == 0 || string.IsNullOrEmpty(this.saMonthGenitiveNames[0])) 151if (this.saAbbrevMonthGenitiveNames == null || this.saAbbrevMonthGenitiveNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevMonthGenitiveNames[0])) 153if (this.saLeapYearMonthNames == null || this.saLeapYearMonthNames.Length == 0 || string.IsNullOrEmpty(this.saLeapYearMonthNames[0])) 173this.iCurrentEra = this.saEraNames.Length; 265this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0]); 277if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevEraNames[0])) 318if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || string.IsNullOrEmpty(this.saAbbrevEraNames[0]))
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (5)
64Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13); 99count = Interop.Globalization.GetCalendars(localeName, calendars, calendars.Length); 103if (count == 0 && calendars.Length > 0) 408if (calendarId != CalendarId.JAPAN && calendarId != CalendarId.JAPANESELUNISOLAR && eraNames?.Length > 0) 410string[] latestEraName = new string[] { eraNames![eraNames.Length - 1] };
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
412pBytes, keyData.Length,
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (6)
1383_saLongTimes = longTimes != null && longTimes.Length != 0 ? longTimes : Invariant._saLongTimes!; 1404_saShortTimes = shortTimes != null && shortTimes.Length != 0 ? shortTimes : DeriveShortTimesFromLong(); 1418string[] shortTimes = new string[longTimes.Length]; 1420for (int i = 0; i < longTimes.Length; i++) 2179if (digits.Length < NumberFormatInfo.s_asciiDigits.Length) 2200for (int i = 0; i < result.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (3)
275for (int i = 0; i < array.Length; i++) 316for (i = 0, j = 0; i < win32Str.Length && j < values.Length; i += 2, j++) 503for (int i = 0; i < cultures.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (2)
880Calendar[] cals = new Calendar[calID.Length]; 881for (int i = 0; i < cals.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (4)
1737results = new string[allFormats.Length]; 1738for (int i = 0; i < allFormats.Length; i++) 1746results = new string[allFormats.Length]; 1747for (int i = 0; i < allFormats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (65)
172Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 186Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week"); 200Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 214Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13, 229Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13, 272Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 275Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 278Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 281Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 284Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 386for (int i = 0; i < OptionalCalendars.Length; i++) 482for (int i = 0; i < EraNames.Length; i++) 493for (int i = 0; i < AbbreviatedEraNames.Length; i++) 501for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++) 530if ((uint)era >= names.Length) 545if (AbbreviatedEraNames.Length == 0) 559if ((uint)era >= (uint)names.Length) 1038Debug.Assert(values.Length >= length); 1058if (value.Length != 7) 1063CheckNullValue(value, value.Length); 1083if (value.Length != 7) 1088CheckNullValue(value, value.Length); 1103if (value.Length != 7) 1108CheckNullValue(value, value.Length); 1125if (value.Length != 13) 1130CheckNullValue(value, value.Length - 1); 1146if (value.Length != 13) 1151CheckNullValue(value, value.Length - 1); 1177if ((uint)month >= (uint)monthNamesArray.Length) 1179ThrowHelper.ThrowArgumentOutOfRange_Range(nameof(month), month + 1, 1, monthNamesArray.Length); 1196Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13, 1206Debug.Assert(genitiveMonthNames.Length == 13, 1224Debug.Assert(leapYearMonthNames.Length == 13, 1235if ((uint)dow >= (uint)names.Length) 1250if ((uint)dow >= (uint)names.Length) 1267string[] result = new string[patterns1.Length * patterns2.Length]; 1271for (int i = 0; i < patterns1.Length; i++) 1273for (int j = 0; j < patterns2.Length; j++) 1362if ((uint)dow >= (uint)names.Length) 1374if ((uint)month >= (uint)names.Length) 1386if ((uint)month >= (uint)names.Length) 1405Debug.Assert(patterns != null && patterns.Length > 0, 1418for (i = 0; i < patterns.Length; i++) 1429if (i < patterns.Length) 1441newPatterns = new string[patterns.Length + 1]; 1444Array.Copy(patterns, 0, newPatterns, 1, patterns.Length); 1485Debug.Assert(allYearMonthPatterns.Length > 0, 1506Debug.Assert(allShortDatePatterns.Length > 0, 1527Debug.Assert(allLongDatePatterns.Length > 0, 1547Debug.Assert(allShortTimePatterns.Length > 0, 1567Debug.Assert(allLongTimePatterns.Length > 0, 1629if (patterns.Length == 0) 1634for (int i = 0; i < patterns.Length; i++) 1691if (value.Length != 13) 1696CheckNullValue(value, value.Length - 1); 1712if (value.Length != 13) 1717CheckNullValue(value, value.Length - 1); 2064for (int i = 0; i < dateWords.Length; i++) 2143for (int i = 1; i <= eras.Length; i++) 2164for (int i = 1; i <= jaDtfi.Calendar.Eras.Length; i++) 2177for (int i = 1; i <= twDtfi.Calendar.Eras.Length; i++) 2212for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (6)
486for (i = 0; i < datePatterns.Length; i++) 493for (i = 0; i < datePatterns.Length; i++) 499for (i = 0; i < datePatterns.Length; i++) 509for (i = 0; i < datePatterns.Length; i++) 516for (i = 0; i < datePatterns.Length; i++) 600for (int i = 0; i < array.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (8)
184if (formats.Length == 0) 196for (int i = 0; i < formats.Length; i++) 3672for (int i = 0; i < eras.Length; i++) 5268if (strs == null || strs.Length == 0) 5270if (strs.Length == 1) 5282for (int i = 1; i < strs.Length - 1; i++) 5303s = Hex(strs[strs.Length - 1]); 5707for (int i = 0; i < words.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\EastAsianLunisolarCalendar.cs (2)
96for (int i = 0; i < eraInfo.Length; i++) 126for (int i = 0; i < eraInfo.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\GregorianCalendarHelper.cs (3)
92for (int i = 0; i < eras.Length; i++) 368var eras = new int[eraInfo.Length]; 369for (int i = 0; i < eraInfo.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (3)
301private static readonly char s_maxHebrewNumberCh = (char)(minHebrewNumberCh + s_hebrewValues.Length - 1); 399Debug.Assert(s_numberPassingState.Length == HebrewTokenCount * ((int)HS.S9_DQ + 1)); 413if (index >= 0 && index < s_hebrewValues.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (1)
46if (actualLength == 0 || actualLength > outputHeap.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.cs (9)
211string[] eraNames = new string[eras.Length]; 213for (int i = 0; i < eras.Length; i++) 216eraNames[i] = eras[eras.Length - i - 1].eraName!; 225string[] erasAbbrev = new string[eras.Length]; 227for (int i = 0; i < eras.Length; i++) 230erasAbbrev[i] = eras[eras.Length - i - 1].abbrevEraName!; 239string[] erasEnglish = new string[eras.Length]; 241for (int i = 0; i < eras.Length; i++) 244erasEnglish[i] = eras[eras.Length - i - 1].englishEraName!;
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (5)
106if (abbrevEnglishEraNames[abbrevEnglishEraNames.Length - 1].Length == 0 || abbrevEnglishEraNames[abbrevEnglishEraNames.Length - 1][0] > '\u007F') 112int startIndex = abbrevEnglishEraNames == s_abbreviatedEnglishEraNames ? eras.Count - 1 : abbrevEnglishEraNames.Length - 1; 114Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 120if (startIndex < abbrevEnglishEraNames.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseLunisolarCalendar.cs (2)
169EraInfo[] newEras = new EraInfo[baseEras.Length]; 173for (int i = 0; i < baseEras.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (4)
108if (nativeDig.Length != 10) 113for (int i = 0; i < nativeDig.Length; i++) 285for (int i = 0; i < groupSize.Length; i++) 289if (i == groupSize.Length - 1 && groupSize[i] == 0)
src\libraries\System.Private.CoreLib\src\System\Globalization\StringInfo.cs (5)
67public int LengthInTextElements => Indexes?.Length ?? 0; 71return SubstringByTextElements(startingTextElement, (Indexes?.Length ?? 0) - startingTextElement); 78if ((uint)startingTextElement >= (uint)indexes.Length) 82if ((uint)lengthInTextElements > (uint)(indexes.Length - startingTextElement)) 90if ((uint)(startingTextElement + lengthInTextElements) < (uint)indexes.Length)
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (1)
503for (int i = 0; i < _literals.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (2)
1683if (formats.Length == 0) 1690for (int i = 0; i < formats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (1)
231for (int i = 0; i < mapping.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Guid.cs (1)
114if (d.Length != 8)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (4)
300if (buffer.Length - index < count) 419if (buffer.Length - index < count) 445int numRead = _stream.ReadAtLeast(result, result.Length, throwOnEndOfStream: false); 447if (numRead != result.Length)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (2)
160OutStream.Write(buffer, 0, buffer.Length); 235if (index > chars.Length - count)
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (1)
121if (_buffer.Length != _bufferSize || _bufferSize >= MaxShadowBufferSize)
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (2)
110FindNextEntry(entryBufferPtr, _entryBuffer == null ? 0 : _entryBuffer.Length); 171FindNextEntry(entryBufferPtr, _entryBuffer == null ? 0 : _entryBuffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (4)
1030if (bytesRead == rentedArray.Length) 1032uint newLength = (uint)rentedArray.Length * 2; 1035newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1); 1047Debug.Assert(bytesRead < rentedArray.Length);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (2)
66_length = _capacity = buffer.Length; 87if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
80if (TryGetHomeDirectoryFromPasswd(buf, heapBuf.Length, out userHomeDirectory))
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
25int len = array.Length;
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (2)
68while ((bytesRead = Read(buffer, 0, buffer.Length)) != 0) 968if ((uint)count > buffer.Length - offset)
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (16)
354if (buffer.Length - index < count) 433if (buffer.Length - index < count) 465_ = byteBuffer.Length; // allow JIT to prove object is not null 526int newMaxCharsPerBuffer = _encoding.GetMaxCharCount(byteBuffer.Length); 599int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos); 613_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length); 626_isBlocked = (_byteLen < _byteBuffer.Length); 703int len = _stream.Read(_byteBuffer, _bytePos, _byteBuffer.Length - _bytePos); 717_byteLen = _stream.Read(_byteBuffer, 0, _byteBuffer.Length); 730_isBlocked = (_byteLen < _byteBuffer.Length); 964else if ((arrayPoolBuffer.Length - arrayPoolBufferPos) < (charLen - charPos)) 1055if (buffer.Length - index < count) 1142int len = await tmpStream.ReadAsync(new Memory<byte>(tmpByteBuffer, tmpBytePos, tmpByteBuffer.Length - tmpBytePos), cancellationToken).ConfigureAwait(false); 1192_isBlocked = (_byteLen < tmpByteBuffer.Length); 1266if (buffer.Length - index < count) 1364_isBlocked = (_byteLen < tmpByteBuffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (11)
312(_byteBuffer = new byte[_encoding.GetMaxByteCount(_charBuffer.Length)]); 377if (buffer.Length - index < count) 434if (dstPos == charBuffer.Length) 440int n = Math.Min(charBuffer.Length - dstPos, count); 456for (int i = 0; i < coreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 687for (int i = 0; i < CoreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 737if (buffer.Length - index < count) 801for (int i = 0; i < CoreNewLine.Length; i++) // Generally 1 (\n) or 2 (\r\n) iterations 889if (buffer.Length - index < count) 986if (preamble.Length > 0) 992byte[] byteBuffer = _byteBuffer ??= new byte[_encoding.GetMaxByteCount(_charBuffer.Length)];
src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (3)
92if (buffer.Length - index < count) 293if (buffer.Length - index < count) 311if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\StringWriter.cs (1)
94if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (6)
76if (buffer.Length - index < count) 123while ((len = Read(chars, 0, chars.Length)) != 0) 266if (buffer.Length - index < count) 296if (buffer.Length - index < count) 396if (buffer.Length - index < count) 409if (buffer.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (2)
38return writers.Length != 0 ? 49Debug.Assert(writers is { Length: > 0 });
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (4)
136Write(buffer, 0, buffer.Length); 150if (buffer.Length - index < count) 581return WriteAsync(buffer, 0, buffer.Length); 645return WriteLineAsync(buffer, 0, buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (2)
319if (array.Length - offset < count) 545if (array.Length - offset < count)
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStreamWrapper.cs (1)
119stream.Write(buffer, 0, buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Memory.cs (5)
52_length = array.Length; 67if ((uint)start > (uint)array.Length) 72_length = array.Length - start; 101if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) 308lengthOfUnderlyingSpan = Unsafe.As<T[]>(tmpObject).Length;
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (8)
37if ((uint)start > (uint)array.Length) 40return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start /* force zero-extension */), array.Length - start); 60int actualIndex = startIndex.GetOffset(array.Length); 61if ((uint)actualIndex > (uint)array.Length) 64return new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)actualIndex /* force zero-extension */), array.Length - actualIndex); 87(int start, int length) = range.GetOffsetAndLength(array.Length); 2769int actualIndex = startIndex.GetOffset(array.Length); 2803(int start, int length) = range.GetOffsetAndLength(array.Length);
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (4)
332Debug.Assert(offset < end && end <= originalBytes.Length); 557if (decodedBytesCount < decodedBytes.Length) 633ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, bytes.Length); 636ArgumentOutOfRangeException.ThrowIfGreaterThan(count, bytes.Length - offset);
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector_1.cs (5)
61if (values.Length < Count) 80if ((index < 0) || ((values.Length - index) < Count)) 683if (destination.Length < Count) 702if ((uint)startIndex >= (uint)destination.Length) 707if ((destination.Length - startIndex) < Count)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (3)
565if (array.Length < Count) 588if ((uint)index >= (uint)array.Length) 593if ((array.Length - index) < Count)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (3)
572if (array.Length < Count) 595if ((uint)index >= (uint)array.Length) 600if ((array.Length - index) < Count)
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (3)
669if (array.Length < Count) 692if ((uint)index >= (uint)array.Length) 697if ((array.Length - index) < Count)
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
299Shuffle(new Span<T>(ref MemoryMarshal.GetArrayDataReference(values), values.Length));
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (3)
52_length = array.Length; 79if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length) 230lengthOfUnderlyingSpan = Unsafe.As<T[]>(tmpObject).Length;
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\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (9)
32TypeInfo[] typeinfos = new TypeInfo[types.Length]; 33for (int i = 0; i < types.Length; i++) 49if (m.Length == 1) 55Type[][] moduleTypes = new Type[m.Length][]; 57for (int i = 0; i < moduleTypes.Length; i++) 60finalLength += moduleTypes[i].Length; 65for (int i = 0; i < moduleTypes.Length; i++) 67int length = moduleTypes[i].Length; 242if (rawAssembly.Length == 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
433if (dest is null || dest.Length < destPos + (currentInputPos - prevInputPos) + charsToAdd)
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (3)
16if (publicKey.Length == 0) 30for (int i = 0; i < publicKeyToken.Length; i++) 40uint publicKeyLength = (uint)(publicKey.Length);
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (1)
66_argCount = _argTypes.Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (5)
233_parameterTypes = new RuntimeType[signature.Length]; 234for (int i = 0; i < signature.Length; i++) 387if (position < 0 || position > _parameterTypes.Length) 418RuntimeParameterInfo[] parameters = new RuntimeParameterInfo[parameterTypes.Length]; 419for (int i = 0; i < parameterTypes.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilder.cs (1)
26if (names.Length == 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
70for (int i = 0; i < _inst.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodOnTypeBuilderInstantiation.cs (1)
86for (int i = 0; i < args.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
235if (_iaLowerBound.Length <= _rank)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilder.cs (5)
89if (names.Length == 0) 127if (parameterTypeOptionalCustomModifiers != null && parameterTypeOptionalCustomModifiers.Length != parameterTypes.Length) 130if (parameterTypeRequiredCustomModifiers != null && parameterTypeRequiredCustomModifiers.Length != parameterTypes.Length)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (3)
118Type[] instSubstituted = new Type[inst.Length]; 120for (int i = 0; i < instSubstituted.Length; i++) 242for (int i = 0; i < _typeArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (1)
310for (int i = 0; i < genericArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBase.cs (1)
95for (int i = 0; i < parameterTypes.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (2)
34_argCount = _argTypes.Length; 332for (int i = 0; i < dest.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInfo.Internal.cs (1)
8internal virtual int GenericParameterCount => GetGenericArguments().Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (1)
84_argCount = _argTypes.Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (1)
35int argCount = argumentTypes.Length;
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (1)
42for (int i = 0; i < parameterTypes.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
26for (int i = 0; i < genericArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Module.cs (4)
54for (int i = 0; i < types.Length; i++) 94for (int i = 0; i < c.Length; i++) 101if (cnt == c.Length) 106for (int i = 0; i < c.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (5)
396genericArgumentsState = new NullabilityInfo[genericArguments.Length]; 398for (int i = 0; i < genericArguments.Length; i++) 473if (nullability.GenericTypeArguments.Length > 0) 477for (int i = 0; i < genericArguments.Length; i++) 608if (nullability.GenericTypeArguments.Length > 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\ReflectionTypeLoadException.cs (1)
58if (exceptions.Length == 0)
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeConstructorInfo.cs (4)
115int argCount = (parameters is null) ? 0 : parameters.Length; 116if (ArgumentTypes.Length != argCount) 147int argCount = (parameters is null) ? 0 : parameters.Length; 148if (ArgumentTypes.Length != argCount)
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs (2)
118int argCount = (parameters is null) ? 0 : parameters.Length; 119if (ArgumentTypes.Length != argCount)
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureConstructedGenericType.cs (3)
18for (int i = 0; i < typeArguments.Length; i++) 44for (int i = 0; i < _genericTypeArguments.Length; i++) 67for (int i = 0; i < _genericTypeArguments.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureTypeExtensions.cs (4)
58int count = patternGenericTypeArguments.Length; 59if (count != actualGenericTypeArguments.Length) 132int count = genericTypeArguments.Length; 153if (position >= genericMethodParameters.Length)
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeInfo.cs (1)
127for (int i = 0; i < constraints.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (1)
76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!");
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (1)
446int length = resourceSetNames.Length;
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (2)
186if (typeCode < 0 || typeCode >= ResourceTypeCode.StartOfUserTypes + _typeTable.Length) 196if (bytes.Length != len)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (3)
411for (int i = 0; i < arr.Length; i++) 975if (typeIndex < 0 || typeIndex >= _typeTable.Length) 1043Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (18)
467for (int i = 0; i < _buckets.Length; i++) 485Debug.Assert(buckets.Length == entries.Length); 486Debug.Assert(BitOperations.IsPow2(buckets.Length)); 494internal bool HasCapacity => _firstFreeEntry < _entries.Length; 512int bucket = hashCode & (_buckets.Length - 1); 552int bucket = hashCode & (_buckets.Length - 1); 571if (index < _entries.Length) 650int newSize = _buckets.Length; 657for (int entriesIndex = 0; entriesIndex < _entries.Length; entriesIndex++) 680newSize = _buckets.Length * 2; 688Debug.Assert(newSize >= _buckets.Length); 694for (int bucketIndex = 0; bucketIndex < newBuckets.Length; bucketIndex++) 709for (; newEntriesIndex < _entries.Length; newEntriesIndex++) 717int bucket = hashCode & (newBuckets.Length - 1); 726for (int entriesIndex = 0; entriesIndex < _entries.Length; entriesIndex++) 740int bucket = hashCode & (newBuckets.Length - 1); 820for (int entriesIndex = 0; entriesIndex < entries.Length; entriesIndex++)
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\FormattableStringFactory.cs (1)
38public override int ArgumentCount => _arguments.Length;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (4)
129return table.Length - 2; 248if (table.Length == 2) 324if (table.Length == 2) 368return table.Length - 1;
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (2)
358Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}");
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (1)
32(int offset, int length) = range.GetOffsetAndLength(array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
31if ((uint)size > (uint)items.Length)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (1)
539for (int i = 0; i < mi.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (5)
39numElements = managed.Length; 141if (array.Length <= buffer.Length) 143_span = buffer[0..array.Length]; 147int bufferSize = checked(array.Length * sizeof(TUnmanagedElement)); 150_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (5)
40numElements = managed.Length; 142if (array.Length <= buffer.Length) 144_span = buffer[0..array.Length]; 148int bufferSize = checked(array.Length * sizeof(TUnmanagedElement)); 151_span = new Span<TUnmanagedElement>(_allocatedMemory, array.Length);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (3)
415return index == 0 && length == array.Length ? 613if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
96Debug.Assert(tokens.Length != 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (2)
222if (array.Length - index < count) 309if (array.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (5)
661if (destination.Length < Vector128<T>.Count) 683if ((uint)startIndex >= (uint)destination.Length) 688if ((destination.Length - startIndex) < Vector128<T>.Count) 837if (values.Length < Vector128<T>.Count) 858if ((index < 0) || ((values.Length - index) < Vector128<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (5)
569if (destination.Length < Vector256<T>.Count) 591if ((uint)startIndex >= (uint)destination.Length) 596if ((destination.Length - startIndex) < Vector256<T>.Count) 745if (values.Length < Vector256<T>.Count) 766if ((index < 0) || ((values.Length - index) < Vector256<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (5)
497if (destination.Length < Vector512<T>.Count) 518if ((uint)startIndex >= (uint)destination.Length) 523if ((destination.Length - startIndex) < Vector512<T>.Count) 670if (values.Length < Vector512<T>.Count) 690if ((index < 0) || ((values.Length - index) < Vector512<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (5)
539if (destination.Length < Vector64<T>.Count) 561if ((uint)startIndex >= (uint)destination.Length) 566if ((destination.Length - startIndex) < Vector64<T>.Count) 716if (values.Length < Vector64<T>.Count) 737if ((index < 0) || ((values.Length - index) < Vector64<T>.Count))
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (6)
105Debug.Assert(_names.Length == _count, "[SerializationInfo.ExpandArrays]_names.Length == _count"); 235if (_count >= _names.Length) 310Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 311Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 327Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 328Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length");
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfoEnumerator.cs (3)
42Debug.Assert(members.Length >= numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 43Debug.Assert(info.Length >= numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 44Debug.Assert(types.Length >= numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (19)
135Array ret = Array.CreateInstance(this, values.Length); 136Array.Copy(values, ret, values.Length); 293for (int i = 0; i < constraints.Length; i++) 340if (namedParams.Length > providedArgs.Length) 345if (namedParams.Length != 0) 401int argCnt = (providedArgs != null) ? providedArgs.Length : 0; 459if (flds.Length == 1) 463else if (flds.Length > 0) 570for (int i = 0; i < semiFinalists.Length; i++) 584results ??= new List<MethodInfo>(semiFinalists.Length) { finalist }; 605for (int i = 0; i < semiFinalists.Length; i++) 630results ??= new List<MethodInfo>(semiFinalists.Length) { finalist }; 686for (int i = 0; i < constraints.Length; i++) 729for (int i = 0; i < genericArguments.Length; i++) 735if (genericArguments.Length != genericParameters.Length) 737SR.Format(SR.Argument_NotEnoughGenArguments, genericArguments.Length, genericParameters.Length));
src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeByteSearchValues.cs (1)
25for (int i = 0; i < values.Length; i++)
src\libraries\System.Private.CoreLib\src\System\SearchValues\RangeCharSearchValues.cs (1)
28for (int i = 0; i < values.Length; i++)
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.T.cs (2)
54string display = $"{GetType().Name}, Count = {values.Length}"; 55if (values.Length > 0)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (4)
127Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 135Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 276Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 284Debug.Assert((uint)nodeIndex < (uint)_nodes.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (1)
45if (c < (uint)table.Length)
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
86newBucket = new string[existingBucket.Length + 1];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (4)
50Debug.Assert(valueBuckets.Length <= 8); 55for (int i = 0; i < valueBuckets.Length; i++) 124for (int bucketIndex = 0; bucketIndex < buckets.Length; bucketIndex++) 136Debug.Assert(count == strings.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
373Debug.Assert(newValuesCount == newValues.Length);
src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (2)
305int iMax = s_escapeStringPairs.Length; 345int iMax = s_escapeStringPairs.Length;
src\libraries\System.Private.CoreLib\src\System\Span.cs (2)
53_length = array.Length; 82if ((ulong)(uint)start + (ulong)(uint)length > (ulong)(uint)array.Length)
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (1)
60for (int i = 0; i < startupHooks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\String.cs (4)
79if (value == null || value.Length == 0) 82string result = FastAllocateString(value.Length); 103ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, value.Length - length); 419ArgumentOutOfRangeException.ThrowIfGreaterThan(destinationIndex, destination.Length - count);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (9)
119for (int i = 0; i < strings.Length; i++) 765ArgumentOutOfRangeException.ThrowIfGreaterThan(startIndex, value.Length - count); 1764if (!singleSeparator && (separators == null || separators.Length == 0)) 2351if (trimChars == null || trimChars.Length == 0) 2357return TrimHelper(pTrimChars, trimChars.Length, TrimType.Both); 2392if (trimChars == null || trimChars.Length == 0) 2398return TrimHelper(pTrimChars, trimChars.Length, TrimType.Head); 2433if (trimChars == null || trimChars.Length == 0) 2439return TrimHelper(pTrimChars, trimChars.Length, TrimType.Tail);
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (11)
91if (chars!.Length - index < count) 230if ((uint)byteIndex > bytes!.Length) 238return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 273if (chars!.Length - charIndex < charCount) 278if ((uint)byteIndex > bytes!.Length) 286return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 451if (bytes!.Length - index < count) 564if (bytes!.Length - byteIndex < byteCount) 569if ((uint)charIndex > (uint)chars!.Length) 577return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 741if (bytes!.Length - byteIndex < byteCount)
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (2)
230if (bytes.Length - byteIndex < byteCount) 234if (chars.Length - charIndex < charCount)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderExceptionFallback.cs (3)
50StringBuilder strBytes = new StringBuilder(bytesUnknown.Length * 4); 53for (int i = 0; i < bytesUnknown.Length && i < MaxLength; i++) 59if (bytesUnknown.Length > MaxLength)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (4)
112if (this.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length))) 167if (this.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length))) 298StringBuilder strBytes = new StringBuilder(bytesUnknown.Length * 3); 300for (i = 0; i < bytesUnknown.Length && i < 20; i++)
src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (6)
56if (bytes.Length - index < count) 95if (bytes.Length - byteIndex < byteCount) 99if (charIndex < 0 || charIndex > chars.Length) 103int charCount = chars.Length - charIndex; 146if (bytes.Length - byteIndex < byteCount) 150if (chars.Length - charIndex < charCount)
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (2)
228if (chars.Length - charIndex < charCount) 232if (bytes.Length - byteIndex < byteCount)
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (6)
51if (chars.Length - index < count) 85if (chars.Length - charIndex < charCount) 89if (byteIndex < 0 || byteIndex > bytes.Length) 93int byteCount = bytes.Length - byteIndex; 133if (chars.Length - charIndex < charCount) 137if (bytes.Length - byteIndex < byteCount)
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (8)
176return Convert(srcEncoding, dstEncoding, bytes, 0, bytes.Length); 529return GetByteCount(chars, 0, chars.Length); 540return GetByteCount(chars, 0, chars.Length); 596return GetBytes(chars, 0, chars.Length); 761return GetCharCount(bytes, 0, bytes.Length); 798return GetChars(bytes, 0, bytes.Length); 1002return GetString(bytes, 0, bytes.Length); 1383_bytes -= byteBuffer.Length; // Didn't use how many ever bytes we're falling back
src\libraries\System.Private.CoreLib\src\System\Text\EncodingProvider.cs (2)
69var newProviders = new EncodingProvider[providers.Length + 1]; 70Array.Copy(providers, newProviders, providers.Length);
src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (1)
131Debug.Assert(arrayEncodingInfoIdx == arrayEncodingInfo.Length);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (20)
68if (chars.Length - index < count) 209if (chars!.Length - charIndex < charCount) 214if ((uint)byteIndex > bytes!.Length) 222return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 276if ((uint)byteIndex > bytes!.Length) 284return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 355return bytes.Length; 370if (bytes.Length - index < count) 436if (bytes.Length == 0) 443char[] chars = new char[bytes.Length]; 448GetCharsCommon(pBytes, bytes.Length, pChars, chars.Length); 470if (bytes.Length - byteIndex < byteCount) 475if ((uint)charIndex > (uint)chars.Length) 483return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 503if (bytes.Length - index < count) 515GetCharsCommon(pBytes + index, count, pChars, chars.Length); 556string result = string.FastAllocateString(bytes.Length); 560GetCharsCommon(pBytes, bytes.Length, pChars, result.Length); 581if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (25)
238Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 248Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 266get => m_ChunkChars.Length + m_ChunkOffset; 334if ((uint)(chunkLength + chunkOffset) > (uint)result.Length || (uint)chunkLength > (uint)sourceArray.Length) 417int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length)); 419if (newLen > chunk.m_ChunkChars.Length) 431Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing."); 625if (_chunks.Length <= pos) 668if (((nuint)(uint)chunkLength + (nuint)(uint)repeatCount) <= (nuint)(uint)chunkChars.Length) 696int firstLength = chunkChars.Length - chunkLength; 700m_ChunkLength = chunkChars.Length; 733if (charCount > value.Length - startIndex) 845int length = Math.Min(m_ChunkChars.Length - m_ChunkLength, count); 849length = Math.Min(m_ChunkChars.Length - m_ChunkLength, count); 875if (destinationIndex > destination.Length - count) 1007if ((uint)chars.Length > (uint)nextCharIndex) 1087Append(ref MemoryMarshal.GetArrayDataReference(value), value.Length); 1338Insert(index, ref MemoryMarshal.GetArrayDataReference(value), value.Length); 1362if (startIndex > value.Length - charCount) 2274if (((uint)chunkLength + (uint)valueCount) <= (uint)chunkChars.Length) 2310int firstLength = m_ChunkChars.Length - m_ChunkLength; 2314m_ChunkLength = m_ChunkChars.Length; 2391Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 2522get => new Span<char>(m_ChunkChars, m_ChunkLength, m_ChunkChars.Length - m_ChunkLength); 2657if (!doNotMoveFollowingChars && chunk.m_ChunkLength <= DefaultCapacity * 2 && chunk.m_ChunkChars.Length - chunk.m_ChunkLength >= count)
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (11)
92if (chars.Length - index < count) 152if (byteIndex < 0 || byteIndex > bytes.Length) 155int byteCount = bytes.Length - byteIndex; 184if (chars.Length - charIndex < charCount) 187if (byteIndex < 0 || byteIndex > bytes.Length) 195int byteCount = bytes.Length - byteIndex; 233if (bytes.Length - index < count) 273if (bytes.Length - byteIndex < byteCount) 276if (charIndex < 0 || charIndex > chars.Length) 284int charCount = chars.Length - charIndex; 322if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (11)
100if (chars.Length - index < count) 160if (byteIndex < 0 || byteIndex > bytes.Length) 163int byteCount = bytes.Length - byteIndex; 192if (chars.Length - charIndex < charCount) 195if (byteIndex < 0 || byteIndex > bytes.Length) 203int byteCount = bytes.Length - byteIndex; 241if (bytes.Length - index < count) 281if (bytes.Length - byteIndex < byteCount) 284if (charIndex < 0 || charIndex > chars.Length) 292int charCount = chars.Length - charIndex; 330if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (14)
62Debug.Assert(_base64Bytes.Length == 64); 136if (chars.Length - index < count) 196if (byteIndex < 0 || byteIndex > bytes.Length) 199int byteCount = bytes.Length - byteIndex; 228if (chars.Length - charIndex < charCount) 231if (byteIndex < 0 || byteIndex > bytes.Length) 239int byteCount = bytes.Length - byteIndex; 277if (bytes.Length - index < count) 317if (bytes.Length - byteIndex < byteCount) 320if (charIndex < 0 || charIndex > chars.Length) 328int charCount = chars.Length - charIndex; 366if (bytes.Length - index < count) 841Debug.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 894if (bytes.Length != 1)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (11)
141if (chars.Length - index < count) 277if ((uint)byteIndex > bytes.Length) 285return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 320if (chars.Length - charIndex < charCount) 325if ((uint)byteIndex > bytes.Length) 333return GetBytesCommon(pChars + charIndex, charCount, pBytes + byteIndex, bytes.Length - byteIndex); 452if (bytes.Length - index < count) 515if (bytes.Length - byteIndex < byteCount) 520if ((uint)charIndex > (uint)chars.Length) 528return GetCharsCommon(pBytes + byteIndex, byteCount, pChars + charIndex, chars.Length - charIndex); 691if (bytes.Length - index < count)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (3)
123if (bytes?.Length <= MaxSmallInputElementCount) 136Debug.Assert(bytes.Length <= MaxSmallInputElementCount); 140int sourceLength = bytes.Length; // hoist this to avoid having the JIT auto-insert null checks
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (10)
392Debug.Assert(keyValues.Length is >= 5 and <= MaxMultiElements); 399for (int i = 0; i < _keyValues.Length; i++) 411else if (_keyValues.Length == 5) 428var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length - 1]; 430if (i != _keyValues.Length - 1) Array.Copy(_keyValues, i + 1, newValues, i, _keyValues.Length - i - 1); 446if (_keyValues.Length < MaxMultiElements) 448var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length + 1]; 449Array.Copy(_keyValues, newValues, _keyValues.Length); 450newValues[_keyValues.Length] = KeyValuePair.Create(key, value);
src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (1)
975for (int i = 0; i < linkingRegistrations.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (1)
522int newNotificationIndex = newChangeNotifications.Length;
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (2)
141handleCount += (nuint)((object[])userData).Length; 168for (int i = 0; i < objArray.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (1)
440Debug.Assert(numSamples <= samples.Length); // can't measure more samples than we have
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (2)
296Debug.Assert(_numPendingRemoves <= _pendingRemoves.Length); 298Debug.Assert(_numUserWaits <= _registeredWaits.Length);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (2)
1976if (tasks.Length == 0) ThrowHelper.ThrowArgumentException(ExceptionResource.Task_MultiTaskContinuation_EmptyTaskList, ExceptionArgument.tasks); 2027if (tasks.Length == 0) ThrowHelper.ThrowArgumentException(ExceptionResource.Task_MultiTaskContinuation_EmptyTaskList, ExceptionArgument.tasks);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (7)
5137Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5289for (int taskIndex = 0; taskIndex < tasks.Length; taskIndex++) 5306if (signaledTaskIndex == -1 && tasks.Length != 0) 6340Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6343m_count = tasks.Length; 6367T[] results = new T[m_tasks.Length]; 6375for (int i = 0; i < m_tasks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCache.cs (1)
36for (int i = 0; i < tasks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (1)
269for (int i = 0; i < combinedExceptions.Length - 1; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (12)
1554Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1556_count = tasksCopy.Length; 1603for (int i = 0; i < tasksCopy.Length; i++) 1624Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1626_count = tasksCopy.Length; 1673for (int i = 0; i < tasksCopy.Length; i++) 2972if (tasks.Length == 0) 2975Task[] tasksCopy = new Task[tasks.Length]; 2976for (int i = 0; i < tasks.Length; i++) 2991if (tasks.Length == 0) 2994Task<TResult>[] tasksCopy = new Task<TResult>[tasks.Length]; 2995for (int i = 0; i < tasks.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (8)
259&& id < slotArray.Length // Is the table large enough? 283&& id < slotArray.Length // Is the table large enough? 347if (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++) 710for (int i = 0; i < slotArray.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (12)
37var newQueues = new WorkStealingQueue[oldQueues.Length + 1]; 38Array.Copy(oldQueues, newQueues, oldQueues.Length); 53if (oldQueues.Length == 0) 65var newQueues = new WorkStealingQueue[oldQueues.Length - 1]; 68Array.Copy(oldQueues, 1, newQueues, 0, newQueues.Length); 70else if (pos == oldQueues.Length - 1) 72Array.Copy(oldQueues, newQueues, newQueues.Length); 77Array.Copy(oldQueues, pos + 1, newQueues, pos, newQueues.Length - pos); 137var newArray = new object?[m_array.Length << 1]; 138for (int i = 0; i < m_array.Length; i++) 698int c = queues.Length; 1648for (int i = 0; i < items.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (2)
52for (int i = 0; i < queues.Length; i++) 511_associatedTimerQueue = TimerQueue.Instances[(uint)Thread.GetCurrentProcessorId() % TimerQueue.Instances.Length];
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
31var timers = new List<TimerQueue>(Instances.Length); 32s_scheduledTimersToFire ??= new List<TimerQueue>(Instances.Length);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (1)
219int currentLength = (safeWaitHandles != null) ? safeWaitHandles.Length : 0;
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (5)
79int currentLength = dataArray == null ? 0 : dataArray.Length; 135if (data._pinnedData == null || data._pinnedData.Length < objArray.Length) 136Array.Resize(ref data._pinnedData, objArray.Length); 138for (int i = 0; i < objArray.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
27for (int i = 0; i < _pinnedData.Length; i++)
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
720Debug.Assert(array.Length - offset < count);
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (1)
732for (int i = 0; i < formats.Length; i++)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (7)
315if (ruleIndex.HasValue && 0 < ruleIndex.GetValueOrDefault() && ruleIndex.GetValueOrDefault() < _adjustmentRules.Length) 321for (int i = 1; i < _adjustmentRules.Length; i++) 1080if (!disableDaylightSavingTime && adjustmentRules?.Length > 0) 1180if (_adjustmentRules == null || _adjustmentRules.Length == 0) 1195int high = _adjustmentRules.Length - 1; 2165if (adjustmentRules != null && adjustmentRules.Length != 0) 2169for (int i = 0; i < adjustmentRules.Length; i++)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (16)
78for (int i = 0; i < dts.Length && dts[i] <= utcNow; i++) 92if (dts.Length == 0) 96for (int i = 0; i < transitionType.Length; i++) 151List<AdjustmentRule> rulesList = new List<AdjustmentRule>(_adjustmentRules.Length); 153for (int i = 0; i < _adjustmentRules.Length; i++) 480if (dts.Length > 0) 485while (index <= dts.Length) 491if (rules != null && rules.Length == 0) 518while (index < dts.Length && dts[index] == DateTime.MinValue) 523if (rulesList.Count == 0 && index < dts.Length) 548else if (index < dts.Length) 667if (transitionTypes.Length > 0) 1215if (data[index++] == '\n' && data[data.Length - 1] == '\n') 1217futureTransitionsPosixFormat = enc.GetString(data, index, data.Length - index - 1); 1284if (data == null || data.Length < index + Length) 1310if (data == null || data.Length < Length)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (4)
46fs.ReadExactly(bytes, 0, bytes.Length); 368if (fileLength == rawData.Length) 371int count = rawData.Length; 411byte[] buffer = new byte[rawData.Length];
src\libraries\System.Private.CoreLib\src\System\Type.cs (6)
198for (int i = 0; i < types.Length; i++) 345for (int i = 0; i < types.Length; i++) 373for (int i = 0; i < types.Length; i++) 475Type[] cls = new Type[args.Length]; 476for (int i = 0; i < cls.Length; i++) 605if (fields == null || fields.Length != 1)
src\libraries\System.Private.CoreLib\src\System\Type.Enum.cs (6)
113object[] values = new object[flds.Length]; 114string[] names = new string[flds.Length]; 116for (int i = 0; i < flds.Length; i++) 126for (int i = 1; i < values.Length; i++) 158ulong[] ulArray = new ulong[array.Length]; 159for (int i = 0; i < array.Length; ++i)
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (24)
56for (int i = 0; i < genericArguments.Length; i++) 125for (int i = 0; i < c.Length; i++) 132if (cnt == c.Length) 137for (int i = 0; i < c.Length; i++) 165for (i = 0; i < m.Length; i++) 173cnt += m.Length; 183for (i = 0; i < c.Length; i++) 191cnt += c.Length; 201for (i = 0; i < f.Length; i++) 209cnt += f.Length; 219for (i = 0; i < p.Length; i++) 227cnt += p.Length; 237for (i = 0; i < e.Length; i++) 245cnt += e.Length; 255for (i = 0; i < t.Length; i++) 263cnt += t.Length; 274for (i = 0; i < m.Length; i++) 282for (i = 0; i < c.Length; i++) 290for (i = 0; i < f.Length; i++) 298for (i = 0; i < p.Length; i++) 306for (i = 0; i < e.Length; i++) 314for (i = 0; i < t.Length; i++) 362for (int i = 0; i < constraints.Length; i++) 392for (int i = 0; i < interfaces.Length; i++)
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (4)
21if (flds.Length == 0) 24IntPtr[] fields = new IntPtr[flds.Length]; 28for (int i = 0; i < flds.Length; i++) 44if (i < (flds.Length - 1) && !fieldType.IsValueType)
src\System\Array.CoreCLR.cs (10)
581return Length; 594return Length - 1; 655for (int i = 0; i < Length; i++) 713int length = @this.Length; 723Array.Copy(@this, 0, array, index, @this.Length); 731return @this.Length; 739if ((uint)index >= (uint)@this.Length) 752if ((uint)index >= (uint)@this.Length) 771return Array.IndexOf(@this, value, 0, @this.Length) >= 0; 792return Array.IndexOf(@this, value, 0, @this.Length);
src\System\Attribute.CoreCLR.cs (24)
255for (int i = 0; i < objAttr.Length; i++) 265if (objAttr.Length == 0) 283for (int i = 0; i < objAttr.Length; i++) 302for (int i = 0; i < objAttr.Length; i++) 312ret = CreateAttributeArrayHelper(type, temp.Length + count); 313Array.Copy(temp, ret, temp.Length); 315int offset = temp.Length; 317for (int i = 0; i < attributes.Length; i++) 349for (int i = 0; i < objAttr.Length; i++) 369for (int i = 0; i < attributes.Length; i++) 384if (indexParams.Length > 0) 386Type[] indexParamTypes = new Type[indexParams.Length]; 387for (int i = 0; i < indexParams.Length; i++) 399for (int i = 0; i < attributes.Length; i++) 426if (obj.Length == 1) 429if (obj.Length == 0) 514if (attrib == null || attrib.Length == 0) 518if (attrib.Length == 1) 614if (attrib == null || attrib.Length == 0) 618if (attrib.Length == 1) 684if (attrib == null || attrib.Length == 0) 688if (attrib.Length == 1) 754if (attrib == null || attrib.Length == 0) 758if (attrib.Length == 1)
src\System\Buffer.CoreCLR.cs (1)
32Debug.Assert(src.Length - srcIndex >= len, "not enough bytes in src");
src\System\Collections\EmptyReadOnlyDictionaryInternal.cs (1)
45if (array.Length - index < this.Count)
src\System\Environment.CoreCLR.cs (1)
97for (int i = 0; i < mainMethodArgs.Length; i++)
src\System\MulticastDelegate.CoreCLR.cs (4)
249if (resultCount <= invocationList.Length) 272int allocCount = invocationList.Length; 299int allocCount = thisInvocationList.Length; 415for (int i = 0; i < del.Length; i++)
src\System\Reflection\AssemblyName.CoreCLR.cs (1)
162nameParts._cbPublicKeyOrToken = (parts._publicKeyOrToken != null) ? parts._publicKeyOrToken.Length : 0;
src\System\Reflection\Associates.cs (4)
57genericArgumentHandles = genericArguments.Length <= 16 ? // arbitrary stackalloc limit 58stackalloc IntPtr[genericArguments.Length] : 59new IntPtr[genericArguments.Length]; 60for (int i = 0; i < genericArguments.Length; i++)
src\System\Reflection\Emit\CustomAttributeBuilder.cs (18)
67if (namedProperties.Length != propertyValues.Length) 69if (namedFields.Length != fieldValues.Length) 82m_constructorArgs = new object?[constructorArgs.Length]; 83Array.Copy(constructorArgs, m_constructorArgs, constructorArgs.Length); 92if (paramTypes.Length != constructorArgs.Length) 96for (i = 0; i < paramTypes.Length; i++) 101for (i = 0; i < paramTypes.Length; i++) 123for (i = 0; i < constructorArgs.Length; i++) 127writer.Write((ushort)(namedProperties.Length + namedFields.Length)); 130for (i = 0; i < namedProperties.Length; i++) 188for (i = 0; i < namedFields.Length; i++) 368uint length = (uint)utf8Str.Length; 446writer.Write(a.Length); 447for (int i = 0; i < a.Length; i++)
src\System\Reflection\Emit\DynamicILGenerator.cs (17)
212stackchange -= parameterTypes.Length; 215stackchange -= optionalParameterTypes.Length; 232cParams = parameterTypes.Length; 280stackchange -= methodInfo.GetParameterTypes().Length; 287stackchange -= optionalParameterTypes.Length; 423requiredCustomModifiers = new Type[parameterTypes.Length][]; 424optionalCustomModifiers = new Type[parameterTypes.Length][]; 473if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) 483if (requiredCustomModifiers != null && (parameterTypes == null || requiredCustomModifiers.Length != parameterTypes.Length)) 486if (optionalCustomModifiers != null && (parameterTypes == null || optionalCustomModifiers.Length != parameterTypes.Length)) 491for (int i = 0; i < parameterTypes.Length; i++) 705for (int i = 0; i < excp.Length; i++) 714if (m_exceptionHeader != null && m_exceptionHeader.Length != 0) 716if (m_exceptionHeader.Length < 4) 756for (int i = 0; i < m_exceptions.Length; i++)
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (2)
132int argCount = (parameters != null) ? parameters.Length : 0; 133if (Signature.Arguments.Length != argCount)
src\System\Reflection\Emit\RuntimeAssemblyBuilder.cs (1)
144nameParts._cbPublicKeyOrToken = (publicKey != null) ? publicKey.Length : 0;
src\System\Reflection\Emit\RuntimeILGenerator.cs (22)
25return EnlargeArray(incoming, incoming.Length * 2); 33Array.Copy(incoming, temp, incoming.Length); 110else if (m_RelocFixupList.Length <= m_RelocFixupCount) 253if (m_length + size >= m_ILStream.Length) 261byte[] temp = new byte[Math.Max(m_ILStream.Length * 2, m_length + size)]; 262Array.Copy(m_ILStream, temp, m_ILStream.Length); 299else if (m_fixupData.Length <= m_fixupCount) 342for (int i = 0; i < exceptions.Length; i++) 345for (int j = i + 1; j < exceptions.Length; j++) 541stackchange -= parameterTypes.Length; 544stackchange -= optionalParameterTypes.Length; 565cParams = parameterTypes.Length; 618stackchange -= parameters.Length; 626stackchange -= optionalParameterTypes.Length; 698stackchange -= parameters.Length; 782int count = labels.Length; 920if (m_exceptionCount >= m_exceptions.Length) 925if (m_currExcStackCount >= m_currExcStack.Length) 1104if (m_labelCount >= m_labelList.Length) 1121if (m_labelList is null || labelIndex < 0 || labelIndex >= m_labelList.Length) 1294if (currentCatch >= m_catchAddr.Length) 1570else if (m_iCount == m_iOffsets.Length)
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (13)
100m_parameterTypes = new Type[parameterTypes.Length]; 101Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length); 186for (int i = 0; i < excp.Length; i++) 280m_signature = SignatureHelper.GetMethodSigHelper(m_module, m_callingConvention, m_inst != null ? m_inst.Length : 0, 292signatureLength = m_localSignature.Length; 335for (int i = 0; i < excp.Length; i++) 525m_inst = new RuntimeGenericTypeParameterBuilder[names.Length]; 526for (int i = 0; i < names.Length; i++) 631m_parameterTypes = new Type[parameterTypes.Length]; 632Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length); 646if (position > 0 && (m_parameterTypes == null || position > m_parameterTypes.Length)) 776else if (m_iNameSpaceCount == m_namespace.Length) 795else if (m_iLocalSymCount == m_strName.Length)
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (17)
261Type[] parameterTypes = new Type[parameters.Length]; 262Type[][] requiredCustomModifiers = new Type[parameters.Length][]; 263Type[][] optionalCustomModifiers = new Type[parameters.Length][]; 265for (int i = 0; i < parameters.Length; i++) 320cGenericParameters = method.GetGenericArguments().Length; 345if (optionalParameterTypes?.Length > 0) 381if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) 464Type[][] requiredCustomModifiers = new Type[parameterTypes.Length][]; 465Type[][] optionalCustomModifiers = new Type[parameterTypes.Length][]; 1011Type[] tt = new Type[paramInfo.Length]; 1013for (int i = 0; i < paramInfo.Length; i++) 1029Type[] parameterTypes = new Type[parameters.Length]; 1030Type[][] requiredCustomModifiers = new Type[parameterTypes.Length][]; 1031Type[][] optionalCustomModifiers = new Type[parameterTypes.Length][]; 1033for (int i = 0; i < parameters.Length; i++) 1281byte[] localSigBytes = new byte[sigBytes.Length]; 1282Buffer.BlockCopy(sigBytes, 0, localSigBytes, 0, sigBytes.Length);
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (11)
408interfaceTokens = new int[interfaces.Length + 1]; 409for (i = 0; i < interfaces.Length; i++) 877for (int i = 0; i < interfaces.Length; i++) 1040m_inst = new RuntimeGenericTypeParameterBuilder[names.Length]; 1041for (int i = 0; i < names.Length; i++) 1371return DefineDataHelper(name, data, data.Length, attributes); 1619else if (body == null || body.Length == 0) 1630if ((body == null || body.Length == 0) && !meth.m_canBeRuntimeImpl) 1641body, (body != null) ? body.Length : 0, 1643exceptions, (exceptions != null) ? exceptions.Length : 0, 1644tokenFixups, (tokenFixups != null) ? tokenFixups.Length : 0);
src\System\Reflection\Emit\SignatureHelper.cs (19)
32sigHelp.AddData(inst.Length); 277for (int i = 0; i < optionalCustomModifiers.Length; i++) 300for (int i = 0; i < requiredCustomModifiers.Length; i++) 343AddData(args.Length); 466if (m_currSig + 4 > m_signature.Length) 494if (m_currSig + 1 > m_signature.Length) 553if (m_currSig + sizeof(void*) > m_signature.Length) 564return ExpandArray(inArray, inArray.Length * 2); 571if (requiredLength < inArray.Length) 572requiredLength = inArray.Length * 2; 575Buffer.BlockCopy(inArray, 0, outArray, 0, inArray.Length); 740for (int i = 0; i < optionalCustomModifiers.Length; i++) 763for (int i = 0; i < requiredCustomModifiers.Length; i++) 805if (requiredCustomModifiers != null && (arguments == null || requiredCustomModifiers.Length != arguments.Length)) 808if (optionalCustomModifiers != null && (arguments == null || optionalCustomModifiers.Length != arguments.Length)) 813for (int i = 0; i < arguments.Length; i++) 885if (m_signature.Length > m_currSig)
src\System\Reflection\Emit\SymbolMethod.cs (2)
37m_parameterTypes = new Type[parameterTypes.Length]; 38Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length);
src\System\Reflection\MdImport.cs (1)
140for (int i = 0; i < types.Length; i++)
src\System\Reflection\RuntimeAssembly.cs (3)
400nameParts._cbPublicKeyOrToken = (publicKeyOrToken != null) ? publicKeyOrToken.Length : 0; 468FileStream[] fs = new FileStream[m.Length]; 470for (int i = 0; i < fs.Length; i++)
src\System\Reflection\RuntimeCustomAttributeData.cs (22)
186if (records.Length == 0) 191CustomAttributeData[] customAttributes = new CustomAttributeData[records.Length]; 192for (int i = 0; i < records.Length; i++) 213for (int i = 0; i < records.Length; i++) 279m_namedParams = new CustomAttributeNamedParameter[properties.Length + fields.Length]; 405Debug.Assert(allCtors.Length == 1); 424if (m_ctorParams.Length != 0) 426CustomAttributeTypedArgument[] typedCtorArgs = new CustomAttributeTypedArgument[m_ctorParams.Length]; 428for (int i = 0; i < typedCtorArgs.Length; i++) 600CustomAttributeTypedArgument[] arrayValue = new CustomAttributeTypedArgument[encodedArg.ArrayValue.Length]; 601for (int i = 0; i < arrayValue.Length; i++) 675if (customAttributeCtorParameters.Length != 0 || customAttributeNamedParameters.Length != 0) 1269if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1311if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1374if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1386if (pcas.Count > 0) pcas.CopyTo(attributes, attributes.Length - pcas.Count); 1503if (attributeFilterType is null && car.Length == 0) 1509for (int i = 0; i < car.Length; i++) 1790for (int i = 0; i < car.Length; i++) 1971HashSet<RuntimeType> set = new HashSet<RuntimeType>(pcas.Length);
src\System\Reflection\RuntimeEventInfo.cs (1)
142for (int i = 0; i < m_otherMethod.Length; i++)
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (9)
250if (parameters.Length == 0) 253ParameterInfo[] ret = new ParameterInfo[parameters.Length]; 255Array.Copy(parameters, ret, parameters.Length); 304if (sig.Arguments.Length != 1) 407RuntimeType[] methodInstantionRuntimeType = new RuntimeType[methodInstantiation.Length]; 413for (int i = 0; i < methodInstantiation.Length; i++) 422Type[] methodInstantiationCopy = new Type[methodInstantiation.Length]; 423for (int iCopy = 0; iCopy < methodInstantiation.Length; iCopy++) 481for (int i = 0; i < pis.Length; i++)
src\System\Reflection\RuntimeModule.cs (7)
32int size = genericArguments.Length; 100if (genericTypeArguments?.Length > 0) 104if (genericMethodArguments?.Length > 0) 173if (genericTypeArguments?.Length > 0) 177if (genericMethodArguments?.Length > 0) 236if (genericTypeArguments?.Length > 0) 240if (genericMethodArguments?.Length > 0)
src\System\Reflection\RuntimeParameterInfo.cs (5)
38int sigArgCount = sig.Arguments.Length; 98if (cParamDefs < args.Length + 1) 100for (int i = 0; i < args.Length; i++) 322if (customAttributes.Length != 0) 326if (customAttributes.Length != 0)
src\System\Reflection\RuntimePropertyInfo.cs (6)
125if (arguments.Length > 0) 240for (int i = 0; i < m_otherMethod.Length; i++) 307for (int i = 0; i < propParams.Length; i++) 369var args = new object?[index.Length + 1]; 371for (int i = 0; i < index.Length; i++) 374args[index.Length] = value;
src\System\Runtime\CompilerServices\CastHelpers.cs (2)
393if ((nuint)index >= (uint)array.Length) 410if ((nuint)index >= (uint)array.Length)
src\System\RuntimeHandles.cs (13)
165if (inHandles == null || inHandles.Length == 0) 170Span<IntPtr> outHandles = inHandles.Length <= stackScratch.Length ? 171stackScratch.Slice(0, inHandles.Length) : 172new IntPtr[inHandles.Length]; 173for (int i = 0; i < inHandles.Length; i++) 188if (inHandles == null || inHandles.Length == 0) 194IntPtr[] outHandles = new IntPtr[inHandles.Length]; 195for (int i = 0; i < inHandles.Length; i++) 199length = outHandles.Length; 1307if (typeInstantiationContext?.Length > 0) 1312if (methodInstantiationContext?.Length > 0) 1413if (typeInstantiationContext?.Length > 0) 1418if (methodInstantiationContext?.Length > 0)
src\System\RuntimeType.CoreCLR.cs (72)
458int memberCount = m_allMembers!.Length; 502for (int i = 0; i < list.Length; i++) 528int cachedCount = cachedMembers.Length; 531for (int i = 0; i < list.Length; i++) 556if (freeSlotIndex >= cachedMembers.Length) 570newSize = cachedMembers.Length + 1; 574newSize = Math.Max(Math.Max(4, 2 * cachedMembers.Length), list.Length); 832for (int i = 0; i < interfaces.Length; i++) 845for (int i = 0; i < interfaces.Length; i++) 997for (int j = 0; j < iFaces.Length; j++) 1023for (int i = 0; i < ifaces.Length; i++) 1061for (int i = 0; i < constraints.Length; i++) 1068for (int j = 0; j < temp.Length; j++) 1524Debug.Assert(value.Length > 0); 1841for (int i = 0; i < methodBases.Length; i++) 1981for (int i = 0; i < candidates.Length; i++) 2017for (int i = 0; i < genericArguments.Length; i++) 2286if (argumentTypes.Length != parameterInfos.Length) 2295bool excessSuppliedArguments = argumentTypes.Length > parameterInfos.Length; 2325if (!parameterInfos[argumentTypes.Length].IsOptional) 2337bool shortByMoreThanOneSuppliedArgument = argumentTypes.Length < parameterInfos.Length - 1; 2511ListBuilder<MethodInfo> candidates = new ListBuilder<MethodInfo>(cache.Length); 2512for (int i = 0; i < cache.Length; i++) 2536ListBuilder<ConstructorInfo> candidates = new ListBuilder<ConstructorInfo>(cache.Length); 2537for (int i = 0; i < cache.Length; i++) 2559ListBuilder<PropertyInfo> candidates = new ListBuilder<PropertyInfo>(cache.Length); 2560for (int i = 0; i < cache.Length; i++) 2565(types == null || (propertyInfo.GetIndexParameters().Length == types.Length))) 2582ListBuilder<EventInfo> candidates = new ListBuilder<EventInfo>(cache.Length); 2583for (int i = 0; i < cache.Length; i++) 2604ListBuilder<FieldInfo> candidates = new ListBuilder<FieldInfo>(cache.Length); 2605for (int i = 0; i < cache.Length; i++) 2626ListBuilder<Type> candidates = new ListBuilder<Type>(cache.Length); 2627for (int i = 0; i < cache.Length; i++) 2710Debug.Assert(i == members.Length); 2809if (types == null || types.Length == 0) 2845if (types.Length == 0 && candidates.Count == 1) 2873if (types == null || types.Length == 0) 2912for (int i = 0; i < cache.Length; i++) 2940for (int i = 0; i < cache.Length; i++) 2990for (int i = 0; i < cache.Length; i++) 3019for (int i = 0; i < cache.Length; i++) 3112Debug.Assert(i == compressMembers.Length); 3150for (int i = 0; i < cache.Length; i++) 3166for (int i = 0; i < cache.Length; i++) 3182for (int i = 0; i < cache.Length; i++) 3198for (int i = 0; i < cache.Length; i++) 3214for (int i = 0; i < cache.Length; i++) 3230for (int i = 0; i < cache.Length; i++) 3549if (genericParameters.Length != instantiation.Length) 3552if (instantiation.Length == 1 && instantiation[0] is RuntimeType rt) 3566RuntimeType[] instantiationRuntimeType = new RuntimeType[instantiation.Length]; 3570for (int i = 0; i < instantiation.Length; i++) 3728Debug.Assert(parameters.Length > 0); 3730if (parameters.Length == 1) 3799if (args.Length == 0 && (bindingAttr & BindingFlags.Public) != 0 && (bindingAttr & BindingFlags.Instance) != 0 3811Type[] argsType = args.Length != 0 ? new Type[args.Length] : EmptyTypes; 3812for (int i = 0; i < args.Length; i++) 3833if (consCount != cons.Length) 3854if (args.Length != 0) 4279int index = hashcode % keys.Length; 4303if (index >= keys.Length) 4304index -= keys.Length; 4337for (int i = 0; i < keys.Length; i++) 4365int index = hashcode % keys.Length; 4378if (index >= keys.Length) 4379index -= keys.Length; 4394if (requiredSize >= table.m_keys.Length)
src\System\StubHelpers.cs (2)
21cbLength = Marshal.StringToAnsiString(str, bufferPtr, buffer.Length, fBestFit, fThrowOnUnmappableChar); 690if (arr is not null && (uint)arr.Length < pState->m_cElements)
src\System\Text\StringBuilder.CoreCLR.cs (3)
31if (newLength > m_ChunkChars.Length) 47if (numChars > m_ChunkChars.Length) 61if (newLength > m_ChunkChars.Length)
src\System\ValueType.cs (1)
51for (int i = 0; i < thisFields.Length; i++)
System.Private.CoreLib.Generators (29)
EventSourceGenerator.Parser.cs (1)
109byte[] combinedBytes = new byte[namespaceBytes.Length + bytes.Length];
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (28)
254int arrayLen = decomposedLeft.Length + decomposedRight.Length; 258var retVal = new INamedTypeSymbol[decomposedLeft.Length + decomposedRight.Length]; 259Array.Copy(decomposedLeft, retVal, decomposedLeft.Length); 260Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length); 325if (decomposedLeft.Length == 0) 327else if (decomposedRight.Length == 0) 330if ((decomposedLeft.Length > 1) || (decomposedRight.Length > 1)) 339if (decomposedLeft.Length == 0 || decomposedRight.Length == 0) 341if (decomposedLeft.Length != 0 || decomposedRight.Length != 0) 347var retVal = new INamedTypeSymbol[decomposedLeft.Length + decomposedRight.Length][]; 348Array.Copy(decomposedLeft, retVal, decomposedLeft.Length); 349Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length); 354if (decomposedLeft.Length != 0 || decomposedRight.Length != 0) 364if (decomposedOperand.Length != 0) 371if (decomposedTrue.Length != 0 || decomposedFalse.Length != 0) 602if (decomposedCondition.Length == 0) 621for (int andClauseIndex = 0; andClauseIndex < decomposedCondition.Length; andClauseIndex++) 670if (decomposedCondition.Length == 1)
System.Private.DataContractSerialization (459)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (2)
107for (int i = 0; i < genericArgs.Length; i++) 286if (typeArguments != null && typeArguments.Length > 0)
src\libraries\Common\src\System\CodeDom\CodeTypeReferenceCollection.cs (1)
53for (int i = 0; i < value.Length; i++)
System\Runtime\Serialization\BitFlagsGenerator.cs (4)
23for (int i = 0; i < _locals.Length; i++) 55return _locals.Length; 72_ilg.NewArray(typeof(byte), _locals.Length); 74for (int i = 0; i < _locals.Length; i++)
System\Runtime\Serialization\ClassDataContract.cs (19)
362int baseChildElementNamespaceCount = (baseChildElementNamespaces != null) ? baseChildElementNamespaces.Length : 0; 365Array.Copy(baseChildElementNamespaces!, childElementNamespaces, baseChildElementNamespaces!.Length); 701baseMemberCount = BaseClassContract.MemberNames!.Length; 706baseContractCount = BaseClassContract.ContractNamespaces!.Length; 817for (int i = 0; i < memberInfos.Length; i++) 823if (memberAttributes != null && memberAttributes.Length > 0) 825if (memberAttributes.Length > 1) 847if (getMethod.GetParameters().Length > 0) 886if (memberAttributes != null && memberAttributes.Length > 0) 888if (memberAttributes.Length > 1) 897if (getMethod == null || IsMethodOverriding(getMethod) || getMethod.GetParameters().Length > 0) 934if (optionalFields == null || optionalFields.Length == 0) 1073for (int i = 0; i < methods.Length; i++) 1111if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != Globals.TypeOfExtensionDataObject) 1134if (parameters == null || parameters.Length != 1 || parameters[0].ParameterType != Globals.TypeOfStreamingContext) 1336Type[] underlyingParamTypes = new Type[paramContracts.Length]; 1337for (int i = 0; i < paramContracts.Length; i++) 1346genericParams = new object[paramTypes.Length]; 1347for (int i = 0; i < paramTypes.Length; i++)
System\Runtime\Serialization\CodeGenerator.cs (8)
125Type[] paramTypes = new Type[parameters.Length]; 126for (int i = 0; i < parameters.Length; i++) 147for (int i = 0; i < argTypes.Length; i++) 418if (methodInfo.GetParameters().Length != expectedCount) 419throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.ParameterCountMismatch, methodInfo.Name, methodInfo.GetParameters().Length, expectedCount)); 1215for (int i = 0; i < caseLabels.Length; i++) 1294NewArray(typeof(object), values.Length); 1297for (int i = 0; i < values.Length; i++)
System\Runtime\Serialization\CollectionDataContract.cs (3)
1053for (int i = 0; i < knownInterfaces.Length; i++) 1135for (int i = 0; i < knownInterfaces.Length; i++) 1390for (int i = 0; i < paramTypes.Length; i++)
System\Runtime\Serialization\ContextAware.cs (1)
19public int Length => _contracts.Length;
System\Runtime\Serialization\DataContract.cs (18)
1343if (dataContractAttributes != null && dataContractAttributes.Length > 0) 1346if (dataContractAttributes.Length > 1) 1368if (collectionContractAttributes != null && collectionContractAttributes.Length > 0) 1371if (collectionContractAttributes.Length > 1) 1488for (int i = 0; i < genParams.Length; i++) 1704for (int i = 0; i < nsAttributes.Length; i++) 1768int blocks = (namespaces.Length + 8) / 64 + 1; 1780if (offset + 64 > namespaces.Length) 1784for (int j = offset; j < namespaces.Length; j++) 1788if (offset <= namespaces.Length) 1790block[namespaces.Length - offset] = 0x80; 1796block[56] = (byte)(namespaces.Length << 3); 1797block[57] = (byte)(namespaces.Length >> 5); 1798block[58] = (byte)(namespaces.Length >> 13); 1799block[59] = (byte)(namespaces.Length >> 21); 1955for (int i = 0; i < knownTypeAttributes.Length; ++i) 2283_genericParams = new object[genericParams.Length]; 2292return _genericParams.Length;
System\Runtime\Serialization\EnumDataContract.cs (6)
220List<DataMember> tempMembers = new List<DataMember>(fields.Length); 221List<long> tempValues = new List<long>(fields.Length); 223for (int i = 0; i < fields.Length; i++) 230if (memberAttributes != null && memberAttributes.Length > 0) 232if (memberAttributes.Length > 1) 251if (dataMemberAttributes != null && dataMemberAttributes.Length > 0)
System\Runtime\Serialization\ExtensionDataObject.cs (1)
179for (int i = 0; i < element.attributes.Length; i++)
System\Runtime\Serialization\ExtensionDataReader.cs (7)
776else if (_elements.Length == _depth) 778ElementData[] newElements = new ElementData[_elements.Length * 2]; 779Array.Copy(_elements, newElements, _elements.Length); 787return (_elements == null || _elements.Length <= nextDepth || _elements[nextDepth] == null) 853else if (attributes.Length == attributeCount) 855AttributeData[] newAttributes = new AttributeData[attributes.Length * 2]; 856Array.Copy(attributes, newAttributes, attributes.Length);
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
157int memberCount = _traditionalClassDataContract.MemberNames.Length;
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
199if (nextId >= s_dataContractCache.Length)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (2)
189_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2); 266int size = Math.Min(_chars.Length, buffer.Length);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (7)
182Type[] paramTypes = new Type[parameters.Length]; 183for (int i = 0; i < parameters.Length; i++) 311int memberCount = classContract.MemberNames!.Length; 399for (int i = 0; i < requiredElements.Length; i++) 413_ilg.NewArray(typeof(byte), array.Length); 415for (int i = 0; i < array.Length; i++) 1064if (values != null && values.Length > 0)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (2)
117Type[] paramTypes = new Type[parameters.Length]; 118for (int i = 0; i < parameters.Length; i++)
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (1)
227context.IncrementItemCount(array.Length);
System\Runtime\Serialization\Json\JsonReaderWriterFactory.cs (1)
26return CreateJsonReader(buffer, 0, buffer.Length, null, quotas, null);
System\Runtime\Serialization\Json\JsonWriterDelegator.cs (8)
36ByteArrayHelperWithString.WriteArray(Writer, bytes, 0, bytes.Length); 123for (int i = 0; i < value.Length; i++) 131for (int i = 0; i < value.Length; i++) 139for (int i = 0; i < value.Length; i++) 147for (int i = 0; i < value.Length; i++) 155for (int i = 0; i < value.Length; i++) 222for (int i = 0; i < value.Length; i++) 230for (int i = 0; i < value.Length; i++)
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (1)
71for (int i = 0; i < entries.Length; i++)
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (2)
67int memberCount = classContract.MemberNames!.Length; 92if (memberIndex < members.Length)
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (2)
50for (int i = 0; i < array.Length; ++i) 73Type? dictionaryValueType = itemTypeGenericArguments.Length == 2 ? itemTypeGenericArguments[1] : null;
System\Runtime\Serialization\Json\XmlJsonReader.cs (18)
721if (offset > buffer.Length) 723throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 726if (count > buffer.Length - offset) 728throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 743if (offset > chars.Length) 745throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 748if (count > chars.Length - offset) 750throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 780if (offset > buffer.Length) 782throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.JsonOffsetExceedsBufferSize, buffer.Length)); 785if (count > buffer.Length - offset) 787throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - offset)); 821if (offset > array.Length) 823throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 826if (count > array.Length - offset) 828throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset)); 1011else if (_scopes.Length == _scopeDepth) 1493if ((_scopes != null) && (_scopes.Length > JsonGlobals.maxScopeSize))
System\Runtime\Serialization\Json\XmlJsonWriter.cs (11)
363if (count > buffer.Length - index) 365throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 379if (count > buffer.Length - index) 381throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 405if (count > buffer.Length - index) 407throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 694if (count > buffer.Length - index) 696throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index)); 1130else if (_scopes.Length == _depth) 1161if ((_scopes != null) && (_scopes.Length > JsonGlobals.maxScopeSize)) 1469for (int i = 0; i < array.Length; i++)
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (2)
48int length = memberNames.Length; 323for (int i = 0; i < memberNames.Length; i++)
System\Runtime\Serialization\MemoryStreamAdapter.cs (3)
64if (slicedBuffer.Length < buffer.Length) 72count: buffer.Length, 98if (innerBuffer.Count == innerBuffer.Array!.Length)
System\Runtime\Serialization\ObjectReferenceStack.cs (5)
30if (_count == _objectArray.Length) 31Array.Resize<object>(ref _objectArray, _objectArray.Length * 2); 61_isReferenceArray = new bool[_objectArray.Length]; 63else if (_count >= _isReferenceArray.Length) 65Array.Resize<bool>(ref _isReferenceArray, _objectArray.Length);
System\Runtime\Serialization\ObjectToIdCache.cs (8)
22m_objs = new object[m_ids.Length]; 23m_isWrapped = new bool[m_ids.Length]; 42if (m_currentCount >= (m_objs.Length - 1)) 85if (i == (m_objs.Length - 1)) 98int cacheSize = m_objs.Length; 137return (RuntimeHelpers.GetHashCode(o) & 0x7FFFFFFF) % m_objs.Length; 142int size = GetPrime(m_objs.Length + 1); // The lookup does an inherent doubling 149for (int j = 0; j < oldObjs.Length; j++)
System\Runtime\Serialization\ReflectionReader.cs (1)
530int arraySize = ((Array)resultCollectionObject).Length;
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (3)
65int memberCount = classContract.MemberNames!.Length; 99if (memberIndex < members.Length) 133int memberCount = contract.MemberNames!.Length;
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (1)
46for (int i = 0; i < array.Length; ++i)
System\Runtime\Serialization\SchemaExporter.cs (5)
556for (int i = 0; i < schemaArray.Length; i++) 561for (int j = 0; j < itemArray.Length; j++) 610if (attrs == null || attrs.Length == 0) 814if (nodes == null || nodes.Length == 0) 817for (int i = 0; i < nodes.Length; i++)
System\Runtime\Serialization\SchemaImporter.cs (1)
1434for (int i = 0; i < markup.Length; i++)
System\Runtime\Serialization\ScopedKnownTypes.cs (2)
22else if (_count == dataContractDictionaries.Length) 24Array.Resize<DataContractDictionary>(ref dataContractDictionaries, dataContractDictionaries.Length * 2);
System\Runtime\Serialization\XmlDataContract.cs (1)
155if (xmlRootAttributes == null || xmlRootAttributes.Length == 0)
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (3)
377int memberCount = classContract.MemberNames!.Length; 431for (; nextRequiredIndex < requiredMembers.Length; nextRequiredIndex++) 467int memberCount = contract.MemberNames!.Length;
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
245if (classContract.ContractNamespaces!.Length > 1) 258for (int i = 0; i < classContract.ChildElementNamespaces!.Length; i++)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (8)
223for (int i = memberIndex + 1; i < memberNames.Length; i++) 229return memberNames.Length; 236for (int i = memberIndex + 1; i < memberNames.Length; i++) 246return memberNames.Length; 253if (requiredIndex == memberNames.Length) 453if (array.Length <= index) 463Array.Copy(array, newArray, array.Length); 471if (size != array.Length)
System\Runtime\Serialization\XmlReaderDelegator.cs (8)
105for (int i = 0; i < localNames.Length; i++) 827context.IncrementItemCount(array.Length); 857context.IncrementItemCount(array.Length); 887context.IncrementItemCount(array.Length); 917context.IncrementItemCount(array.Length); 947context.IncrementItemCount(array.Length); 977context.IncrementItemCount(array.Length); 1007context.IncrementItemCount(array.Length);
System\Runtime\Serialization\XmlSerializableServices.cs (1)
60for (int i = 0; i < nodes.Length; i++)
System\Runtime\Serialization\XmlWriterDelegator.cs (15)
532writer.WriteBase64(bytes, 0, bytes.Length); 680for (int i = 0; i < value.Length; i++) 687dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 695for (int i = 0; i < value.Length; i++) 702dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 710for (int i = 0; i < value.Length; i++) 717dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 725for (int i = 0; i < value.Length; i++) 732dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 740for (int i = 0; i < value.Length; i++) 747dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 755for (int i = 0; i < value.Length; i++) 762dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length); 770for (int i = 0; i < value.Length; i++) 777dictionaryWriter.WriteArray(null, itemName, itemNamespace, value, 0, value.Length);
System\Runtime\Serialization\XPathQueryGenerator.cs (1)
50for (int pathToMemberIndex = 0; pathToMemberIndex < pathToMember.Length; pathToMemberIndex++)
System\Runtime\Serialization\XsdDataContractExporter.cs (2)
117for (int j = 0; j < types.Length; j++) 320for (int j = 0; j < types.Length; j++)
System\Text\Base64Encoding.cs (32)
54if (index > chars.Length) 55throw new ArgumentOutOfRangeException(nameof(index), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 57if (count > chars.Length - index) 58throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - index)); 105if (charIndex > chars.Length) 106throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 109if (charCount > chars.Length - charIndex) 110throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)); 114if (byteIndex > bytes.Length) 115throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 130byte* pbMax = _bytes + bytes.Length - byteIndex; 178if (charIndex > chars.Length) 179throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 182if (charCount > chars.Length - charIndex) 183throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)); 187if (byteIndex > bytes.Length) 188throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 203byte* pbMax = _bytes + bytes.Length - byteIndex; 261if (byteIndex > bytes.Length) 262throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 264if (byteCount > bytes.Length - byteIndex) 265throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)); 270if (charIndex > chars.Length) 271throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 272if (charCount < 0 || charCount > chars.Length - charIndex) 345if (byteIndex > bytes.Length) 346throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 348if (byteCount > bytes.Length - byteIndex) 349throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)); 354if (charIndex > chars.Length) 355throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 357if (charCount < 0 || charCount > chars.Length - charIndex)
System\Text\BinHexEncoding.cs (14)
28if (charIndex > chars.Length) 29throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 31if (charCount > chars.Length - charIndex) 32throw new ArgumentOutOfRangeException(nameof(charCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - charIndex)); 35if (byteIndex > bytes.Length) 36throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 38if (byteCount < 0 || byteCount > bytes.Length - byteIndex) 67if (byteIndex > bytes.Length) 68throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.Format(SR.OffsetExceedsBufferSize, bytes.Length)); 70if (byteCount > bytes.Length - byteIndex) 71throw new ArgumentOutOfRangeException(nameof(byteCount), SR.Format(SR.SizeExceedsRemainingBufferSpace, bytes.Length - byteIndex)); 75if (charIndex > chars.Length) 76throw new ArgumentOutOfRangeException(nameof(charIndex), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 77if (charCount < 0 || charCount > chars.Length - charIndex)
System\Xml\ArrayHelper.cs (7)
34while (read < array.Length) 36int actual = ReadArray(reader, localName, namespaceUri, array, read, array.Length - read); 44if (read < array.Length || reader.NodeType == XmlNodeType.EndElement) 50if (totalRead != array.Length || arrayCount > 0) 56Array.Copy(arrays![i], 0, newArray, offset, arrays[i].Length); 57offset += arrays[i].Length; 75int actual = ReadArray(reader, localName, namespaceUri, array, 0, array.Length);
System\Xml\EncodingStreamWrapper.cs (9)
388if (encCount == s_encodingUTF8.Length && CompareCaseInsensitive(s_encodingUTF8, buffer, encStart)) 392else if (encCount == s_encodingUnicodeLE.Length && CompareCaseInsensitive(s_encodingUnicodeLE, buffer, encStart)) 396else if (encCount == s_encodingUnicodeBE.Length && CompareCaseInsensitive(s_encodingUnicodeBE, buffer, encStart)) 400else if (encCount == s_encodingUnicode.Length && CompareCaseInsensitive(s_encodingUnicode, buffer, encStart)) 403ThrowEncodingMismatch(DataContractSerializer.UTF8NoBom.GetString(buffer, encStart, encCount), DataContractSerializer.UTF8NoBom.GetString(s_encodingUTF8, 0, s_encodingUTF8.Length)); 416for (int i = 0; i < key.Length; i++) 601_byteCount = _stream.Read(_bytes, _byteCount, (_chars.Length - 1) * 2); 700int size = _chars.Length < count ? _chars.Length : count;
System\Xml\StringHandle.cs (3)
148length = buffer.Length; 155length = buffer.Length; 163length = buffer.Length;
System\Xml\UniqueId.cs (13)
70if (offset > guid.Length) 71throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, guid.Length)); 72if (guidLength > guid.Length - offset) 99if (offset > chars.Length) 100throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 102if (count > chars.Length - offset) 103throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 205if (offset > chars.Length) 206throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 208if (count > chars.Length - offset) 285if (offset > buffer.Length) 286throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 288if (guidLength > buffer.Length - offset)
System\Xml\ValueHandle.cs (6)
444if (actualLength != buffer.Length) 512return DataContractSerializer.Base64Encoding.GetString(bytes, 0, bytes.Length); 690Debug.Assert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length)); 772Debug.Assert(byteOffset + actualByteCount < bytes.Length, 773$"byteOffset {byteOffset} + actualByteCount {actualByteCount} MUST BE < bytes.Length {bytes.Length}");
System\Xml\XmlBaseReader.cs (37)
272else if (_elementNodes.Length == _depth) 306else if (_attributeNodes.Length == attributeIndex) 466if (_attributeNodes != null && _attributeNodes.Length > 16) 468if (_elementNodes != null && _elementNodes.Length > 16) 1055for (int i = 0; i < localNames.Length; i++) 1070for (int i = 0; i < localNames.Length; i++) 1096for (int i = 0; i < localNames.Length; i++) 1111for (int i = 0; i < localNames.Length; i++) 1131if (offset > chars.Length) 1132throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 1134if (count > chars.Length - offset) 1135throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 1159if (offset > buffer.Length) 1160throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 1162if (count > buffer.Length - offset) 1163throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1304if (value.Length > _quotas.MaxArrayLength) 1312return ReadContentAsBase64(_quotas.MaxArrayLength, _bufferReader.Buffer.Length); 1347if (offset > buffer.Length) 1348throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 1350if (count > buffer.Length - offset) 1351throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1383if (offset > buffer.Length) 1384throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 1386if (count > buffer.Length - offset) 1387throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1900if (_chars == null || _chars.Length < count) 2625if (_indices != null && _indices.Length > 32) 2635if (_indices != null && _indices.Length == _attributeCount && IsSorted()) 2639for (int i = 0; i < newIndices.Length; i++) 2648for (int i = 0; i < _indices!.Length - 1; i++) 2725if (_namespaces != null && _namespaces.Length > 32) 2727if (_attributes != null && _attributes.Length > 4) 2741nameSpace.Uri.SetValue(3, xmlBuffer.Length - 3); 2776for (int i = 0; i < _shortPrefixUri.Length; i++) 2863else if (_attributes.Length == _attributeCount) 2901else if (_namespaces.Length == _nsCount)
System\Xml\XmlBaseWriter.cs (14)
670else if (_elements.Length == _depth) 1029if (count > chars.Length - offset) 1030throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 1081if (count > chars.Length - offset) 1082throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 1444if (count > buffer.Length - offset) 1445throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1781for (int i = 0; i < array.Length; i++) 1800for (int i = 0; i < array.Length; i++) 1998if (_namespaces != null && _namespaces.Length > 32) 2000if (_attributes != null && _attributes.Length > 4) 2080else if (_attributes.Length == _attributeCount) 2108for (int i = 0; i < s_prefixes.Length; i++) 2174if (_namespaces!.Length == _nsCount)
System\Xml\XmlBinaryReader.cs (9)
49if (offset > buffer.Length) 50throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 52if (count > buffer.Length - offset) 53throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1026BufferReader.InsertBytes(buffer, 0, buffer.Length); 1230if (offset > array.Length) 1231throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 1233if (count > array.Length - offset) 1234throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlBinaryReaderSession.cs (5)
45else if (id >= _strings.Length) 47XmlDictionaryString[] newStrings = new XmlDictionaryString[Math.Min(Math.Max(id + 1, _strings.Length * 2), MaxArrayEntries)]; 48Array.Copy(_strings, newStrings, _strings.Length); 58if (_strings != null && key >= 0 && key < _strings.Length) 78for (int i = 0; i < _strings.Length; i++)
System\Xml\XmlBinaryWriter.cs (8)
109Debug.Assert(offset >= 0 && offset + 1 + Unsafe.SizeOf<T>() <= buffer.Length, "WriteTextNodeRaw"); 124Debug.Assert(offset >= 0 && offset + Unsafe.SizeOf<T>() <= buffer.Length, "WriteRaw"); 1185while ((count = reader.ReadValueChunk(_chars, 0, _chars.Length)) > 0) 1207while ((count = reader.ReadValueAsBase64(_bytes, 0, _bytes.Length)) > 0) 1280if (offset > array.Length) 1281throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 1283if (count > array.Length - offset) 1284throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlBinaryWriterSession.cs (5)
173if (_listCount < _list.Length) 238if (index >= _array.Length) 245if (index >= _array.Length) 247int[] newArray = new int[Math.Max(index + 1, _array.Length * 2)]; 248Array.Copy(_array, newArray, _array.Length);
System\Xml\XmlBufferReader.cs (9)
79_windowOffsetMax = _streamBuffer.Length; 100if (_streamBuffer != null && _streamBuffer.Length > 4096) 194if (_offsetMax >= _buffer.Length) 226if (newOffsetMax > _buffer.Length) 228byte[] newBuffer = new byte[Math.Max(256, _buffer.Length * 2)]; 230newOffsetMax = Math.Min(newOffsetMax, newBuffer.Length); 255if (_offsetMax > buffer.Length - count) 507if (_chars == null || _chars.Length < count) 817int length2 = buffer2.Length;
System\Xml\XmlCanonicalWriter.cs (50)
93_inclusivePrefixes = new string[inclusivePrefixes.Length]; 94for (int i = 0; i < inclusivePrefixes.Length; ++i) 118if (_scopes != null && _scopes.Length > 16) 120if (_attributes != null && _attributes.Length > 16) 122if (_xmlnsBuffer != null && _xmlnsBuffer.Length > 1024) 153else if (_depth == _scopes.Length) 209if (prefixOffset > prefixBuffer.Length) 210throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length)); 212if (prefixLength > prefixBuffer.Length - prefixOffset) 213throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)); 217if (localNameOffset > localNameBuffer.Length) 218throw new ArgumentOutOfRangeException(nameof(localNameOffset), SR.Format(SR.OffsetExceedsBufferSize, localNameBuffer.Length)); 220if (localNameLength > localNameBuffer.Length - localNameOffset) 221throw new ArgumentOutOfRangeException(nameof(localNameLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, localNameBuffer.Length - localNameOffset)); 250for (int i = 0; i < _inclusivePrefixes!.Length; ++i) 348else if (_xmlnsOffset + byteCount > _xmlnsBuffer.Length) 350byte[] newBuffer = new byte[Math.Max(_xmlnsOffset + byteCount, _xmlnsBuffer.Length * 2)]; 385if (prefixOffset > prefixBuffer.Length) 386throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length)); 388if (prefixLength > prefixBuffer.Length - prefixOffset) 389throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)); 393if (nsOffset > nsBuffer.Length) 394throw new ArgumentOutOfRangeException(nameof(nsOffset), SR.Format(SR.OffsetExceedsBufferSize, nsBuffer.Length)); 396if (nsLength > nsBuffer.Length - nsOffset) 397throw new ArgumentOutOfRangeException(nameof(nsLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, nsBuffer.Length - nsOffset)); 436if (prefixOffset > prefixBuffer.Length) 437throw new ArgumentOutOfRangeException(nameof(prefixOffset), SR.Format(SR.OffsetExceedsBufferSize, prefixBuffer.Length)); 439if (prefixLength > prefixBuffer.Length - prefixOffset) 440throw new ArgumentOutOfRangeException(nameof(prefixLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)); 444if (localNameOffset > localNameBuffer.Length) 445throw new ArgumentOutOfRangeException(nameof(localNameOffset), SR.Format(SR.OffsetExceedsBufferSize, localNameBuffer.Length)); 447if (localNameLength > localNameBuffer.Length - localNameOffset) 448throw new ArgumentOutOfRangeException(nameof(localNameLength), SR.Format(SR.SizeExceedsRemainingBufferSpace, localNameBuffer.Length - localNameOffset)); 507if (offset > chars.Length) 508throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 510if (count > chars.Length - offset) 511throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 562if (offset > chars.Length) 563throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 565if (count > chars.Length - offset) 566throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 599if (offset > chars.Length) 600throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, chars.Length)); 602if (count > chars.Length - offset) 603throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)); 663else if (_attributeCount == _attributes.Length) 681else if (_xmlnsAttributes.Length == _xmlnsAttributeCount) 877for (int i = 0; i < indices.Length; i++) 884Attribute[] attributes = new Attribute[_writer._attributes!.Length]; 885for (int i = 0; i < indices.Length; i++)
System\Xml\XmlConverter.cs (3)
432if (objects.Length == 0) 435if (objects.Length > 1) 438for (int i = 1; i < objects.Length; i++)
System\Xml\XmlDictionary.cs (1)
48else if (_nextId == _strings.Length)
System\Xml\XmlDictionaryReader.cs (20)
33return CreateBinaryReader(buffer, 0, buffer.Length, quotas); 92return CreateTextReader(buffer, 0, buffer.Length, quotas); 297for (int i = 0; i < localNames.Length; i++) 320for (int i = 0; i < localNames.Length; i++) 517while (read < buffer.Length) 521actual = ReadContentAsBase64(buffer, read, buffer.Length - read); 523actual = ReadContentAsBinHex(buffer, read, buffer.Length - read); 531if (read < buffer.Length) 539Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length); 540offset += buffers[i].Length; 593Guid[] guids = new Guid[values.Length]; 594for (int i = 0; i < values.Length; i++) 601UniqueId[] uniqueIds = new UniqueId[values.Length]; 602for (int i = 0; i < values.Length; i++) 615for (int i = 0; i < strings.Length; i++) 635for (int i = 0; i < strings.Length; i++) 1010if (offset > array.Length) 1011throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 1013if (count > array.Length - offset) 1014throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlDictionaryWriter.cs (4)
441if (offset > array.Length) 442throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, array.Length)); 444if (count > array.Length - offset) 445throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, array.Length - offset));
System\Xml\XmlSigningNodeWriter.cs (1)
360int byteCount = Math.Min(_base64Chars.Length / 4 * 3, count - count % 3);
System\Xml\XmlStreamNodeWriter.cs (2)
383byte* bytesMax = _bytes + buffer.Length - offset; 388return (_encoding ?? DataContractSerializer.ValidatingUTF8).GetBytes(chars, charCount, _bytes, buffer.Length - offset);
System\Xml\XmlUTF8TextReader.cs (5)
561if (offset > buffer.Length) 562throw new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.OffsetExceedsBufferSize, buffer.Length)); 564if (count > buffer.Length - offset) 565throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, buffer.Length - offset)); 1423while (j < _rowOffsets.Length - 1 && _rowOffsets[j + 1] < offset)
System\Xml\XmlUTF8TextWriter.cs (3)
117if (_chars == null || _chars.Length < charCount) 409int isEscapedCharLength = isEscapedChar.Length; 427int isEscapedCharLength = isEscapedChar.Length;
System.Private.Uri (4)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (2)
36public int Capacity => _array?.Length ?? 0; 107if (_count < result.Length)
System\UriHelper.cs (2)
320ValueStringBuilder vsb = new ValueStringBuilder(dest.Length); 325if (vsb.Length > dest.Length)
System.Private.Xml (852)
System\Xml\Base64Decoder.cs (2)
46ArgumentOutOfRangeException.ThrowIfGreaterThan(len, chars.Length - startPos); 89Debug.Assert(buffer.Length - index >= count);
System\Xml\Base64Encoder.cs (1)
31ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Base64EncoderAsync.cs (1)
17if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\BinaryXml\SqlUtils.cs (1)
85Debug.Assert(rgulU.Length == s_cNumeMax);
System\Xml\BinaryXml\XmlBinaryReader.cs (13)
1899if (symNum == symtable.Length) 1915if (qnameNum == qnametable.Length) 1962Array.Clear(_symbolTables.symtable, 1, _symbolTables.symtable.Length - 1); 2007if (cbKeep > 7 * (data.Length / 8)) 2010byte[] newdata = new byte[checked(data.Length * 2)]; 2038int cbFill = data.Length - end; 2411int newcount = _elementStack.Length * 2; 2414System.Array.Copy(_elementStack, n, _elementStack.Length); 2420int newcount = _attributes.Length * 2; 2497if (_attrCount == _attributes.Length) 2604if (_attrCount == _attributes.Length) 2715if (_attrHashTbl.Length < tblSize) 3044if (_elemDepth == _elementStack.Length)
System\Xml\BinHexDecoder.cs (3)
46ArgumentOutOfRangeException.ThrowIfGreaterThan(len, chars.Length - startPos); 93Debug.Assert(buffer.Length - index >= count); 124if (bytesDecoded < bytes.Length)
System\Xml\BinHexEncoder.cs (1)
16ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\BinHexEncoderAsync.cs (1)
13if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\BitStack.cs (1)
91len = _bitStack.Length;
System\Xml\Cache\XPathDocumentBuilder.cs (1)
832if (++_pageInfo.NodeCount >= _page.Length)
System\Xml\Cache\XPathNodeHelper.cs (2)
349idxPrec = pagePrec.Length - 1; 665if (++idxNode >= pageNode.Length)
System\Xml\Cache\XPathNodeInfoAtom.cs (6)
443infoNew = _hashTable[info.GetHashCode() & (_hashTable.Length - 1)]; 457if (_sizeTable >= _hashTable.Length) 460_hashTable = new XPathNodeInfoAtom[oldTable.Length * 2]; 462for (int i = 0; i < oldTable.Length; i++) 486int idx = info.GetHashCode() & (_hashTable.Length - 1); 500for (int i = 0; i < _hashTable.Length; i++)
System\Xml\Core\HtmlEncodedRawTextWriter.cs (2)
415Debug.Assert(count >= 0 && index + count <= buffer.Length); 702Debug.Assert(_uriEscapingBuffer?.Length > 0);
System\Xml\Core\HtmlUtf8RawTextWriter.cs (2)
394Debug.Assert(count >= 0 && index + count <= buffer.Length); 679Debug.Assert(_uriEscapingBuffer?.Length > 0);
System\Xml\Core\IncrementalReadDecoders.cs (2)
67Debug.Assert(chars.Length - startPos >= len); 114Debug.Assert(buffer.Length - index >= count);
System\Xml\Core\ReadContentAsBinaryHelper.cs (4)
68ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 111ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 154ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 197ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (4)
16if (index < 0 || (uint)count > buffer.Length - index) 60if (index < 0 || (uint)count > buffer.Length - index) 104if (index < 0 || (uint)count > buffer.Length - index) 148if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\Core\XmlCharCheckingReader.cs (2)
484ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 532ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlCharCheckingReaderAsync.cs (2)
308if (index < 0 || (uint)count > buffer.Length - index) 362if (index < 0 || (uint)count > buffer.Length - index)
System\Xml\Core\XmlCharCheckingWriter.cs (1)
269ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlCharCheckingWriterAsync.cs (1)
216ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlEncodedRawTextWriter.cs (10)
148_bufBytes = new byte[_bufChars.Length]; 654Debug.Assert(count >= 0 && index + count <= buffer.Length); 678Debug.Assert(count >= 0 && index + count <= buffer.Length); 857_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _); 860if (_bufBytesUsed >= (_bufBytes.Length - 16)) 880_encoder!.Convert(_bufChars, 1, 0, _bufBytes!, 0, _bufBytes!.Length, true, out _, out bEnc, out _); 1689if (_lastMarkPos + 1 == _textContentMarks!.Length) 1698Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length); 1699int[] newTextContentMarks = new int[_textContentMarks.Length * 2]; 1700Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length);
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (5)
550Debug.Assert(count >= 0 && index + count <= buffer.Length); 572Debug.Assert(count >= 0 && index + count <= buffer.Length); 689_encoder!.Convert(_bufChars, startOffset, endOffset - startOffset, _bufBytes!, _bufBytesUsed, _bufBytes!.Length - _bufBytesUsed, false, out chEnc, out bEnc, out _); 692if (_bufBytesUsed >= (_bufBytes.Length - 16)) 712_encoder!.Convert(_bufChars, 1, 0, _bufBytes!, 0, _bufBytes!.Length, true, out _, out bEnc, out _);
System\Xml\Core\XmlEventCache.cs (8)
119for (idxEvent = 0; idxEvent < page.Length; idxEvent++) 183writer.WriteBase64(bytes, 0, bytes.Length); 188writer.WriteBinHex(bytes, 0, bytes.Length); 273for (idxEvent = 0; idxEvent < page.Length; idxEvent++) 549else if (_pageSize >= _pageCurr!.Length) 565if (index != 0 || count != buffer.Length) 567if (buffer.Length - index > count) 568count = buffer.Length - index;
System\Xml\Core\XmlReader.cs (1)
1712int bytesToRead = Math.Min(bytes.Length, 2);
System\Xml\Core\XmlSubtreeReader.cs (3)
1305if (index == _nsAttributes.Length) 1307NodeData[] newNsAttrs = new NodeData[_nsAttributes.Length * 2]; 1586ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlTextEncoder.cs (2)
116ArgumentOutOfRangeException.ThrowIfGreaterThan(count, array.Length - offset); 442ArgumentOutOfRangeException.ThrowIfGreaterThan(count, array.Length - offset);
System\Xml\Core\XmlTextReaderImpl.cs (38)
1597ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1644ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1690ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1737ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1797ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 2856bufferSize = _ps.bytes.Length; 2869if (_ps.bytes == null || _ps.bytes.Length < bufferSize) 2876if (_ps.chars == null || _ps.chars.Length < bufferSize + 1) 2883if (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0) 2885int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed); 3346if (_ps.charsUsed == _ps.chars.Length - 1) 3354char[] newChars = new char[_ps.chars.Length * 2]; 3355BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3365if (_ps.bytes.Length - _ps.bytesUsed < MaxByteSequenceLen) 3367byte[] newBytes = new byte[_ps.bytes.Length * 2]; 3374charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3382int charsLen = _ps.chars.Length; 3405char[] newChars = new char[_ps.chars.Length * 2]; 3406BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 3431charsRead = _ps.chars.Length - _ps.charsUsed - 1; 3441if (_ps.bytePos == _ps.bytesUsed && _ps.bytes.Length - _ps.bytesUsed > 0) 3443int read = _ps.stream.Read(_ps.bytes, _ps.bytesUsed, _ps.bytes.Length - _ps.bytesUsed); 3465charsRead = _ps.textReader.Read(_ps.chars, _ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1); 3477Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3490Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 5003if (_attrDuplSortingArray == null || _attrDuplSortingArray.Length < _attrCount) 7623Debug.Assert(nodeIndex < _nodes.Length); 7624Debug.Assert(_nodes[_nodes.Length - 1] == null); 7637Debug.Assert(nodeIndex < _nodes.Length); 7638if (nodeIndex >= _nodes.Length - 1) 7640NodeData[] newNodes = new NodeData[_nodes.Length * 2]; 7641Array.Copy(_nodes, newNodes, _nodes.Length); 7644Debug.Assert(nodeIndex < _nodes.Length); 8101else if (_parsingStatesStackTop + 1 == _parsingStatesStack.Length) 8103ParsingState[] newParsingStateStack = new ParsingState[_parsingStatesStack.Length * 2]; 8104Array.Copy(_parsingStatesStack, newParsingStateStack, _parsingStatesStack.Length); 8153if (array.Length - index < count) 9563Debug.Assert(endPos < chars.Length);
System\Xml\Core\XmlTextReaderImplAsync.cs (23)
393ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 449ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 514ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 570ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 622ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 882bufferSize = _ps.bytes.Length; 897if (_ps.bytes == null || _ps.bytes.Length < bufferSize) 904if (_ps.chars == null || _ps.chars.Length < bufferSize + 1) 911if (_ps.bytesUsed < 4 && _ps.bytes.Length - _ps.bytesUsed > 0) 913int bytesToRead = Math.Min(4, _ps.bytes.Length - _ps.bytesUsed); 1035if (_ps.charsUsed == _ps.chars.Length - 1) 1043char[] newChars = new char[_ps.chars.Length * 2]; 1044BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 1053if (_ps.bytes!.Length - _ps.bytesUsed < MaxByteSequenceLen) 1055byte[] newBytes = new byte[_ps.bytes.Length * 2]; 1062charsRead = _ps.chars.Length - _ps.charsUsed - 1; 1070int charsLen = _ps.chars.Length; 1093char[] newChars = new char[_ps.chars.Length * 2]; 1094BlockCopyChars(_ps.chars, 0, newChars, 0, _ps.chars.Length); 1117charsRead = _ps.chars.Length - _ps.charsUsed - 1; 1125if (_ps.bytePos == _ps.bytesUsed && _ps.bytes!.Length - _ps.bytesUsed > 0) 1149charsRead = await _ps.textReader.ReadAsync(_ps.chars.AsMemory(_ps.charsUsed, _ps.chars.Length - _ps.charsUsed - 1)).ConfigureAwait(false); 1161Debug.Assert(_ps.charsUsed < _ps.chars.Length);
System\Xml\Core\XmlTextWriter.cs (6)
1442if (i <= _indentChars.Length) 1450_textWriter.Write(_indentChars, 0, Math.Min(i, _indentChars.Length)); 1451i -= _indentChars.Length; 1522if (nsIndex == _nsStack.Length) 1783if (_top == _stack.Length - 1) 1785TagInfo[] na = new TagInfo[_stack.Length + 10];
System\Xml\Core\XmlUtf8RawTextWriter.cs (2)
569Debug.Assert(count >= 0 && index + count <= buffer.Length); 591Debug.Assert(count >= 0 && index + count <= buffer.Length);
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (2)
494Debug.Assert(count >= 0 && index + count <= buffer.Length); 514Debug.Assert(count >= 0 && index + count <= buffer.Length);
System\Xml\Core\XmlWellFormedWriter.cs (6)
472if (top == _elemScopeStack.Length) 1066ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1092ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1144ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1752if (top == _nsStack.Length) 2098if (top == _attrStack.Length)
System\Xml\Core\XmlWellFormedWriterAsync.cs (4)
279if (top == _elemScopeStack.Length) 1004ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1030ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index); 1082ArgumentOutOfRangeException.ThrowIfGreaterThan(count, buffer.Length - index);
System\Xml\Core\XmlWellFormedWriterHelpers.cs (1)
521else if (_items.Length == newItemIndex)
System\Xml\Core\XsdCachingReader.cs (8)
653Debug.Assert(attIndex < _attributeEvents.Length); 660if (attIndex >= _attributeEvents.Length - 1) 662ValidatingReaderNodeData[] newAttributeEvents = new ValidatingReaderNodeData[_attributeEvents.Length * 2]; 663Array.Copy(_attributeEvents, newAttributeEvents, _attributeEvents.Length); 671Debug.Assert(_contentIndex <= _contentEvents.Length); 679if (_contentIndex >= _contentEvents.Length - 1) 681ValidatingReaderNodeData[] newContentEvents = new ValidatingReaderNodeData[_contentEvents.Length * 2]; 682Array.Copy(_contentEvents, newContentEvents, _contentEvents.Length);
System\Xml\Core\XsdValidatingReader.cs (4)
2304Debug.Assert(attIndex < _attributePSVINodes.Length); 2312if (attIndex >= _attributePSVINodes.Length - 1) 2315AttributePSVIInfo[] newPSVINodes = new AttributePSVIInfo[_attributePSVINodes.Length * 2]; 2316Array.Copy(_attributePSVINodes, newPSVINodes, _attributePSVINodes.Length);
System\Xml\Dom\DocumentSchemaValidator.cs (3)
541else if (currentIndex >= _nodeSequenceToValidate.Length - 1) 543XmlNode[] newNodeSequence = new XmlNode[_nodeSequenceToValidate.Length * 2]; 544Array.Copy(_nodeSequenceToValidate, newNodeSequence, _nodeSequenceToValidate.Length);
System\Xml\Dom\DomNameTable.cs (2)
26Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two 97for (int i = 0; i < oldEntries.Length; i++)
System\Xml\NameTable.cs (5)
91if (start >= key.Length || start < 0 || (long)start + len > (long)key.Length) 148if (start >= key.Length || start < 0 || (long)start + len > (long)key.Length) 219for (int i = 0; i < oldEntries.Length; i++)
System\Xml\Resolvers\XmlPreloadedResolver.cs (6)
78: this(array, 0, array.Length) 203for (int i = 0; i < s_xhtml10_Dtd.Length; i++) 214Debug.Assert(s_rss091_Dtd.Length == 1); 287Add(uri, new ByteArrayChunk(value, 0, value.Length)); 297ArgumentOutOfRangeException.ThrowIfGreaterThan(count, value.Length - offset); 360for (int i = 0; i < dtdSet.Length; i++)
System\Xml\Schema\Asttree.cs (3)
558ArrayList AstArray = new ArrayList(xpath.Length); 559_fAxisArray = new ArrayList(xpath.Length); 565for (int i = 0; i < xpath.Length; ++i)
System\Xml\Schema\BitSet.cs (14)
45int bitsLength = _bits.Length; 85if ((++nBitSlot) == _bits.Length) 113int bitsLength = _bits.Length; 114int setLength = other._bits.Length; 133int setLength = other._bits.Length; 144for (int i = _bits.Length; --i >= 0;) 163int bitsLength = _bits.Length; 164int setLength = other._bits.Length; 209for (int i = 0; i < _bits.Length; i++) 219int i = Math.Min(_bits.Length, other._bits.Length); 238if (nRequiredLength > _bits.Length) 241int request = 2 * _bits.Length; 245Array.Copy(_bits, newBits, _bits.Length);
System\Xml\Schema\ConstraintStruct.cs (12)
33_tableDim = constraint.Fields.Length; 246_dim = ((Array)obj!).Length; 359return atomicValues1.Length == 1 && atomicValues1.GetValue(0)!.Equals(other.Value); 364return arr1.Length == 1 && arr1.GetValue(0)!.Equals(other.Value); 374return atomicValues2.Length == 1 && atomicValues2.GetValue(0)!.Equals(this.Value); 379return arr2.Length == 1 && arr2.GetValue(0)!.Equals(this.Value); 431for (int i = 0; i < _ks.Length; ++i) 446for (int i = 0; i < _ks.Length; i++) 466for (int j = 0; j < atomicValues.Length; j++) 473for (int j = 0; j < ((Array)_ks[i].Value!).Length; j++) 494for (int i = 0; i < _ks.Length; i++) 515for (int i = 1; i < _ks.Length; i++)
System\Xml\Schema\ContentValidator.cs (5)
1536for (int i = 0; i < transitionTable.Length; i++) 1623for (int i = 0; i < transition.Length - 1; i++) 1659for (int i = 0; i < transition.Length - 1; i++) 1985Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length); 2009Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length);
System\Xml\Schema\DataTypeImplementation.cs (13)
237for (int i = 0; i < s_xsdTypes.Length; i++) 258for (int i = 0; i < s_xsdTypes.Length; i++) 954int length = arr1.Length; 955if (length != arr2.Length) 966for (int i = 0; i < atomicValues1.Length; i++) 978for (int i = 0; i < arr1.Length; i++) 1038for (int i = 0; i < valuesToCheck.Length; i++) 1105for (int i = 0; i < splitString.Length; ++i) 1121for (int i = 0; i < splitString.Length; ++i) 1216for (int i = 0; i < _types.Length; ++i) 1228for (int i = 0; i < _types.Length; ++i) 1249for (int i = 0; i < _types.Length; ++i) 1291for (int i = 0; i < _types.Length; ++i)
System\Xml\Schema\DtdParser.cs (3)
1431else if (_condSectionEntityIds.Length == _condSectionDepth) 1433int[] tmp = new int[_condSectionEntityIds.Length * 2]; 1434Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length);
System\Xml\Schema\DtdParserAsync.cs (3)
1053else if (_condSectionEntityIds.Length == _condSectionDepth) 1055int[] tmp = new int[_condSectionEntityIds.Length * 2]; 1056Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length);
System\Xml\Schema\DtdValidator.cs (2)
366for (int i = 0; i < ss.Length; ++i) 584for (int i = 0; i < ss.Length; ++i)
System\Xml\Schema\FacetChecker.cs (4)
716for (int i = 0; i < s_map.Length; i++) 1570int length = value.Length; 1636int length = values.Length; 1677for (int j = 0; j < values.Length; ++j)
System\Xml\Schema\NamespaceList.cs (1)
45for (int i = 0; i < splitString.Length; ++i)
System\Xml\Schema\Preprocessor.cs (2)
1614baseTypeCount += union1.MemberTypes.Length; 1616for (int i = 0; i < qNames.Length; ++i)
System\Xml\Schema\SchemaCollectionCompiler.cs (1)
640for (int i = 0; i < mainMemberTypes.Length; ++i)
System\Xml\Schema\SchemaCollectionpreProcessor.cs (2)
1281baseTypeCount += union1.MemberTypes.Length; 1282for (int i = 0; i < union1.MemberTypes.Length; ++i)
System\Xml\Schema\SchemaSetCompiler.cs (2)
132int numberOfSchemaTypes = schemaSimpleTypes.Length - 3; //skip last 2 xquery types 730for (int i = 0; i < mainMemberTypes.Length; ++i)
System\Xml\Schema\XdrBuilder.cs (2)
449for (int i = 0; i < _CurState._Attributes!.Length; i++) 1491for (int i = 0; i < _CurState._NextStates.Length; i++)
System\Xml\Schema\XdrValidator.cs (2)
490for (int i = 0; i < ss.Length; ++i) 591for (int i = 0; i < ss.Length; ++i)
System\Xml\Schema\XmlSchemaCollection.cs (2)
234ArgumentOutOfRangeException.ThrowIfEqual(index, array.Length); 249ArgumentOutOfRangeException.ThrowIfEqual(index, array.Length);
System\Xml\Schema\XmlSchemaObjectTable.cs (2)
195Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 248Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
System\Xml\Schema\XmlSchemaSet.cs (2)
669ArgumentOutOfRangeException.ThrowIfGreaterThan(index, schemas.Length - 1); 857for (int i = 0; i < locationsTable.Length; i++)
System\Xml\Schema\XmlSchemaSimpleTypeUnion.cs (3)
41if (_memberTypes != null && _memberTypes.Length > 0) 44XmlQualifiedName[] newQNames = new XmlQualifiedName[_memberTypes.Length]; 46for (int i = 0; i < _memberTypes.Length; i++)
System\Xml\Schema\XmlSchemaValidator.cs (12)
1275for (int j = 0; j < locations.Length - 1; j += 2) 1994for (int i = 0; i < ss.Length; ++i) 2148_context.Constr = new ConstraintStruct[currentElementDecl.Constraints!.Length]; 2150for (int i = 0; i < currentElementDecl.Constraints.Length; ++i) 2157for (int i = 0; i < _context.Constr.Length; ++i) 2172for (int j = 0; j < constraintStructures.Length; ++j) 2222for (int j = 0; j < constraintStructures.Length; ++j) 2277for (int i = 0; i < constraintStructures.Length; ++i) 2323for (int i = 0; i < constraints.Length; ++i) 2441for (int i = 0; i < vcs.Length; ++i) 2733Debug.Assert(nsList.Length > 0); 2735for (int i = 1; i < nsList.Length; i++)
System\Xml\Schema\XmlValueConverter.cs (2)
3149_converters = new XmlValueConverter[memberTypes.Length]; 3150for (int i = 0; i < memberTypes.Length; i++)
System\Xml\Schema\XsdBuilder.cs (5)
729for (int i = 0; i < _currentEntry.Attributes.Length; i++) 2434for (int i = 0; i < _currentEntry.NextStates.Length; ++i) 2494for (int i = 0; i < values.Length; i++) 2523for (int i = 0; i < stringValues.Length; i++) 2526for (int j = 0; j < s_derivationMethodStrings.Length; j++)
System\Xml\Schema\XsdValidator.cs (10)
316for (int i = 0; i < xsiSchemaLocation.Length - 1; i += 2) 710for (int i = 0; i < ss.Length; ++i) 850context!.Constr = new ConstraintStruct[context.ElementDecl!.Constraints!.Length]; 852for (int i = 0; i < context.ElementDecl.Constraints.Length; ++i) 859for (int i = 0; i < context.Constr.Length; ++i) 874for (int j = 0; j < constraints.Length; ++j) 920for (int j = 0; j < constraints.Length; ++j) 975for (int i = 0; i < constraints.Length; ++i) 1029for (int i = 0; i < constraints.Length; ++i) 1132for (int i = 0; i < vcs.Length; ++i)
System\Xml\Serialization\CodeGenerator.cs (4)
98for (int i = 0; i < argTypes.Length; i++) 1615Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 1616for (int i = 0; i < parameterTypes.Length; ++i)
System\Xml\Serialization\CodeIdentifier.cs (2)
233for (int i = 0; i < parts.Length; i++) 287for (int i = 0; i < names.Length; i++)
System\Xml\Serialization\Compilation.cs (22)
53for (int i = 0; i < xmlMappings.Length; i++) 110for (int i = 0; i < xmlMappings.Length; i++) 147if (attrs.Length == 0) 269if (attrs.Length != 1) 282for (int i = 0; i < modules.Length; i++) 328for (int i = 0; i < types.Length; i++) 338if (assembly != null && types.Length > 0) 340for (int i = 0; i < types.Length; i++) 375if (types != null && types.Length == 1 && types[0] != null) 392string?[] writeMethodNames = new string[xmlMappings.Length]; 394for (int i = 0; i < xmlMappings.Length; i++) 406string?[] readMethodNames = new string[xmlMappings.Length]; 407for (int i = 0; i < xmlMappings.Length; i++) 416for (int i = 0; i < xmlMappings.Length; i++) 430stream.Write(info, 0, info.Length); 438var mainType = (types.Length > 0) ? types[0] : null; 450for (int i = 0; i < types.Length; i++) 487string[] writeMethodNames = new string[xmlMappings.Length]; 489for (int i = 0; i < xmlMappings.Length; i++) 503string[] readMethodNames = new string[xmlMappings.Length]; 504for (int i = 0; i < xmlMappings.Length; i++) 512for (int i = 0; i < xmlMappings.Length; i++)
System\Xml\Serialization\Compiler.cs (4)
45for (int i = 0; i < ctors.Length; i++) 48for (int j = 0; j < parms.Length; j++) 57for (int i = 0; i < arguments.Length; i++) 72if (typeForwardedFromAttribute.Length > 0)
System\Xml\Serialization\ImportContext.cs (2)
334for (int i = 0; i < memberTypes.Length; i++) 439for (int i = 0; i < attrs.Length; i++)
System\Xml\Serialization\Mappings.cs (13)
401_sortedElements = new ElementAccessor[_elements.Length]; 402Array.Copy(_elements, _sortedElements, _elements.Length); 594for (int i = 0; i < _members.Length; i++) 647for (int i = 0; i < _members.Length; i++) 717get { return _text != null && (_elements == null || _elements.Length == 0); } 722get { return (_elements != null && _elements.Length > 0); } 774_sortedElements = new ElementAccessor[_elements.Length]; 775Array.Copy(_elements, _sortedElements, _elements.Length); 811if (_elements != null && _elements.Length > 0) return _elements[0]; 826if (a.Length != b.Length) 828for (int i = 0; i < a.Length; i++) 838if (Elements != null && Elements.Length > 0)
System\Xml\Serialization\Models.cs (5)
165MemberInfo[] fieldsAndProps = new MemberInfo[members.Length]; 169for (int i = 0; i < members.Length; i++) 177for (int i = 0; i < members.Length; i++) 254if (parameters.Length > 0) return false; 432for (int i = 0; i < fields.Length; i++)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (26)
112object[] p = new object[mappings.Length]; 159for (int i = 0; i < mappings.Length; i++) 181for (int j = 0; j < mappings.Length; j++) 217for (int j = 0; j < mapping.Elements!.Length; j++) 241&& !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 258if (members.Length > 0 && members[0].Mapping.IsReturnValue) 307for (int i = 0; i < mappings.Length; i++) 335object?[] p = new object[mappings.Length]; 366Member[] members = new Member[mappings.Length]; 367for (int i = 0; i < mappings.Length; i++) 377for (int j = 0; j < mappings.Length; j++) 391if (members.Length > 0 && members[0].Mapping.IsReturnValue) 569if (collection is Array currentArray && currentArray.Length == collectionMember.Count) 766for (int i = 0; i < m.Mapping.Elements!.Length; i++) 831for (int i = 0; i < elements.Length; i++) 1305for (int i = 0; i < constants.Length; i++) 1360members = new Member[mappings.Length]; 1361for (int i = 0; i < mappings.Length; i++) 1417if (member.Mapping.Elements!.Length == 0) 1619var allMembersList = new List<Member>(mappings.Length); 1621for (int i = 0; i < mappings.Length; i++) 1646for (int j = 0; j < mapping.Elements!.Length; j++) 1663if (member.Source == null && mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1973Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.Type!.GetElementType()!, vals.Length); 1974for (int i = 0; i < vals.Length; i++) 2027length = currentArray.Length;
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (30)
122!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 135if (elements.Length == 0 && text == null) 147if (choiceSource == null || ((Array)choiceSource).Length < ((Array)o).Length) 189if (elements.Length == 0 && text == null) 192if (elements.Length == 1 && text == null) 207for (int i = 0; i < elements.Length; i++) 276if (elements.Length > 0 && o != null) 350if (mapping.Elements == null || mapping.Elements.Length != 1) 586for (int i = 0; i < members.Length; i++) 615for (int i = 0; i < members.Length; i++) 637bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 707if (constants.Length > 0) 711for (int i = 0; i < constants.Length; i++) 726string[] xmlNames = new string[constants.Length]; 727long[] valueIds = new long[constants.Length]; 729for (int i = 0; i < constants.Length; i++) 908for (int i = 0; i < members.Length; i++) 1210int pLength = p.Length; 1227for (int i = 0; i < mapping.Members!.Length; i++) 1237for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++) 1255for (int i = 0; i < mapping.Members!.Length; i++) 1268for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++) 1287for (int j = 0; j < mapping.Members.Length; j++) 1297if (isRpc && member.IsReturnValue && member.Elements!.Length > 0) 1318if (pLength > mapping.Members.Length) 1320for (int i = mapping.Members.Length; i < pLength; i++) 1352if (memberInfos == null || memberInfos.Length == 0) 1359if (memberInfos != null && memberInfos.Length != 0) 1381if (memberInfos.Length != 1)
System\Xml\Serialization\SchemaObjectWriter.cs (4)
215for (int i = 0; i < a.Length; i++) 526for (int ia = 0; ia < a.Length; ia++) 545for (int ia = 0; ia < a.Length; ia++) 596for (int i = 0; i < o.MemberTypes.Length; i++)
System\Xml\Serialization\SoapAttributes.cs (1)
33for (int i = 0; i < attrs.Length; i++)
System\Xml\Serialization\SoapReflectionImporter.cs (6)
58for (int i = 0; i < attrs.Length; i++) 465if (mapping.Elements!.Length == 1) 576for (int i = 0; i < model.Constants.Length; i++) 610MemberMapping[] mappings = new MemberMapping[xmlReflectionMembers.Length]; 611for (int i = 0; i < mappings.Length; i++) 784for (int i = 0; i < names.Length; i++)
System\Xml\Serialization\TypeExtensions.cs (1)
48parameters.Length == 1 &&
System\Xml\Serialization\Types.cs (14)
436if (typeDescs.Length == 0) return null; 440for (int i = 0; i < typeDescs.Length; i++) 452for (i = 0; i < typeDescs.Length; i++) 456if (i == typeDescs.Length) break; 544for (int i = 0; i < s_unsupportedTypes.Length; i++) 595for (int i = 0; i < s_unsupportedTypes.Length; i++) 1001for (int i = 0; i < arguments.Length; i++) 1050for (int i = 0; i < mapping.Members!.Length; i++) 1116for (int i = 0; i < mappings.Length; ++i) 1151for (int i = 0; i < mappings.Length; i++) 1240if (attrs != null && attrs.Length > 0) 1332if (defaultMembers != null && defaultMembers.Length > 0) 1336for (int i = 0; i < defaultMembers.Length; i++) 1344if (parameters.Length == 1 && parameters[0].ParameterType == typeof(int))
System\Xml\Serialization\XmlAttributes.cs (2)
84for (int i = 0; i < attrs.Length; i++) 179if (attrs.Length == 0) return null;
System\Xml\Serialization\Xmlcustomformatter.cs (6)
153for (int i = 0; i < toks.Length; i++) 176if (value.Length == 0) 186if (ids.Length != vals.Length) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Invalid enum")); 193for (int i = 0; i < ids.Length; i++) 458for (int i = 0; i < parts.Length; i++)
System\Xml\Serialization\XmlMapping.cs (1)
132for (int i = 0; i < mappings.Length; i++)
System\Xml\Serialization\XmlMembersMapping.cs (3)
23_mappings = new XmlMemberMapping[mapping.Members!.Length]; 24for (int i = 0; i < _mappings.Length; i++) 65get { return _mappings.Length; }
System\Xml\Serialization\XmlReflectionImporter.cs (22)
96for (int i = 0; i < attrs.Length; i++) 224if (mapping.Elements != null && mapping.Elements.Length > 0) 510if (attrs.Length > 0) 869if (member.Elements != null && member.Elements.Length != 0) 961for (int i = 0; i < names.Length; i++) 1001if (mapping.Elements!.Length == 1) 1086for (int i = 0; i < mapping.Elements!.Length; i++) 1196for (int i = 0; i < model.Constants.Length; i++) 1231MemberMapping[] mappings = new MemberMapping[xmlReflectionMembers.Length]; 1237for (int i = 0; i < mappings.Length; i++) 1372if (xmlReflectionMember.OverrideIsNullable && member.Elements!.Length > 0) 1379for (int i = 0; i < reflectionMembers.Length; i++) 1432for (int i = 0; i < xmlReflectionMembers.Length; i++) 1449if (infos == null || infos.Length == 0) 1461else if (infos.Length > 1) 1953if (accessor.TypeDesc.IsArrayLike && accessor.Elements.Length > 0 && !(accessor.Elements[0].Mapping is ArrayMapping)) 1963accessor.ChoiceIdentifier.MemberIds = new string[accessor.Elements.Length]; 1964for (int i = 0; i < accessor.Elements.Length; i++) 1969for (int j = 0; j < choiceMapping.Constants!.Length; j++) 2104for (int i = 0; i < choiceMapping.Constants!.Length; i++) 2191else if (!isSequence && member.Elements != null && member.Elements.Length > 0) 2193for (int i = 0; i < member.Elements.Length; i++)
System\Xml\Serialization\XmlSchemaExporter.cs (14)
45if (mapping.Members!.Length == 1 && mapping.Members[0].Elements![0].Mapping is SpecialMapping) 82else if (member.Elements == null || member.Elements.Length == 0) 650if (accessors.Length == 0) return; 651if (accessors.Length == 1) 660for (int i = 0; i < accessors.Length; i++) 883string[] names = new string[c.Length]; 884long[] ids = new long[c.Length]; 886for (int i = 0; i < c.Length; i++) 897for (int i = 0; i < c.Length; i++) 1042for (int i = 0; i < members.Length; i++) 1055if (member.Elements!.Length > 0) 1058!(member.Elements.Length == 1 && member.Elements[0].Mapping is ArrayMapping); 1113for (int i = 0; i < members.Length; i++) 1158for (int i = 0; i < mapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSchemaImporter.cs (17)
153if (mapping.Members!.Length != 1 || !mapping.Members[0].Accessor!.Any) 186MemberMapping[] members = new MemberMapping[names.Length]; 187for (int i = 0; i < names.Length; i++) 565for (int i = 0; i < structMapping.Members.Length; i++) 757Hashtable uniqueTypeDescs = new Hashtable(member.Elements.Length); 759for (int i = 0; i < member.Elements.Length; i++) 795for (int i = 0; i < typeDescs.Length; i++) 821member.ChoiceIdentifier.MemberIds = new string[member.Elements.Length]; 823for (int i = 0; i < member.Elements.Length; i++) 858if (arrayMapping.Elements!.Length != 1) 933for (int j = 0; j < elements.Length; j++) 982for (int i = 0; i < elements.Length; i++) 1066if (elements.Length == 0) 1069for (int i = 0; i < elements.Length; i++) 1486if (nodes != null && nodes.Length > 0) 1735if (isList && enumMapping.Constants.Length > 63) 1772for (int i = 0; i < choice.Length; i++)
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (9)
40if (scopes.Length > 0) 90if (index < a.Length) return a; 91TypeMapping[] b = new TypeMapping[a.Length + 32]; 151if (methods != null && methods.Length != 0 && xmlMappings != null && xmlMappings.Length == methods.Length) 153for (int i = 0; i < methods.Length; i++) 176for (int i = 0; i < types.Length; i++) 342for (int i = 0; i < xmlMappings.Length; i++)
System\Xml\Serialization\XmlSerializationILGen.cs (9)
41if (scopes.Length > 0) 134if (index < a.Length) return a; 135TypeMapping[] b = new TypeMapping[a.Length + 32]; 214if (methods != null && methods.Length != 0 && xmlMappings != null && xmlMappings.Length == methods.Length) 220for (int i = 0; i < methods.Length; i++) 244for (int i = 0; i < types.Length; i++) 452for (int i = 0; i < xmlMappings.Length; i++)
System\Xml\Serialization\XmlSerializationReader.cs (49)
480if (offset == buffer.Length) 489bytes = _r.ReadElementContentAsBase64(buffer, offset, buffer.Length - offset); 493bytes = _r.ReadElementContentAsBinHex(buffer, offset, buffer.Length - offset); 503currentSize = Math.Min(block.Length, total); 1053for (int i = 0; i < dimensions.Length; i++) 1347if (index < a.Length) return a; 1348Array b = Array.CreateInstance(elementType, a.Length * 2); 1360if (a.Length == length) return a; 1534for (int i = 0; i < array.Length; i++) 2438for (int j = 0; j < mappings.Length; j++) 2476Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture)); 2495for (int i = 0; i < mappings.Length; i++) 2512for (int j = 0; j < mappings.Length; j++) 2532for (int j = 0; j < mapping.Elements!.Length; j++) 2546else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 2561if (members.Length > 0 && members[0].Mapping.IsReturnValue) Writer.WriteLine("IsReturnValue = true;"); 2563WriteParamsRead(mappings.Length); 2618for (int i = 0; i < mappings.Length; i++) 2656Writer.Write(mappings.Length.ToString(CultureInfo.InvariantCulture)); 2674Member[] members = new Member[mappings.Length]; 2675for (int i = 0; i < mappings.Length; i++) 2692for (int j = 0; j < mappings.Length; j++) 2706if (members.Length > 0 && members[0].Mapping.IsReturnValue) Writer.WriteLine("IsReturnValue = true;"); 2712WriteParamsRead(mappings.Length); 2920for (int i = 0; i < constants.Length; i++) 3020for (int i = 0; i < constants!.Length; i++) 3298var arraysToDeclareList = new List<Member>(mappings.Length); 3299var arraysToSetList = new List<Member>(mappings.Length); 3300var allMembersList = new List<Member>(mappings.Length); 3302for (int i = 0; i < mappings.Length; i++) 3320for (int j = 0; j < mapping.Elements!.Length; j++) 3335if (mapping.Attribute == null && mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping) 3349if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 3371WriteParamsRead(mappings.Length); 3441members = new Member[mappings.Length]; 3442for (int i = 0; i < mappings.Length; i++) 3460WriteParamsRead(mappings.Length); 3495for (int i = 0; i < members.Length; i++) 3671for (int i = 0; i < members.Length; i++) 3854for (int i = 0; i < members.Length; i++) 3857if (member.Mapping.Elements!.Length == 0) 3888for (int i = 0; i < members.Length; i++) 3966for (int i = 0; i < members.Length; i++) 3978for (int j = 0; j < elements.Length; j++) 4145for (int i = 0; i < elements.Length; i++) 4163for (int i = 0; i < members.Length; i++) 4183for (int i = 0; i < members.Length; i++) 4197for (int j = 0; j < elements.Length; j++) 4409for (int i = 0; i < members.Length; i++)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (29)
363for (int j = 0; j < mappings.Length; j++) 420ilg.NewArray(typeof(object), mappings.Length); 438for (int i = 0; i < mappings.Length; i++) 455for (int j = 0; j < mappings.Length; j++) 475for (int j = 0; j < mapping.Elements!.Length; j++) 489else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 504if (members.Length > 0 && members[0].Mapping.IsReturnValue) 516WriteParamsRead(mappings.Length); 620for (int i = 0; i < mappings.Length; i++) 998for (int i = 0; i < constants.Length; i++) 1088for (int i = 0; i < constants.Length; i++) 1548var arraysToDeclareList = new List<Member>(mappings.Length); 1549var arraysToSetList = new List<Member>(mappings.Length); 1550var allMembersList = new List<Member>(mappings.Length); 1552for (int i = 0; i < mappings.Length; i++) 1570for (int j = 0; j < mapping.Elements!.Length; j++) 1585if (mapping.Attribute == null && mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping) 1599if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1621WriteParamsRead(mappings.Length); 1839for (int i = 0; i < members.Length; i++) 2144for (int i = 0; i < members.Length; i++) 2221for (int i = 0; i < members.Length; i++) 2233for (int j = 0; j < elements.Length; j++) 2449for (int i = 0; i < elements.Length; i++) 2467for (int i = 0; i < members.Length; i++) 2483for (int i = 0; i < members.Length; i++) 2497for (int j = 0; j < elements.Length; j++) 2647for (int i = 0; i < members.Length; i++) 2849Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType)));
System\Xml\Serialization\XmlSerializationWriter.cs (41)
377for (int i = 0; i < xmlNodes.Length; i++) 406XmlCustomFormatter.WriteArrayBase64(_w, (byte[])o, 0, ((byte[])o).Length); 1005XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1021XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1040XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1126XmlCustomFormatter.WriteArrayBase64(_w, value, 0, value.Length); 1263int arrayLength = a.Length; 1509for (int i = 0; i < parameterTypes.Length; i++) 1698for (int i = 0; i < structMapping.Members!.Length; i++) 1722for (int i = 0; i < enumFields.Length; i++) 1774for (int i = 0; i < memberInfos.Length; i++) 1821for (int i = 0; i < paramTypes.Length; i++) 1824if (i < (paramTypes.Length - 1)) 1886for (int i = 0; i < args.Length; i++) 2467for (int i = 0; i < values.Length; i++) 2644for (int i = 0; i < mapping.Members!.Length; i++) 2658for (int j = 0; j < mapping.Members.Length; j++) 2698for (int i = 0; i < mapping.Members!.Length; i++) 2712for (int j = 0; j < mapping.Members.Length; j++) 2743for (int j = 0; j < mapping.Members.Length; j++) 2761if (isRpc && member.IsReturnValue && member.Elements!.Length > 0) 2793Writer.Write(mapping.Members.Length.ToString(CultureInfo.InvariantCulture)); 2797WriteExtraMembers(mapping.Members.Length.ToString(CultureInfo.InvariantCulture), "pLength"); 2883if (constants.Length > 0) 2891for (int i = 0; i < constants.Length; i++) 2911for (int i = 0; i < constants.Length; i++) 2922for (int i = 0; i < constants.Length; i++) 3182for (int i = 0; i < members.Length; i++) 3221for (int i = 0; i < members.Length; i++) 3227bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 3485!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 3494if (elements.Length == 0 && text == null) return; 3612int count = elements.Length + (text == null ? 0 : 1); 3642if (elements.Length == 0 && text == null) return; 3643if (elements.Length == 1 && text == null) 3666for (int i = 0; i < elements.Length; i++) 3734if (elements.Length - anyCount > 0) Writer.Write("else "); 3830if (elements.Length > 0) 3852if (elements.Length > 0) 4390for (int i = 0; i < members.Length; i++) 4447for (int i = 0; i < choiceMapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (27)
216for (int i = 0; i < values.Length; i++) 418for (int i = 0; i < mapping.Members!.Length; i++) 431for (int j = 0; j < mapping.Members.Length; j++) 473for (int i = 0; i < mapping.Members!.Length; i++) 487for (int j = 0; j < mapping.Members.Length; j++) 521for (int j = 0; j < mapping.Members.Length; j++) 630if (constants.Length > 0) 641for (int i = 0; i < constants.Length; i++) 669ilg.NewArray(typeof(string), constants.Length); 671for (int i = 0; i < constants.Length; i++) 681ilg.NewArray(typeof(long), constants.Length); 684for (int i = 0; i < constants.Length; i++) 1084for (int i = 0; i < members.Length; i++) 1115for (int i = 0; i < members.Length; i++) 1121bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null); 1426!(elements.Length == 1 && elements[0].Mapping is ArrayMapping)) 1436if (elements.Length == 0 && text == null) return; 1567int count = elements.Length + (text == null ? 0 : 1); 1588if (elements.Length == 0 && text == null) return; 1589if (elements.Length == 1 && text == null) 1612for (int i = 0; i < elements.Length; i++) 1675if (elements.Length - anyCount > 0) 1683if (elements.Length - anyCount > 0) ilg.InitElseIf(); 1826if (elements.Length > 0) 1840if (elements.Length > 0) 2235for (int i = 0; i < members.Length; i++) 2276for (int i = 0; i < choiceMapping.Constants!.Length; i++)
System\Xml\Serialization\XmlSerializer.cs (14)
286for (int i = 0; i < extraTypes.Length; i++) 548if (mappings == null || mappings.Length == 0) return Array.Empty<XmlSerializer>(); 585XmlSerializer[] serializers = new XmlSerializer[mappings.Length]; 589for (int i = 0; i < serializers.Length; i++) 606XmlSerializer?[] serializers = new XmlSerializer?[mappings.Length]; 607for (int i = 0; i < serializers.Length; i++) 619var serializers = new XmlSerializer[mappings.Length]; 620for (int i = 0; i < serializers.Length; i++) 636if (types == null || types.Length == 0) 648for (int i = 0; i < types.Length; i++) 675XmlSerializer?[] serializers = new XmlSerializer?[mappings.Length]; 684for (int i = 0; i < mappings.Length; i++) 726XmlTypeMapping[] mappings = new XmlTypeMapping[types.Length]; 727for (int i = 0; i < types.Length; i++)
System\Xml\Serialization\XmlSerializerNamespaces.cs (1)
43_namespaces = new Dictionary<string, XmlQualifiedName>(namespaces.Length);
System\Xml\XmlConvert.cs (1)
303return BinHexEncoder.Encode(inArray, 0, inArray.Length);
System\Xml\XmlEncoding.cs (2)
236return chars.Length * 4; 277return bytes.Length / 4;
System\Xml\XmlException.cs (2)
227Debug.Assert(invCharIndex < data.Length); 229Debug.Assert(length <= data.Length);
System\Xml\XmlNamespacemanager.cs (3)
158if (_lastDecl == _nsdecls.Length - 1) 160NamespaceDeclaration[] newNsdecls = new NamespaceDeclaration[_nsdecls.Length * 2]; 161Array.Copy(_nsdecls, newNsdecls, _nsdecls.Length);
System\Xml\XPath\Internal\FunctionQuery.cs (1)
27for (int i = 0; i < tmp.Length; i++)
System\Xml\XPath\Internal\IdQuery.cs (1)
49for (int idx = 0; idx < ids.Length; idx++)
System\Xml\XPath\Internal\SortQuery.cs (6)
159Debug.Assert(_expressions.Length == _comparers.Length); 160Debug.Assert(0 < _expressions.Length); 161Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 163if (_numSorts == _expressions.Length) 175Debug.Assert(_numSorts < _expressions.Length);
System\Xml\XPath\Internal\StringFunctions.cs (3)
31for (int i = 0; i < tmp.Length; i++) 232for (int comparePos = 0; comparePos < chars.Length; comparePos++) 264for (int comparePos = 0; comparePos < chars.Length; comparePos++)
System\Xml\XPath\Internal\XPathMultyIterator.cs (9)
23for (int i = 0; i < this.arr.Length; i++) 34for (int i = 0; i < arr.Length; i++) 38for (int i = arr.Length - 2; firstNotEmpty <= i;) 69Debug.Assert(firstNotEmpty <= item && item < arr.Length); 71while (item + 1 < arr.Length) 104for (int i = 0; i < arr.Length; i++) 128Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false"); 138if (firstNotEmpty >= arr.Length) 148if (firstNotEmpty >= arr.Length)
System\Xml\XPath\Internal\XPathParser.cs (2)
550if (pi.ArgTypes.Length < argCount) 552argCount = pi.ArgTypes.Length; // argument we have the type specified (can be < pi.Minargs)
System\Xml\Xsl\IlGen\GenerateHelper.cs (2)
1646_writerDump!.Write(" {0, -10} (Label {1}", opcode.Name, arrLabels.Length != 0 ? _symbols![arrLabels[0]]!.ToString() : ""); 1647for (int i = 1; i < arrLabels.Length; i++)
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (1)
57private static readonly int s_patternCount = Enum.GetValues<OptimizerPatternName>().Length;
System\Xml\Xsl\IlGen\XmlILModule.cs (3)
137paramTypesNew = new Type[paramTypes.Length + 1]; 139Array.Copy(paramTypes, 0, paramTypesNew, 1, paramTypes.Length); 161for (int i = 0; i < paramNames.Length; i++)
System\Xml\Xsl\QIL\QilList.cs (1)
122if (_count == _members.Length)
System\Xml\Xsl\QIL\QilPatternFactory.cs (1)
374switch (args.Length)
System\Xml\Xsl\QIL\QilTypeChecker.cs (1)
950Check(actualArgs.Count == extFunc.Method!.GetParameters().Length, actualArgs, "InvokeEarlyBound argument count must match function's argument count");
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (2)
358else if (_numEntries >= _arrAttrs.Length) 361Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (1)
225if (pair.Length != 2)
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (9)
174if (methSearch.Name.Equals(_name, comparison) && (_numArgs == -1 || methSearch.GetParameters().Length == _numArgs)) 198if (methSearch.Name.Equals(_name, comparison) && (_numArgs == -1 || methSearch.GetParameters().Length == _numArgs)) 212if (methSearch.Name.Equals(_name, comparison) && methSearch.GetParameters().Length == _numArgs) 238_argClrTypes = new Type[paramInfo.Length]; 239for (i = 0; i < paramInfo.Length; i++) 246_argXmlTypes = new XmlQueryType[paramInfo.Length]; 247for (i = 0; i < paramInfo.Length; i++) 282Debug.Assert(args.Length == _argClrTypes!.Length, "Mismatched number of actual and formal arguments.");
System\Xml\Xsl\Runtime\XmlIterators.cs (1)
45if (_idx >= _idrefs.Length)
System\Xml\Xsl\Runtime\XmlNavigatorStack.cs (1)
36if (_sp >= _stkNav.Length)
System\Xml\Xsl\Runtime\XmlQueryContext.cs (3)
272XmlExtensionFunction extFunc = _extFuncsLate.Bind(name, namespaceUri, args.Length, instance.GetType(), XmlQueryRuntime.LateBoundFlags); 275objActualArgs = new object[args.Length]; 277for (int i = 0; i < args.Length; i++)
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (14)
83_earlyObjects = (_earlyInfo != null) ? new object[_earlyInfo.Length] : null; 87_globalValues = (_globalNames != null) ? new object[_globalNames.Length] : null; 98_atomizedNames = new string[names.Length]; 104for (i = 0; i < names.Length; i++) 113for (i = 0; i < names.Length; i++) 124_filters = new XmlNavigatorFilter[filters.Length]; 126for (i = 0; i < filters.Length; i++) 170for (int idx = 0; idx < _globalNames!.Length; idx++) 187for (int idx = 0; idx < _globalNames!.Length; idx++) 250Debug.Assert(_earlyObjects != null && index < _earlyObjects.Length, "Early bound object does not exist"); 272for (int idx = 0; idx < _earlyInfo.Length; idx++) 897if (_indexes != null && indexId < _indexes.Length) 938else if (indexId >= _indexes.Length) 942Array.Copy(_indexes, indexesNew, _indexes.Length);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (4)
387Debug.Assert(keys.Length >= _size, "Number of keys must be >= number of items."); 399if (_size >= _items.Length) 607for (iEach = 0; iEach < sortArray.Length; iEach++) 614for (iEach = 1; iEach < sortArray.Length; iEach++)
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (9)
223dataWriter.Write(_names.Length); 237dataWriter.Write(_prefixMappingsList.Length); 240dataWriter.Write(mappings.Length); 256dataWriter.Write(_filters.Length); 271dataWriter.Write(_types.Length); 285dataWriter.Write(_collations.Length); 299dataWriter.Write(_globalNames.Length); 314dataWriter.Write(_earlyBound.Length); 315ebTypes = new Type[_earlyBound.Length];
System\Xml\Xsl\Runtime\XmlSortKey.cs (8)
259cntCmp = (_sortKeyBytes.Length < that._sortKeyBytes.Length) ? _sortKeyBytes.Length : that._sortKeyBytes.Length; 276if (_sortKeyBytes.Length < that._sortKeyBytes.Length) 278else if (_sortKeyBytes.Length > that._sortKeyBytes.Length)
System\Xml\Xsl\Runtime\XmlSortKeyAccumulator.cs (2)
81if (_pos >= _keys.Length) 84Array.Copy(_keys, keysNew, _keys.Length);
System\Xml\Xsl\Runtime\XsltLibrary.cs (1)
94for (int i = 0; i < arr.Length; i++)
System\Xml\Xsl\XmlIlGenerator.cs (3)
369_helper.LoadInteger(data.Length); 380_helper.LoadInteger(ebTypes.Length); 384for (int idx = 0; idx < ebTypes.Length; idx++)
System\Xml\Xsl\XmlQueryType.cs (7)
450for (int i = 1; i < sa.Length; i++) 853var matrix = new BitMatrix(s_baseTypeCodes.Length); 855for (int i = 0; i < s_baseTypeCodes.Length; i++) 903Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range."); 908Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
System\Xml\Xsl\XmlQueryTypeFactory.cs (7)
65XmlQueryType[] queryMemberTypes = new XmlQueryType[baseMemberTypes!.Length]; 67for (int i = 0; i < baseMemberTypes.Length; i++) 91if (types.Length == 0) 93else if (types.Length == 1) 100for (int i = 1; i < types.Length; i++) 351Debug.Assert(arrEnum[arrEnum.Length - 1] == XmlTypeCode.DayTimeDuration, 541for (int idx = 0; idx < s_specialBuiltInItemTypes.Length; idx++)
System\Xml\Xsl\XPath\XPathBuilder.cs (1)
988Debug.Assert(maxArgs == 0 || maxArgs == Infinity || argTypes != null && argTypes.Length == maxArgs);
System\Xml\Xsl\XslException.cs (2)
60if (args != null && args.Length > 0) 65for (int idx = 1; idx < args.Length; idx++)
System\Xml\Xsl\Xslt\CompilerError.cs (1)
42for (int i = 0; i < value.Length; i++)
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (1)
137if (++_lastRecord == _records.Length)
System\Xml\Xsl\Xslt\MatcherBuilder.cs (1)
522Debug.Assert(priority == branches.Length - 1);
System\Xml\Xsl\Xslt\OutputScopeManager.cs (1)
70if (_lastRecord == _records.Length)
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (1)
26Debug.Assert(args == null || args.Length == 0, "Error message must already be composed in res");
System\Xml\Xsl\Xslt\XsltInput.cs (13)
84if (_records.Length <= position) 86int newSize = _records.Length * 2; 92Array.Copy(_records, tmp, _records.Length); 715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length); 731for (int i = 0; i < attributes.Length; i++) 766for (kwd = 0; kwd < attributes.Length; kwd++) 775if (kwd == attributes.Length) 823for (int i = 0; i < attributes.Length; i++) 960for (int idx = 0; idx < list.Length; idx++) 981for (int idx = 0; idx < list.Length; idx++) 1016for (col = 0; col < list.Length; col++) 1023if (col == list.Length)
System\Xml\Xsl\Xslt\XsltLoader.cs (6)
121for (int i = 0; i < attributes.Length; i++) 620for (int i = 0; i < qnames.Length; i++) 957Debug.Assert(NumCharAttrs == DefaultValues.Length); 2664List<QilName> modes = new List<QilName>(list.Length); 2668if (list.Length == 0) 2830for (int i = 0; i < tokens.Length; i++)
System\Xml\Xsl\XsltOld\ActionFrame.cs (2)
100Debug.Assert(_variables != null && index < _variables.Length); 106Debug.Assert(_variables != null && index < _variables.Length);
System\Xml\Xsl\XsltOld\Avt.cs (1)
54for (int i = 0; i < _events.Length; i++)
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
73if (this.TextInfo.Length < newSize)
System\Xml\Xsl\XsltOld\Compiler.cs (1)
442for (int idx = 0; idx < nsList.Length; idx++)
System\Xml\Xsl\XsltOld\ContainerAction.cs (1)
460for (int i = 0; i < elements.Length; i++)
System\Xml\Xsl\XsltOld\InputScopeManager.cs (2)
141for (int idx = 0; idx < nsList.Length; idx++) 164for (int idx = 0; idx < nsList.Length; idx++)
System\Xml\Xsl\XsltOld\Processor.cs (1)
361for (int i = 0; i < _keyList.Length; i++)
System\Xml\Xsl\XsltOld\SequentialOutput.cs (3)
631Debug.Assert(find.Length == replace.Length); 652for (i = find.Length - 1; 0 <= i; i--)
System\Xml\Xsl\XsltOld\UseAttributeSetsAction.cs (3)
42_useAttributeSets = new XmlQualifiedName[qnames.Length]; 44for (int i = 0; i < qnames.Length; i++) 72if (frame.Counter < _useAttributeSets!.Length)
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (17)
113int length = methods.Length; 141if (methods[i].GetParameters().Length == argTypes.Length) 159for (int par = 0; par < parameters.Length; par++) 243if (argTypes.Length < func.Minargs || func.Maxargs < argTypes.Length) 245throw XsltException.Create(SR.Xslt_WrongNumberArgs, name, argTypes.Length.ToString(CultureInfo.InvariantCulture)); 765if (args.Length > 0) 823if (args.Length == 2) 940DecimalFormat formatInfo = ((XsltCompileContext)xsltContext).ResolveFormatName(args.Length == 3 ? ToString(args[2]) : null); 969int minArgs = parameters.Length; 970int maxArgs = parameters.Length; 971_types = new Type[parameters.Length]; 972XPathResultType[] argTypes = new XPathResultType[parameters.Length]; 974for (int i = parameters.Length - 1; 0 <= i; i--) 995Debug.Assert(args.Length <= this.Minargs, "We are checking this on resolve time"); 996for (int i = args.Length - 1; 0 <= i; i--)
System\Xml\Xsl\XsltOld\XsltOutput.cs (2)
202_cdataElements ??= new Hashtable(qnames.Length); 204for (int i = 0; i < qnames.Length; i++)
System\Xml\Xslt\XslCompiledTransform.cs (1)
185GeneratedCodeAttribute? generatedCodeAttr = customAttrs.Length > 0 ? (GeneratedCodeAttribute)customAttrs[0] : null;
System.Private.Xml.Linq (20)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
54if (count == arr.Length)
System\Xml\Linq\XHashtable.cs (10)
165if (_numEntries < _buckets.Length) 172for (int bucketIdx = 0; bucketIdx < _buckets.Length; bucketIdx++) 204if (newSize < _buckets.Length / 2) 206newSize = _buckets.Length; 210newSize = _buckets.Length * 2; 222for (int bucketIdx = 0; bucketIdx < _buckets.Length; bucketIdx++) 287if (newEntry < 0 || newEntry >= _buckets.Length) 304entryIndex = Interlocked.CompareExchange(ref _buckets[hashCode & (_buckets.Length - 1)], newEntry, EndOfList); 339currentIndex = _buckets[hashCode & (_buckets.Length - 1)]; 364_buckets[hashCode & (_buckets.Length - 1)] = currentIndex;
System\Xml\Linq\XObject.cs (9)
98while (i < a.Length && a[i] != null) i++; 99if (i == a.Length) 131for (int i = 0; i < a.Length; i++) 155for (int i = 0; i < a.Length; i++) 181for (int i = 0; i < a.Length; i++) 216for (int i = 0; i < a.Length; i++) 244for (int i = 0; i < a.Length; i++) 273while (i < a.Length) 308while (i < a.Length)
System.Reflection.Context (43)
System\Reflection\Context\CollectionServices.cs (3)
17if (left.Length != right.Length) 20for (int i = 0; i < left.Length; i++)
System\Reflection\Context\Custom\AttributeUtils.cs (3)
134return attributes != null && attributes.Length > 0; 181if (usageAttributes == null || usageAttributes.Length == 0) 187else if (usageAttributes.Length == 1)
System\Reflection\Context\Custom\CustomType.cs (5)
101if (types != null && types.Length > 0) 207getPropertyGetter = (types == null || types.Length == 0) && name.StartsWith("get_", comparison); 210getPropertySetter = (types == null || types.Length == 1) && name.StartsWith("set_", comparison); 265Debug.Assert(types == null || types.Length == 0); 277Debug.Assert(getPropertySetter && types != null && types.Length == 1);
System\Reflection\Context\Projection\ProjectingType.cs (19)
240methods.Length + 241constructors.Length + 242properties.Length + 243events.Length + 244fields.Length + 245nestedTypes.Length]; 248Array.Copy(methods, 0, members, i, methods.Length); i += methods.Length; 249Array.Copy(constructors, 0, members, i, constructors.Length); i += constructors.Length; 250Array.Copy(properties, 0, members, i, properties.Length); i += properties.Length; 251Array.Copy(events, 0, members, i, events.Length); i += events.Length; 252Array.Copy(fields, 0, members, i, fields.Length); i += fields.Length; 253Array.Copy(nestedTypes, 0, members, i, nestedTypes.Length); i += nestedTypes.Length; 255Debug.Assert(i == members.Length);
System\Reflection\Context\Projection\Projector.cs (4)
26if (values == null || values.Length == 0) 87Type[] newTypes = new Type[values.Length]; 88for (int i = 0; i < values.Length; i++) 130for (int i = 0; i < projected.Length; i++)
System\Reflection\Context\Virtual\VirtualParameter.cs (1)
32int length = parameters.Length;
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (3)
122args = new object[index.Length + 1]; 124Array.Copy(index, args, index.Length); 126args[index.Length] = value;
System\Reflection\Context\Virtual\VirtualPropertyInfo.cs (1)
75return GetCustomAttributes(attributeType, inherit).Length > 0;
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertyGetter.cs (2)
31if (parameters != null && parameters.Length > 0) 57return GetCustomAttributes(attributeType, inherit).Length > 0;
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (2)
38if (parameters == null || parameters.Length != 1) 74return GetCustomAttributes(attributeType, inherit).Length > 0;
System.Reflection.DispatchProxy (14)
src\libraries\Common\src\System\Reflection\Emit\IgnoreAccessChecksToAttributeBuilder.cs (1)
79.Single(c => c.GetParameters().Length == 1 &&
System\Reflection\DispatchProxyGenerator.cs (13)
286for (int i = 0; i < args.Length; i++) 302for (int i = 0; i < args.Length; i++) 419Type[] paramTypes = new Type[parameters.Length]; 420Type[][] paramReqMods = new Type[paramTypes.Length][]; 422for (int i = 0; i < parameters.Length; i++) 435string[] ss = new string[ts.Length]; 436for (int i = 0; i < ts.Length; i++) 441for (int i = 0; i < genericParameters.Length; i++) 452GenericArray<object> argsArr = new GenericArray<object>(il, parameters.Length); 454for (int i = 0; i < parameters.Length; i++) 481GenericArray<Type> typeArr = new GenericArray<Type>(il, genericTypes.Length); 482for (int i = 0; i < genericTypes.Length; ++i) 514for (int i = 0; i < parameters.Length; i++)
System.Reflection.Emit (79)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\MethodBuilderInstantiation.cs (1)
70for (int i = 0; i < _inst.Length; i++)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
235if (_iaLowerBound.Length <= _rank)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (1)
310for (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)
427stackChange -= con.GetParameters().Length; 504SwitchInstructionEncoder switchEncoder = _il.Switch(labels.Length); 605if (optionalParameterTypes == null || optionalParameterTypes.Length == 0) 633stackChange -= sm.ParameterTypes.Length; 637stackChange -= methodInfo.GetParameters().Length; 650stackChange -= optionalParameterTypes.Length; 659if (optionalParameterTypes != null && optionalParameterTypes.Length > 0) 673stackChange -= optionalParameterTypes.Length; 705stackChange -= parameterTypes.Length;
System\Reflection\Emit\MethodBuilderImpl.cs (14)
67_parameterTypes = new Type[parameterTypes.Length]; 68_parameterBuilders = new ParameterBuilderImpl[parameterTypes.Length + 1]; // parameter 0 reserved for return type 69for (int i = 0; i < parameterTypes.Length; i++) 84internal int ParameterCount => _parameterTypes == null ? 0 : _parameterTypes.Length; 104_returnType, ModuleBuilderImpl.GetSignatureConvention(_callingConventions), GetGenericArguments().Length, !IsStatic, optionalParameterTypes: null, 120var typeParameters = new GenericTypeParameterBuilderImpl[names.Length]; 121for (int i = 0; i < names.Length; i++) 135if (position > 0 && (_parameterTypes == null || position > _parameterTypes.Length)) 229_parameterTypes = new Type[parameterTypes.Length]; 230_parameterBuilders = new ParameterBuilderImpl[parameterTypes.Length + 1]; // parameter 0 reserved for return type 231for (int i = 0; i < parameterTypes.Length; i++) 297_parameterBuilders ??= new ParameterBuilderImpl[_parameterTypes.Length + 1]; // parameter 0 reserved for return type 298ParameterInfo[] parameters = new ParameterInfo[_parameterTypes.Length]; 300for (int i = 0; i < _parameterTypes.Length; i++)
System\Reflection\Emit\ModuleBuilderImpl.cs (10)
66_coreTypes = new Type[s_coreTypes.Length]; 87_coreTypes = new Type[s_coreTypes.Length]; 93for (int i = 0; i < _coreTypes.Length; i++) 103for (int i = 0; i < _coreTypes.Length; i++) 370for (int i = 0; i < gParams.Length; i++) 790GetSignatureConvention(method.CallingConvention), method.GetGenericArguments().Length, !method.IsStatic, optionalParameterTypes); 825if (parameterInfos.Length == 0) 830Type[] parameterTypes = new Type[parameterInfos.Length]; 832for (int i = 0; i < parameterInfos.Length; i++) 849if (publicKeyOrToken != null && publicKeyOrToken.Length > 0)
System\Reflection\Emit\PseudoCustomAttributesData.cs (6)
40for (int i = 0; i < attr._namedParamNames.Length; ++i) 363for (int i = 0; i < paramNames.Length; i++) 392for (int i = 0; i < paramNames.Length; i++) 441for (int i = 0; i < paramNames.Length; i++) 478for (int i = 0; i < paramNames.Length; i++) 494for (int i = 0; i < paramNames.Length; i++)
System\Reflection\Emit\SignatureHelper.cs (10)
45Parameters(parameters.Length, out ReturnTypeEncoder retType, out ParametersEncoder parameterEncoder); 65GenericTypeArgumentsEncoder encoder = new BlobEncoder(methodSpecSignature).MethodSpecificationSignature(genericArguments.Length); 81int paramsLength = ((parameters == null) ? 0 : parameters.Length) + ((optionalParameterTypes == null) ? 0 : optionalParameterTypes.Length); 99if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) 134for (int i = 0; i < parameters.Length; i++) 138if (requiredModifiers != null && requiredModifiers.Length > i && requiredModifiers[i] != null) 143if (optionalModifiers != null && optionalModifiers.Length > i && optionalModifiers[i] != null) 159Parameters(property.ParameterTypes == null ? 0 : property.ParameterTypes.Length, out ReturnTypeEncoder retType, out ParametersEncoder paramEncoder); 199module.GetTypeHandle(type.GetGenericTypeDefinition()), genericArguments.Length, type.IsValueType);
System\Reflection\Emit\TypeBuilderImpl.cs (22)
76for (int i = 0; i < interfaces.Length; i++) 278var typeParameters = new GenericTypeParameterBuilderImpl[names.Length]; 279for (int i = 0; i < names.Length; i++) 291if (data.Length <= 0 || data.Length >= 0x003f0000) 293throw new ArgumentException(SR.Argument_BadSizeForData, nameof(data.Length)); 299return DefineDataHelper(name, data, data.Length, attributes); 401if (bodyParameters.Length == declarationParameters.Length) 403for (int i = 0; i < bodyParameters.Length; i++) 582for (int i = 0; i < attributeInfo._namedParamNames.Length; ++i) 731for (int i = 0; i < types.Length; i++) 783if (argumentTypes.Length != parameterTypes.Length) 788for (int i = 0; i < parameterTypes.Length; i++) 989InterfaceMethods = new MethodInfo[interfaceMethods.Length], 990TargetMethods = new MethodInfo[interfaceMethods.Length] 993for (int i = 0; i < interfaceMethods.Length; i++) 1011for (int i = 0; i < interfaceMethods.Length; i++) 1028Type[] parameterTypes = new Type[parameterInfos.Length]; 1029for (int i = 0; i < parameterInfos.Length; i++) 1081for (int i = 0; i < interfaces.Length; i++)
System.Reflection.Metadata (54)
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (3)
62if (pkt.Length > PUBLIC_KEY_TOKEN_LEN) 66if (pkt.Length == 0) 72HexConverter.EncodeToUtf16(pkt, vsb.AppendSpan(pkt.Length * 2), HexConverter.Casing.Lower);
System\Reflection\Internal\Utilities\BlobUtilities.cs (1)
16Debug.Assert(buffer.Length > 0);
System\Reflection\Internal\Utilities\EncodingHelper.netcoreapp.cs (2)
38int prefixedByteCount = byteCount + prefix.Length; 48Marshal.Copy((IntPtr)bytes, buffer, prefix.Length, byteCount);
System\Reflection\Internal\Utilities\EnumerableExtensions.cs (1)
31for (int i = 0; i < map.Length; i++)
System\Reflection\Internal\Utilities\MemoryBlock.cs (5)
531var high = asciiKeys.Length - 1; 659int endRowNumber = ptrTable.Length - 1; 758while (endRowNumber + 1 < ptrTable.Length && 821for (int i = 0; i < ptrTable.Length; i++) 848Debug.Assert(i == result.Length);
System\Reflection\Internal\Utilities\ObjectPool`1.cs (2)
70for (int i = 0; i < items.Length; i++) 102for (int i = 0; i < items.Length; i++)
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
27int readSize = Math.Min(size, buffer.Length);
System\Reflection\Metadata\AssemblyNameInfo.cs (1)
61PublicKeyOrToken = parts._publicKeyOrToken is null ? default : parts._publicKeyOrToken.Length == 0
System\Reflection\Metadata\BlobBuilder.cs (6)
68return new BlobBuilder(Math.Max(_buffer.Length, minimalSize)); 125Debug.Assert(Length >= 0 && Length <= _buffer.Length); 160protected int FreeBytes => _buffer.Length - Length; 163protected internal int ChunkCapacity => _buffer.Length; 602if (result > _buffer.Length - byteCount) 787BlobUtilities.ValidateRange(buffer.Length, start, byteCount, nameof(byteCount));
System\Reflection\Metadata\BlobWriter.cs (3)
29: this(buffer, 0, buffer.Length) 42Debug.Assert(count <= buffer.Length - start); 232BlobUtilities.ValidateRange(buffer.Length, start, byteCount, nameof(byteCount));
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (5)
119for (int i = 0; i < rowCounts.Length; i++) 124for (int i = 0; i < heapSizes.Length; i++) 183var immutable = new ImmutableArray<T>[array.Length]; 184for (int i = 0; i < array.Length; i++) 197for (int t = 0; t < rowCounts.Length; t++)
System\Reflection\Metadata\IL\MethodBodyBlock.cs (2)
195for (int i = 0; i < result.Length; i++) 212for (int i = 0; i < result.Length; i++)
System\Reflection\Metadata\Internal\StringHeap.cs (4)
114for (int i = 0; i < s_virtualValues!.Length; i++) 186var bytes = new byte[prefix.Length + block.Length]; 187Buffer.BlockCopy(prefix, 0, bytes, 0, prefix.Length); 188Marshal.Copy((IntPtr)block.Pointer, bytes, prefix.Length, block.Length);
System\Reflection\Metadata\Internal\VirtualHeap.cs (1)
103var blob = new PinnedBlob(GCHandle.Alloc(value, GCHandleType.Pinned), value.Length);
System\Reflection\Metadata\MetadataReader.cs (6)
242for (int i = 0; i < streamHeaders.Length; i++) 497for (int i = 0; i < rowCounts.Length; i++) 787Debug.Assert(local.Length == external.Length); 789var rowCounts = new int[local.Length]; 795for (int i = (int)firstLocalTableIndex; i < rowCounts.Length; i++)
System\Reflection\Metadata\MetadataReader.WinMD.cs (7)
96Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 102Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 108Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 114Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 187Debug.Assert(k == keys.Length && v == keys.Length && k == v); 198for (int i = 0; i < keys.Length - 1; i++)
System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs (1)
2596Debug.Assert(blob.Length >= TemplateParameterOffset_AttributeUsageTarget + 4);
System\Reflection\PortableExecutable\PEBinaryReader.cs (1)
100for (int i = bytes.Length; i > 0; --i)
System\Reflection\PortableExecutable\PEBuilder.cs (1)
504if (signature == null || signature.Length > strongNameSignatureFixup.Length)
System\Reflection\PortableExecutable\PEReader.cs (1)
666if (algorithmName.Length == 0 || checksum.Length == 0)
System.Reflection.MetadataLoadContext (124)
System\CoreRtBridge.cs (2)
72return roMethod.GetGenericArgumentsOrParametersNoCopy().Length; 73return m.GetGenericArguments().Length;
System\Reflection\DefaultBinder.cs (31)
52Type[] realTypes = new Type[types.Length]; 53for (i = 0; i < types.Length; i++) 62if (match == null || match.Length == 0) 70for (i = 0; i < candidates.Length; i++) 73if (par.Length != types.Length) 75for (j = 0; j < types.Length; j++) 105if (j == types.Length) 116int[] paramOrder = new int[types.Length]; 117for (i = 0; i < types.Length; i++) 160if (match == null || match.Length == 0) 169int indexesLength = (indexes != null) ? indexes.Length : 0; 170for (i = 0; i < candidates.Length; i++) 175if (par.Length != indexesLength) 281MethodBase[] aExactMatches = new MethodBase[match.Length]; 284for (int i = 0; i < match.Length; i++) 287if (par.Length == 0) 292for (j = 0; j < types.Length; j++) 300if (j < types.Length) 327int typesLength = (types != null) ? types.Length : 0; 328for (int i = 0; i < match.Length; i++) 366for (int i = 0; i < types.Length; i++) 383if (paramArrayType1 != null && paramOrder1[i] >= p1.Length - 1) 388if (paramArrayType2 != null && paramOrder2[i] >= p2.Length - 1) 412if (p1.Length > p2.Length) 416else if (p2.Length > p1.Length) 569if (params1.Length != params2.Length) 572int numParams = params1.Length;
System\Reflection\MetadataLoadContext.KnownConstructors.cs (1)
37int count = parameterCoreTypes.Length;
System\Reflection\MetadataLoadContext.Loading.cs (2)
34if (pkt.Length == 0 && defNameData.PublicKey != null && defNameData.PublicKey.Length != 0)
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (9)
86if (p1.Length != p2.Length) 95for (int i = 0; i < p1.Length; i++) 107if (method1.GetGenericArguments().Length != method2.GetGenericArguments().Length) 109for (int i = 0; i < p1.Length; i++) 161if (ga1.Length != ga2.Length) 164for (int i = 0; i < ga1.Length; i++)
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (1)
180if (count == _members.Length)
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (3)
42if (argumentTypes.Length != parameterInfos.Length) 65for (int i = 0; i < parameterInfos.Length; i++)
System\Reflection\Runtime\SignatureTypeExtensions.cs (4)
61int count = patternGenericTypeArguments.Length; 62if (count != actualGenericTypeArguments.Length) 134int count = genericTypeArguments.Length; 155if (position >= genericMethodParameters.Length)
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.cs (1)
63if (pk.Length != 0)
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.GetName.cs (1)
25if (pk.Length != 0)
System\Reflection\TypeLoading\Assemblies\RoAssembly.cs (2)
148AssemblyName[] result = new AssemblyName[data.Length]; 149for (int i = 0; i < data.Length; i++)
System\Reflection\TypeLoading\Assemblies\RoAssembly.Modules.cs (5)
37FileStream[] fs = new FileStream[m.Length]; 38for (int i = 0; i < fs.Length; i++) 47List<Module> modules = new List<Module>(_loadedModules.Length + 1) 51for (int i = 0; i < _loadedModules.Length; i++) 90List<RoModule> modules = new List<RoModule>(_loadedModules.Length + 1);
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (2)
41int parameterCount = _parameterTypes.Length; 56int parameterCount = _parameterTypes.Length;
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (2)
18if (members.Length == 0) 21if (members.Length > 1)
System\Reflection\TypeLoading\General\Assignability.cs (2)
200for (int i = 0; i < genericTypeParameters.Length; i++) 341if (toTypeGenericTypeArguments.Length != 1)
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (2)
50for (int i = skip; i < _table.Length; i++) 62Array.Copy(_table, skip, newArray, 0, newArray.Length);
System\Reflection\TypeLoading\General\Helpers.cs (8)
27if (original.Length == 0) 32T[] copy = new T[original.Length]; 33Array.Copy(sourceArray: original, sourceIndex: 0, destinationArray: copy, destinationIndex: 0, length: original.Length); 46if (original.Length == 0) 49Type[] copy = new Type[original.Length]; 50for (int i = 0; i < original.Length; i++) 251int count = genericMethodArguments == null ? 0 : genericMethodArguments.Length; 265for (int position = 0; position < methodSigStrings.Parameters.Length; position++)
System\Reflection\TypeLoading\General\MethodSig.cs (2)
33Debug.Assert(position >= -1 && position < Parameters.Length); 39Debug.Assert(position >= -1 && position < Parameters.Length);
System\Reflection\TypeLoading\General\TypeContext.cs (2)
23if (GenericTypeArguments == null || ((uint)index) >= GenericTypeArguments.Length) 30if (GenericMethodArguments == null || ((uint)index) >= GenericMethodArguments.Length)
System\Reflection\TypeLoading\Methods\RoConstructedGenericMethod.cs (3)
62if (_genericMethodArguments.Length != other._genericMethodArguments.Length) 65for (int i = 0; i < _genericMethodArguments.Length; i++)
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (3)
97public sealed override bool IsGenericMethodDefinition => GetGenericTypeParametersNoCopy().Length != 0; 109int count = typeArguments.Length; 123if (count != GetGenericTypeParametersNoCopy().Length)
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
79for (int i = 0; i < pis.Length; i++)
System\Reflection\TypeLoading\Methods\RoSyntheticMethod.cs (2)
44int parameterCount = _parameterTypes.Length; 58int parameterCount = _parameterTypes.Length;
System\Reflection\TypeLoading\Modules\GetTypeCoreCache.cs (9)
83int bucket = ComputeBucket(hashCode, _buckets.Length); 105int bucket = ComputeBucket(hashCode, _buckets.Length); 120public bool HasCapacity => _nextFreeEntry != _entries.Length; 124int newSize = HashHelpers.GetPrime(_buckets.Length * 2); 126newSize = _buckets.Length + 3; 140for (int bucket = 0; bucket < _buckets.Length; bucket++) 177Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 179for (int bucket = 0; bucket < _buckets.Length; bucket++) 189int storedBucket = ComputeBucket(_entries[walk1]._hashCode, _buckets.Length);
System\Reflection\TypeLoading\Properties\RoProperty.cs (1)
138int count = methodParameters.Length;
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (6)
30if (types.Length == 0 && candidates.Count == 1) 34if (parameters.Length == 0) 95if (types.Length == 0 && candidates.Count == 1) 127if (types == null || (candidate.GetIndexParameters().Length == types.Length)) 137if (types == null || types.Length == 0)
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.cs (1)
81internal sealed override int GetGenericParameterCount() => GetGenericTypeParametersNoCopy().Length;
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (2)
75for (int i = 0; i < _genericTypeArguments.Length; i++) 93for (int i = 0; i < _genericTypeArguments.Length; i++)
System\Reflection\TypeLoading\Types\RoConstructedGenericType.Key.cs (4)
29if (GenericTypeArguments.Length != other.GenericTypeArguments.Length) 31for (int i = 0; i < GenericTypeArguments.Length; i++) 54for (int i = 0; i < GenericTypeArguments.Length; i++)
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (1)
98int count = typeArguments.Length;
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (4)
87for (int i = 0; i < _parameterTypes.Length; i++) 126if (!args.Length.Equals(otherArgs.Length)) 129for (int i = 0; i < args.Length; i++)
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (3)
26int count = parameterUnmodifiedTypes.Length; 53List<Type> builder = new(returnTypeOptionalModifiers.Length + 1); 71for (int i = 0; i < returnTypeOptionalModifiers.Length; i++)
System\Reflection\TypeLoading\Types\RoModifiedGenericType.cs (1)
21int count = unmodifiedTypes.Length;
System\Reflection\TypeLoading\Types\RoType.cs (1)
343int numValues = enumFields.Length;
System.Resources.Extensions (13)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (5)
594writer.Write(bytes.Length); 595writer.Write(bytes, 0, bytes.Length); 608writer.Write(arr.Length); 609writer.Write(arr, 0, arr.Length); 622while ((read = s.Read(buffer, 0, buffer.Length)) != 0)
src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
25int len = array.Length;
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (1)
76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!");
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (4)
411for (int i = 0; i < arr.Length; i++) 609for (int i = 0; i < bits.Length; i++) 975if (typeIndex < 0 || typeIndex >= _typeTable.Length) 1043Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
System\Resources\Extensions\PreserializedResourceWriter.cs (2)
250writer.Write7BitEncodedInt(data.Length); 274writer.Write7BitEncodedInt(data.Length);
System.Resources.Writer (5)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (5)
594writer.Write(bytes.Length); 595writer.Write(bytes, 0, bytes.Length); 608writer.Write(arr.Length); 609writer.Write(arr, 0, arr.Length); 622while ((read = s.Read(buffer, 0, buffer.Length)) != 0)
System.Runtime.Caching (22)
System\Runtime\Caching\CacheExpires.cs (14)
134for (int i = 0; i < _counts.Length; i++) 148for (int i = _counts.Length - 1; i >= ci; i--) 162for (int i = _counts.Length - 1; i >= ci; i--) 174if (ci >= _counts.Length) 383oldLength = _pages.Length; 401for (int i = oldLength; i < newPages.Length; i++) 408newPages[newPages.Length - 1]._pageNext = -1; 411_freePageList._tail = newPages.Length - 1; 422for (int i = 0; i < entries.Length - 1; i++) 426entries[entries.Length - 1]._next = ExpiresEntryRef.INVALID; 481for (int i = 1; i < entries.Length; i++) 635for (int i = 0; i < _pages.Length; i++) 641for (int j = 1; j < entries.Length; j++) 781for (byte b = 0; b < _buckets.Length; b++)
System\Runtime\Caching\CacheUsage.cs (8)
368oldLength = _pages.Length; 386for (int i = oldLength; i < newPages.Length; i++) 393newPages[newPages.Length - 1]._pageNext = -1; 396_freePageList._tail = newPages.Length - 1; 407for (int i = 0; i < entries.Length - 1; i++) 411entries[entries.Length - 1]._ref1._next = UsageEntryRef.INVALID; 464for (int i = 1; i < entries.Length; i++) 834for (byte b = 0; b < _buckets.Length; b++)
System.Runtime.InteropServices (7)
System\Runtime\InteropServices\ComAwareEventInfo.cs (2)
104if (comEventInterfaces == null || comEventInterfaces.Length == 0) 111if (comEventInterfaces.Length > 1)
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (5)
89var parameterTypes = new Type[parameters.Length]; 90var parameterOptionalModifiers = new Type[parameters.Length][]; 91var parameterRequiredModifiers = new Type[parameters.Length][]; 92for (int i = 0; i < parameters.Length; i++) 104for (int i = 0; i < parameters.Length; i++)
System.Runtime.Numerics (99)
src\libraries\Common\src\System\Number.Formatting.Common.cs (4)
485int groupSizeLen = groupDigits.Length; // The length of groupDigits array. 764if (groupDigits.Length != 0) // You can pass in 0 length arrays 777if (groupSizeIndex < groupDigits.Length - 1) 810if (groupSizeIndex < groupDigits.Length - 1)
System\Number.BigInteger.cs (2)
264bits = new uint[bits.Length + 1]; 897int cuSrc = value._bits.Length;
System\Numerics\BigInteger.cs (93)
419int len = val.Length - 1; 448if (len != val.Length) 471if ((rgu is not null) && (rgu.Length > MaxLength)) 632int iu = _bits.Length - 1; 766int size = dividend._bits.Length; 788if (dividend._bits.Length < divisor._bits.Length) 796int size = dividend._bits.Length; 802size = dividend._bits.Length - divisor._bits.Length + 1; 843ulong h = value._bits[value._bits.Length - 1]; 844ulong m = value._bits.Length > 1 ? value._bits[value._bits.Length - 2] : 0; 845ulong l = value._bits.Length > 2 ? value._bits[value._bits.Length - 3] : 0; 849long b = (long)value._bits.Length * 32 - c; 986int size = (modulus._bits?.Length ?? 1) << 1; 1058int size = BigIntegerCalculator.PowBound(power, value._bits!.Length); 1102if ((_sign ^ other) < 0 || (cu = _bits.Length) > 2) 1122int cu = _bits.Length; 1145if ((_sign ^ other) < 0 || (cu = _bits.Length) > 2) 1161int cu = _bits.Length; 1369Debug.Assert(bits.Length > 0); 1370Debug.Assert(bits[bits.Length - 1] != 0); 1376highDword = ~bits[bits.Length - 1]; 1377if (bits.Length - 1 == nonZeroDwordIndex) 1388highDword = bits[bits.Length - 1]; 1416length = checked(4 * (bits.Length - 1) + length); 1443for (int i = 0; i < bits.Length - 1; i++) 1507Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1519buffer = buffer.Slice(0, _bits.Length + 1); 1583if ((_bits is null) || (_bits.Length <= 4)) 1594double lowBitsCount32 = _bits.Length - 2; // if Length > int.MaxValue/32, counting in bits can cause overflow 1798int length = value._bits.Length; 1823int length = bits.Length; 1870if (value._bits.Length > 1) 1895int len = value._bits.Length; 1932int len = value._bits.Length; 2007else if (value._bits.Length > 1 || value._sign < 0) 2026int len = value._bits.Length; 2052int len = value._bits.Length; 2337int size = (left._bits?.Length ?? 1) + 1; 2344size = (right._bits?.Length ?? 1) + 1; 2393int size = (left._bits?.Length ?? 1) + 1; 2400size = (right._bits?.Length ?? 1) + 1; 2444int size = (left._bits?.Length ?? 1) + 1; 2451size = (right._bits?.Length ?? 1) + 1; 2498int xl = value._bits?.Length ?? 1; 2559int xl = value._bits?.Length ?? 1; 2790int size = dividend._bits.Length; 2810if (dividend._bits.Length < divisor._bits.Length) 2816int size = dividend._bits.Length - divisor._bits.Length + 1; 2860if (dividend._bits.Length < divisor._bits.Length) 2866int size = dividend._bits.Length; 3062bitsArrayLength = bits.Length; 3103Debug.Assert(_bits is null ? xd.Length == 1 : xd.Length == _bits.Length); 3124Debug.Assert(_bits.Length > 0); 3126Debug.Assert(_bits.Length > 1 || _bits[0] >= kuMaskHighBit); 3128Debug.Assert(_bits[_bits.Length - 1] != 0); 3130Debug.Assert(_bits.Length <= MaxLength); 3189for (int i = 0; i < value._bits.Length; i++) 3212while ((part == 0) && (i < value._bits.Length)); 3214while (i < value._bits.Length) 3232int byteCount = (value._bits is null) ? sizeof(int) : (value._bits.Length * 4); 3249int xl = value._bits?.Length ?? 1; 3367int byteCount = (value._bits is null) ? sizeof(int) : (value._bits.Length * 4); 3384int xl = value._bits?.Length ?? 1; 3514for (int i = 1; (part == 0) && (i < value._bits.Length); i++) 3559int result = (bits.Length - 1) * 32; 3573for (int index = 0; index < bits.Length - 1; index++) 3611ref byte address = ref Unsafe.Add(ref startAddress, (bits.Length - 1) * sizeof(uint)); 3613for (int i = 0; i < bits.Length; i++) 3652while ((part == 0) && (i < bits.Length)); 3654while (i < bits.Length) 3714for (int i = 0; i < bits.Length; i++) 3753while ((part == 0) && (i < bits.Length)); 3755while (i < bits.Length) 3804int result = bits.Length * 4; 3814for (int index = 0; index < bits.Length - 1; index++) 3859return ((value._bits.Length * 32) - 1) ^ uint.LeadingZeroCount(value._bits[^1]); 4913if (value._bits.Length >= 2) 4945if (value._bits.Length >= 4) 4951if (value._bits.Length >= 3) 4956if (value._bits.Length >= 2) 4989if (Environment.Is64BitProcess && (value._bits.Length >= 2)) 5094if (value._bits.Length >= 2) 5126if (value._bits.Length >= 4) 5132if (value._bits.Length >= 3) 5137if (value._bits.Length >= 2) 5170if (Environment.Is64BitProcess && (value._bits.Length >= 2))
System.Runtime.Serialization.Formatters (80)
System\Runtime\Serialization\Formatters\Binary\BinaryFormatterWriter.cs (2)
242while (arrayOffset < array.Length) 244int numArrayItems = Math.Min(ChunkSize / typeLength, array.Length - arrayOffset);
System\Runtime\Serialization\Formatters\Binary\BinaryObjectInfo.cs (11)
257int count = _cache._memberInfos.Length; 491_count = _cache._memberInfos.Length; 580memberData = new object[_cache._memberNames.Length]; 632if (_cache._memberNames.Length > 0 && _cache._memberNames[_lastPosition].Equals(name)) 636else if ((++_lastPosition < _cache._memberNames.Length) && (_cache._memberNames[_lastPosition].Equals(name))) 643for (int i = 0; i < _cache._memberNames.Length; i++) 681if (inMemberNames.Length < _cache._memberInfos.Length) 686Type[] outMemberTypes = new Type[_cache._memberInfos.Length]; 688for (int i = 0; i < _cache._memberInfos.Length; i++) 698for (int j = 0; j < inMemberNames.Length; j++)
System\Runtime\Serialization\Formatters\Binary\BinaryObjectReader.cs (1)
157Debug.Assert(index < _crossAppDomainArray.Length, "[System.Runtime.Serialization.Formatters.BinaryObjectReader index out of range for CrossAppDomainArray]");
System\Runtime\Serialization\Formatters\Binary\BinaryObjectWriter.cs (3)
147var memberObjectInfos = new WriteObjectInfo[memberNames.Length]; 155for (int i = 0; i < memberTypes.Length; i++) 206int numItems = memberNames.Length;
System\Runtime\Serialization\Formatters\Binary\BinaryParser.cs (5)
334op._memberLength = op._binaryTypeEnumA.Length; 459op._memberLength = op._binaryTypeEnumA.Length; 558op._memberLength = op._binaryTypeEnumA.Length; 885while (arrayOffset < array.Length) 887int numArrayItems = Math.Min(ChunkSize / typeLength, array.Length - arrayOffset);
System\Runtime\Serialization\Formatters\Binary\BinaryUtilClasses.cs (23)
156if (_top == (_objects.Length - 1)) 178int size = _objects.Length * 2; 180Array.Copy(_objects, newItems, _objects.Length); 214_objects = new object[sizedArray._objects.Length]; 216_negObjects = new object[sizedArray._negObjects.Length]; 228return -index > _negObjects.Length - 1 ? null : _negObjects[-index]; 232return index > _objects.Length - 1 ? null : _objects[index]; 239if (-index > _negObjects.Length - 1) 247if (index > _objects.Length - 1) 262int size = Math.Max(_negObjects.Length * 2, (-index) + 1); 264Array.Copy(_negObjects, newItems, _negObjects.Length); 269int size = Math.Max(_objects.Length * 2, index + 1); 271Array.Copy(_objects, newItems, _objects.Length); 291_objects = new int[sizedArray._objects.Length]; 293_negObjects = new int[sizedArray._negObjects.Length]; 305return -index > _negObjects.Length - 1 ? 0 : _negObjects[-index]; 309return index > _objects.Length - 1 ? 0 : _objects[index]; 316if (-index > _negObjects.Length - 1) 324if (index > _objects.Length - 1) 339int size = Math.Max(_negObjects.Length * 2, (-index) + 1); 341Array.Copy(_negObjects, newItems, _negObjects.Length); 346int size = Math.Max(_objects.Length * 2, index + 1); 348Array.Copy(_objects, newItems, _objects.Length);
System\Runtime\Serialization\Formatters\Binary\ObjectMap.cs (5)
43_binaryTypeEnumA = new BinaryTypeEnum[_memberTypes.Length]; 44_typeInformationA = new object[_memberTypes.Length]; 46for (int i = 0; i < _memberTypes.Length; i++) 71_memberTypes = new Type[memberNames.Length]; 73for (int i = 0; i < memberNames.Length; i++)
System\Runtime\Serialization\Formatters\Binary\SerializationHeaderRecord.cs (1)
51if (headerBytes.Length < 17)
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.Security.Claims (9)
System\Security\Claims\Claim.cs (2)
461if (userData != null && userData.Length > 0) 503writer.Write(userData!.Length);
System\Security\Claims\ClaimsIdentity.cs (2)
845if (userData != null && userData.Length > 0) 894writer.Write(userData!.Length);
System\Security\Claims\ClaimsPrincipal.cs (2)
528if (userData != null && userData.Length > 0) 547writer.Write(userData!.Length);
System\Security\Claims\GenericPrincipal.cs (3)
47if (roles != null && roles.Length > 0) 49List<Claim> roleClaims = new List<Claim>(roles.Length); 75for (int i = 0; i < m_roles.Length; ++i)
System.Security.Cryptography (394)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
52if (TryGetUserNameFromPasswd(uid, buf, heapBuf.Length, out username))
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (1)
85bytesNeeded = ObjObj2Txt(buf, bufHeap.Length, asn1ObjectPtr);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
164int ret = method(handle, bytes, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EcDsa.ImportExport.cs (8)
76p, p.Length, 77curve.A!, curve.A!.Length, 78curve.B!, curve.B!.Length, 79curve.G.X!, curve.G.X!.Length, 80curve.G.Y!, curve.G.Y!.Length, 81curve.Order!, curve.Order!.Length, 82curve.Cofactor, curve.Cofactor!.Length, 83curve.Seed, curve.Seed == null ? 0 : curve.Seed.Length);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
39ErrErrorStringN(error, buf, buffer.Length);
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
77ReportDownloadStop(ret?.Length ?? 0);
src\libraries\Common\src\System\Security\Cryptography\Asn1\AttributeAsn.xml.cs (1)
37for (int i = 0; i < AttrValues.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\SafeBagAsn.xml.cs (1)
51for (int i = 0; i < BagAttributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs7\EncryptedDataAsn.xml.cs (1)
35for (int i = 0; i < UnprotectedAttributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml.cs (1)
37for (int i = 0; i < Attributes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
25Debug.Assert(clearSize <= array.Length);
src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (5)
36ret.G = parms.G.ExportKeyParameter(ret.P.Length); 60ret.X = x.ExportKeyParameter(ret.Q.Length); 64ret.Y = y.ExportKeyParameter(ret.P.Length); 104ret.G = parms.G.ExportKeyParameter(ret.P.Length); 105ret.Y = y.ExportKeyParameter(ret.P.Length);
src\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (12)
106if (parameters.J != null && parameters.J.Length >= parameters.P.Length) 111int keySize = parameters.P.Length; 112if (parameters.G.Length != keySize || parameters.Y.Length != keySize) 115if (hasPrivateKey && parameters.X!.Length != parameters.Q.Length) 123parameters.P, parameters.P.Length, 124parameters.Q, parameters.Q.Length, 125parameters.G, parameters.G.Length, 126parameters.Y, parameters.Y.Length, 127parameters.X, parameters.X != null ? parameters.X.Length : 0))
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (14)
431curve.A = specifiedParameters.Curve.A.ToUnsignedIntegerBytes(primeOrPoly.Length); 432curve.B = specifiedParameters.Curve.B.ToUnsignedIntegerBytes(primeOrPoly.Length); 433curve.Order = specifiedParameters.Order.ToUnsignedIntegerBytes(primeOrPoly.Length); 438if (baseSpan[0] != 0x04 || baseSpan.Length != 2 * primeOrPoly.Length + 1) 443curve.G.X = baseSpan.Slice(1, primeOrPoly.Length).ToArray(); 444curve.G.Y = baseSpan.Slice(1 + primeOrPoly.Length).ToArray(); 520for (int i = 0; i < attributes.Length; i++) 657int lastIndex = polynomial.Length - 1; 677for (int inverseIndex = 0; inverseIndex < polynomial.Length; inverseIndex++) 757while (start < fieldElement.Length - 1 && fieldElement[start] == 0) 767int basePointLength = ecParameters.Curve.G.X!.Length * 2 + 1; 782ecParameters.Curve.G.Y.CopyTo(basePointBytes.Slice(1 + ecParameters.Curve.G.X.Length)); 795int publicKeyLength = ecParameters.Q.X!.Length * 2 + 1; 810ecParameters.Q.Y.CopyTo(publicKeyBytes.Slice(1 + ecParameters.Q.X!.Length));
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (4)
136int half = secretAgreement.Length / 2; 137int odd = secretAgreement.Length & 1; 150Span<byte> part2 = stackalloc byte[ret.Length]; 160for (int i = 0; i < ret.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.ImportExport.cs (25)
117parameters.Q.X, parameters.Q.X?.Length ?? 0, 118parameters.Q.Y, parameters.Q.Y?.Length ?? 0, 119parameters.D, parameters.D == null ? 0 : parameters.D.Length); 129parameters.Q.X, parameters.Q.X?.Length ?? 0, 130parameters.Q.Y, parameters.Q.Y?.Length ?? 0, 131parameters.D, parameters.D == null ? 0 : parameters.D.Length, 132parameters.Curve.Prime!, parameters.Curve.Prime!.Length, 133parameters.Curve.A!, parameters.Curve.A!.Length, 134parameters.Curve.B!, parameters.Curve.B!.Length, 135parameters.Curve.G.X!, parameters.Curve.G.X!.Length, 136parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length, 137parameters.Curve.Order!, parameters.Curve.Order!.Length, 138parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length, 139parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length); 149parameters.Q.X, parameters.Q.X?.Length ?? 0, 150parameters.Q.Y, parameters.Q.Y?.Length ?? 0, 151parameters.D, parameters.D == null ? 0 : parameters.D.Length, 152parameters.Curve.Polynomial!, parameters.Curve.Polynomial!.Length, 153parameters.Curve.A!, parameters.Curve.A!.Length, 154parameters.Curve.B!, parameters.Curve.B!.Length, 155parameters.Curve.G.X!, parameters.Curve.G.X!.Length, 156parameters.Curve.G.Y!, parameters.Curve.G.Y!.Length, 157parameters.Curve.Order!, parameters.Curve.Order!.Length, 158parameters.Curve.Cofactor, parameters.Curve.Cofactor!.Length, 159parameters.Curve.Seed, parameters.Curve.Seed == null ? 0 : parameters.Curve.Seed.Length);
src\libraries\Common\src\System\Security\Cryptography\Helpers.cs (1)
51{ Length: 0 } => src,
src\libraries\Common\src\System\Security\Cryptography\KeySizeHelpers.cs (1)
60for (int i = 0; i < legalSizes.Length; i++)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (5)
378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 385if (length != pwdTmpBytes!.Length) 393Debug.Assert(pwdTmpBytes!.Length == 0); 443return written + lastBlock.Length; 967return writeOffset + tmpEnd.Length;
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (2)
43int halfModulusLength = (n.Length + 1) / 2; 49D = key.PrivateExponent.ExportKeyParameter(n.Length),
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (3)
223if (!encrypted || bytesWritten != buf.Length) 225Debug.Fail($"TryEncrypt behaved unexpectedly: {nameof(encrypted)}=={encrypted}, {nameof(bytesWritten)}=={bytesWritten}, {nameof(buf.Length)}=={buf.Length}");
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
22Debug.Fail($"Convert.TryToBase64 failed with {input.Length} bytes to a {base64.Length} buffer");
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
80if (TryGetHomeDirectoryFromPasswd(buf, heapBuf.Length, out userHomeDirectory))
System\Security\Cryptography\AesCcm.cs (1)
31AesAEAD.CheckKeySize(key.Length);
System\Security\Cryptography\AesImplementation.cs (2)
187long keySize = rgbKey.Length * (long)BitsPerByte; 193long ivSize = rgbIV.Length * (long)BitsPerByte;
System\Security\Cryptography\AesImplementation.OpenSsl.cs (1)
21IntPtr algorithm = GetAlgorithm(key.Length * 8, feedback * 8, cipherMode);
System\Security\Cryptography\AsnEncodedData.cs (1)
127if (_rawData == null || _rawData.Length == 0)
System\Security\Cryptography\AsnEncodedDataCollection.cs (3)
72if (index < 0 || index >= array.Length) 74if (Count > array.Length - index) 91if (index < 0 || index >= array.Length)
System\Security\Cryptography\AsnFormatter.cs (3)
21Debug.Assert(sArray != null && sArray.Length != 0); 23int length = (sArray.Length * 3) - 1; // two chars per byte, plus 1 space between each 29for (int i = 0; i < sArray.Length; i++)
System\Security\Cryptography\AsymmetricAlgorithm.cs (2)
790bufSize = buf.Length; 820bufSize = buf.Length;
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (1)
225fieldSizeBits = pars.Q!.Length * 8;
System\Security\Cryptography\Base64Transforms.cs (5)
45if (requiredOutputLength > outputBuffer.Length - outputOffset) 78Debug.Assert(written == output.Length); 300Debug.Assert(_inputIndex < _inputBuffer.Length); 373if ((uint)inputCount > inputBuffer.Length) 379if ((inputBuffer.Length - inputCount) < inputOffset)
System\Security\Cryptography\CapiHelper.DSA.Shared.cs (17)
25if (dsaParameters.P == null || dsaParameters.P.Length == 0 || dsaParameters.Q == null || dsaParameters.Q.Length != DSS_Q_LEN) 29if (dsaParameters.G == null || dsaParameters.G.Length != dsaParameters.P.Length) 34if (dsaParameters.J != null && dsaParameters.J.Length >= dsaParameters.P.Length) 38if (dsaParameters.Y != null && dsaParameters.Y.Length != dsaParameters.P.Length) 42if (dsaParameters.Seed != null && dsaParameters.Seed.Length != 20) 45bool isPrivate = (dsaParameters.X != null && dsaParameters.X.Length > 0); 48if (isPrivate && dsaParameters.X!.Length != DSS_Q_LEN) 51uint bitLenP = (uint)dsaParameters.P.Length * 8; 52uint bitLenJ = dsaParameters.J == null ? 0 : (uint)dsaParameters.J.Length * 8; 81bw.Write((uint)(dsaParameters.Q.Length * 8)); 86bw.Write((uint)dsaParameters.X!.Length * 8); 299Debug.Assert(dsaParameters.Y.Length > 0); 339if (dsaParameters.Seed == null || dsaParameters.Seed.Length == 0)
System\Security\Cryptography\CapiHelper.Shared.cs (13)
75if (rsaParameters.Exponent == null || rsaParameters.Exponent.Length > 4) 78int modulusLength = rsaParameters.Modulus.Length; 84if (rsaParameters.P.Length != halfModulusLength) 87if (rsaParameters.Q == null || rsaParameters.Q.Length != halfModulusLength) 90if (rsaParameters.DP == null || rsaParameters.DP.Length != halfModulusLength) 93if (rsaParameters.DQ == null || rsaParameters.DQ.Length != halfModulusLength) 96if (rsaParameters.InverseQ == null || rsaParameters.InverseQ.Length != halfModulusLength) 99if (rsaParameters.D == null || rsaParameters.D.Length != modulusLength) 103bool isPrivate = (rsaParameters.P != null && rsaParameters.P.Length != 0); 119for (int i = 0; i < rsaParameters.Exponent.Length; i++) 203if (cspBlob.Length < 8) 268if (currentIV?.Length > blockSizeBytes) 271Buffer.BlockCopy(currentIV, 0, tmp, 0, tmp.Length);
System\Security\Cryptography\ChaCha20Poly1305.cs (1)
36CheckKeySize(key.Length);
System\Security\Cryptography\CngProperty.cs (1)
93for (int i = 0; i < _value.Length; i++)
System\Security\Cryptography\CryptoConfig.cs (13)
313string[] algorithmNames = new string[names.Length]; 314Array.Copy(names, algorithmNames, algorithmNames.Length); 413(args == null || args.Length == 1) && 445for (int i = 0; i < cons.Length; i++) 448if (con.GetParameters().Length == args.Length) 505string[] oidNames = new string[names.Length]; 506Array.Copy(names, oidNames, oidNames.Length); 557uint[] oidNums = new uint[oidString.Length]; 558for (int i = 0; i < oidString.Length; i++) 564if (oidNums.Length < 2) 572for (int i = 2; i < oidNums.Length; i++) 583for (int i = 2; i < oidNums.Length; i++)
System\Security\Cryptography\CryptoStream.cs (2)
153_stream.Write(finalBytes, 0, finalBytes.Length); 443_outputBufferIndex = _outputBuffer.Length;
System\Security\Cryptography\DES.cs (2)
53if (!(value.Length * 8).IsLegalSize(s_legalKeySizes)) 112if (rgbKey != null && rgbKey.Length == 8)
System\Security\Cryptography\DesImplementation.cs (2)
64long keySize = rgbKey.Length * (long)BitsPerByte; 75long ivSize = rgbIV.Length * (long)BitsPerByte;
System\Security\Cryptography\DSA.cs (11)
101return SignData(data, 0, data.Length, hashAlgorithm); 141ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 144ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 198ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 201ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 303return VerifyData(data, 0, data.Length, signature, hashAlgorithm); 311ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 314ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 371ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 374ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 1107int qLength = dsaParameters.Q!.Length;
System\Security\Cryptography\DSA.Xml.cs (4)
36byte[] g = ReadRequiredElement(ref state, nameof(DSAParameters.G), p.Length); 37byte[] y = ReadRequiredElement(ref state, nameof(DSAParameters.Y), p.Length); 41byte[]? x = XmlKeyHelper.ReadCryptoBinary(ref state, nameof(DSAParameters.X), q.Length); 107StringBuilder builder = new StringBuilder((keyParameters.P.Length << 1) / 3);
System\Security\Cryptography\DSACryptoServiceProvider.Unix.cs (2)
134if (parameters.Y != null && parameters.Y.Length > 1024 / 8) 234if (rgbHash.Length != SHA1_HASHSIZE)
System\Security\Cryptography\ECCurve.cs (11)
203B == null || B.Length != A.Length || 204G.X == null || G.X.Length != A.Length || 205G.Y == null || G.Y.Length != A.Length || 206Order == null || Order.Length == 0 || 207Cofactor == null || Cofactor.Length == 0) 216if (Prime == null || Prime.Length != A!.Length) 229if (Polynomial == null || Polynomial.Length == 0)
System\Security\Cryptography\ECDsa.cs (12)
47return SignData(data, 0, data.Length, hashAlgorithm); 55ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 58ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 112ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 115ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 723return VerifyData(data, 0, data.Length, signature, hashAlgorithm); 731ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 734ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 791ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 794ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 1018if (hash.Length <= destination.Length) 1021bytesWritten = hash.Length;
System\Security\Cryptography\ECParameters.cs (6)
38if (Q.Y != null && Q.X != null && Q.Y.Length == Q.X.Length) 46hasErrors = (D != null && (D.Length != Curve.Order!.Length)); 52hasErrors = (D != null && (D.Length != Q.X.Length));
System\Security\Cryptography\HashAlgorithm.cs (8)
49HashCore(buffer, 0, buffer.Length); 81if (count < 0 || (count > buffer.Length)) 83if ((buffer.Length - count) < offset) 102while ((bytesRead = inputStream.Read(buffer, 0, buffer.Length)) > 0) 239if (inputCount < 0 || inputCount > inputBuffer.Length) 241if ((inputBuffer.Length - inputCount) < inputOffset) 268if (final.Length == hashSizeInBytes) 271bytesWritten = final.Length;
System\Security\Cryptography\HashProvider.cs (1)
26if (data.Length - offset < count)
System\Security\Cryptography\Helpers.cs (5)
48byte[] oddParityKey = new byte[key.Length]; 49for (int index = 0; index < key.Length; index++) 70char[] chars = new char[bytes.Length * 2]; 145if (a2 == null || a1.Length != a2.Length)
System\Security\Cryptography\HMACMD5.cs (1)
109Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA1.cs (1)
113Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA256.cs (1)
105Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA3_256.cs (1)
141Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA3_384.cs (1)
141Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA3_512.cs (1)
141Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA384.cs (1)
122Debug.Assert(written == buffer.Length);
System\Security\Cryptography\HMACSHA512.cs (1)
119Debug.Assert(written == buffer.Length);
System\Security\Cryptography\IncrementalHash.cs (4)
79/// the <see cref="Array.Length"/> value of <paramref name="data"/>. 83/// <paramref name="data"/>.<see cref="Array.Length"/> - <paramref name="offset"/>. 92ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length); 93if ((data.Length - count) < offset)
System\Security\Cryptography\LiteHashProvider.cs (1)
179Debug.Assert(written == result.Length);
System\Security\Cryptography\MD5.cs (1)
71Debug.Assert(written == buffer.Length);
System\Security\Cryptography\OidCollection.cs (4)
28if (count == _oids.Length) 78if (index < 0 || index >= array.Length) 80if (index + Count > array.Length) 96if (index < 0 || index >= array.Length)
System\Security\Cryptography\OpenSslAsnFormatter.cs (1)
34if (!Interop.Crypto.Asn1OctetStringSet(octetString, rawData, rawData.Length))
System\Security\Cryptography\PasswordDeriveBytes.cs (6)
126ib = _extra.Length - _extraCount; 153if (rgb.Length + ib > cb) 203_hash.TransformBlock(_password, 0, _password.Length, _password, 0); 207_hash.TransformBlock(_salt, 0, _salt.Length, _salt, 0); 236cs.Write(_baseValue!, 0, _baseValue!.Length); 249cs.Write(_baseValue, 0, _baseValue.Length);
System\Security\Cryptography\PemKeyHelpers.cs (2)
34bufferSize = buffer.Length; 70bufferSize = buffer.Length;
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (5)
43for (int ib = 0; ib < rgbT.Length;) 47hasher.TransformBlock(rgbSeed, 0, rgbSeed.Length, rgbSeed, 0); 52Buffer.BlockCopy(hash, 0, rgbT, ib, Math.Min(rgbT.Length - ib, hash.Length)); 54ib += hasher.Hash.Length;
System\Security\Cryptography\RandomNumberGenerator.cs (2)
41if (offset == 0 && count == data.Length) 401if (count > data.Length - offset)
System\Security\Cryptography\RC2Implementation.cs (6)
63if (!ValidKeySize(rgbKey.Length)) 68long ivSize = rgbIV.Length * (long)BitsPerByte; 88if (!ValidKeySize(Key.Length)) 112if (!ValidKeySize(Key.Length)) 137if (!ValidKeySize(Key.Length)) 162if (!ValidKeySize(Key.Length))
System\Security\Cryptography\Rfc2898DeriveBytes.cs (6)
141return _salt.AsSpan(0, _salt.Length - sizeof(uint)).ToArray(); 147_salt = new byte[value.Length + sizeof(uint)]; 219_endIndex = _buffer.Length; 286BinaryPrimitives.WriteUInt32BigEndian(_salt.AsSpan(_salt.Length - sizeof(uint)), _block + 1); 287Debug.Assert(_blockSize == _buffer.Length); 307for (int j = _buffer.Length - 1; j >= 0; j--)
System\Security\Cryptography\RSA.cs (17)
106if (destination.Length >= result.Length) 109bytesWritten = result.Length; 121if (destination.Length >= result.Length) 124bytesWritten = result.Length; 330if (destination.Length >= result.Length) 333bytesWritten = result.Length; 345if (destination.Length >= result.Length) 348bytesWritten = result.Length; 376return SignData(data, 0, data.Length, hashAlgorithm, padding); 389ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 392ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 638return VerifyData(data, 0, data.Length, signature, hashAlgorithm, padding); 652ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, data.Length); 655ArgumentOutOfRangeException.ThrowIfGreaterThan(count, data.Length - offset); 735rentSize = rented.Length; 778rentSize = rented.Length; 1454if (written > rented.Length)
System\Security\Cryptography\RSA.Xml.cs (2)
34int halfN = (n.Length + 1) / 2; 43byte[]? d = XmlKeyHelper.ReadCryptoBinary(ref state, nameof(RSAParameters.D), n.Length);
System\Security\Cryptography\RSACryptoServiceProvider.Unix.cs (3)
47if (rgb.Length != (KeySize / 8)) 133if (parameters.Exponent == null || parameters.Exponent.Length > 4) 139_publicOnly = (parameters.P == null || parameters.P.Length == 0);
System\Security\Cryptography\SHA1.cs (1)
68Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA256.cs (1)
67Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA3_256.cs (1)
93Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA3_384.cs (1)
93Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA3_512.cs (1)
93Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA384.cs (1)
67Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SHA512.cs (1)
67Debug.Assert(written == buffer.Length);
System\Security\Cryptography\SymmetricAlgorithm.cs (4)
75if (value.Length != this.BlockSize / 8) 95long bitLength = value.Length * 8L; 476|| (uint)written > decryptBuffer.Length) 1078|| (uint)written > decryptBuffer.Length)
System\Security\Cryptography\TripleDES.cs (5)
53if (!(value.Length * 8).IsLegalSize(s_legalKeySizes)) 68if (!(rgbKey.Length * 8).IsLegalSize(s_legalKeySizes)) 74if ((rgbOddParityKey.Length == 24) && EqualBytes(rgbOddParityKey, 8, 16, 8)) 83Debug.Assert((start1 + count) <= rgbKey.Length); 84Debug.Assert((start2 + count) <= rgbKey.Length);
System\Security\Cryptography\TripleDesImplementation.cs (3)
56long keySize = rgbKey.Length * (long)BitsPerByte; 62long ivSize = rgbIV.Length * (long)BitsPerByte; 67if (rgbKey.Length == 16)
System\Security\Cryptography\UniversalCryptoDecryptor.cs (6)
54Debug.Assert(inputBuffer.Length >= _heldoverCipher.Length, "inputBuffer.Length >= _heldoverCipher.Length"); 55inputBuffer.Slice(inputBuffer.Length - _heldoverCipher.Length).CopyTo(_heldoverCipher); 56inputBuffer = inputBuffer.Slice(0, inputBuffer.Length - _heldoverCipher.Length); 95rentedCiphertextSize = _heldoverCipher.Length + inputBuffer.Length; 99inputBuffer.CopyTo(ciphertext.Slice(_heldoverCipher.Length)); 157Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (1)
52Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoTransform.cs (6)
73ArgumentOutOfRangeException.ThrowIfGreaterThan(inputOffset, inputBuffer.Length); 77if (inputCount > inputBuffer.Length - inputOffset) 81ArgumentOutOfRangeException.ThrowIfGreaterThan(outputOffset, outputBuffer.Length); 82if (inputCount > outputBuffer.Length - outputOffset) 96ArgumentOutOfRangeException.ThrowIfGreaterThan(inputOffset, inputBuffer.Length); 97if (inputCount > inputBuffer.Length - inputOffset)
System\Security\Cryptography\X509Certificates\Asn1\CertificationRequestInfoAsn.xml.cs (1)
50for (int i = 0; i < Attributes.Length; i++)
System\Security\Cryptography\X509Certificates\Asn1\DistributionPointAsn.xml.cs (1)
47for (int i = 0; i < CRLIssuer.Length; i++)
System\Security\Cryptography\X509Certificates\Asn1\DistributionPointNameAsn.xml.cs (1)
48for (int i = 0; i < FullName.Length; i++)
System\Security\Cryptography\X509Certificates\Asn1\TbsCertificateAsn.xml.cs (1)
125for (int i = 0; i < Extensions.Length; i++)
System\Security\Cryptography\X509Certificates\CertificatePolicy.cs (4)
68for (int i = 1; i <= _policies.Length; i++) 75int dataIdx = _policies.Length - i; 127for (int i = 1; i <= _policies.Length; i++) 134int dataIdx = _policies.Length - i;
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (2)
222if (attr.AttrValues.Length != 1) 264if (attr.AttrValues.Length == 0)
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
52if (bytesConsumed != currentCrl.Length)
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (1)
193if (chainPal.ChainElements!.Length > 0)
System\Security\Cryptography\X509Certificates\ECDsaX509SignatureGenerator.cs (7)
100Debug.Assert(ecParameters.Q.X!.Length == ecParameters.Q.Y!.Length); 101byte[] uncompressedPoint = new byte[1 + ecParameters.Q.X.Length + ecParameters.Q.Y.Length]; 106Buffer.BlockCopy(ecParameters.Q.X, 0, uncompressedPoint, 1, ecParameters.Q.X.Length); 107Buffer.BlockCopy(ecParameters.Q.Y, 0, uncompressedPoint, 1 + ecParameters.Q.X.Length, ecParameters.Q.Y.Length);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
45if (thumbprint.Length != SHA1.HashSizeInBytes)
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (7)
126for (int i = 0; i < s_rootStoreDirectories.Length; i++) 158s_directoryLastWrite = new DateTime[s_rootStoreDirectories.Length]; 174for (int i = 0; i < s_rootStoreDirectories.Length; i++) 339for (int i = 0; i < directories.Length; i++) 345if (directories.Length > 1) 348if (set.Count != directories.Length) 353for (int i = 0; i < directories.Length; i++)
System\Security\Cryptography\X509Certificates\OpenSslCertificateAssetDownloader.cs (3)
20if (data == null || data.Length == 0) 62SafeX509CrlHandle handle = Interop.Crypto.DecodeX509Crl(data, data.Length); 75Interop.Crypto.BioWrite(bio, data, data.Length);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
216stream.Write(pkcs12, 0, pkcs12.Length);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (5)
794bytes.Length == 13 || bytes.Length == 15, 797bytes[bytes.Length - 1] == 'Z', 800if (bytes != null && bytes.Length is 13 or 15 && bytes[^1] == 'Z') 818bytes.Length == 13 ? "yyMMddHHmmss'Z'" : "yyyyMMddHHmmss'Z'",
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (3)
951for (int i = 0; i < elements.Length; i++) 1389else if (errorDepth >= _errors.Length) 1396_errors.AsSpan(toReturn.Length).Clear();
System\Security\Cryptography\X509Certificates\OpenSslX509Encoder.cs (6)
168using (SafeAsn1BitStringHandle bitString = Interop.Crypto.DecodeAsn1BitString(encoded, encoded.Length)) 175if (decoded.Length > 2) 205if (decoded.Length > 0) 210if (decoded.Length > 1) 227encoded.Length, 240using (SafeEkuExtensionHandle eku = Interop.Crypto.DecodeExtendedKeyUsage(encoded, encoded.Length))
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (1)
59for (int i = 0; i < attributes.Length; i++)
System\Security\Cryptography\X509Certificates\UnixPkcs12Reader.cs (8)
168for (int i = 0; i < rentedContents.Length; i++) 421for (int i = 0; i < _safeContentsValues!.Length; i++) 478spkiBuf = CryptoPool.Rent((toReturn?.Length ?? 128) * 2); 530if (attr.AttrType == Oids.LocalKeyId && attr.AttrValues.Length > 0) 642return (keyParams?.Length ?? 0) == 0; 657if (attr.AttrType == Oids.LocalKeyId && attr.AttrValues.Length > 0) 811if (idx >= oldRent.Length) 813T[] newRent = ArrayPool<T>.Shared.Rent(oldRent.Length * 2);
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
181for (int i = 0; i < _decoded.Length; i++)
System\Security\Cryptography\X509Certificates\X509Certificate.cs (3)
92if (rawData == null || rawData.Length == 0) 107if (rawData == null || rawData.Length == 0) 422for (int i = 0; i < thumbPrint.Length && i < 4; ++i)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
386if (rawData == null || rawData.Length == 0)
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
61for (; i < certificates.Length; i++) 278for (; 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\X509SubjectKeyIdentifierExtension.cs (1)
112if (!gotContents || consumed != encoded.Length)
System\Security\Cryptography\XmlKeyHelper.cs (2)
81int idx = Math.Max(0, buf.Length - sizeof(int)); 87for (; idx < buf.Length; idx++)
System.Security.Cryptography.Cose (17)
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
193retVal += GetByteStringEncodedSize(content.Length);
System\Security\Cryptography\Cose\CoseMessage.cs (3)
270if (protectedHeaderAsBstr.Length == 0) 442while ((bytesRead = contentStream.Read(contentBuffer, 0, contentBuffer.Length)) > 0) 599Debug.Assert(bytesWritten == buffer.Length);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (6)
290Debug.Assert(buffer.Length == bytesWritten); 543int encodedLength = CoseHelpers.GetCoseSignEncodedLengthMinusSignature(_isTagged, MultiSignSizeOfCborTag, _protectedHeaderAsBstr.Length, UnprotectedHeaders, _content); 549encodedLength += CoseHelpers.GetByteStringEncodedSize(signature._encodedSignProtectedHeaders.Length); 551encodedLength += CoseHelpers.GetByteStringEncodedSize(signature._signature.Length); 788_protectedHeaderAsBstr.Length, 864_protectedHeaderAsBstr.Length,
System\Security\Cryptography\Cose\CoseSign1Message.cs (5)
240Debug.Assert(buffer.Length == bytesWritten); 625_protectedHeaderAsBstr.Length, 726_protectedHeaderAsBstr.Length, 790CoseHelpers.GetCoseSignEncodedLengthMinusSignature(_isTagged, Sign1SizeOfCborTag, _protectedHeaderAsBstr.Length, UnprotectedHeaders, _content) + 791CoseHelpers.GetByteStringEncodedSize(_signature.Length);
System\Security\Cryptography\Cose\CoseSignature.cs (2)
402_encodedSignProtectedHeaders.Length, 434_encodedSignProtectedHeaders.Length,
System.Text.Encoding.CodePages (62)
System\Text\BaseCodePageEncoding.cs (9)
106int bytesRead = stream.Read(codePageDataFileHeader, 0, codePageDataFileHeader.Length); 107Debug.Assert(bytesRead == codePageDataFileHeader.Length); 144int bytesRead = stream.Read(codePageIndex, 0, codePageIndex.Length); 145Debug.Assert(bytesRead == codePageIndex.Length); 190int bytesRead = stream.Read(codePageHeader, 0, codePageHeader!.Length); 191Debug.Assert(bytesRead == codePageHeader.Length); 266Debug.Assert(m_codePageHeader != null && m_codePageHeader.Length == CODEPAGE_HEADER_SIZE, "m_codePageHeader expected to match in size the struct CodePageHeader"); 300m_dataSize = (int)(s_codePagesEncodingDataStream.Length - pCodePageIndex->Offset - m_codePageHeader.Length); 308m_dataSize = pCodePageIndex->Offset - currentOffset - m_codePageHeader.Length;
System\Text\DBCSCodePageEncoding.cs (7)
87Debug.Assert(m_codePageHeader?.Length > 0); 403Debug.Assert((arrayTemp.Length / 2) < 20, 404$"[DBCSCodePageEncoding.ReadBestFitTable]Expected small best fit table < 20 for code page {CodePage}, not {arrayTemp.Length / 2}"); 406for (int i = 0; i < arrayTemp.Length - 2; i += 2) 411for (int j = i + 2; j < arrayTemp.Length; j += 2) 1065Debug.Assert(bytes >= byteStart + byteBuffer.Length, 1067bytes -= byteBuffer.Length; // didn't use these byte(s)
System\Text\DecoderBestFitFallback.cs (6)
148int highBound = _oFallback.arrayBestFit!.Length; 157if (bytesCheck.Length == 0 || bytesCheck.Length > 2) 160if (bytesCheck.Length == 1) 182Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 203Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\DecoderFallbackBufferHelper.cs (2)
50if (_fallbackBuffer!.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length))) 106if (_fallbackBuffer!.Fallback(bytes, (int)(pBytes - byteStart - bytes.Length)))
System\Text\DecoderNLS.cs (6)
88if (bytes.Length - index < count) 132if (bytes.Length - byteIndex < byteCount) 135if (charIndex < 0 || charIndex > chars.Length) 138int charCount = chars.Length - charIndex; 187if (bytes.Length - byteIndex < byteCount) 190if (chars.Length - charIndex < charCount)
System\Text\EncoderBestFitFallback.cs (3)
171int highBound = _oFallback.arrayBestFit!.Length; 187Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 208Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderNLS.cs (6)
86if (chars.Length - index < count) 121if (chars.Length - charIndex < charCount) 124if (byteIndex < 0 || byteIndex > bytes.Length) 127int byteCount = bytes.Length - byteIndex; 172if (chars.Length - charIndex < charCount) 175if (bytes.Length - byteIndex < byteCount)
System\Text\EncodingCharBuffer.cs (1)
158_bytes -= byteBuffer.Length; // Didn't use how many ever bytes we're falling back
System\Text\EncodingNLS.cs (16)
57if (chars.Length - index < count) 61if (chars.Length == 0) 114if (byteIndex < 0 || byteIndex > bytes.Length) 117int byteCount = bytes.Length - byteIndex; 151if (chars.Length - charIndex < charCount) 154if (byteIndex < 0 || byteIndex > bytes.Length) 158if (chars.Length == 0) 162int byteCount = bytes.Length - byteIndex; 203if (bytes.Length - index < count) 207if (bytes.Length == 0) 243if (bytes.Length - byteIndex < byteCount) 246if (charIndex < 0 || charIndex > chars.Length) 250if (bytes.Length == 0) 254int charCount = chars.Length - charIndex; 295if (bytes.Length - index < count) 299if (bytes.Length == 0) return string.Empty;
System\Text\GB18030Encoding.cs (1)
140for (int index = 0; index < _tableUnicodeToGBDiffs.Length; index++)
System\Text\SBCSCodePageEncoding.cs (5)
62Debug.Assert(m_codePageHeader?.Length > 0); 102int bytesRead = s_codePagesEncodingDataStream.Read(buffer, 0, buffer.Length); 103Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 166int bytesRead = s_codePagesEncodingDataStream.Read(buffer, 0, buffer.Length); 167Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer.");
System.Text.Encodings.Web (5)
System\Text\Encodings\Web\TextEncoder.cs (1)
250ValidateRanges(startIndex, characterCount, actualInputLength: value.Length);
System\Text\Encodings\Web\TextEncoderSettings.cs (4)
69for (int i = 0; i < characters.Length; i++) 125for (int i = 0; i < ranges.Length; i++) 157for (int i = 0; i < characters.Length; i++) 193for (int i = 0; i < ranges.Length; i++)
System.Text.Json (111)
src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (10)
49Debug.Assert(_index <= _rentedBuffer.Length); 68return _rentedBuffer.Length; 77return _rentedBuffer.Length - _index; 99Debug.Assert(_index <= _rentedBuffer.Length); 134Debug.Assert(_index <= _rentedBuffer.Length - count); 179int currentLength = _rentedBuffer.Length; 208Debug.Assert(oldBuffer.Length >= _index); 209Debug.Assert(_rentedBuffer.Length >= _index); 217Debug.Assert(_rentedBuffer.Length - _index > 0); 218Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\libraries\System.Text.Json\Common\JsonHelpers.cs (3)
131if (index >= adjacencyRow.Length) 148int idx = sortedNodes.Length; 158if (adjacency[i] is { } childMap && nextIndex < childMap.Length && childMap[nextIndex])
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (2)
239if (constructors.Length == 1) 256else if (constructor.GetParameters().Length == 0)
System\ReflectionExtensions.cs (2)
77if (attributes.Length == 0) 82if (attributes.Length == 1)
System\Text\Json\BitStack.cs (15)
67Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}"); 70Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}"); 76if (elementIndex >= _array.Length) 79Debug.Assert(index >= 0 && index > (int)((uint)_array.Length * 32 - 1), $"Only grow when necessary - index: {index}, arrayLength: {_array.Length}"); 83Debug.Assert(elementIndex < _array.Length, $"Set - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 123Debug.Assert(index >= 0, $"Get - Negative - index: {index}, arrayLength: {_array.Length}"); 127Debug.Assert(elementIndex < _array.Length, $"Get - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 135Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}"); 136Debug.Assert(minSize >= 0 && minSize >= _array.Length); 138int nextDouble = Math.Max(minSize + 1, _array.Length * 2);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (8)
115Length = completeDb.Length; 195if (Length <= _data.Length / 2) 200if (newRent.Length < _data.Length) 223if (Length >= _data.Length - DbRow.Size) 247int newCapacity = toReturn.Length * 2; 255if (newCapacity == toReturn.Length) newCapacity = int.MaxValue; 258Buffer.BlockCopy(toReturn, 0, _data, 0, toReturn.Length);
System\Text\Json\Document\JsonDocument.Parse.cs (11)
690MetadataDb database = MetadataDb.CreateLocked(utf8Json.Length); 691database.Append(tokenType, startLocation: 0, utf8Json.Length); 788Debug.Assert(rented.Length >= utf8Bom.Length); 807if (rented.Length == written) 810rented = ArrayPool<byte>.Shared.Rent(checked(toReturn.Length * 2)); 811Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length); 816lastRead = stream.Read(rented, written, rented.Length - written); 871Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length); 895if (rented.Length == written) 898rented = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2); 899Buffer.BlockCopy(toReturn, 0, rented, 0, toReturn.Length);
System\Text\Json\Document\JsonDocument.StackRowStack.cs (8)
24_topOfStack = _rentedBuffer.Length; 56Debug.Assert(_topOfStack <= _rentedBuffer!.Length - StackRow.Size); 66_rentedBuffer = ArrayPool<byte>.Shared.Rent(toReturn.Length * 2); 72_rentedBuffer.Length - toReturn.Length + _topOfStack, 73toReturn.Length - _topOfStack); 75_topOfStack += _rentedBuffer.Length - toReturn.Length;
System\Text\Json\JsonPropertyDictionary.cs (1)
148if (index >= array.Length)
System\Text\Json\JsonPropertyDictionary.KeyCollection.cs (1)
60if (index >= propertyNameArray.Length)
System\Text\Json\JsonPropertyDictionary.ValueCollection.cs (1)
60if (index >= nodeArray.Length)
System\Text\Json\Serialization\Converters\Collection\ArrayConverter.cs (2)
41for (; index < array.Length; index++) 48for (; index < array.Length; index++)
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (1)
181int numberOfGenericArgs = converterType.GetGenericArguments().Length;
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactoryHelpers.cs (4)
31method.GetParameters().Length == 1 && 33method.GetGenericArguments().Length == 1) 55method.GetParameters().Length == 1 && 57method.GetGenericArguments().Length == 2)
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (2)
54if (constructor == null || typeToConvert.IsAbstract || parameters!.Length == 0) 60int parameterCount = parameters.Length;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (4)
355else if (argumentState.FoundPropertyCount == argumentState.FoundProperties.Length) 360var newCache = ArrayPool<FoundProperty>.Shared.Rent(argumentState.FoundProperties.Length * 2); 563else if (argumentState.FoundPropertyCount == argumentState.FoundPropertiesAsync!.Length) 567var newCache = ArrayPool<FoundPropertyAsync>.Shared.Rent(argumentState.FoundPropertiesAsync!.Length * 2);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (5)
71Debug.Assert(names.Length == values.Length); 75for (int i = 0; i < names.Length; i++) 427for (int i = 0; i < enumValues.Length; i++) 508for (int i = 0; i < enumValues.Length; i++)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
124Debug.Assert(genericArgs.Length == 2);
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
460for (int i = 0; i < trackedContexts.Length; i++)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (3)
142if (members.Length > 0) 169if (propertyInfo.GetIndexParameters().Length > 0 || 296int parameterCount = parameters.Length;
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
654sb.AppendLine($"{ind} NameAsUtf8.Length: {(NameAsUtf8Bytes?.Length ?? -1)},");
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (4)
111int count = localPropertyRefsSorted.Length; 219cacheCount = localPropertyRefsSorted.Length; 266int count = localParameterRefsSorted.Length; 355cacheCount = localParameterRefsSorted.Length;
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (2)
1126var parameterCache = new JsonPropertyDictionary<JsonParameterInfo>(Options.PropertyNameCaseInsensitive, jsonParameters.Length); 1182ParameterCount = jsonParameters.Length;
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (3)
15Debug.Assert(modifiers.Length > 0); 22var newModifiers = new Action<JsonTypeInfo>[_modifiers.Length + 1]; 24newModifiers[_modifiers.Length] = modifier;
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (3)
26Debug.Assert(constructorInfo is null || constructorInfo.GetParameters().Length == 0); 87int parameterCount = parameters.Length; 130int parameterCount = parameters.Length;
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (3)
24Debug.Assert(ctorInfo is null || ctorInfo.GetParameters().Length == 0); 48int parameterCount = constructor.GetParameters().Length; 83int parameterCount = constructor.GetParameters().Length;
System\Text\Json\Serialization\ReadBufferState.cs (6)
67while (fillBuffer && bufferState._count < bufferState._buffer.Length); 97while (_count < _buffer.Length); 115if ((uint)_count > ((uint)_buffer.Length / 2)) 120byte[] newBuffer = ArrayPool<byte>.Shared.Rent((_buffer.Length < (int.MaxValue / 2)) ? _buffer.Length * 2 : int.MaxValue); 153Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Serialization\ReadStack.cs (2)
90else if (_count - 1 == _stack.Length) 92Array.Resize(ref _stack, 2 * _stack.Length);
System\Text\Json\Serialization\WriteStack.cs (2)
135else if (_count - _indexOffset == _stack.Length) 137Array.Resize(ref _stack, 2 * _stack.Length);
System.Text.Json.SourceGeneration (11)
JsonSourceGenerator.Parser.cs (4)
1453int paramCount = constructorParameters?.Length ?? 0; 1586capacity: EncodedPropName.Length + utf8Json.Length * 2); 1588for (int i = 0; i < utf8Json.Length; i++) 1677if (publicCtors.Length == 1)
src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (2)
22public int Count => _values.Length; 63if ((uint)newIndex < (uint)_values.Length)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (5)
76(TKey, int)[] keys = new (TKey, int)[arrayCopy.Length]; 77for (int i = 0; i < keys.Length; i++) 131if (index >= adjacencyRow.Length) 148int idx = sortedNodes.Length; 158if (adjacency[i] is { } childMap && nextIndex < childMap.Length && childMap[nextIndex])
System.Text.RegularExpressions (184)
System\Text\RegularExpressions\CaptureCollection.cs (2)
99if ((uint)arrayIndex > (uint)array.Length) 103if (array.Length - arrayIndex < Count)
System\Text\RegularExpressions\GroupCollection.cs (6)
36public int Count => _match._matchcount.Length; 58else if ((uint)groupnum < _match._matchcount.Length) 79_groups = new Group[_match._matchcount.Length - 1]; 80for (int i = 0; i < _groups.Length; i++) 115ArgumentOutOfRangeException.ThrowIfGreaterThan(arrayIndex, array.Length); 117if (array.Length - arrayIndex < Count)
System\Text\RegularExpressions\Match.cs (7)
72for (int i = 0; i < matchcount.Length; i++) 141GroupToStringImpl(_matchcount.Length - 1); 154int numgroups = inner._matchcount.Length; 176if (capcount * 2 + 2 > matches[cap].Length) 237(uint)cap < (uint)matchcount.Length && 300for (int groupNumber = 0; groupNumber < matches.Length; groupNumber++) 327for (int cap = 0; cap < matchcount.Length; cap++)
System\Text\RegularExpressions\Regex.cs (6)
241for (int i = 0; i < regexinfos.Length; i++) 324for (int i = 0; i < result.Length; i++) 347for (int i = 0; i < result.Length; i++) 594runner.runtrackpos = runner.runtrack!.Length; 595runner.runstackpos = runner.runstack!.Length; 596runner.runcrawlpos = runner.runcrawl!.Length;
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (2)
160Ldc(tree.CaptureNames.Length); 164for (int i = 0; i < tree.CaptureNames.Length; i++)
System\Text\RegularExpressions\RegexCharClass.cs (5)
329int len = s_propTable.Length; 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1276if ((uint)index < (uint)cache.Length) 1567if (chars[0] < asciiStrings.Length) 1826int max = s_propTable.Length;
System\Text\RegularExpressions\RegexCompiler.cs (1)
1288switch (literalChars.Length)
System\Text\RegularExpressions\RegexFindOptimizations.cs (5)
107chars is { Length: 1 }) 145if (RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: true) is { Length: > 1 } caseInsensitivePrefixes) 315bool invalidChars = chars is not { Length: 1 } || fixedDistanceSets[i].Negated; 342Debug.Assert(chars is { Length: 1 }); 611if (chars is { Length: <= 5 }) // 5 == currently the max length efficiently handled by IndexOfAny{Except} without SearchValues
System\Text\RegularExpressions\RegexParser.cs (4)
116if (captureNumberList == null || captop == captureNumberList.Length) 126captureCount = captureNumberList.Length; 127for (int i = 0; i < captureNumberList.Length; i++) 2127(uint)i < (uint)capslist.Length)
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (2)
795int s1CharsLength = s1Chars?.Length ?? 0; 796int s2CharsLength = s2Chars?.Length ?? 0;
System\Text\RegularExpressions\RegexReplacement.cs (5)
162for (int i = _rules.Length - 1; i >= 0; i--) 218Debug.Assert(_rules.Length <= 1); 219Debug.Assert(_rules.Length == 0 || (_rules[0] == 0 && _strings.Length == 1)); 221return ReplaceSimpleText(regex, input, _rules.Length != 0 ? _strings[0] : "", count, startat);
System\Text\RegularExpressions\RegexRunner.cs (19)
260runtrackpos = runtrack!.Length; 261runstackpos = runstack!.Length; 262runcrawlpos = runcrawl!.Length; 306runtrackpos = runtrack!.Length; 307runstackpos = runstack!.Length; 308runcrawlpos = runcrawl.Length; 455int[] newtrack = new int[runtrack!.Length * 2]; 457Array.Copy(runtrack, 0, newtrack, runtrack.Length, runtrack.Length); 458runtrackpos += runtrack.Length; 468int[] newstack = new int[runstack!.Length * 2]; 470Array.Copy(runstack, 0, newstack, runstack.Length, runstack.Length); 471runstackpos += runstack.Length; 480int[] newcrawl = new int[runcrawl!.Length * 2]; 482Array.Copy(runcrawl, 0, newcrawl, runcrawl.Length, runcrawl.Length); 483runcrawlpos += runcrawl.Length; 511return runcrawl!.Length - runcrawlpos;
System\Text\RegularExpressions\RegexTree.cs (2)
49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 55for (int i = 0; i < captureNames.Length; i++)
System\Text\RegularExpressions\Symbolic\BDD.cs (9)
174Debug.Assert(nodes[nodes.Length - 1] == this); 175Debug.Assert(nodes.Length <= (1 << 24)); 187while (nodes.Length >= (1 << node_bits)) 193long[] result = new long[nodes.Length + 2]; 209for (int i = 0; i < nodes.Length; i++) 283for (int i = 0; i < nonterminals.Length; i++) 312for (int i = 0; i < serialized.Length; i++) 323byte[] result = new byte[(k * serialized.Length) + 1]; 325for (int i = 0; i < serialized.Length; i += 1)
System\Text\RegularExpressions\Symbolic\BDDRangeConverter.cs (22)
55var result = new (uint, uint)[(1 << newBits) * ranges.Length]; 70if (ranges[0].Item1 == 0 && ranges[ranges.Length - 1].Item2 == maximal) 76for (int i = 1; i < result.Length; i++) 115ranges = new (uint, uint)[ranges1.Length]; 116for (int i = 0; i < ranges1.Length; i++) 136ranges = new (uint, uint)[rangesR.Length]; 138for (int i = 1; i < rangesR.Length; i++) 145ranges = new (uint, uint)[rangesR.Length + 1]; 147for (int i = 0; i < rangesR.Length; i++) 159(uint, uint) last = rangesL[rangesL.Length - 1]; 169for (int i = 0; i < rangesL.Length - 1; i++) 195ranges = new (uint, uint)[rangesL.Length + rangesR.Length - 1]; 196for (int i = 0; i < rangesL.Length - 1; i++) 201ranges[rangesL.Length - 1] = (last.Item1, first.Item2 | mask); 202for (int i = 1; i < rangesR.Length; i++) 204ranges[rangesL.Length - 1 + i] = (rangesR[i].Item1 | mask, rangesR[i].Item2 | mask); 209ranges = new (uint, uint)[rangesL.Length + rangesR.Length]; 210for (int i = 0; i < rangesL.Length; i++) 215for (int i = 0; i < rangesR.Length; i++) 217ranges[rangesL.Length + i] = (rangesR[i].Item1 | mask, rangesR[i].Item2 | mask);
System\Text\RegularExpressions\Symbolic\BitVector.cs (8)
94var blocks = new ulong[xBlocks.Length]; 95for (int i = 0; i < blocks.Length; i++) 111var blocks = new ulong[xBlocks.Length]; 112for (int i = 0; i < blocks.Length; i++) 127var blocks = new ulong[firstOther._blocks.Length]; 131for (int i = 0; i < blocks.Length; i++) 145var blocks = new ulong[xBlocks.Length]; 146for (int i = 0; i < blocks.Length; i++)
System\Text\RegularExpressions\Symbolic\BitVectorSolver.cs (7)
19var singleBitVectors = new BitVector[minterms.Length]; 20for (int i = 0; i < singleBitVectors.Length; i++) 22singleBitVectors[i] = BitVector.CreateSingleBit(minterms.Length, i); 26Empty = BitVector.CreateFalse(minterms.Length); 27Full = BitVector.CreateTrue(minterms.Length); 54for (int i = 0; i < partition.Length; i++) 79for (int i = 0; i < partition.Length; i++)
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (1)
51if (c < (uint)ascii.Length)
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (5)
40Debug.Assert(minterms.Length > 0, "Requires at least"); 42if (minterms.Length == 1) 53for (int i = 0; i < minterms.Length; i++) 73for (int i = 0; i < ascii.Length; i++) 97return (uint)c < (uint)ascii.Length ? ascii[c] : _nonAscii.Find(c);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (6)
47Debug.Assert(childResults is null || childResults.Length != 0); 90Debug.Assert(childResults is not null && childResults.Length == node.ChildCount()); 206Debug.Assert(childResults.Length == node.ChildCount()); 229for (int i = childResults.Length - 1; i >= 0; i--) 253Debug.Assert(childResults.Length == 1); 269Debug.Assert(childResults.Length == 1);
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (4)
34if ((uint)key < (uint)sparse.Length) 41Debug.Assert(entryKey < sparse.Length); 76Debug.Assert(newLength > _sparse.Length); 79newLength = Math.Max(2 * _sparse.Length, newLength);
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (1)
348for (int i = 0; i < reverseTransformed.Length; i++)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (13)
102Debug.Assert(newSize >= array.Length); 104Array.Copy(array, newArray, array.Length); 115int numMinterms = _minterms.Length; 134int numMinterms = _minterms.Length; 174if (state.Id == _stateArray.Length) 177int newsize = _stateArray.Length * 2; 228if (nfaStateId == _nfaCoreIdArray.Length) 231int newsize = Math.Max(_nfaCoreIdArray.Length * 2, InitialNfaStateCapacity); 238Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 261Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 262Debug.Assert(_nfaCoreIdArray[nfaStateId] < _stateArray.Length); 271Debug.Assert(offset < _dfaDelta.Length); 300Debug.Assert(nfaOffset < _nfaDelta.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (14)
166_mintermsLog = BitOperations.Log2((uint)_minterms.Length) + 1; 180_positionKinds = new uint[_minterms.Length + 2]; 181for (int mintermId = -1; mintermId < _positionKinds.Length - 1; mintermId++) 204for (uint charKind = 0; charKind < initialStates.Length; charKind++) 214for (uint charKind = 0; charKind < dotstarredInitialStates.Length; charKind++) 230for (uint charKind = 0; charKind < reverseInitialStates.Length; charKind++) 251if ((uint)mintermId == (uint)_minterms.Length) 296if ((uint)mintermId >= (uint)minterms.Length) 733for (int j = 0; j < transitions.Length; ++j) 743Registers newRegisters = j != transitions.Length - 1 ? sourceRegisters.Clone() : sourceRegisters; 840Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 841Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 843Array.Copy(other.CaptureStarts, CaptureStarts, CaptureStarts.Length); 844Array.Copy(other.CaptureEnds, CaptureEnds, CaptureEnds.Length);
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)
39int maxMinterm = state.StartsWithLineAnchor ? _minterms!.Length : _minterms!.Length - 1; 77int maxMinterm = state.StartsWithLineAnchor ? _minterms.Length : _minterms.Length - 1;
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (5)
55int[] mintermIdsWithoutZ = new int[_minterms.Length]; 56int[] mintermIdsWithZ = new int[_minterms.Length + 1]; 57for (int i = 0; i < _minterms.Length; ++i) 62mintermIdsWithZ[_minterms.Length] = _minterms.Length;
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (1)
42_matcher = minterms.Length > 64 ?
System\Text\RegularExpressions\Symbolic\UInt64Solver.cs (7)
17Debug.Assert(minterms.Length <= 64); 22Full = minterms.Length == 64 ? ulong.MaxValue : ulong.MaxValue >> (64 - minterms.Length); 66for (int i = 0; i < partition.Length; i++) 83ulong[] minterms = new ulong[_minterms.Length]; 84for (int i = 0; i < minterms.Length; i++) 104for (int i = 0; i < partition.Length; i++)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryConditions.cs (1)
30Debug.Assert(Enum.GetValues<UnicodeCategory>().Length == UnicodeCategoryValueCount);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (4)
68for (int c = 0; c < catBDDs.Length; c++) 78for (int i = 0; i < catBDDs.Length; i++) 85for (int i = 0; i < catBDDs.Length; i++) 100for (int i = 0; i < values.Length; i++)
System\Text\StructListBuilder.cs (4)
35if ((uint)pos < (uint)array.Length) 61Debug.Assert(array.Length == _count); 64int newSize = array.Length == 0 ? DefaultArraySize : array.Length * 2;
System.Text.RegularExpressions.Generator (64)
RegexGenerator.Emitter.cs (45)
1358literalChars.Length switch 4663Debug.Assert(args.Length is >= 1); 4666string key = $"{MethodName}{args.Length}"; 4672var lines = new string[24 + args.Length]; 4673lines[0] = $"/// <summary>Pushes {args.Length} value{(args.Length == 1 ? "" : "s")} onto the backtracking stack.</summary>"; 4675lines[2] = $"internal static void {MethodName}(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})"; 4677lines[4] = $" // If there's space available for {(args.Length > 1 ? $"all {args.Length} values, store them" : "the value, store it")}."; 4680lines[7] = $" if ((uint){(args.Length > 1 ? $"(p + {args.Length - 1})" : "p")} < (uint)s.Length)"; 4682for (int i = 0; i < args.Length; i++) 4686lines[9 + args.Length] = args.Length > 1 ? $" pos += {args.Length};" : " pos++;"; 4687lines[10 + args.Length] = $" return;"; 4688lines[11 + args.Length] = $" }}"; 4689lines[12 + args.Length] = $""; 4690lines[13 + args.Length] = $" // Otherwise, resize the stack to make room and try again."; 4691lines[14 + args.Length] = $" WithResize(ref stack, ref pos{FormatN(", arg{0}", args.Length)});"; 4692lines[15 + args.Length] = $""; 4693lines[16 + args.Length] = $" // <summary>Resize the backtracking stack array and push {args.Length} value{(args.Length == 1 ? "" : "s")} onto the stack.</summary>"; 4694lines[17 + args.Length] = $" [MethodImpl(MethodImplOptions.NoInlining)]"; 4695lines[18 + args.Length] = $" static void WithResize(ref int[] stack, ref int pos{FormatN(", int arg{0}", args.Length)})"; 4696lines[19 + args.Length] = $" {{"; 4697lines[20 + args.Length] = $" Array.Resize(ref stack, (pos + {args.Length - 1}) * 2);"; 4698lines[21 + args.Length] = $" {MethodName}(ref stack, ref pos{FormatN(", arg{0}", args.Length)});"; 4699lines[22 + args.Length] = $" }}"; 4700lines[23 + args.Length] = $"}}"; 4715Debug.Assert(args.Length is >= 1); 4717if (args.Length == 1) 4724string key = $"{MethodName}{args.Length}"; 4728var lines = new string[5 + args.Length]; 4729lines[0] = $"/// <summary>Pops {args.Length} value{(args.Length == 1 ? "" : "s")} from the backtracking stack.</summary>"; 4731lines[2] = $"internal static void {MethodName}(int[] stack, ref int pos{FormatN(", out int arg{0}", args.Length)})"; 4733for (int i = 0; i < args.Length; i++) 4737lines[4 + args.Length] = $"}}"; 5405for (int i = 0; i < parts.Length; i++)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (5)
329int len = s_propTable.Length; 1270Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1276if ((uint)index < (uint)cache.Length) 1567if (chars[0] < asciiStrings.Length) 1826int max = s_propTable.Length;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (4)
107chars is { Length: 1 }) 145if (RegexPrefixAnalyzer.FindPrefixes(root, ignoreCase: true) is { Length: > 1 } caseInsensitivePrefixes) 315bool invalidChars = chars is not { Length: 1 } || fixedDistanceSets[i].Negated; 342Debug.Assert(chars is { Length: 1 });
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (4)
116if (captureNumberList == null || captop == captureNumberList.Length) 126captureCount = captureNumberList.Length; 127for (int i = 0; i < captureNumberList.Length; i++) 2127(uint)i < (uint)capslist.Length)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (2)
795int s1CharsLength = s1Chars?.Length ?? 0; 796int s2CharsLength = s2Chars?.Length ?? 0;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTree.cs (2)
49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 55for (int i = 0; i < captureNames.Length; i++)
Stubs.cs (1)
28stringBuilder.CopyTo(0, chars, 0, chars.Length);
UpgradeToGeneratedRegexCodeFixer.cs (1)
321for (int i = 0; i < parts.Length; i++)
System.Threading.Channels (20)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (8)
85int tail2 = (last + 1) & (array.Length - 1); 111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize); 143segment._state._first = (first + 1) & (array.Length - 1); 209segment._state._first = (first + 1) & (segment._array.Length - 1); 233segment._state._first = (first + 1) & (array.Length - 1); 281segment._state._first = (first + 1) & (segment._array.Length - 1); 327pt = (pt + 1) & (segment._array.Length - 1)) 346int arraySize = segment._array.Length;
src\libraries\Common\src\System\Collections\Generic\Deque.cs (12)
24if (_size == _array.Length) 30if (++_tail == _array.Length) 57if (++_head == _array.Length) 78index = _array.Length - 1; 89_tail = _array.Length - 1; 106pos = (pos + 1) % _array.Length; 112Debug.Assert(_size == _array.Length); 117int capacity = (int)(_array.Length * 2L); 118if (capacity < _array.Length + MinimumGrow) 120capacity = _array.Length + MinimumGrow; 131Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 132Array.Copy(_array, 0, newArray, _array.Length - _head, _tail);
System.Threading.RateLimiting (19)
src\libraries\Common\src\System\Collections\Generic\Deque.cs (12)
24if (_size == _array.Length) 30if (++_tail == _array.Length) 57if (++_head == _array.Length) 78index = _array.Length - 1; 89_tail = _array.Length - 1; 106pos = (pos + 1) % _array.Length; 112Debug.Assert(_size == _array.Length); 117int capacity = (int)(_array.Length * 2L); 118if (capacity < _array.Length + MinimumGrow) 120capacity = _array.Length + MinimumGrow; 131Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 132Array.Copy(_array, 0, newArray, _array.Length - _head, _tail);
System\Threading\RateLimiting\ChainedPartitionedRateLimiter.cs (6)
59for (int i = 0; i < _limiters.Length; i++) 71RateLimitLease? notAcquiredLease = CommonAcquireLogic(exception, lease, ref leases, i, _limiters.Length); 85for (int i = 0; i < _limiters.Length; i++) 97RateLimitLease? notAcquiredLease = CommonAcquireLogic(exception, lease, ref leases, i, _limiters.Length); 129exceptions[exceptions.Length - 1] = ex; 238for (int i = _leases.Length - 1; i >= 0; i--)
System\Threading\RateLimiting\PartitionedRateLimiter.cs (1)
61if (limiters.Length == 0)
System.Threading.Tasks.Dataflow (25)
Base\DataflowBlock.cs (1)
2097Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID");
Blocks\BatchBlock.cs (5)
741for (int i = 0; i < newBatch.Length; i++) newBatch[i] = _messages.Dequeue(); 800Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long 914Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long 1144if (multipleOutputItems == null) return singleOutputItem.Length; 1148foreach (T[] item in multipleOutputItems) count += item.Length;
Blocks\JoinBlock.cs (1)
1397Debug.Assert(_targets.Length > 0, "A join must have targets.");
Internal\ImmutableArray.cs (8)
52var newArray = new T[_array.Length + 1]; 53Array.Copy(_array, newArray, _array.Length); 54newArray[newArray.Length - 1] = item; 68if (_array.Length == 1) return Empty; 71var newArray = new T[_array.Length - 1]; 73Array.Copy(_array, index + 1, newArray, index, _array.Length - index - 1); 78public int Count { get { return _array.Length; } } 90public T[] ToArray() { return _array.Length == 0 ? s_empty._array : (T[])_array.Clone(); }
Internal\QueuedMap.cs (1)
214Debug.Assert(arrayOffset + count <= items.Length, "Range must be within array size");
Internal\SourceCore.cs (1)
436for (int i = 0; i < itemsAsArray.Length; i++)
src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (8)
85int tail2 = (last + 1) & (array.Length - 1); 111int newSegmentSize = Math.Min(_tail._array.Length * 2, MaxSegmentSize); 143segment._state._first = (first + 1) & (array.Length - 1); 209segment._state._first = (first + 1) & (segment._array.Length - 1); 233segment._state._first = (first + 1) & (array.Length - 1); 281segment._state._first = (first + 1) & (segment._array.Length - 1); 327pt = (pt + 1) & (segment._array.Length - 1)) 346int arraySize = segment._array.Length;
System.Threading.Tasks.Parallel (13)
System\Threading\Tasks\Parallel.cs (9)
206Action[] actionsCopy = new Action[actions.Length]; 207for (int i = 0; i < actionsCopy.Length; i++) 223actionsCopy.Length); 231if (actionsCopy.Length < 1) return; 248(actionsCopy.Length > SMALL_ACTIONCOUNT_LIMIT) || 249(parallelOptions.MaxDegreeOfParallelism != -1 && parallelOptions.MaxDegreeOfParallelism < actionsCopy.Length) 271while (myIndex <= actionsCopy.Length) 332Task[] tasks = new Task[actionsCopy.Length]; 338for (int i = 1; i < tasks.Length; i++)
System\Threading\Tasks\ParallelRangeManager.cs (4)
97int numIndexRangesToVisit = _indexRanges.Length; 165_nCurrentIndexRange = (_nCurrentIndexRange + 1) % _indexRanges.Length; 291Debug.Assert(_indexRanges != null && _indexRanges.Length != 0); 293int nInitialRange = (Interlocked.Increment(ref _nCurrentIndexRangeToAssign) - 1) % _indexRanges.Length;
System.Transactions.Local (12)
System\Transactions\Transaction.cs (2)
465byte[] toReturn = new byte[internalPromotedToken.Length]; 466Array.Copy(internalPromotedToken, toReturn, toReturn.Length);
System\Transactions\TransactionInteropNonWindows.cs (9)
57var whereaboutsCopy = new byte[whereabouts.Length]; 58Buffer.BlockCopy(whereabouts, 0, whereaboutsCopy, 0, whereabouts.Length); 75if (cookie.Length < 32) 86var cookieCopy = new byte[cookie.Length]; 87Buffer.BlockCopy(cookie, 0, cookieCopy, 0, cookie.Length); 145if (propagationToken.Length < 24) 246if (propagationToken.Length < 24) 251byte[] propagationTokenCopy = new byte[propagationToken.Length]; 252Array.Copy(propagationToken, propagationTokenCopy, propagationToken.Length);
System\Transactions\TransactionManager.cs (1)
173resourceManagerRecoveryInformation = reader.ReadBytes(recoveryInformation.Length - checked((int)stream.Position));
System.Web.HttpUtility (9)
System\Web\HttpUtility.cs (4)
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); 199public static byte[]? UrlDecodeToBytes(byte[]? bytes) => bytes == null ? null : UrlDecodeToBytes(bytes, 0, bytes.Length); 210return HttpEncoder.UrlEncode(bytes, 0, bytes.Length, alwaysCreateNewReturnValue: false);
System\Web\Util\HttpEncoder.cs (5)
243if (decodedBytesCount < decodedBytes.Length) 428if (0 == offset && bytes.Length == count) 474byte[] encodedBytes = UrlEncodeNonAscii(bytes, 0, bytes.Length); 620ArgumentOutOfRangeException.ThrowIfGreaterThan(offset, bytes.Length); 623ArgumentOutOfRangeException.ThrowIfGreaterThan(count, bytes.Length - offset);
System.Windows.Controls.Ribbon (9)
Microsoft\Windows\Controls\GenericValueConverters.cs (2)
31if (values.Length < 2) 36for (int i = 1; i < values.Length; i++)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (1)
464if (handleTypeCount == 0 || handleTypeCount == handleTypes.Length)
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonScrollButtonVisibilityConverter.cs (1)
50values.Length != 4 ||
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (3)
195for (i = 1; i < _unitStrings.Length; ++i) 210if (i >= _unitStrings.Length) 212for (i = 0; i < _pixelUnitStrings.Length; ++i)
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
2241for (int i = 0; i < properties.Length; i++)
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (1)
392int wordCount = string.IsNullOrEmpty(Text) ? 0 : Text.Split().Length;
System.Xaml (97)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (4)
143for (int i = assemblies.Length - 1; i >= 0; i--) 266if (reqKeyToken.Length == curKeyToken.Length) 270for (int i = 0; i < reqKeyToken.Length; i++)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (8)
1294public override int Capacity => _entries.Length; 1300if (_count < _entries.Length) 1307int size = _entries.Length; 1323Array.Copy(_entries, 0, destEntries, 0, _entries.Length); 1345if (_count < _entries.Length) 1468if (_entries.Length >= oldCount) 1498ArgumentOutOfRangeException.ThrowIfGreaterThan(value, _entries.Length); 1529if (newCapacity + (newCapacity >> 2) >= _sourceArray.Length)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
92if (nameFrags.Length == 1)
System\Xaml\Context\XamlContext.cs (1)
275for (int i = 0; i < typeArgs.Length; i++)
System\Xaml\Context\XamlParserContext.cs (2)
175if (parInfo.Length >= parameterCount) 177parameterCount = parInfo.Length;
System\Xaml\InfosetObjects\XamlObjectWriter.cs (1)
1131for (int i = 0; i < args.Length; i++)
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
258for (int i = 0; i < attributes.Length; i++)
System\Xaml\Parser\GenericTypeNameScanner.cs (1)
359Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\MeScanner.cs (3)
552Debug.Assert(KnownStrings.WhitespaceChars.Length == 5); 612IsConstructorParsingMode = context.CurrentLongestConstructorOfMarkupExtension.Length > 0; 613MaxConstructorParams = context.CurrentLongestConstructorOfMarkupExtension.Length;
System\Xaml\Parser\NodeStreamSorter.cs (6)
472_sortingInfoArray = new ReorderInfo[_originalNodesInOrder.Length]; 476for (int i = 0; i < _originalNodesInOrder.Length; i++) 507for (int idx = 0; idx < _sortingInfoArray.Length; idx++) 564while (idx < _sortingInfoArray.Length 674for (int idx = start + 1; idx < _sortingInfoArray.Length; idx++) 692end =_sortingInfoArray.Length;
System\Xaml\Parser\XamlText.cs (1)
362for (int i = 0; i < EastAsianCodePointRanges.Length; i++)
System\Xaml\RefOnly\LooseTypeExtensions.cs (2)
94for (int i = 0; i < genericParameterConstraints.Length; i++) 110for (int i = 0; i < interfaces.Length; i++)
System\Xaml\Replacements\TypeListConverter.cs (2)
28Type[] types = new Type[tl.Length]; 29for (int i = 0; i < tl.Length; i++)
System\Xaml\Runtime\ClrObjectRuntime.cs (3)
114if (args == null || args.Length == 0) 125methods = new MethodBase[members.Length]; 126Array.Copy(members, methods, members.Length);
System\Xaml\Runtime\DynamicMethodRuntime.cs (8)
198if (args == null || args.Length == 0) 349if (args.Length == 0) 357Type[] paramTypes = new Type[parameters.Length]; 358LocalBuilder[] locals = new LocalBuilder[paramTypes.Length]; 359for (int i = 0; i < parameters.Length; i++) 392for (int i = 0; i < locals.Length; i++) 566Emit_ConstInt(ilGenerator, paramArgNums.Length); 570for (int i = 0; i < paramArgNums.Length; i++)
System\Xaml\Schema\CollectionReflector.cs (2)
308if (paramInfos == null || paramInfos.Length != paramCount) 353if (method.GetParameters().Length == argCount)
System\Xaml\Schema\Reflector.cs (6)
72if (attributes.Length == 0) 135if (attributes.Length == 0) 169if (attributes.Length == 0) 207if (attributes.Length == 0) 248if (attributes.Length == 0) 280if (attributes.Length == 0)
System\Xaml\Schema\TypeReflector.cs (13)
457knownMembers = new List<XamlMember>(propList.Length + eventList.Length); 473Dictionary<string, PropertyInfo> result = new Dictionary<string, PropertyInfo>(propList.Length); 474for (int i = 0; i < propList.Length; i++) 477if (currentProp.GetIndexParameters().Length > 0) 534Dictionary<string, EventInfo> result = new Dictionary<string, EventInfo>(eventList.Length); 535for (int i = 0; i < eventList.Length; i++) 589if (pi.GetIndexParameters().Length == 0) 900return (pmi.Length == 1) && (mi.ReturnType != typeof(void)); 922return (pmi.Length == 2); 945return (pmi.Length == 2) && typeof(Delegate).IsAssignableFrom(pmi[1].ParameterType); 1052if (objs.Length == 0) 1056if (objs.Length > 1)
System\Xaml\Schema\XamlNamespace.cs (5)
62if (typeArgs == null || typeArgs.Length == 0) 99Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types."); 105typeName = MangleGenericTypeName(typeName, typeArgs.Length); 156var clrTypeArgs = new Type[typeArgs.Length]; 157for (int n = 0; n < typeArgs.Length; n++)
System\Xaml\Schema\XamlTypeInvoker.cs (1)
132if (!_xamlType.UnderlyingType.IsValueType && (arguments == null || arguments.Length == 0))
System\Xaml\XamlBackgroundReader.cs (1)
113get { return _inIdx >= _incoming.Length; }
System\Xaml\XamlMember.cs (5)
654if (parameters.Length > 0) 805if ((method.GetParameters().Length != 1) || (method.ReturnType == typeof(void))) 813if ((method != null) && (method.GetParameters().Length != 2)) 876if (attribs.Length > 0) 975if (parameters.Length == 2)
System\Xaml\XamlObjectReader.cs (4)
1275if (arguments.Count != methodParams.Length) 1644if (constructorParameters.Length != ctorArgProps.Count) { continue; } 1646IList constructorArguments = new List<object>(constructorParameters.Length); 1647for (int i = 0; i < constructorParameters.Length; i++)
System\Xaml\XamlSchemaContext.cs (2)
318if (typeArguments == null || typeArguments.Length == 0) 1037_unexaminedAssemblies = new WeakReferenceList<Assembly>(currentAssemblies.Length);
System\Xaml\XamlType.cs (12)
921if (addParams.Length == 2) 940if (addParams.Length == 2) 944else if (addParams.Length == 1) 1185Debug.Assert(typeArgs.Length == 1); 1225Debug.Assert(typeArgs.Length == 1); 1498XamlType[] result = new XamlType[types.Length]; 1499for (int i = 0; i < types.Length; i++) 1584XamlType[] typeVector = new XamlType[parameterInfos.Length]; 1585for (int i = 0; i < parameterInfos.Length; i++) 1592if (ctorDict.ContainsKey(typeVector.Length)) 1596throw new XamlSchemaException(SR.Format(SR.MarkupExtensionWithDuplicateArity, UnderlyingType, typeVector.Length)); 1602ctorDict.Add(typeVector.Length, GetReadOnly(typeVector));
System\Xaml\XamlXmlWriter.cs (2)
1903if (constructorParameters.Length != ctorArgProps.Count) 1908for (int i = 0; i < constructorParameters.Length; i++)
TaskUsageLogger (3)
TaskUsageLogger.cs (3)
93if (parameters.Length != 1) 387if (parts.Length > 1 && String.Equals(name1, parts[parts.Length - 1], StringComparison.OrdinalIgnoreCase))
Templates.Blazor.Tests (16)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
94if (builtPackages.Length == 0) 99Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Blazor.WebAssembly.Auth.Tests (16)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
94if (builtPackages.Length == 0) 99Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Blazor.WebAssembly.Tests (16)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
94if (builtPackages.Length == 0) 99Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Mvc.Tests (16)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
94if (builtPackages.Length == 0) 99Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Templates.Tests (16)
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
94if (builtPackages.Length == 0) 99Assert.Equal(3, builtPackages.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (8)
145if ((byteArray.Length == AspNetHttpsOidFriendlyName.Length && byteArray[0] == (byte)'A') || byteArray.Length == 0) 511Array.Clear(keyBytes, 0, keyBytes.Length); 512Array.Clear(pem, 0, pem.Length); 518Array.Clear(keyBytes, 0, keyBytes.Length); 519Array.Clear(pem, 0, pem.Length); 569Array.Clear(bytes, 0, bytes.Length); 597Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
28Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
59Array.Clear(export, 0, export.Length);
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
TestExclusionListTasks (4)
src\tasks\AndroidAppBuilder\ApkBuilder.cs (1)
412if (classFiles.Length == 0)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
TestTasks (1)
InjectRequestHandler.cs (1)
21if (args.Length > 1)
UIAutomationClient (67)
MS\Internal\Automation\ClientEventManager.cs (2)
145int[] propertiesAsInts = new int[properties.Length]; 146for (int i = 0; i < properties.Length; i++)
MS\Internal\Automation\MenuTracker.cs (2)
76Debug.Assert(handlers.Length <= 1, "handlers.Length"); 77if( handlers.Length > 0 )
MS\Internal\Automation\Misc.cs (8)
51int l = a1.Length; 53if (l != a2.Length) 85totalLength += a.Length; 93int l = a.Length; 106if (a.Length == 0) 114for (int src = 1; src < a.Length; src++) 126if (newLength == a.Length) 695for (int source = 0; source < ach.Length; source++)
MS\Internal\Automation\ProxyManager.cs (4)
106for( int i = 0 ; i < _pseudoProxies.Length ; i++ ) 724for( int i = proxyInfo.Length - 1; i >= 0; i-- ) 731for( int j = 0 ; j < _pseudoProxyClassNames.Length ; j++ ) 801if ( index >= QUERYCLASSNAME_BASE && index - QUERYCLASSNAME_BASE < _classNames.Length )
MS\Internal\Automation\Schema.cs (2)
197AutomationElement[] els = new AutomationElement[objArr.Length]; 198for (int i = 0; i < objArr.Length; i++)
MS\Internal\Automation\UiaCoreApi.cs (22)
144IntPtr dataStart = Marshal.AllocCoTaskMem((properties.Length + patterns.Length) * sizeof(int)); 149_propertyCount = properties.Length; 150for (int i = 0; i < properties.Length; i++) 156_patternCount = patterns.Length; 157for (int i = 0; i < patterns.Length; i++) 226for (int propertyIndex = 0; propertyIndex < request.Properties.Length; propertyIndex++) 250int patternBaseIndex = 1 + request.Properties.Length; 251for (int patternIndex = 0; patternIndex < request.Patterns.Length; patternIndex++) 460Debug.Assert(offsets.Length == treeStructures.Length); 463UiaCacheResponse[] responses = new UiaCacheResponse[treeStructures.Length]; 466for (int i = 0; i < treeStructures.Length; i++) 469int endRow = i < treeStructures.Length - 1 ? offsets[i + 1] : requestedData.GetLength(0); 591CheckError(RawUiaAddEvent(hnode, eventId, callback, scope, properties, properties == null ? 0 : properties.Length, miniCR, out hevent)); 878SafeTextRangeHandle[] result = new SafeTextRangeHandle[arr.Length]; 879for (int i = 0; i < arr.Length; i++) 894SafeTextRangeHandle[] result = new SafeTextRangeHandle[arr.Length]; 895for (int i = 0; i < arr.Length; i++) 1021int count = doubles.Length / 4; 1022int leftover = doubles.Length % 4; 1121if (arr == null || arr.Length != 2)
MS\Internal\Automation\WindowHideOrCloseTracker.cs (2)
90Debug.Assert(handlers.Length <= 1, "handlers.Length"); 91if ( handlers.Length > 0 )
MS\Internal\Automation\WindowShowOrOpenTracker.cs (2)
88Debug.Assert(handlers.Length <= 1, "handlers.Length"); 89if (handlers.Length > 0)
MS\Internal\Automation\WinEventWrap.cs (3)
37Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid"); 39_hHooks = new IntPtr[_eventIds.Length]; 134for (int i=0;i<_hHooks.Length;i++)
System\Windows\Automation\AndCondition.cs (2)
40Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) ); 52SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.And, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\Automation.cs (1)
236if (properties.Length == 0)
System\Windows\Automation\AutomationElement.cs (8)
339for (int i = 0; i < id.Length; i++) 763if (responses.Length < 1) 768Debug.Assert(responses.Length == 1); 788AutomationElement[] els = new AutomationElement[responses.Length]; 790for( int i = 0 ; i < responses.Length ; i ++ ) 815if (patterns != null && patterns.Length > 0) 1241int dataOffset = isProperty ? 1 : 1 + _request.Properties.Length; 1242for (int i = 0; i < refTable.Length; i++)
System\Windows\Automation\AutomationElementCollection.cs (1)
93return _elements.Length;
System\Windows\Automation\Condition.cs (2)
70IntPtr mem = Marshal.AllocCoTaskMem(conditions.Length * intPtrSize); 79for (int i = 0; i < conditions.Length; i++)
System\Windows\Automation\OrCondition.cs (2)
39Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) ); 51SetMarshalData(new UiaCoreApi.UiaAndOrCondition(UiaCoreApi.ConditionType.Or, _conditionArrayHandle.DangerousGetHandle(), _conditions.Length));
System\Windows\Automation\Text\TextRange.cs (4)
85TextPatternRange[] ranges = new TextPatternRange[hTextRanges.Length]; 86for (int i = 0; i < hTextRanges.Length; i++) 410AutomationElement[] wrappedChildren = new AutomationElement[rawChildren.Length]; 411for (int i = 0; i < rawChildren.Length; i++)
UIAutomationClientSideProviders (69)
MS\Internal\AutomationProxies\Accessible.cs (6)
572if (accChildren != null && 0 <= index && index < accChildren.Length) 649children = new Accessible[objs.Length]; 650for (int i=0;i<objs.Length;i++) 994if (index >= children.Length) 995index = children.Length - 1; 1021for (int i=0;i<children.Length;i++)
MS\Internal\AutomationProxies\EventManager.cs (1)
484if (currentRanges != null && currentRanges.Length > 0)
MS\Internal\AutomationProxies\Misc.cs (7)
66int len = baseID.Length; 78double[] doubles = new double[rectArray.Length * 4]; 80for (int i = 0; i < rectArray.Length; i++) 141int l = a1.Length; 143if (l != a2.Length) 1074if (index >= QUERYCLASSNAME_BASE && index - QUERYCLASSNAME_BASE < _asClassNames.Length) 1659for (int source = 0; source < ach.Length; source++)
MS\Internal\AutomationProxies\MSAANativeProvider.cs (8)
277properties = new AutomationProperty[propertiesAsInts.Length]; 278for (int i = 0; i < propertiesAsInts.Length; i++) 295properties = new AutomationProperty[propertiesAsInts.Length]; 296for (int i = 0; i < propertiesAsInts.Length; i++) 395rval = new int[parentId.Length + 1]; 406rval[rval.Length - 1] = _acc.AccessibleChildrenIndex(Parent._acc); 580IRawElementProviderSimple [] rawEPS= new IRawElementProviderSimple[accessibles.Length]; 581for (int i=0;i<accessibles.Length;i++)
MS\Internal\AutomationProxies\MSAAWinEventWrap.cs (1)
96for (int i=0;i<_hHooks.Length;i++)
MS\Internal\AutomationProxies\ProxyHwnd.cs (5)
307properties = new AutomationProperty[propertiesAsInts.Length]; 308for (int i = 0; i < propertiesAsInts.Length; i++) 325properties = new AutomationProperty[propertiesAsInts.Length]; 326for (int i = 0; i < propertiesAsInts.Length; i++) 533for (int i = 0; evtId != null && i < evtId.Length; i++)
MS\Internal\AutomationProxies\WindowsHyperlink.cs (3)
301for (int source = 0; source < ach.Length; source++) 305if (source + 1 < ach.Length && ach[source] == '<' && (ach[source + 1] == 'A' || ach[source + 1] == 'a')) 309else if (source + 2 < ach.Length && ach[source] == '<' && ach[source + 1] == '/' && (ach[source + 2] == 'A' || ach[source + 2] == 'a'))
MS\Internal\AutomationProxies\WindowsIPAddress.cs (2)
130if (abOctet.Length == 4) 227if (strIPAddresses.Length != 4)
MS\Internal\AutomationProxies\WindowsListBox.cs (1)
463WinEventTracker.RemoveToNotificationList(hwnd, aEvtIdProperties, null, aEvtIdProperties.Length);
MS\Internal\AutomationProxies\WindowsListView.cs (12)
241int groupsCount = groupIds.Length; 244if (groupIds.Length == 0) 279int groupsCount = groupIds.Length; 282if (groupIds.Length == 0) 353if (groupIds.Length == 0) 380int groupsCount = groupIds.Length; 383if (groupIds.Length == 0) 496for (int i = 0, c = aidProps.Length; i < c; i++) 525for (int i = 0, c = aidProps.Length; i < c; i++) 830if ( viewID < 0 || viewID > ListViewViews.Length ) 839if ( viewID < 0 || viewID > ListViewViews.Length ) 1600if (groupIds.Length == 0)
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (4)
257if (groupInfo._count <= 0 || groupInfo._count > items.Length) 271if (groupInfo._count <= 0 || groupInfo._count > items.Length) 316if (groupInfo._count <= 0 || groupInfo._count > items.Length) 518if (groupManagerInfo._count <= 0 || groupManagerInfo._count >= items.Length)
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (4)
802System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length"); 803if (min == _items.Length) 807_items = new int[temp.Length * 2]; 808Array.Copy(temp, _items, temp.Length);
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
124for (index = 0; index < groupIds.Length && windowsListViewGroup.ID != groupIds[index]; index++); 126if (index >= groupIds.Length)
MS\Internal\AutomationProxies\WindowsMenu.cs (5)
465WinEventTracker.AddToNotificationList(IntPtr.Zero, new WinEventTracker.ProxyRaiseEvents(MenuEvents), _menuEvents, _menuEvents.Length); 486WinEventTracker.RemoveToNotificationList (IntPtr.Zero, _menuEvents, new WinEventTracker.ProxyRaiseEvents (MenuEvents), _menuEvents.Length); 1068int count = aidProps.Length; 1367for (int i = 0; i < keywordsAccelerators.Length; i++) 2781for (int i = 0; i < keywordsAccelerators.Length; i++)
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (2)
413if (a1.Length != a2.Length || a1.Rank != a2.Rank)
MS\Internal\AutomationProxies\WindowsTab.cs (2)
315&& aidProps.Length > 0 337&& aidProps.Length > 0
MS\Internal\AutomationProxies\WindowsTooltip.cs (3)
97WinEventTracker.AddToNotificationList( IntPtr.Zero, new WinEventTracker.ProxyRaiseEvents( OnToolTipEvents ), _toolTipEventIds, _toolTipEventIds.Length ); 114WinEventTracker.RemoveToNotificationList( IntPtr.Zero, _toolTipEventIds, new WinEventTracker.ProxyRaiseEvents( OnToolTipEvents ), _toolTipEventIds.Length ); 259for (scan = rects.Length - 1; scan >= 0; scan--)
MS\Internal\AutomationProxies\WinEventTracker.cs (1)
599private static Hashtable[] _ahp = new Hashtable[_eventIdToIndex.Length];
UIAutomationProvider (1)
MS\Internal\Automation\UiaCoreProviderApi.cs (1)
63CheckError(RawUiaRaiseStructureChangedEvent(provider, structureChangeType, runtimeId, runtimeId == null ? 0 : runtimeId.Length));
UIAutomationTypes (20)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (1)
43if (handleTypeCount == 0 || handleTypeCount == handleTypes.Length)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (17)
5905get { return buffer.Length; } 5910IntPtr result = Marshal.AllocCoTaskMem(buffer.Length); 5911Marshal.Copy(buffer, 0, result, buffer.Length); 5919while (i < buffer.Length && buffer[i] != 0) 5924if (i < buffer.Length) 5934Marshal.Copy(ptr, buffer, 0, buffer.Length); 5941int count = Math.Min(bytes.Length, buffer.Length - offset); 5946if (offset < buffer.Length) 5963get { return buffer.Length; } 5968IntPtr result = Marshal.AllocCoTaskMem(buffer.Length * 2); 5969Marshal.Copy(buffer, 0, result, buffer.Length); 5977while (i < buffer.Length && buffer[i] != 0) 5982if (i < buffer.Length) 5991Marshal.Copy(ptr, buffer, 0, buffer.Length); 5997int count = Math.Min(s.Length, buffer.Length - offset); 6002if (offset < buffer.Length)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (1)
2899int len = args.Length;
System\Windows\Automation\ControlType.cs (1)
97int totalRows = this._requiredPatternsSets.Length;
VersioningWebSite (1)
VersionRouteAttribute.cs (1)
64if (rangeValues.Length == 1)
Wasm.Performance.ConsoleHost (4)
src\Shared\CommandLineUtils\CommandLine\CommandLineApplication.cs (4)
149for (var index = 0; index < args.Length; index++) 230if (longOption.Length == 2) 299if (shortOption.Length == 2) 596command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
Wasm.Performance.Driver (1)
Program.cs (1)
28if (args.Length > 0)
WasmAppBuilder (36)
EmccCompile.cs (7)
63if (SourceFiles.Length == 0) 82_totalFiles = SourceFiles.Length; 109_numCompiled = SourceFiles.Length - filesToCompile.Count; 118Log.LogMessage(MessageImportance.High, $"[{_numCompiled}/{SourceFiles.Length}] skipped unchanged files"); 133int allowedParallelism = DisableParallelCompile ? 1 : Math.Min(SourceFiles.Length, Environment.ProcessorCount); 308if (parts.Length == 0) 312string value = parts.Length > 1 ? parts[1] : string.Empty;
InterpToNativeGenerator.cs (1)
125w.WriteLine($"static unsigned int interp_to_native_signatures_count = {signatures.Length};");
LogAdapter.cs (1)
40if ((o?.Length ?? 0) > 0)
ManagedToNativeGenerator.cs (3)
41if (Assemblies!.Length == 0) 47if (PInvokeModules!.Length == 0) 172List<string> managedAssemblies = new(assemblies.Length);
PInvokeTableGenerator.cs (8)
162if (candidates.Length < 2) 169int firstNumArgs = first.Method.GetParameters().Length; 173c.Method.GetParameters().Length != firstNumArgs); 223if (fields.Length == 1) 385var assemblyName = assemblyFullName != null && assemblyFullName.Split(',').Length > 0 ? assemblyFullName.Split(',')[0].Trim() : ""; 388int numParams = method.GetParameters().Length; 486if (!type.IsLayoutSequential && (fields.Length > 1)) 519for (int i = 0; i < attributeNames.Length; ++i)
SignatureMapper.cs (1)
72if (fields.Length == 1) {
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
wasi\WasiAppBuilder.cs (4)
22if (!InvariantGlobalization && !IsSingleFileBundle && (IcuDataFileNames == null || IcuDataFileNames.Length == 0)) 25if (Assemblies.Length == 0 && !IsSingleFileBundle) 30if (ExtraFilesToDeploy.Length > 0) 36if (FilesToIncludeInFileSystem.Length > 0)
WasmAppBuilder.cs (5)
62if (!InvariantGlobalization && (IcuDataFileNames == null || IcuDataFileNames.Length == 0)) 65if (Assemblies.Length == 0) 263if (FilesToIncludeInFileSystem.Length > 0) 313bool loadRemote = RemoteSources?.Length > 0; 328if (RemoteSources?.Length > 0)
WasmAppBuilderBaseTask.cs (3)
103if (matchingAssemblies.Length == 0) 106if (matchingAssemblies.Length > 1) 125if (string.IsNullOrEmpty(DefaultHostConfig) && HostConfigs.Length > 0)
WebSocketSample (1)
Program.cs (1)
13if (args.Length < 1)
WinShimmer (2)
Program.cs (2)
23if (args.Length != 3) 25throw new ArgumentOutOfRangeException("args", $"WinShimmer was provided {args.Length} arguments instead of 3");
WorkloadBuildTasks (7)
InstallWorkloadFromArtifacts.cs (2)
89if (InstallTargets.Length == 0) 365if (matchingDirs.Length > 1)
PackageInstaller.cs (1)
36if (references.Length == 0)
PatchNuGetConfig.cs (1)
109if (nuGetConfigPackageSourceMappings.Length > 0)
src\tasks\Common\Utils.cs (3)
234if (data.Length == 0) 237int outputLength = ((4 * data.Length / 3) + 3) & ~3; 239int base64SafeLength = Convert.ToBase64CharArray(data, 0, data.Length, base64Safe, 0, Base64FormattingOptions.None);
XmlFileLogger (3)
ItemGroupParser.cs (2)
27if (lines.Length == 1) 44for (int i = 1; i < lines.Length; i++)
XmlFileLogger.cs (1)
165if (parameters.Length != 1)
xunit.assert (10)
CollectionAsserts.cs (6)
158 if (index < elementInspectors.Length) 171 if (tracker.IterationCount != elementInspectors.Length) 172 throw CollectionException.ForMismatchedItemCount(elementInspectors.Length, tracker.IterationCount, tracker.FormatStart()); 199 if (index < elementInspectors.Length) 212 if (tracker.IterationCount != elementInspectors.Length) 213 throw CollectionException.ForMismatchedItemCount(elementInspectors.Length, tracker.IterationCount, tracker.FormatStart());
MultipleAsserts.cs (1)
26 if (checks == null || checks.Length == 0)
Sdk\ArgumentFormatter.cs (2)
219 typeParameters.Length == 0 463 result = string.Format(CultureInfo.CurrentCulture, "{0}<{1}>", result, new string(',', typeInfo.GenericTypeParameters.Length - 1));
Sdk\AssertHelper.cs (1)
126 .Where(p => p.CanRead && p.GetMethod != null && p.GetMethod.IsPublic && !p.GetMethod.IsStatic && p.GetIndexParameters().Length == 0)
xunit.console (8)
CommandLine.cs (4)
21for (var i = args.Length - 1; i >= 0; i--) 119var args = new List<string>(capacity: rspLines.Length); 408if (pieces.Length != 2 || string.IsNullOrEmpty(pieces[0]) || string.IsNullOrEmpty(pieces[1])) 421if (pieces.Length != 2 || string.IsNullOrEmpty(pieces[0]) || string.IsNullOrEmpty(pieces[1]))
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextPaths.cs (1)
48var application = files != null && files.Length > 0 ? files[0] : null;
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\PackageCompilationAssemblyResolver.cs (1)
80if (_nugetPackageDirectories == null || _nugetPackageDirectories.Length == 0 ||
common\Json.cs (1)
29get { return _array.Length; }
ConsoleRunner.cs (1)
40if (args.Length == 0 || args[0] == "-?" || args[0] == "/?" || args[0] == "-h" || args[0] == "--help")