7840 references to Array
Analyzer.Utilities.UnitTests (2)
Extensions\IEnumerableExensionsTests.cs (1)
84public void CopyTo(Array array, int index) => throw new NotImplementedException();
FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisTests.cs (1)
62expectedResults ??= Array.Empty<(int Line, int Column, string? MethodName, HazardousUsageEvaluationResult Result)>();
AnalyzerRunner (1)
CodeRefactoringRunner.cs (1)
249_ => Array.Empty<string>(),
aspire (3)
Backchannel\AppHostBackchannel.cs (1)
207Array.Empty<object>(),
src\Shared\CircularBuffer.cs (1)
242return Array.Empty<T>();
Templating\DotNetTemplateFactory.cs (1)
213return await ApplyTemplateAsync(template, parseResult, (_, _) => Task.FromResult(Array.Empty<string>()), cancellationToken);
Aspire.Cli.Tests (5)
Commands\AddCommandTests.cs (1)
589return (0, Array.Empty<NuGetPackage>());
Commands\NewCommandTests.cs (1)
505return (0, Array.Empty<NuGetPackage>());
Interaction\ConsoleInteractionServiceTests.cs (1)
17var choices = Array.Empty<string>();
Utils\CliTestHelper.cs (2)
117public string[] EnabledFeatures { get; set; } = Array.Empty<string>(); 118public string[] DisabledFeatures { get; set; } = Array.Empty<string>();
Aspire.Components.Common.TestUtilities (2)
ConformanceTests.cs (2)
33protected virtual (string json, string error)[] InvalidJsonToErrorMessage => Array.Empty<(string json, string error)>(); 37protected virtual string[] NotAcceptableLogCategories => Array.Empty<string>();
Aspire.Confluent.Kafka (2)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\InstrumentedConsumer.cs (1)
358: Array.Empty<ActivityLink>();
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\OpenTelemetryConsumeResultExtensions.cs (1)
156: Array.Empty<ActivityLink>();
Aspire.Dashboard (7)
DashboardWebApplication.cs (1)
179_validationFailures = Array.Empty<string>();
Otlp\Model\OtlpApplicationView.cs (1)
37Array.Sort(properties, (p1, p2) => string.Compare(p1.Key, p2.Key, StringComparisons.OtlpAttribute));
Otlp\Model\OtlpHelpers.cs (3)
187return Array.Empty<KeyValuePair<string, string>>(); 207return Array.Empty<KeyValuePair<string, string>>(); 279Array.Clear(copiedAttributes);
Otlp\Model\OtlpInstrument.cs (1)
57Array.Sort(tempAttributes, 0, copyCount, KeyValuePairComparer.Instance);
src\Shared\CircularBuffer.cs (1)
242return Array.Empty<T>();
Aspire.Dashboard.Tests (1)
TelemetryRepositoryTests\MetricsTests.cs (1)
403AssertDimensionValues(instrument.Dimensions, Array.Empty<KeyValuePair<string, string>>(), valueCount: 1);
Aspire.Hosting (2)
src\Shared\CircularBuffer.cs (1)
242return Array.Empty<T>();
src\Shared\CommandLineArgsParser.cs (1)
16var args = result.Count > 1 ? result.Skip(1).ToArray() : Array.Empty<string>();
Aspire.Hosting.Azure.Functions (1)
src\Shared\CommandLineArgsParser.cs (1)
16var args = result.Count > 1 ? result.Skip(1).ToArray() : Array.Empty<string>();
Aspire.Hosting.GitHub.Models (1)
GitHubModelsHealthCheck.cs (1)
49messages = Array.Empty<object>()
Aspire.Hosting.Tests (1)
Backchannel\AppHostBackchannelTests.cs (1)
88Array.Empty<object>()
Aspire.Microsoft.Azure.Cosmos.Tests (1)
ConformanceTests.cs (1)
19protected override string[] RequiredLogCategories => Array.Empty<string>();
Aspire.Microsoft.Data.SqlClient.Tests (1)
ConformanceTests.cs (1)
26protected override string[] RequiredLogCategories => Array.Empty<string>();
Aspire.Milvus.Client.Tests (1)
ConformanceTests.cs (1)
34protected override string[] RequiredLogCategories => Array.Empty<string>();
Aspire.Playground.Tests (1)
tests\Aspire.TestUtilities\FileUtil.cs (1)
25foreach (var extension in Environment.GetEnvironmentVariable("PATHEXT")?.Split(';') ?? Array.Empty<string>())
Aspire.Qdrant.Client.Tests (1)
ConformanceTests.cs (1)
28protected override string[] RequiredLogCategories => Array.Empty<string>();
Aspire.RabbitMQ.Client.Tests (1)
ConformanceTests.cs (1)
32protected override string[] RequiredLogCategories => Array.Empty<string>();
Aspire.RabbitMQ.Client.v7.Tests (1)
tests\Aspire.RabbitMQ.Client.Tests\ConformanceTests.cs (1)
32protected override string[] RequiredLogCategories => Array.Empty<string>();
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
DistributedCacheConformanceTests.cs (1)
22protected override (string json, string error)[] InvalidJsonToErrorMessage => Array.Empty<(string json, string error)>();
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
OutputCacheConformanceTests.cs (1)
22protected override (string json, string error)[] InvalidJsonToErrorMessage => Array.Empty<(string json, string error)>();
Aspire.TestUtilities (1)
FileUtil.cs (1)
25foreach (var extension in Environment.GetEnvironmentVariable("PATHEXT")?.Split(';') ?? Array.Empty<string>())
AzureSearch.ApiService (1)
Hotel.cs (1)
38public bool? SmokingAllowed => (Rooms != null) ? Array.Exists(Rooms, element => element.SmokingAllowed == true) : (bool?)null;
BasicTestApp (1)
ServerReliability\JSInterop.cs (1)
31Array.Reverse(messageChars);
BinaryFormatTests (3)
FormatTests\FormattedObject\BinaryFormatWriterTests.cs (3)
212public static TheoryData<Array> StringArray_Parse_Data => 219public static TheoryData<Array> PrimitiveArray_Parse_Data => 230public static TheoryData<Array> Array_UnsupportedTestData =>
Binding.UDS.IntegrationTests (1)
ServiceHelper.cs (1)
23var hostBuilder = Host.CreateDefaultBuilder(Array.Empty<string>());
BuildValidator (3)
LocalReferenceResolver.cs (1)
98: Array.Empty<AssemblyInfo>();
Program.cs (2)
105referencesPath ??= Array.Empty<string>(); 107var excludes = new List<string>(exclude ?? Array.Empty<string>());
CodeGenerator (3)
HttpUtilities\CombinationsWithoutRepetition.cs (1)
91Array.Clear(Current, 0, Current.Length);
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
868{Each(loop.Headers.Where(header => Array.IndexOf(InternalHeaderAccessors, header.Name) >= 0), header => $@"
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
ConfigurationSchemaGenerator (2)
RuntimeSource\SourceGenerators\DiagnosticInfo.cs (1)
29MessageArgs = messageArgs ?? Array.Empty<object?>()
RuntimeSource\SourceGenerators\ImmutableEquatableArray.cs (1)
18public static ImmutableEquatableArray<T> Empty { get; } = new ImmutableEquatableArray<T>(Array.Empty<T>());
Contract.Service.IntegrationTests (1)
ServiceContractTests.4.0.0.cs (1)
498stream.ReadExactly(Array.Empty<byte>(), 0, 0);
Crossgen2Tasks (1)
ResolveReadyToRunCompilers.cs (1)
68var supportedRIDsList = supportedRuntimeIdentifiers == null ? Array.Empty<string>() : supportedRuntimeIdentifiers.Split(';');
csc (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
341var buffer = Array.Empty<byte>();
DemoConsole (1)
DesignerSerializationService.cs (1)
25return Array.Empty<object>();
dotnet-dev-certs (9)
ReporterEventListener.cs (1)
33var message = string.Format(CultureInfo.InvariantCulture, eventData.Message ?? "", eventData.Payload?.ToArray() ?? Array.Empty<object>());
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
dotnet-svcutil.xmlserializer (2)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (1)
246types = Array.FindAll<Type>(rtle.Types, delegate (Type t) { return t != null; });
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (1)
215if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
dotnet-svcutil-lib (266)
CodeDomFixup\CodeDomVisitors\ConstructorFixer.cs (1)
19Array.Empty<Type>(),
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerErrorCollection.cs (1)
117/// <para>Copies the <see cref='Microsoft.CodeDom.Compiler.CompilerErrorCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerInfo.cs (2)
160Array.Copy(_compilerLanguages, compilerLanguages, _compilerLanguages.Length); 167Array.Copy(_compilerExtensions, compilerExtensions, _compilerExtensions.Length);
FrameworkFork\Microsoft.CodeDom\Compiler\TempFiles.cs (1)
138void ICollection.CopyTo(Array array, int start)
FrameworkFork\Microsoft.CodeDom\System\CodeAttributeArgumentCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeAttributeArgumentCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeAttributeDeclarationCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeAttributeDeclarationCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeCatchClauseCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeCatchClauseCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeCommentStatementCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeCommentStatementCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeExpressionCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeExpressionCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeNamespaceCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeNamespaceCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeNamespaceImportCollection.cs (1)
186void ICollection.CopyTo(Array array, int index)
FrameworkFork\Microsoft.CodeDom\System\CodeParameterDeclarationExpressionCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeParameterDeclarationExpressionCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeStatementCollection.cs (1)
129/// <para>Copies the <see cref='Microsoft.CodeDom.CodeStatementCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeTypeDeclarationCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeTypeDeclarationCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeTypeMemberCollection.cs (1)
120/// <para>Copies the <see cref='Microsoft.CodeDom.CodeTypeMemberCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReferenceCollection.cs (1)
136/// <para>Copies the <see cref='Microsoft.CodeDom.CodeTypeReferenceCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
FrameworkFork\Microsoft.Xml\Xml\Base64Decoder.cs (1)
126internal override void SetNextOutputBuffer(Array buffer, int index, int count)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (11)
1913System.Array.Copy(symtable, 0, n, 0, symNum); 1929System.Array.Copy(qnametable, 0, n, 0, qnameNum); 1973Array.Clear(_symbolTables.symtable, 1, _symbolTables.symtable.Length - 1); 1974Array.Clear(_symbolTables.qnametable, 0, _symbolTables.qnametable.Length); 2022System.Array.Copy(data, mark, newdata, 0, cbKeep); 2027System.Array.Copy(data, mark, data, 0, cbKeep); 2434System.Array.Copy(_elementStack, 0, n, 0, _elementStack.Length); 2443System.Array.Copy(_attributes, 0, n, 0, _attrCount); 2752Array.Clear(_attrHashTbl, 0, tblSize); 4174Array.Copy(_data, _tokDataPos, data, 0, _tokLen); 4354Array.Copy(_data, _tokDataPos, data, 0, _tokLen);
FrameworkFork\Microsoft.Xml\Xml\BinHexDecoder.cs (2)
121internal override void SetNextOutputBuffer(Array buffer, int index, int count) 172Array.Copy(bytes, 0, tmp, 0, bytesDecoded);
FrameworkFork\Microsoft.Xml\Xml\BitStack.cs (1)
107Array.Copy(_bitStack, bitStackNew, len);
FrameworkFork\Microsoft.Xml\Xml\BufferBuilder.cs (1)
487Array.Copy(_buffers, 0, newBuffers, 0, _buffers.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\IncrementalReadDecoders.cs (3)
19internal abstract void SetNextOutputBuffer(Array array, int offset, int len); 32internal override void SetNextOutputBuffer(Array array, int offset, int len) { } 112internal override void SetNextOutputBuffer(Array buffer, int index, int count)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEncodedRawTextWriter.cs (1)
1580Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEventCache.cs (1)
578Array.Copy(buffer, index, bufferNew, 0, count);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReader.cs (2)
1302Array.Copy(_nsAttributes, 0, newNsAttrs, 0, index); 1561private void CheckBuffer(Array buffer, int index, int count)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (8)
4594Array.Copy(_nodes, _index + 1, nameSortedAttributes, 0, _attrCount); 4595Array.Sort<object>(nameSortedAttributes, DtdDefaultAttributeInfoToNodeDataComparer.Instance); 5135Array.Copy(_nodes, _index + 1, _attrDuplSortingArray, 0, _attrCount); 5136Array.Sort(_attrDuplSortingArray, 0, _attrCount); 7789Array.Copy(_nodes, 0, newNodes, 0, _nodes.Length); 8248Array.Copy(_parsingStatesStack, 0, newParsingStateStack, 0, _parsingStatesStack.Length); 8279private int IncrementalRead(Array array, int index, int count) 9327if (Array.BinarySearch<object>(nameSortedNodeData, defAttrInfo, DtdDefaultAttributeInfoToNodeDataComparer.Instance) >= 0)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextWriter.cs (2)
1475Array.Copy(_nsStack, newStack, nsIndex); 1735if (_top > 0) Array.Copy(_stack, na, _top + 1);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (3)
503Array.Copy(_elemScopeStack, newStack, top); 1855Array.Copy(_nsStack, newStack, top); 2224Array.Copy(_attrStack, newStack, top);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriterHelpers.cs (1)
518Array.Copy(_items, newItems, newItemIndex);
FrameworkFork\Microsoft.Xml\Xml\Core\XsdCachingReader.cs (2)
674Array.Copy(_attributeEvents, 0, newAttributeEvents, 0, _attributeEvents.Length); 699Array.Copy(_contentEvents, 0, newContentEvents, 0, _contentEvents.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReader.cs (1)
2196Array.Copy(_attributePSVINodes, 0, newPSVINodes, 0, _attributePSVINodes.Length);
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentSchemaValidator.cs (1)
572Array.Copy(_nodeSequenceToValidate, 0, newNodeSequence, 0, _nodeSequenceToValidate.Length);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlAttributeCollection.cs (1)
265void ICollection.CopyTo(Array array, int index)
FrameworkFork\Microsoft.Xml\Xml\HWStack.cs (1)
44System.Array.Copy(_stack, 0, newstack, 0, _used);
FrameworkFork\Microsoft.Xml\Xml\schema\BitSet.cs (1)
257Array.Copy(_bits, newBits, _bits.Length);
FrameworkFork\Microsoft.Xml\Xml\schema\ConstraintStruct.cs (10)
249_dim = ((Array)obj).Length; 289_dstruct.Dvalue[i] = Convert.ToDecimal(((Array)_ovalue).GetValue(i), NumberFormatInfo.InvariantInfo); 358Array arr1 = this.Value as System.Array; 372Array arr2 = other.Value as System.Array; 471Array arr = _ks[i].Value as System.Array; 484for (int j = 0; j < ((Array)_ks[i].Value).Length; j++) 486_hashcode += ((Array)_ks[i].Value).GetValue(j).GetHashCode();
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (2)
2105Array.Copy(rposInfo.rangeCounters, 0, newRPosInfo.rangeCounters, 0, rposInfo.rangeCounters.Length); 2132Array.Copy(rposInfo.rangeCounters, 0, newRPosInfo.rangeCounters, 0, rposInfo.rangeCounters.Length);
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (8)
160int i = Array.BinarySearch(s_xdrTypes, name, null); 166int i = Array.BinarySearch(s_xsdTypes, name, null); 984System.Array arr1 = (System.Array)value1; 985System.Array arr2 = (System.Array)value2; 1064Array valuesToCheck = valueToCheck as Array;
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (1)
1458Array.Copy(_condSectionEntityIds, 0, tmp, 0, _condSectionEntityIds.Length);
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (2)
1647Array values = value as Array;
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaCollection.cs (1)
263void ICollection.CopyTo(Array array, int index)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObjectTable.cs (2)
215public void CopyTo(Array array, int arrayIndex) 270public void CopyTo(Array array, int arrayIndex)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (1)
332_clrTypeDefault = Array.CreateInstance(converterAtomic.DefaultClrType, 0).GetType();
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (2)
698if (arrayType == typeof(Array)) 701Call(typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) }));
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifiers.cs (2)
187Array array = Array.CreateInstance(type, _list.Count);
FrameworkFork\Microsoft.Xml\Xml\Serialization\Mappings.cs (3)
395Array.Copy(_elements, 0, _sortedElements, 0, _elements.Length); 762Array.Sort(elements, new AccessorComparer()); 792Array.Copy(_elements, 0, _sortedElements, 0, _elements.Length);
FrameworkFork\Microsoft.Xml\Xml\Serialization\NameTable.cs (3)
93internal Array ToArray(Type type) 95Array a = Array.CreateInstance(type, _table.Count);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaImporter.cs (2)
877Array.Sort(member.Elements, new ElementComparer()); 1910Array.Sort(choice, new ElementComparer());
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
104Array.Copy(a, b, index);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (1)
136Array.Copy(a, b, index);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (16)
1435protected Array EnsureArrayIndex(Array a, int index, Type elementType) 1437if (a == null) return Array.CreateInstance(elementType, 32); 1439Array b = Array.CreateInstance(elementType, a.Length * 2); 1440Array.Copy(a, b, index); 1445protected Array ShrinkArray(Array a, int length, Type elementType, bool isNullable) 1450return Array.CreateInstance(elementType, 0); 1453Array b = Array.CreateInstance(elementType, length); 1454Array.Copy(a, b, length); 1637Array array = (Array)f.Source; 1753return Array.CreateInstance(elementType, 0); 1760Array array = null;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (5)
1299Array a = (Array)o; 3911WriteDefaultIndexerInit(typeof(IList), typeof(Array).FullName, false, false); 4202string typeFullName = arrayTypeDesc.IsCollection ? arrayTypeDesc.CSharpName : typeof(Array).FullName; 4318typeName = typeof(Array).FullName;
FrameworkFork\Microsoft.Xml\Xml\XmlNamespaceManager.cs (1)
172Array.Copy(_nsdecls, 0, newNsdecls, 0, _nsdecls.Length);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathMultyIterator.cs (1)
54Array.Copy(arr, firstNotEmpty, arr, firstNotEmpty + 1, pos - firstNotEmpty);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (7)
449type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>()) != null); 507Array.Copy(baseChildElementNamespaces, 0, childElementNamespaces, 0, baseChildElementNamespaces.Length); 792this.ContractNamespaces = this.MemberNames = this.MemberNamespaces = Array.Empty<XmlDictionaryString>(); 835Array.Copy(BaseContract.MemberNames, 0, MemberNames, 0, baseMemberCount); 837Array.Copy(BaseContract.MemberNamespaces, 0, MemberNamespaces, 0, baseMemberCount); 840Array.Copy(BaseContract.ContractNamespaces, 0, ContractNamespaces, 0, baseContractCount); 1399ConstructorInfo ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (2)
85s_arraySetValue = typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) }); 102s_objectToString = typeof(object).GetMethod("ToString", Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (2)
1086defaultCtor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, Array.Empty<Type>()); 1265getEnumeratorMethod = type.GetMethod(Globals.GetEnumeratorMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (5)
656Array.Resize<DataContract>(ref s_dataContractCache, newSize); 934else if (type == typeof(Array)) 1007dataContract = new CollectionDataContract(typeof(Array)); 2110MethodInfo method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>()); 2117object types = method.Invoke(null, Array.Empty<object>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSerializer.cs (1)
156_knownTypeCollection = new ReadOnlyCollection<Type>(Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
185Array.Copy(BaseContract._contractNamespaces, 0, _contractNamespaces, 0, baseContractCount);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExtensionDataReader.cs (2)
501Array.Copy(_elements, 0, newElements, 0, _elements.Length); 586Array.Copy(attributes, 0, newAttributes, 0, attributes.Length);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (1)
93s_typeOfArray = typeof(Array);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ObjectReferenceStack.cs (2)
32Array.Resize<object>(ref _objectArray, _objectArray.Length * 2); 67Array.Resize<bool>(ref _isReferenceArray, _isReferenceArray.Length * 2);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ScopedKnownTypes.cs (1)
20Array.Resize<DataContractDictionary>(ref dataContractDictionaries, dataContractDictionaries.Length * 2);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (1)
362ConstructorInfo ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (3)
65s_writeEndElementMethod = typeof(XmlWriterDelegator).GetMethod("WriteEndElement", Globals.ScanAllMembers, Array.Empty<Type>()); 175s_isStartElementMethod0 = typeof(XmlReaderDelegator).GetMethod("IsStartElement", Globals.ScanAllMembers, Array.Empty<Type>()); 222s_hashtableCtor = Globals.TypeOfHashtable.GetConstructor(Globals.ScanAllMembers, Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (1)
512constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
378MethodInfo moveNextMethod = enumeratorType.GetMethod(Globals.MoveNextMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>()); 379MethodInfo getCurrentMethod = enumeratorType.GetMethod(Globals.GetCurrentMethodName, BindingFlags.Instance | BindingFlags.Public, Array.Empty<Type>());
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
479Array.Copy(array, 0, newArray, 0, array.Length); 494Array.Copy(array, 0, newArray, 0, size);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (1)
458internal void IncrementArrayCount(XmlWriterDelegator xmlWriter, Array array)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlReaderDelegator.cs (1)
350return Array.Empty<byte>();
FrameworkFork\System.Runtime.Serialization\System\Xml\ArrayHelper.cs (2)
53Array.Copy(arrays[i], 0, newArray, offset, arrays[i].Length); 56Array.Copy(array, 0, newArray, offset, totalRead - offset);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (11)
300Array.Copy(_elementNodes, 0, newElementNodes, 0, _depth); 334Array.Copy(_attributeNodes, 0, newAttributeNodes, 0, attributeIndex); 1373Array.Copy(_trailBytes, 0, buffer, offset, actual); 1375Array.Copy(_trailBytes, actual, _trailBytes, 0, _trailByteCount); 1399Array.Copy(_trailChars, 0, chars, charCount, _trailCharCount); 1432Array.Copy(chars, charCount, _trailChars, 0, _trailCharCount); 1443Array.Copy(_trailBytes, 0, buffer, offset, actual); 1445Array.Copy(_trailBytes, actual, _trailBytes, 0, _trailByteCount); 2486Array.Sort(_indeces, 0, _attributeCount, this); 2697Array.Copy(_attributes, 0, newAttributes, 0, _attributeCount); 2735Array.Copy(_namespaces, 0, newNamespaces, 0, _nsCount);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseWriter.cs (6)
619Array.Copy(_elements, 0, newElementNodes, 0, _depth); 1138else if (value is Array) 1140WriteValue((Array)value); 1567private void WriteValue(Array array) 1856Array.Copy(_attributes, 0, newAttributes, 0, _attributeCount); 1950Array.Copy(_namespaces, 0, newNamespaces, 0, _nsCount);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryReader.cs (1)
1205private void CheckArray(Array array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryReaderSession.cs (2)
52Array.Copy(_strings, 0, newStrings, 0, _strings.Length); 126Array.Clear(_strings, 0, _strings.Length);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryWriter.cs (1)
1267private void CheckArray(Array array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBinaryWriterSession.cs (2)
121Array.Clear(_list, 0, _list.Length); 253Array.Copy(_array, 0, newArray, 0, _array.Length);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBufferReader.cs (2)
38private static XmlBufferReader s_empty = new XmlBufferReader(Array.Empty<byte>()); 114_buffer = Array.Empty<byte>();
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionary.cs (1)
62Array.Resize(ref _strings, newSize);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryReader.cs (3)
841buffer = Array.Empty<byte>(); 861buffer = Array.Empty<byte>(); 891private void CheckArray(Array array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlDictionaryWriter.cs (1)
403private void CheckArray(Array array, int offset, int count)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlStreamNodeWriter.cs (1)
472Array.Copy(newBytes, 0, buffer, (int)(bytes - _bytes) + offset, toCopy);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\BufferedOutputStream.cs (1)
128Array.Copy(_chunks, newChunks, _chunks.Length);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\SynchronizedPool.cs (1)
204Array.Copy(localPending, newPending, localPending.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BufferedWriteStream.cs (3)
86Array.Copy(_buffer, 0, shadowBuffer, 0, _writePos); 244Array.Copy(array, offset, _buffer, _writePos, bytesToWrite); 380Array.Copy(array, offset, _buffer, _writePos, count);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (2)
69ConstructorInfo ctorInfo = handler.GetConstructor(Array.Empty<Type>()); 164instances[cnt] = (DelegatingHandler)_handlerCtors[cnt].Invoke(Array.Empty<Type>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (1)
74httpRequestMessage.Content = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageProperty.cs (2)
343HttpContent newContent = new ByteArrayContent(Array.Empty<byte>()); 354this.HttpRequestMessage.Content = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (1)
35httpResponseMessage.Content = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageProperty.cs (2)
367HttpContent newContent = new ByteArrayContent(Array.Empty<byte>()); 378this.HttpResponseMessage.Content = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Message.cs (1)
2071Array.Copy(_entries, 1, _entries, 0, _entries.Length - 1);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageHeaders.cs (3)
107Array.Copy(headers._headers, _headers, _headerCount); 1265Array.Copy(_headers, headerIndex, _headers, headerIndex + 1, _headerCount - headerIndex); 1421Array.Copy(_headers, headerIndex + 1, _headers, headerIndex, _headerCount - headerIndex - 1);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageProperties.cs (1)
709Array.Copy(_properties, newProperties, _properties.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannel.cs (4)
1194Call(message.Headers.Action, true, operation, new object[] { message }, Array.Empty<object>(), timeout); 1210EndCall(MessageHeaders.WildcardAction, Array.Empty<object>(), result); 1221return (Message)Call(message.Headers.Action, false, operation, new object[] { message }, Array.Empty<object>(), timeout); 1237return (Message)EndCall(MessageHeaders.WildcardAction, Array.Empty<object>(), result);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (5)
180object result = channel.EndCall(operation.Action, Array.Empty<object>(), asyncResult); 222channel.EndCall(operation.Action, Array.Empty<object>(), asyncResult); 277return (bool)_tcsInfo.TrySetCanceledMethod.Invoke(_tcsInstance, Array.Empty<object>()); 293TrySetCanceledMethod = GenericType.GetRuntimeMethod("TrySetCanceled", Array.Empty<Type>()); 461Array.Copy(_methodDatas, newMethodDatas, _methodDatas.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (1)
57Array.Copy(supported, enc, supported.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\WebSocketTransportDuplexSessionChannel.cs (2)
1183Task task = _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, timeoutHelper.GetCancellationToken()); 1209await _webSocket.SendAsync(new ArraySegment<byte>(Array.Empty<byte>(), 0, 0), _outgoingMessageType, true, cancelToken);
FrameworkFork\System.ServiceModel\System\ServiceModel\ClientBase.cs (3)
542Array.Copy(args, inArgs, args.Length); 555Array.Copy(args, inArgs, args.Length); 567Array.Copy(retArgs, args, args.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ClientClassGenerator.cs (1)
141Array.Copy(arr, 0, newArr, 1, arr.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessageContractImporter.cs (1)
489isReturn = Array.IndexOf<string>(parameterOrder, part.Name) == -1;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\OperationGenerator.cs (1)
986Array.Sort<MemberInfo>(publicMembers,
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceContractGenerator.cs (2)
646Array.Sort((MessagePartDescription[])xHeaders, MessagePartDescriptionComparer.Singleton); 647Array.Sort((MessagePartDescription[])yHeaders, MessagePartDescriptionComparer.Singleton);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\TypeLoader.cs (1)
1546Array.Sort<MessagePartDescription>(partDescriptions, CompareMessagePartDescriptions);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlExporter.cs (2)
1004return Array.Exists<XmlQualifiedName>(prefixDefinitions, 1018Array.Find<XmlQualifiedName>(prefixDefinitions,
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (2)
1386Array.Resize<XmlAttribute>(ref attributes, i + 1); 2163if (attributes != null && Array.Exists(attributes, PolicyHelper.IsPolicyURIs))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\XmlSerializerOperationBehavior.cs (1)
499Array.Copy(members, newMembers, newMembers.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ClientRuntime.cs (1)
404return Array.Empty<T>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\FaultFormatter.cs (1)
169Array.Sort<FaultContractInfo>(temp,
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (7)
685value = Array.Empty<bool>(); 698value = Array.Empty<DateTime>(); 711value = Array.Empty<Decimal>(); 724value = Array.Empty<Int32>(); 737value = Array.Empty<Int64>(); 750value = Array.Empty<Single>(); 763value = Array.Empty<Double>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ProxyOperationRuntime.cs (4)
70_outParams = Array.Empty<ParameterInfo>(); 309outs = Array.Empty<object>(); 316return Array.Empty<object>(); 325ins = Array.Empty<object>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\XmlSerializerOperationFormatter.cs (5)
435Array tArray = Array.CreateInstance(headerDescription.Type, messageHeaderOfTArray.Length); 493object[] messageHeaderOfTArray = (object[])Array.CreateInstance(TypedHeaderManager.GetMessageHeaderType(headerDescription.Type), messageHeaderOfTAttributes.Count); 494Array headerValues = (Array)headerValue;
FrameworkFork\System.ServiceModel\System\ServiceModel\EmptyArray.cs (2)
14return Array.Empty<T>(); 23return Array.Empty<T>();
FrameworkFork\System.ServiceModel\System\ServiceModel\ServiceChannelManager.cs (1)
411return Array.Empty<IChannel>();
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedCollection.cs (1)
234void ICollection.CopyTo(Array array, int index)
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedReadOnlyCollection.cs (1)
178void ICollection.CopyTo(Array array, int index)
FrameworkFork\System.Web.Services\Configuration\WebServicesSection.cs (1)
85Array.Sort(prefixes);
Metadata\MetadataFileNameManager.cs (1)
158if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
OutputPathHelper.cs (1)
164if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
Shared\Options\ListValue.cs (2)
182public void CopyTo(Array array, int index) 187void ICollection.CopyTo(Array array, int index)
TypeLoader.cs (1)
49listType.AddRange(Array.FindAll<Type>(rtle.Types, delegate (Type t)
dotnet-user-jwts (1)
Commands\ListCommand.cs (1)
61reporter.Output(JsonSerializer.Serialize(Array.Empty<Jwt>(), JwtSerializerOptions.Default));
Extensibility.MessageEncoder.IntegrationTests (2)
CustomTextMessageEncoder.cs (2)
63Array.Copy(buffer.Array, buffer.Offset, msgContents, 0, msgContents.Length); 95Array.Copy(messageBuffer.Array, 0, totalBytes, messageOffset, messageLength);
GenerateDocumentationAndConfigFiles (74)
Program.cs (1)
784var actualContent = Array.Empty<string>();
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (12)
19/// <seealso cref="Array.Clear(Array)"/> 24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
GenerateRulesMissingDocumentation (1)
Program.cs (1)
50var actualContent = Array.Empty<string>();
GetDocument.Insider (3)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.7.25377.103\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
182return buildMethod?.Invoke(builder, Array.Empty<object>()); 238_entryPoint.Invoke(null, Array.Empty<object>());
Commands\GetDocumentCommandWorker.cs (1)
37private static readonly object[] _getDocumentsArguments = Array.Empty<object>();
http2cat (6)
src\Shared\Http2cat\Http2Utilities.cs (1)
123public static readonly byte[] _noData = Array.Empty<byte>();
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
IdeCoreBenchmarks (2)
SegmentedArrayBenchmarks_Indexer.cs (2)
46Array.Copy(_values, 1, _values, 0, _values.Length - 1); 64Array.Copy(_valuesObject, 1, _valuesObject, 0, _valuesObject.Length - 1);
IIS.FunctionalTests (7)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Shared\Http2cat\Http2Utilities.cs (1)
123public static readonly byte[] _noData = Array.Empty<byte>();
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
IIS.LongTests (7)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Shared\Http2cat\Http2Utilities.cs (1)
123public static readonly byte[] _noData = Array.Empty<byte>();
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
IIS.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
IIS.NewHandler.FunctionalTests (7)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Shared\Http2cat\Http2Utilities.cs (1)
123public static readonly byte[] _noData = Array.Empty<byte>();
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
IIS.NewShim.FunctionalTests (7)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Shared\Http2cat\Http2Utilities.cs (1)
123public static readonly byte[] _noData = Array.Empty<byte>();
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
IISExpress.FunctionalTests (7)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\ClientCertificateFixture.cs (1)
57Array.Clear(export, 0, export.Length);
src\Shared\Http2cat\Http2Utilities.cs (1)
123public static readonly byte[] _noData = Array.Empty<byte>();
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
illink (12)
ILLink.CodeFixProvider (1)
RequiresHelpers.cs (1)
17return Array.Empty<SyntaxNode>();
ILLink.RoslynAnalyzer (3)
src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (2)
34/// <see cref="System.Array.Empty{T}"/> 57/// <see cref="System.Array.CreateInstance(System.Type, int)"/>
TrimAnalysis\TrimAnalysisVisitor.cs (1)
110var elements = operation.Initializer?.ElementValues.Select(val => Visit(val, state)).ToArray() ?? System.Array.Empty<MultiValue>();
InMemory.FunctionalTests (9)
Http2\Http2WebSocketTests.cs (5)
127await SendDataAsync(1, Array.Empty<byte>(), endStream: true); 218await SendDataAsync(1, Array.Empty<byte>(), endStream: true); 253await SendDataAsync(3, Array.Empty<byte>(), endStream: true); 357await SendDataAsync(1, Array.Empty<byte>(), endStream: true); 661await SendDataAsync(1, Array.Empty<byte>(), endStream: true);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (3)
183byte[] certData = RespondEmpty ? Array.Empty<byte>() : authority.GetCertData(); 201byte[] crl = RespondEmpty ? Array.Empty<byte>() : authority.GetCrl(); 236byte[] ocspResponse = RespondEmpty ? Array.Empty<byte>() : authority.BuildOcspResponse(certId, nonce);
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
468if ((string[])ctx.Request.Headers[headerName] != Array.Empty<string>())
Interop.FunctionalTests (2)
SkipOnArchitectureAttribute.cs (1)
21public bool IsMet => (Array.IndexOf(_excludedArchitectures, RuntimeInformation.OSArchitecture) == -1);
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Metrics (65)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
Metrics.Legacy (65)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
Microsoft.Analyzers.Extra (1)
DiagDescriptors.cs (1)
143Array.Empty<string>());
Microsoft.Analyzers.Extra.Tests (2)
SyntaxNodeExtensionsTests.cs (2)
56Assert.Equal("a.AddA()", methodInvocSyntax?.FindNodeInTreeUpToSpecifiedParentByMethodName(model, new[] { parentToFind }, Array.Empty<Type>())?.ToString()); 93Assert.Null(methodInvocSyntax?.FindNodeInTreeUpToSpecifiedParentByMethodName(model, Array.Empty<string>(), typesToStopTraversing));
Microsoft.Analyzers.Local (3)
ApiLifecycle\Json\JsonObjectExtensions.cs (1)
17return Array.Empty<T>();
ApiLifecycle\Model\Assembly.cs (1)
25Types = Array.Empty<TypeDef>();
ApiLifecycle\Utils.cs (1)
21return Array.Empty<string>();
Microsoft.Analyzers.Local.Tests (25)
ApiLifecycle\AnalysisModelTest.cs (6)
28Assert.Equal(Array.Empty<Field>(), member.Fields); 29Assert.Equal(Array.Empty<string>(), member.BaseTypes); 30Assert.Equal(Array.Empty<string>(), member.Constraints); 31Assert.Equal(Array.Empty<Method>(), member.Methods); 32Assert.Equal(Array.Empty<Prop>(), member.Properties); 66Assert.Equal(Array.Empty<TypeDef>(), package.Types);
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (19)
150Array.Empty<string>(), 165Array.Empty<string>(), 179Array.Empty<string>(), 217Array.Empty<string>(), 236Array.Empty<string>(), 279Array.Empty<string>(), 298Array.Empty<string>(), 313Array.Empty<string>(), 328Array.Empty<string>(), 394Array.Empty<string>(), 435Array.Empty<string>(), 458Array.Empty<string>(), 498Array.Empty<string>(), 524Array.Empty<string>(), 685Array.Empty<string>(), 693Array.Empty<string>(), 717Array.Empty<string>(), 740Array.Empty<string>(), 763Array.Empty<string>(),
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
45filterCharacterRules: ImmutableArray.Create(CharacterSetModificationRule.Create(CharacterSetModificationKind.Replace, Array.Empty<char>())));
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
39filterCharacterRules: ImmutableArray.Create(CharacterSetModificationRule.Create(CharacterSetModificationKind.Replace, Array.Empty<char>())));
Microsoft.AspNetCore.App.Analyzers.Test (2)
Authorization\AddAuthorizationBuilderTests.cs (1)
740await VerifyCS.VerifyCodeFixAsync(fullSource, Array.Empty<DiagnosticResult>(), fullSource);
TestDiagnosticAnalyzer.cs (1)
168return GetDiagnosticsAsync(new[] { project }, Analyzer, Array.Empty<string>());
Microsoft.AspNetCore.Authentication.Core (2)
AuthenticationSchemeProvider.cs (2)
54private IEnumerable<AuthenticationScheme> _schemesCopy = Array.Empty<AuthenticationScheme>(); 55private IEnumerable<AuthenticationScheme> _requestHandlersCopy = Array.Empty<AuthenticationScheme>();
Microsoft.AspNetCore.Authentication.Test (1)
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Authorization (3)
AuthorizationFailure.cs (2)
27public IEnumerable<IAuthorizationRequirement> FailedRequirements { get; private set; } = Array.Empty<IAuthorizationRequirement>(); 32public IEnumerable<AuthorizationFailureReason> FailureReasons { get; private set; } = Array.Empty<AuthorizationFailureReason>();
AuthorizationHandlerContext.cs (1)
65=> (IEnumerable<AuthorizationFailureReason>?)_failedReasons ?? Array.Empty<AuthorizationFailureReason>();
Microsoft.AspNetCore.Authorization.Policy (3)
AuthorizationMiddleware.cs (3)
116var authorizeData = endpoint?.Metadata.GetOrderedMetadata<IAuthorizeData>() ?? Array.Empty<IAuthorizeData>(); 118var policies = endpoint?.Metadata.GetOrderedMetadata<AuthorizationPolicy>() ?? Array.Empty<AuthorizationPolicy>(); 122var requirementData = endpoint?.Metadata?.GetOrderedMetadata<IAuthorizationRequirementData>() ?? Array.Empty<IAuthorizationRequirementData>();
Microsoft.AspNetCore.Authorization.Test (4)
AuthorizationEndpointConventionBuilderExtensionsTests.cs (2)
38builder.RequireAuthorization(Array.Empty<IAuthorizeData>()); 76builder.RequireAuthorization(Array.Empty<string>());
ClaimsAuthorizationRequirementTests.cs (1)
45var requirement = CreateRequirement("Custom", Array.Empty<string>());
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.BrowserTesting (1)
BrowserManagerConfiguration.cs (1)
298false => Array.Empty<string>(),
Microsoft.AspNetCore.Components (30)
BindConverter.cs (1)
2035if (obj is not Array initialArray)
CascadingParameterState.cs (3)
41return Array.Empty<CascadingParameterState>(); 73return resultStates ?? (IReadOnlyList<CascadingParameterState>)Array.Empty<CascadingParameterState>(); 134return result?.ToArray() ?? Array.Empty<CascadingParameterInfo>();
ParameterView.cs (2)
22private static readonly ParameterView _empty = new ParameterView(ParameterViewLifetime.Unbound, _emptyFrames, 0, Array.Empty<CascadingParameterState>()); 30: this(lifetime, frames, ownerIndex, Array.Empty<CascadingParameterState>())
Rendering\ComponentState.cs (1)
213_cascadingParameters = (IReadOnlyList<CascadingParameterState>?)remainingCascadingParameters ?? Array.Empty<CascadingParameterState>();
RenderTree\ArrayBuilderSegment.cs (1)
34public T[] Array => _builder?.Buffer ?? System.Array.Empty<T>();
RenderTree\ArrayRange.cs (1)
43System.Array.Copy(Array, buffer, Count);
RenderTree\Renderer.cs (1)
107? Array.Empty<ICascadingValueSupplier>()
Routing\UrlValueConstraint.cs (3)
95public abstract Array ParseMultiple(StringSegmentAccumulator values, string destinationNameForMessage); 130public override Array ParseMultiple(StringSegmentAccumulator values, string destinationNameForMessage) 135return Array.Empty<T>();
src\Components\Shared\src\ArrayBuilder.cs (4)
37private static readonly T[] Empty = Array.Empty<T>(); 153Array.Copy(_items, index, _items, index + 1, _itemsInUse - index); 183Array.Copy(_items, newItems, _itemsInUse); 196Array.Clear(_items, 0, _itemsInUse);
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (9)
108_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 175_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 254_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 404Array.Clear(_arrayStorage, 0, _count); 460Array.Copy(storage, 0, array, arrayIndex, _count); 497Array.Copy(array, index + 1, array, index, _count - index); 528Array.Copy(array, index + 1, array, index, _count - index); 568Array.Copy(array, index + 1, array, index, _count - index); 698Array.Copy(_arrayStorage, 0, array, 0, _count);
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
112var arguments = argumentString?.Split(',', StringSplitOptions.TrimEntries) ?? Array.Empty<string>();
src\Http\Routing\src\Patterns\RouteParameterParser.cs (1)
22return new RoutePatternParameterPart(string.Empty, null, RoutePatternParameterKind.Standard, Array.Empty<RoutePatternParameterPolicyReference>());
src\Http\Routing\src\Patterns\RoutePatternFactory.cs (2)
540(IReadOnlyList<RoutePatternParameterPart>?)parameters ?? Array.Empty<RoutePatternParameterPart>(), 638parameterConstraints?.ToArray() ?? Array.Empty<RoutePatternParameterPolicyReference>(),
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (2)
21return GetDiagnosticsAsync(sources: new[] { source }, Analyzer, Array.Empty<string>()); 26return GetDiagnosticsAsync(new[] { project }, Analyzer, Array.Empty<string>());
Microsoft.AspNetCore.Components.Endpoints (22)
Discovery\ComponentCollectionBuilder.cs (1)
56return Array.Empty<ComponentInfo>();
Discovery\PageCollectionBuilder.cs (1)
55return Array.Empty<PageComponentInfo>();
Discovery\PageComponentBuilder.cs (1)
17private IReadOnlyList<string> _routeTemplates = Array.Empty<string>();
FormMapping\Converters\CollectionAdapters\ArrayCollectionFactory.cs (1)
11Array.Copy(buffer, result, size);
FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (1)
19Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (15)
159Array.Empty<Type>(), 185Array.Empty<Type>(), 287Array.Empty<Type>(), 297Array.Empty<Type>(), 304Array.Empty<Type>(), 314Array.Empty<Type>(), 361Array.Empty<Expression>())); 379Array.Empty<Type>(), 398Array.Empty<Type>(), 406Array.Empty<Type>(), 461Array.Empty<Expression>())); 483Array.Empty<Type>(), 501Array.Empty<Type>(), 509Array.Empty<Type>(), 552Expression.Not(Expression.Call(readerParam, nameof(FormDataReader.CurrentPrefixExists), Array.Empty<Type>())),
FormMapping\PrefixResolver.cs (2)
25Array.Sort(_sortedKeys, 0, count, FormKeyComparer.SortCriteria); 34return Array.BinarySearch(_sortedKeys, 0, _length, new FormKey(currentPrefixBuffer), FormKeyComparer.PrefixCriteria) >= 0;
Microsoft.AspNetCore.Components.Endpoints.Tests (28)
Binding\FormDataMapperTests.cs (2)
2346Array.Copy(buffer.Data, newBuffer, buffer.Data.Length); 2358Array.Copy(buffer.Data, result, buffer.Count);
Binding\PrefixResolverTests.cs (1)
25var prefixResolver = new PrefixResolver(Array.Empty<FormKey>(), 1);
HotReloadServiceTests.cs (1)
204Array.Empty<PageComponentBuilder>(),
RazorComponentEndpointDataSourceTest.cs (16)
52Array.Empty<IComponentRenderMode>(), 80Array.Empty<IComponentRenderMode>(), 109Array.Empty<IComponentRenderMode>(), 144Array.Empty<IComponentRenderMode>(), 145Array.Empty<Type>(), 150Array.Empty<IComponentRenderMode>(), 156Array.Empty<IComponentRenderMode>(), 163Array.Empty<IComponentRenderMode>(), 164Array.Empty<Type>(), 169Array.Empty<IComponentRenderMode>(), 177Array.Empty<Type>() 182Array.Empty<IComponentRenderMode>(), 183Array.Empty<Type>(), 189Array.Empty<IComponentRenderMode>(), 198Array.Empty<Type>() 207Array.Empty<PageComponentBuilder>(),
RazorComponentEndpointFactoryTest.cs (8)
71Array.Empty<object>()), 74new ConfiguredRenderModesMetadata(Array.Empty<IComponentRenderMode>())); 99Array.Empty<object>()), 102new ConfiguredRenderModesMetadata(Array.Empty<IComponentRenderMode>())); 127Array.Empty<object>()), 130new ConfiguredRenderModesMetadata(Array.Empty<IComponentRenderMode>())); 159Array.Empty<object>()), 162new ConfiguredRenderModesMetadata(Array.Empty<IComponentRenderMode>()));
Microsoft.AspNetCore.Components.Forms (1)
ValidationMessageStore.cs (1)
65=> _messages.TryGetValue(fieldIdentifier, out var messages) ? messages : Array.Empty<string>();
Microsoft.AspNetCore.Components.Forms.Tests (2)
ExpressionFormatterTest.cs (2)
190public Person[] Children { get; init; } = Array.Empty<Person>(); 192public IReadOnlyList<string> Nicknames { get; init; } = Array.Empty<string>();
Microsoft.AspNetCore.Components.Performance (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Components.QuickGrid (3)
GridItemsProviderRequest.cs (1)
69SortByColumn?.SortBy?.ToPropertyList(SortByAscending) ?? Array.Empty<SortedProperty>();
QuickGrid.razor.cs (2)
118private ICollection<TGridItem> _currentNonVirtualizedViewItems = Array.Empty<TGridItem>(); 413return GridItemsProviderResult.From(Array.Empty<TGridItem>(), 0);
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (2)
21return GetDiagnosticsAsync(sources: new[] { source }, Analyzer, Array.Empty<string>()); 26return GetDiagnosticsAsync(new[] { project }, Analyzer, Array.Empty<string>());
Microsoft.AspNetCore.Components.Server (8)
BlazorPack\BlazorPackHubProtocolWorker.cs (1)
46return Array.Empty<byte>();
Circuits\CircuitIdFactory.cs (2)
38Array.Copy( 70Array.Copy(
src\Components\Shared\src\ArrayBuilder.cs (4)
37private static readonly T[] Empty = Array.Empty<T>(); 153Array.Copy(_items, index, _items, index + 1, _itemsInUse - index); 183Array.Copy(_items, newItems, _itemsInUse); 196Array.Clear(_items, 0, _itemsInUse);
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.Components.Server.Tests (19)
Circuits\CircuitClientProxyTest.cs (1)
26var sendTask = circuitClient.SendCoreAsync("test", Array.Empty<object>());
Circuits\CircuitPersistenceManagerTest.cs (1)
439var circuitHandlers = Array.Empty<CircuitHandler>();
Circuits\RemoteJSDataStreamTest.cs (1)
125var chunk = Array.Empty<byte>();
Circuits\RemoteJSRuntimeTest.cs (2)
66jsRuntime.TestReceiveByteArray(id: 0, Array.Empty<byte>()); 70jsRuntime.TestReceiveByteArray(i, Array.Empty<byte>());
Circuits\ServerComponentDeserializerTest.cs (2)
428new ServerComponent(0, null, assembly, type, Array.Empty<ComponentParameter>(), Array.Empty<object>(), Guid.NewGuid()),
Circuits\TestCircuitHost.cs (1)
64handlers ??= Array.Empty<CircuitHandler>();
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
101var populatedMetadata = Array.Empty<string>();
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (9)
65message: new InvocationMessage("xyz", "method", Array.Empty<object>()), 69message: new InvocationMessage("method", Array.Empty<object>()), 81message: new InvocationMessage(null, "Target", Array.Empty<object>(), new string[] { "__test_id__" }), 89message: new InvocationMessage(null, "Target", Array.Empty<object>(), new string[] { "__test_id__", "__test_id2__" }), 147message: new StreamInvocationMessage("xyz", "method", Array.Empty<object>()), 155message: new StreamInvocationMessage("xyz", "method", Array.Empty<object>(), new string[] { "__test_id__" }), 239var expectedMessage = new InvocationMessage("xyz", "method", Array.Empty<object>()); 428new MessageSizeTestData("StreamInvocationMessage", new StreamInvocationMessage("1", "target", Array.Empty<object>()), 15), 429new MessageSizeTestData("StreamInvocationMessage_WithStreamId", new StreamInvocationMessage("1", "target", Array.Empty<object>(), new [] { "2" }), 17),
Microsoft.AspNetCore.Components.Tests (41)
RendererTest.cs (20)
260[1] = CreateRenderFactory(Array.Empty<int>()) 419[1] = CreateRenderFactory(Array.Empty<int>()) 463[1] = CreateRenderFactory(Array.Empty<int>()) 522[2] = CreateRenderFactory(Array.Empty<int>()), 523[3] = CreateRenderFactory(Array.Empty<int>()) 3567[0] = CreateRenderFactory(Array.Empty<int>()), 3600[0] = CreateRenderFactory(Array.Empty<int>()), 3633[0] = CreateRenderFactory(Array.Empty<int>()), 3671[0] = CreateRenderFactory(Array.Empty<int>()), 3753[0] = Array.Empty<NestedAsyncComponent.ExecutionAction>(), 3782[1] = CreateRenderFactory(Array.Empty<int>()), 3783[2] = CreateRenderFactory(Array.Empty<int>()), 3811[0] = Array.Empty<NestedAsyncComponent.ExecutionAction>(), 3838[1] = CreateRenderFactory(Array.Empty<int>()), 3839[2] = CreateRenderFactory(Array.Empty<int>()), 3893[1] = CreateRenderFactory(Array.Empty<int>()), 3949[1] = CreateRenderFactory(Array.Empty<int>()), 4061[0] = CreateRenderFactory(Array.Empty<int>()), 4095[0] = CreateRenderFactory(Array.Empty<int>()), 4137[0] = CreateRenderFactory(Array.Empty<int>()),
Rendering\ArrayBuilderSegmentTest.cs (1)
44Array.Clear(originalBuffer, 0, originalBuffer.Length); // Extra proof that we're not using the original storage
Routing\QueryParameterValueSupplierTest.cs (17)
135AssertKeyValuePair<bool[]>("BoolVals", Array.Empty<bool>()); 136AssertKeyValuePair<DateTime[]>("DateTimeVals", Array.Empty<DateTime>()); 137AssertKeyValuePair<decimal[]>("DecimalVals", Array.Empty<decimal>()); 138AssertKeyValuePair<double[]>("DoubleVals", Array.Empty<double>()); 139AssertKeyValuePair<float[]>("FloatVals", Array.Empty<float>()); 140AssertKeyValuePair<Guid[]>("GuidVals", Array.Empty<Guid>()); 141AssertKeyValuePair<int[]>("IntVals", Array.Empty<int>()); 142AssertKeyValuePair<long[]>("LongVals", Array.Empty<long>()); 143AssertKeyValuePair<bool?[]>("NullableBoolVals", Array.Empty<bool?>()); 144AssertKeyValuePair<DateTime?[]>("NullableDateTimeVals", Array.Empty<DateTime?>()); 145AssertKeyValuePair<decimal?[]>("NullableDecimalVals", Array.Empty<decimal?>()); 146AssertKeyValuePair<double?[]>("NullableDoubleVals", Array.Empty<double?>()); 147AssertKeyValuePair<float?[]>("NullableFloatVals", Array.Empty<float?>()); 148AssertKeyValuePair<Guid?[]>("NullableGuidVals", Array.Empty<Guid?>()); 149AssertKeyValuePair<int?[]>("NullableIntVals", Array.Empty<int?>()); 150AssertKeyValuePair<long?[]>("NullableLongVals", Array.Empty<long?>()); 151AssertKeyValuePair<string[]>("StringVals", Array.Empty<string>());
Routing\RouteTableFactoryTests.cs (1)
83var routeTable = routeTableFactory.Create(new RouteKey(GetType().Assembly, Array.Empty<Assembly>()), _serviceProvider);
Routing\TemplateParserTests.cs (1)
267Array.Empty<RoutePatternParameterPolicyReference>())
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Components.Web (9)
Forms\HtmlFieldPrefix.cs (1)
10private readonly LambdaExpression[] _rest = Array.Empty<LambdaExpression>();
Forms\Mapping\FormMappingContext.cs (2)
59return Array.Empty<FormMappingError>(); 74Array.Empty<FormMappingError>();
Web\DataTransfer.cs (3)
29public string[] Files { get; set; } = Array.Empty<string>(); 34public DataTransferItem[] Items { get; set; } = Array.Empty<DataTransferItem>(); 39public string[] Types { get; set; } = Array.Empty<string>();
Web\TouchEventArgs.cs (3)
19public TouchPoint[] Touches { get; set; } = Array.Empty<TouchPoint>(); 24public TouchPoint[] TargetTouches { get; set; } = Array.Empty<TouchPoint>(); 32public TouchPoint[] ChangedTouches { get; set; } = Array.Empty<TouchPoint>();
Microsoft.AspNetCore.Components.Web.Tests (5)
Forms\HtmlFieldPrefixTest.cs (2)
103public Person[] Children { get; init; } = Array.Empty<Person>(); 105public IReadOnlyList<string> Nicknames { get; init; } = Array.Empty<string>();
Forms\InputFileChangeEventArgsTest.cs (3)
11var emptySet = new InputFileChangeEventArgs(Array.Empty<IBrowserFile>()); 29var instance = new InputFileChangeEventArgs(Array.Empty<IBrowserFile>()); 45var instance = new InputFileChangeEventArgs(Array.Empty<IBrowserFile>());
Microsoft.AspNetCore.Components.WebAssembly (2)
src\Components\Shared\src\TransmitDataStreamToJS.cs (2)
28await runtime.InvokeVoidAsync(methodIdentifier, streamId, Array.Empty<byte>(), 0, null); 35await runtime.InvokeVoidAsync(methodIdentifier, streamId, Array.Empty<byte>(), 0, ex.Message);
Microsoft.AspNetCore.Components.WebView (8)
src\Components\Shared\src\ArrayBuilder.cs (4)
37private static readonly T[] Empty = Array.Empty<T>(); 153Array.Copy(_items, index, _items, index + 1, _itemsInUse - index); 183Array.Copy(_items, newItems, _itemsInUse); 196Array.Clear(_items, 0, _itemsInUse);
src\Components\Shared\src\TransmitDataStreamToJS.cs (2)
28await runtime.InvokeVoidAsync(methodIdentifier, streamId, Array.Empty<byte>(), 0, null); 35await runtime.InvokeVoidAsync(methodIdentifier, streamId, Array.Empty<byte>(), 0, ex.Message);
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
83return new StaticWebAssetsDirectoryContents((files as IEnumerable<IFileInfo>) ?? Array.Empty<IFileInfo>()); 313public string[] ContentRoots { get; set; } = Array.Empty<string>();
Microsoft.AspNetCore.Components.WebView.WindowsForms (2)
BlazorWebView.cs (2)
229 var newItems = (eventArgs.NewItems ?? Array.Empty<object>()).Cast<RootComponent>(); 230 var oldItems = (eventArgs.OldItems ?? Array.Empty<object>()).Cast<RootComponent>();
Microsoft.AspNetCore.Components.WebView.Wpf (2)
BlazorWebView.cs (2)
316 var newItems = (eventArgs.NewItems ?? Array.Empty<RootComponent>()).Cast<RootComponent>(); 317 var oldItems = (eventArgs.OldItems ?? Array.Empty<RootComponent>()).Cast<RootComponent>();
Microsoft.AspNetCore.ConcurrencyLimiter.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Cryptography.KeyDerivation (1)
PBKDF2\ManagedPbkdf2Provider.cs (1)
89Array.Clear(passwordBytes, 0, passwordBytes.Length);
Microsoft.AspNetCore.DataProtection (13)
AuthenticatedEncryption\ConfigurationModel\SecretExtensions.cs (2)
33Array.Clear(unprotectedSecretRawBytes, 0, unprotectedSecretRawBytes.Length); 59Array.Clear(unprotectedSecret, 0, unprotectedSecret.Length);
Cng\DpapiSecretSerializerHelper.cs (2)
61Array.Clear(plaintextSecret, 0, plaintextSecret.Length); 139Array.Clear(plaintextSecret, 0, plaintextSecret.Length);
KeyManagement\KeyRingBasedDataProtector.cs (1)
54Array.Copy(originalPurposes, 0, newPurposes, 0, originalPurposes.Length);
Managed\AesGcmAuthenticatedEncryptor.cs (4)
132Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 133Array.Clear(derivedKey, 0, derivedKey.Length); 208Array.Clear(decryptedKdk, 0, decryptedKdk.Length); 209Array.Clear(derivedKey, 0, derivedKey.Length);
Managed\ManagedAuthenticatedEncryptor.cs (1)
74var EMPTY_ARRAY = Array.Empty<byte>();
RegistryPolicyResolver.cs (1)
104Array.Empty<IKeyEscrowSink>() :
XmlEncryption\XmlEncryptionExtensions.cs (2)
176Array.Clear(underlyingBuffer, 0, underlyingBuffer.Length); 197Array.Clear(plaintextSecret, 0, plaintextSecret.Length);
Microsoft.AspNetCore.DataProtection.Abstractions (2)
src\Shared\WebEncoders\WebEncoders.cs (2)
72return Array.Empty<byte>(); 129return Array.Empty<byte>();
Microsoft.AspNetCore.DataProtection.Tests (1)
KeyManagement\KeyRingProviderTests.cs (1)
155var allKeys1 = Array.Empty<IKey>();
Microsoft.AspNetCore.DeveloperCertificates.XPlat (8)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
Microsoft.AspNetCore.Diagnostics (2)
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
26return Array.Empty<StackFrameInfo>(); 36return Array.Empty<StackFrameInfo>();
Microsoft.AspNetCore.Diagnostics.HealthChecks (4)
Builder\HealthCheckApplicationBuilderExtensions.cs (3)
38UseHealthChecksCore(app, path, port: null, Array.Empty<object>()); 89UseHealthChecksCore(app, path, port, Array.Empty<object>()); 122UseHealthChecksCore(app, path, portAsInt, Array.Empty<object>());
Builder\HealthCheckEndpointRouteBuilderExtensions.cs (1)
65var args = options != null ? new[] { Options.Create(options) } : Array.Empty<object>();
Microsoft.AspNetCore.Diagnostics.Middleware (4)
Logging\HttpLoggingTagNames.cs (1)
64Array.AsReadOnly(new[]
src\Shared\BufferWriterPool\BufferWriter.cs (3)
36private T[] _buffer = Array.Empty<T>(); 76Array.Resize(ref _buffer, value); 185Array.Resize(ref _buffer, targetCapacity);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Latency\RequestLatencyTelemetryMiddlewareTests.cs (1)
151Array.Empty<ILatencyDataExporter>(),
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.AspNetCore.Diagnostics.Tests (1)
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
src\Grpc\JsonTranscoding\src\Shared\Server\BindMethodFinder.cs (2)
61Array.Empty<ParameterModifier>()); 88Array.Empty<ParameterModifier>());
src\Grpc\JsonTranscoding\src\Shared\X509CertificateHelpers.cs (2)
43return Array.Empty<string>(); 67return Array.Empty<string>();
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
ServerStreamingServerCallHandlerTests.cs (1)
335serviceOptions.Interceptors.Add(interceptor.Type, interceptor.Args ?? Array.Empty<object>());
UnaryServerCallHandlerTests.cs (2)
1407interceptors.Add((typeof(TestInterceptor), Args: Array.Empty<object>())); 1838serviceOptions.Interceptors.Add(interceptor.Type, interceptor.Args ?? Array.Empty<object>());
Microsoft.AspNetCore.Grpc.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcDataContractResolver.cs (1)
69dataContract = DataContract.ForObject(messageDescriptor.ClrType, Array.Empty<DataProperty>(), extensionDataType: typeof(Value));
Microsoft.AspNetCore.HeaderParsing (2)
HeaderParsingFeature.cs (2)
25private Box?[] _boxes = Array.Empty<Box?>(); 64Array.Resize(ref _boxes, header.Position + 1);
Microsoft.AspNetCore.Hosting (6)
Internal\WebHostOptions.cs (1)
80?? Array.Empty<string>();
src\Shared\ErrorPage\ErrorPageModelBuilder.cs (1)
44errorDetails = Array.Empty<ExceptionDetails>();
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
26return Array.Empty<StackFrameInfo>(); 36return Array.Empty<StackFrameInfo>();
src\Shared\StaticWebAssets\ManifestStaticWebAssetFileProvider.cs (2)
83return new StaticWebAssetsDirectoryContents((files as IEnumerable<IFileInfo>) ?? Array.Empty<IFileInfo>()); 313public string[] ContentRoots { get; set; } = Array.Empty<string>();
Microsoft.AspNetCore.Hosting.Tests (1)
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Hosting.WindowsServices (1)
WebHostService.cs (1)
33internal void Start() => OnStart(Array.Empty<string>());
Microsoft.AspNetCore.Http (12)
FormCollection.cs (1)
22private static readonly string[] EmptyKeys = Array.Empty<string>();
HeaderDictionary.cs (2)
20private static readonly string[] EmptyKeys = Array.Empty<string>(); 21private static readonly StringValues[] EmptyValues = Array.Empty<StringValues>();
Internal\RequestCookieCollection.cs (1)
20private static readonly string[] EmptyKeys = Array.Empty<string>();
QueryCollection.cs (1)
22private static readonly string[] EmptyKeys = Array.Empty<string>();
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (7)
74_arrayStorage = Array.Empty<KeyValuePair<TKey, TValue>>(); 258Array.Clear(_arrayStorage, 0, _count); 310Array.Copy(storage, 0, array, arrayIndex, _count); 359Array.Copy(array, index + 1, array, index, _count - index); 391Array.Copy(array, index + 1, array, index, _count - index); 432Array.Copy(array, index + 1, array, index, _count - index); 534Array.Copy(_arrayStorage, 0, array, 0, _count);
Microsoft.AspNetCore.Http.Abstractions (21)
Extensions\UseMiddlewareExtensions.cs (1)
130Array.Copy(_args, 0, ctorArgs, 1, _args.Length);
Routing\EndpointMetadataCollection.cs (2)
27public static readonly EndpointMetadataCollection Empty = new EndpointMetadataCollection(Array.Empty<object>()); 124var results = matches == null ? Array.Empty<T>() : matches.ToArray();
Routing\RouteValueDictionary.cs (18)
108_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 154_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 158_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 175_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 192_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 208_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 215_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 231_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 240Array.Copy(other, 0, storage, 0, count); 246_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 254_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 398_arrayStorage = Array.Empty<KeyValuePair<string, object?>>(); 404Array.Clear(_arrayStorage, 0, _count); 460Array.Copy(storage, 0, array, arrayIndex, _count); 497Array.Copy(array, index + 1, array, index, _count - index); 528Array.Copy(array, index + 1, array, index, _count - index); 568Array.Copy(array, index + 1, array, index, _count - index); 698Array.Copy(_arrayStorage, 0, array, 0, _count);
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
EndpointMetadataCollectionTests.cs (1)
54Assert.Same(Array.Empty<string>(), ordered);
HttpResponseWritingExtensionsTests.cs (1)
65Array.Copy(actual, actualShortened, length);
RouteValueDictionaryTests.cs (2)
2110var array = Array.Empty<KeyValuePair<string, object?>>(); 2157Assert.Same(Array.Empty<KeyValuePair<string, object?>>(), value._arrayStorage);
Microsoft.AspNetCore.Http.Connections (3)
src\Shared\WebEncoders\WebEncoders.cs (2)
72return Array.Empty<byte>(); 129return Array.Empty<byte>();
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.Http.Connections.Tests (7)
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (5)
37Array.Copy(data, 0, startSegment, 10, data.Length); 52Array.Copy(data, 0, startSegment, 10, data.Length); 67Array.Copy(data, 0, startSegment, 10, data.Length); 96segments.Add(Array.Empty<byte>()); 100segments.Add(Array.Empty<byte>());
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
TestWebSocketConnectionFeature.cs (1)
222Buffer = Array.Empty<byte>(),
Microsoft.AspNetCore.Http.Extensions (44)
HeaderDictionaryTypeExtensions.cs (7)
154MediaTypeHeaderValue.TryParseList(value, out var result) ? result : Array.Empty<MediaTypeHeaderValue>(); 157StringWithQualityHeaderValue.TryParseList(value, out var result) ? result : Array.Empty<StringWithQualityHeaderValue>(); 160CookieHeaderValue.TryParseList(value, out var result) ? result : Array.Empty<CookieHeaderValue>(); 163EntityTagHeaderValue.TryParseList(value, out var result) ? result : Array.Empty<EntityTagHeaderValue>(); 166SetCookieHeaderValue.TryParseList(value, out var result) ? result : Array.Empty<SetCookieHeaderValue>(); 233return Array.Empty<T>(); 331return Array.Empty<T>();
RequestDelegateFactory.cs (3)
66private static readonly MethodInfo ArrayEmptyOfObjectMethod = typeof(Array).GetMethod(nameof(Array.Empty), BindingFlags.Public | BindingFlags.Static)!.MakeGenericMethod(new Type[] { typeof(object) }); 651return Array.Empty<Expression>();
RequestDelegateFactoryContext.cs (2)
57public Type[] ArgumentTypes { get; set; } = Array.Empty<Type>(); 59public Expression[] BoxedArgs { get; set; } = Array.Empty<Expression>();
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ArrayCollectionFactory.cs (1)
11Array.Copy(buffer, result, size);
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\ArrayPoolBufferAdapter.cs (1)
19Array.Copy(buffer.Data, newBuffer, buffer.Data.Length);
src\Components\Endpoints\src\FormMapping\Factories\ComplexType\ComplexTypeExpressionConverterFactoryOfT.cs (15)
159Array.Empty<Type>(), 185Array.Empty<Type>(), 287Array.Empty<Type>(), 297Array.Empty<Type>(), 304Array.Empty<Type>(), 314Array.Empty<Type>(), 361Array.Empty<Expression>())); 379Array.Empty<Type>(), 398Array.Empty<Type>(), 406Array.Empty<Type>(), 461Array.Empty<Expression>())); 483Array.Empty<Type>(), 501Array.Empty<Type>(), 509Array.Empty<Type>(), 552Expression.Not(Expression.Call(readerParam, nameof(FormDataReader.CurrentPrefixExists), Array.Empty<Type>())),
src\Components\Endpoints\src\FormMapping\PrefixResolver.cs (2)
25Array.Sort(_sortedKeys, 0, count, FormKeyComparer.SortCriteria); 34return Array.BinarySearch(_sortedKeys, 0, _length, new FormKey(currentPrefixBuffer), FormKeyComparer.PrefixCriteria) >= 0;
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (6)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
src\Shared\ParameterBindingMethodCache.cs (1)
321return (constructor, Array.Empty<ConstructorParameter>());
src\Shared\PropertyAsParameterInfo.cs (6)
71return Array.Empty<ParameterInfo>(); 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 181_constructionParameterInfo?.GetCustomAttributesData() ?? Array.Empty<CustomAttributeData>());
Microsoft.AspNetCore.Http.Extensions.Tests (6)
ProblemDetailsServiceTest.cs (1)
135writers ??= Array.Empty<IProblemDetailsWriter>();
RequestDelegateFactoryTests.cs (3)
291RequestDelegateFactory.Create(([FromRoute] int id) => { }, new() { RouteParameterNames = Array.Empty<string>() })); 340new object?[] { (Action<HttpContext, int[]>)Store, new string[] {}, Array.Empty<int>() }, 1569RouteParameterNames = routeParam is not null ? new[] { paramName } : Array.Empty<string>()
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
95return Array.Empty<RequestDelegateGenerator.StaticRouteHandlerModel.Endpoint>();
RequestDelegateGenerator\RequestDelegateCreationTests.Arrays.cs (1)
147new object[] { "int[]", new string[] {}, Array.Empty<int>() },
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
95return Array.Empty<RequestDelegateGenerator.StaticRouteHandlerModel.Endpoint>();
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\Endpoint.cs (1)
101public EndpointParameter[] Parameters { get; } = Array.Empty<EndpointParameter>();
Microsoft.AspNetCore.Http.Results (8)
ChallengeHttpResult.cs (2)
20: this(Array.Empty<string>()) 62public IReadOnlyList<string> AuthenticationSchemes { get; internal init; } = Array.Empty<string>();
ForbidHttpResult.cs (2)
20: this(Array.Empty<string>()) 41: this(Array.Empty<string>(), properties)
SignOutHttpResult.cs (1)
20: this(Array.Empty<string>())
TypedResults.cs (3)
42=> new(authenticationSchemes: authenticationSchemes ?? Array.Empty<string>(), properties); 60=> new(authenticationSchemes: authenticationSchemes ?? Array.Empty<string>(), properties); 86=> new(authenticationSchemes ?? Array.Empty<string>(), properties);
Microsoft.AspNetCore.Http.Results.Tests (2)
FileContentResultTests.cs (2)
45var result = Assert.IsAssignableFrom<IFileHttpResult>(new FileContentHttpResult(Array.Empty<byte>(), contentType) { FileDownloadName = downloadName }); 58var result = Assert.IsAssignableFrom<IContentTypeHttpResult>(new FileContentHttpResult(Array.Empty<byte>(), contentType) { FileDownloadName = downloadName });
Microsoft.AspNetCore.Http.Tests (5)
HeaderDictionaryTests.cs (3)
126Assert.Same(Array.Empty<string>(), (string[])emptyHeaders["Header1"]); 129Assert.Same(Array.Empty<string>(), (string[])asIHeaderDictionary["Header1"]); 130Assert.Same(Array.Empty<string>(), (string[])asIHeaderDictionary.Host);
QueryCollectionTests.cs (2)
17Assert.Same(Array.Empty<string>(), (string[])query["query1"]); 20Assert.Same(Array.Empty<string>(), (string[])QueryCollection.Empty["query1"]);
Microsoft.AspNetCore.HttpLogging (2)
src\Shared\Buffers\BufferSegmentStack.cs (1)
61Array.Resize(ref _array, 2 * _array.Length);
W3CLoggingMiddleware.cs (1)
244var src = Array.Empty<char>();
Microsoft.AspNetCore.HttpLogging.Tests (6)
HttpLoggingMiddlewareTests.cs (6)
45Array.Empty<IHttpLoggingInterceptor>(), 55Array.Empty<IHttpLoggingInterceptor>(), 65Array.Empty<IHttpLoggingInterceptor>(), 85Array.Empty<IHttpLoggingInterceptor>(), 95Array.Empty<IHttpLoggingInterceptor>(), 2115interceptor == null ? Array.Empty<IHttpLoggingInterceptor>() : [interceptor],
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
498Array.Copy(forwarded, remaining, newLength);
Microsoft.AspNetCore.Identity (3)
IdentityApiEndpointRouteBuilderExtensions.cs (1)
443Array.Copy(descriptions, newDescriptions, descriptions.Length);
SignInManager.cs (2)
202IList<Claim> claims = Array.Empty<Claim>(); 244IList<Claim> additionalClaims = Array.Empty<Claim>();
Microsoft.AspNetCore.Identity.FunctionalTests (1)
src\Identity\Extensions.Core\src\Base32.cs (1)
80return Array.Empty<byte>();
Microsoft.AspNetCore.Identity.Test (2)
SignInManagerTest.cs (1)
675.ReturnsAsync(hasValidProviders ? new string[1] { "Fake" } : Array.Empty<string>())
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.InternalTesting.Tests (2)
TestableAssembly.cs (2)
77var factConstructor = typeof(FactAttribute).GetConstructor(Array.Empty<Type>()); 78var factBuilder = new CustomAttributeBuilder(factConstructor, Array.Empty<object>());
Microsoft.AspNetCore.Mvc.Abstractions (7)
Abstractions\ActionDescriptor.cs (4)
50public IList<object> EndpointMetadata { get; set; } = Array.Empty<ParameterDescriptor>(); 55public IList<ParameterDescriptor> Parameters { get; set; } = Array.Empty<ParameterDescriptor>(); 60public IList<ParameterDescriptor> BoundProperties { get; set; } = Array.Empty<ParameterDescriptor>(); 65public IList<FilterDescriptor> FilterDescriptors { get; set; } = Array.Empty<FilterDescriptor>();
ActionConstraints\ActionConstraintContext.cs (1)
17public IReadOnlyList<ActionSelectorCandidate> Candidates { get; set; } = Array.Empty<ActionSelectorCandidate>();
ModelBinding\ValueProviderResult.cs (1)
33public static ValueProviderResult None = new ValueProviderResult(Array.Empty<string>());
src\Shared\ParameterBindingMethodCache.cs (1)
321return (constructor, Array.Empty<ConstructorParameter>());
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
AddResponseTypeAttributeCodeFixAction.cs (1)
176return Array.Empty<(int, ITypeSymbol?)>();
SymbolApiResponseMetadataProvider.cs (1)
80return Array.Empty<DeclaredApiResponseMetadata>();
Microsoft.AspNetCore.Mvc.ApiExplorer (7)
EndpointModelMetadata.cs (1)
53public override IReadOnlyList<object> ValidatorMetadata { get; } = Array.Empty<object>();
src\Shared\PropertyAsParameterInfo.cs (6)
71return Array.Empty<ParameterInfo>(); 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 181_constructionParameterInfo?.GetCustomAttributesData() ?? Array.Empty<CustomAttributeData>());
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (22)
EndpointMetadataApiDescriptionProviderTest.cs (22)
40var apiDescriptions = GetApiDescriptions(() => { }, "/", Array.Empty<string>()); 1053var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1078var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1103var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1129var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1179var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1216var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1250var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1279var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1309var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1341var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1373var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1405var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1434var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1463var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1551var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1580var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1620var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1649var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1680var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1714var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); 1748var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>());
Microsoft.AspNetCore.Mvc.Core (49)
ApiBehaviorOptions.cs (1)
17private readonly IReadOnlyList<ICompatibilitySwitch> _switches = Array.Empty<ICompatibilitySwitch>();
ApplicationParts\RelatedAssemblyAttribute.cs (3)
59return Array.Empty<Assembly>(); 65return Array.Empty<Assembly>(); 76return Array.Empty<Assembly>();
Authorization\AuthorizeFilter.cs (1)
146var endpointAuthorizeData = endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>() ?? Array.Empty<IAuthorizeData>();
BindAttribute.cs (1)
79=> original?.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>();
ChallengeResult.cs (2)
20: this(Array.Empty<string>()) 51: this(Array.Empty<string>(), properties)
Filters\FilterFactory.cs (1)
121return Array.Empty<IFilterMetadata>();
ForbidResult.cs (2)
20: this(Array.Empty<string>()) 51: this(Array.Empty<string>(), properties)
Formatters\TextOutputFormatter.cs (1)
178return Array.Empty<StringWithQualityHeaderValue>();
Infrastructure\ActionSelectionTable.cs (1)
183return Array.Empty<TItem>();
Infrastructure\ControllerEndpointFilterInvocationContext.cs (1)
27Arguments = arguments ?? Array.Empty<object?>();
Infrastructure\DefaultApiProblemDetailsWriter.cs (1)
80Array.Empty<IOutputFormatter>(),
Infrastructure\ObjectResultExecutor.cs (1)
93(IList<IOutputFormatter>)result.Formatters ?? Array.Empty<IOutputFormatter>(),
ModelBinding\Binders\ArrayModelBinder.cs (1)
96return Array.Empty<TElement>();
ModelBinding\Binders\ComplexObjectModelBinderProvider.cs (2)
46return Array.Empty<IModelBinder>(); 50Array.Empty<IModelBinder>() :
ModelBinding\Binders\FormCollectionModelBinder.cs (1)
94IReadOnlyList<IFormFile> IFormFileCollection.GetFiles(string name) => Array.Empty<IFormFile>();
ModelBinding\Binders\HeaderModelBinder.cs (1)
106var values = Array.Empty<string>();
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
511var parameters = defaultModelMetadata.BoundConstructor?.BoundConstructorParameters ?? Array.Empty<ModelMetadata>();
ModelBinding\Metadata\ModelAttributes.cs (2)
16internal static readonly ModelAttributes Empty = new ModelAttributes(Array.Empty<object>()); 71Attributes = Array.Empty<object>();
ModelBinding\ModelBindingHelper.cs (4)
633var valueAsArray = value as Array; 640var converted = (IList)Array.CreateInstance(destinationElementType, valueAsArray.Length); 652var converted = (IList)Array.CreateInstance(destinationElementType, 1);
ModelBinding\PrefixContainer.cs (2)
32_sortedValues = Array.Empty<string>(); 38Array.Sort(_sortedValues, StringComparer.OrdinalIgnoreCase);
ModelBinding\Validation\ClientValidatorCache.cs (1)
124return Array.Empty<IClientModelValidator>();
ModelBinding\Validation\DefaultComplexObjectValidationStrategy.cs (1)
57_parameters = Array.Empty<ModelMetadata>();
ModelBinding\Validation\ValidatorCache.cs (1)
113return Array.Empty<IModelValidator>();
MvcOptions.cs (1)
28private readonly IReadOnlyList<ICompatibilitySwitch> _switches = Array.Empty<ICompatibilitySwitch>();
Routing\ActionConstraintMatcherPolicy.cs (1)
139IReadOnlyList<IActionConstraint>? constraints = Array.Empty<IActionConstraint>();
Routing\ActionEndpointDataSourceBase.cs (2)
124groupConventions: Array.Empty<Action<EndpointBuilder>>(), 126groupFinallyConventions: Array.Empty<Action<EndpointBuilder>>());
Routing\ActionEndpointFactory.cs (4)
76perRouteConventions: Array.Empty<Action<EndpointBuilder>>(), 79perRouteFinallyConventions: Array.Empty<Action<EndpointBuilder>>()); 166perRouteConventions: Array.Empty<Action<EndpointBuilder>>(), 169perRouteFinallyConventions: Array.Empty<Action<EndpointBuilder>>());
SignOutResult.cs (2)
22: this(Array.Empty<string>()) 32: this(Array.Empty<string>(), properties)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (6)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
Microsoft.AspNetCore.Mvc.Core.Test (124)
ApplicationModels\ApiBehaviorApplicationModelProviderTest.cs (5)
24var actionModel = new ActionModel(method, Array.Empty<object>()) 51var actionModel = new ActionModel(method, Array.Empty<object>()) 59var parameterModel = new ParameterModel(parameter, Array.Empty<object>()) 94var actionModel = new ActionModel(method, Array.Empty<object>()) 102var parameterModel = new ParameterModel(parameter, Array.Empty<object>())
ApplicationModels\ApiConventionApplicationModelConventionTest.cs (3)
66var controller = new ControllerModel(typeof(object).GetTypeInfo(), Array.Empty<object>()); 67var action = new ActionModel(typeof(object).GetMethods()[0], Array.Empty<object>()) 166actionAttributes = actionAttributes ?? Array.Empty<object>();
ApplicationModels\DefaultApplicationModelProviderTest.cs (1)
34var context = new ApplicationModelProviderContext(Array.Empty<TypeInfo>());
ApplicationModels\RouteTokenTransformerConventionTest.cs (2)
18var model = new ActionModel(GetMethodInfo(), Array.Empty<object>()); 38var model = new ActionModel(GetMethodInfo(), Array.Empty<object>());
DependencyInjection\ApplicationModelConventionExtensionsTest.cs (26)
18var controllerModel = new ControllerModel(controllerType.GetTypeInfo(), Array.Empty<object>()); 21var actionModel = new ActionModel(controllerType.GetMethod(nameof(HelloController.GetInfo)), Array.Empty<object>()); 25Array.Empty<object>()); 47var controllerModel1 = new ControllerModel(controllerType1, Array.Empty<object>()) 51new ActionModel(actionMethod1, Array.Empty<object>()), 57var controllerModel2 = new ControllerModel(controllerType2, Array.Empty<object>()) 61new ActionModel(actionMethod2, Array.Empty<object>()), 92Array.Empty<object>()); 95var controllerModel1 = new ControllerModel(controllerType1, Array.Empty<object>()) 99new PropertyModel(property1, Array.Empty<object>()), 103new ActionModel(actionMethod1, Array.Empty<object>()) 115var controllerModel2 = new ControllerModel(controllerType2, Array.Empty<object>()) 119new PropertyModel(property2, Array.Empty<object>()), 153app.Controllers.Add(new ControllerModel(typeof(HelloController).GetTypeInfo(), Array.Empty<object>())); 154app.Controllers.Add(new ControllerModel(typeof(WorldController).GetTypeInfo(), Array.Empty<object>())); 194new ControllerModel(typeof(HelloController).GetTypeInfo(), Array.Empty<object>()) 231var controllerModel = new ControllerModel(controllerType, Array.Empty<object>()) 236new ActionModel(controllerType.GetMethod(nameof(HelloController.GetHello)), Array.Empty<object>()) 256var controllerModel = new ControllerModel(controllerType, Array.Empty<object>()) 261new PropertyModel(controllerType.GetProperty(nameof(HelloController.Property1)), Array.Empty<object>()) 282var controllerModel = new ControllerModel(controllerType, Array.Empty<object>()) 305var controllerModel = new ControllerModel(controllerType, Array.Empty<object>()) 310var actionModel = new ActionModel(controllerType.GetMethod(nameof(HelloController.GetInfo)), Array.Empty<object>()) 317Array.Empty<object>()) 338var controllerModel = new ControllerModel(controllerType, Array.Empty<object>()) 343var actionModel = new ActionModel(controllerType.GetMethod(nameof(HelloController.GetInfo)), Array.Empty<object>())
Infrastructure\ActionMethodExecutorTest.cs (16)
27Array.Empty<object>()); 53Array.Empty<object>()); 79Array.Empty<object>()); 104Array.Empty<object>()); 133Array.Empty<object>()); 162Array.Empty<object>()); 191Array.Empty<object>()); 216Array.Empty<object>()); 242Array.Empty<object>()); 268Array.Empty<object>()); 293Array.Empty<object>()); 319Array.Empty<object>()); 348Array.Empty<object>()); 377Array.Empty<object>()); 402Array.Empty<object>()); 431Array.Empty<object>());
Infrastructure\ActionSelectionTableTest.cs (1)
555var metadata = new List<object>(a.EndpointMetadata ?? Array.Empty<object>());
Infrastructure\ClientErrorResultFilterTest.cs (1)
117Array.Empty<IFilterMetadata>(),
Infrastructure\DefaultOutputFormatterSelectorTest.cs (9)
68Array.Empty<IOutputFormatter>(), 97Array.Empty<IOutputFormatter>(), 168Array.Empty<IOutputFormatter>(), 197Array.Empty<IOutputFormatter>(), 227Array.Empty<IOutputFormatter>(), 262Array.Empty<IOutputFormatter>(), 291Array.Empty<IOutputFormatter>(), 324Array.Empty<IOutputFormatter>(), 355Array.Empty<IOutputFormatter>(),
Infrastructure\ModelStateInvalidFilterTest.cs (1)
76Array.Empty<IFilterMetadata>(),
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (4)
306Array.Empty<IModelBinder>(), 350Array.Empty<IModelBinder>(), 394Array.Empty<IModelBinder>(), 447Array.Empty<IModelBinder>(),
ModelBinding\Binders\DictionaryModelBinderTest.cs (1)
351Array.Empty<IModelBinder>(),
ModelBinding\Binders\HeaderModelBinderTests.cs (2)
119{ "", typeof(string[]), Array.Empty<string>() }, 120{ null, typeof(string[]), Array.Empty<string>() },
ModelBinding\Metadata\DefaultBindingMetadataProviderTest.cs (6)
278new ModelAttributes(Array.Empty<object>(), null, parameterAttributes)); 301new ModelAttributes(Array.Empty<object>(), null, parameterAttributes)); 324new ModelAttributes(Array.Empty<object>(), null, parameterAttributes)); 347new ModelAttributes(Array.Empty<object>(), null, parameterAttributes)); 370new ModelAttributes(Array.Empty<object>(), null, parameterAttributes)); 394new ModelAttributes(Array.Empty<object>(), null, parameterAttributes));
ModelBinding\Metadata\DefaultModelMetadataTest.cs (9)
126var attributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), null); 163var attributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), null); 200var attributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), null); 358var cache = new DefaultMetadataDetails(key, new ModelAttributes(Array.Empty<object>(), null, null)); 381var cache = new DefaultMetadataDetails(key, new ModelAttributes(Array.Empty<object>(), null, null)); 402var cache = new DefaultMetadataDetails(key, new ModelAttributes(Array.Empty<object>(), null, null));
ModelBinding\Metadata\SystemTextJsonValidationMetadataProviderTest.cs (11)
18var modelAttributes = new ModelAttributes(Array.Empty<object>(), new[] { new JsonPropertyNameAttribute(propertyName) }, Array.Empty<object>()); 36var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>()); 53var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>()); 71var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>());
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (1)
172var cache = new DefaultMetadataDetails(key, new ModelAttributes(Array.Empty<object>(), null, null));
Routing\ActionEndpointDataSourceBaseTest.cs (2)
132Array.Empty<IActionDescriptorProvider>(), 133Array.Empty<IActionDescriptorChangeProvider>(),
Routing\ActionEndpointFactoryTest.cs (19)
277Array.Empty<ConventionalRouteEntry>(), 278conventions: Array.Empty<Action<EndpointBuilder>>(), 279groupConventions: Array.Empty<Action<EndpointBuilder>>(), 280finallyConventions: Array.Empty<Action<EndpointBuilder>>(), 281groupFinallyConventions: Array.Empty<Action<EndpointBuilder>>(), 370var endpoints = CreateConventionalRoutedEndpoints(action, Array.Empty<ConventionalRouteEntry>(), createInertEndpoints: true); 383Array.Empty<ConventionalRouteEntry>(), 384conventions: Array.Empty<Action<EndpointBuilder>>(), 385groupConventions: Array.Empty<Action<EndpointBuilder>>(), 386finallyConventions: Array.Empty<Action<EndpointBuilder>>(), 387groupFinallyConventions: Array.Empty<Action<EndpointBuilder>>(), 407conventions: Array.Empty<Action<EndpointBuilder>>(), 408groupConventions: Array.Empty<Action<EndpointBuilder>>(), 409finallyConventions: Array.Empty<Action<EndpointBuilder>>(), 410groupFinallyConventions: Array.Empty<Action<EndpointBuilder>>(), 433conventions: Array.Empty<Action<EndpointBuilder>>(), 434groupConventions: Array.Empty<Action<EndpointBuilder>>(), 435finallyConventions: Array.Empty<Action<EndpointBuilder>>(), 436groupFinallyConventions: Array.Empty<Action<EndpointBuilder>>(),
Routing\ControllerLinkGeneratorExtensionsTest.cs (1)
203new EndpointMetadataCollection(metadata ?? Array.Empty<object>()),
Routing\DynamicControllerEndpointMatcherPolicyTest.cs (2)
317return new ValueTask<IReadOnlyList<Endpoint>>(Array.Empty<Endpoint>()); 356new Endpoint((ctx) => Task.CompletedTask, new EndpointMetadataCollection(Array.Empty<object>()), "ReplacedEndpoint")
Routing\PageLinkGeneratorExtensionsTest.cs (1)
173new EndpointMetadataCollection(metadata ?? Array.Empty<object>()),
Microsoft.AspNetCore.Mvc.Core.TestCommon (2)
SimpleValueProvider.cs (2)
42var array = (Array)rawValue;
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
MvcDataAnnotationsLocalizationOptions.cs (1)
15private readonly IReadOnlyList<ICompatibilitySwitch> _switches = Array.Empty<ICompatibilitySwitch>();
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (8)
DataAnnotationsMetadataProviderTest.cs (3)
1728=> new ModelAttributes(typeAttributes, Array.Empty<object>(), Array.Empty<object>()); 1733=> new ModelAttributes(typeAttributes, propertyAttributes, Array.Empty<object>());
DataAnnotationsModelValidatorProviderTest.cs (1)
118var result = provider.HasValidators(mockValidatable.GetType(), Array.Empty<object>());
DataMemberRequiredBindingMetadataProviderTest.cs (1)
143=> new ModelAttributes(typeAttributes, propertyAttributes, Array.Empty<object>());
ModelMetadataProviderTest.cs (3)
1068Array.Empty<object>(), 1069Array.Empty<object>())); 1085Array.Empty<object>()));
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
MvcXmlOptions.cs (1)
15private readonly IReadOnlyList<ICompatibilitySwitch> _switches = Array.Empty<ICompatibilitySwitch>();
Microsoft.AspNetCore.Mvc.FunctionalTests (6)
InputFormatterTests.cs (4)
226var content = new ByteArrayContent(Array.Empty<byte>()); 271var content = new ByteArrayContent(Array.Empty<byte>()); 286var content = new ByteArrayContent(Array.Empty<byte>()); 301var content = new ByteArrayContent(Array.Empty<byte>());
RoutingEndpointRoutingTest.cs (2)
225Array.Empty<string>(), 242Array.Empty<string>(),
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
ComplexTypeIntegrationTestBase.cs (1)
3229public TestInnerModel[] InnerModels { get; set; } = Array.Empty<TestInnerModel>();
Microsoft.AspNetCore.Mvc.Localization (2)
LocalizedHtmlString.cs (2)
22: this(name, value, isResourceNotFound: false, arguments: Array.Empty<object>()) 33: this(name, value, isResourceNotFound, arguments: Array.Empty<object>())
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
BsonTempDataSerializer.cs (1)
148return Array.Empty<byte>();
MvcNewtonsoftJsonOptions.cs (1)
19private readonly IReadOnlyList<ICompatibilitySwitch> _switches = Array.Empty<ICompatibilitySwitch>();
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (8)
NewtonsoftJsonValidationMetadataProviderTest.cs (8)
20var modelAttributes = new ModelAttributes(Array.Empty<object>(), new[] { new JsonPropertyAttribute() { PropertyName = propertyName } }, Array.Empty<object>()); 38var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>()); 57var modelAttributes = new ModelAttributes(Array.Empty<object>(), Array.Empty<object>(), Array.Empty<object>());
Microsoft.AspNetCore.Mvc.Razor (2)
Compilation\DefaultViewCompiler.cs (1)
114ExpirationTokens = Array.Empty<IChangeToken>(),
RazorViewEngine.cs (1)
415Array.Empty<ViewLocationCacheItem>();
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RuntimeViewCompiler.cs (1)
206ExpirationTokens = Array.Empty<IChangeToken>(), // Never expire because we can't recompile.
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
RuntimeViewCompilerTest.cs (1)
836precompiledViews = precompiledViews ?? Array.Empty<CompiledViewDescriptor>();
TestInfrastructure\TestRazorReferenceManager.cs (1)
19CompilationReferences = Array.Empty<MetadataReference>();
Microsoft.AspNetCore.Mvc.Razor.Test (3)
Compilation\DefaultRazorPageFactoryProviderTest.cs (1)
82ExpirationTokens = Array.Empty<IChangeToken>(),
Compilation\DefaultViewCompilerTest.cs (1)
120compiledViews = compiledViews ?? Array.Empty<CompiledViewDescriptor>();
RazorViewEngineTest.cs (1)
2045ExpirationTokens = changeTokens ?? Array.Empty<IChangeToken>(),
Microsoft.AspNetCore.Mvc.RazorPages (11)
ApplicationModels\PageApplicationModel.cs (1)
48EndpointMetadata = new List<object>(ActionDescriptor.EndpointMetadata ?? Array.Empty<object>());
Infrastructure\DefaultPageLoader.cs (4)
70routes: Array.Empty<ConventionalRouteEntry>(), 87groupConventions: Array.Empty<Action<EndpointBuilder>>(), 88finallyConventions: Array.Empty<Action<EndpointBuilder>>(), 89groupFinallyConventions: Array.Empty<Action<EndpointBuilder>>(),
Infrastructure\DefaultPageModelActivatorProvider.cs (1)
33return (context) => factory(context.HttpContext.RequestServices, Array.Empty<object>());
Infrastructure\PageActionDescriptorProvider.cs (1)
104FilterDescriptors = Array.Empty<FilterDescriptor>(),
Infrastructure\PageActionEndpointDataSource.cs (1)
61Array.Empty<ConventionalRouteEntry>(),
Infrastructure\PageActionInvokerCache.cs (2)
133return Array.Empty<PageHandlerExecutorDelegate>(); 150return Array.Empty<PageHandlerBinderDelegate>();
RazorPagesOptions.cs (1)
15private readonly IReadOnlyList<ICompatibilitySwitch> _switches = Array.Empty<ICompatibilitySwitch>();
Microsoft.AspNetCore.Mvc.RazorPages.Test (64)
ApplicationModels\TempDataFilterPageApplicationModelProviderTest.cs (1)
125PageApplicationModel = new PageApplicationModel(descriptor, handlerType.GetTypeInfo(), Array.Empty<object>()),
ApplicationModels\ViewDataAttributePageApplicationModelProviderTest.cs (1)
51PageApplicationModel = new PageApplicationModel(descriptor, handlerType.GetTypeInfo(), Array.Empty<object>()),
Filters\AutoValidateAntiforgeryPageApplicationModelProviderTest.cs (2)
48PageApplicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()) 73PageApplicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>())
Filters\PageHandlerResultFilterTest.cs (8)
33Array.Empty<IFilterMetadata>(), 38Array.Empty<IFilterMetadata>(), 74Array.Empty<IFilterMetadata>(), 79Array.Empty<IFilterMetadata>(), 116Array.Empty<IFilterMetadata>(), 121Array.Empty<IFilterMetadata>(), 148Array.Empty<IFilterMetadata>(), 153Array.Empty<IFilterMetadata>(),
Filters\PageSaveTempDataPropertyFilterTest.cs (3)
65Array.Empty<IFilterMetadata>(), 106Array.Empty<IFilterMetadata>(), 146Array.Empty<IFilterMetadata>(),
Filters\PageViewDataAttributeFilterTest.cs (2)
21var filter = new PageViewDataAttributeFilter(Array.Empty<LifecycleProperty>()); 40var filter = new PageViewDataAttributeFilter(Array.Empty<LifecycleProperty>());
Infrastructure\CompiledPageActionDescriptorFactoryTest.cs (19)
18var model = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 82var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 109var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 110var handlerModel = new PageHandlerModel(methodInfo, Array.Empty<object>()); 137var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 168var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 169var handlerModel = new PageHandlerModel(methodInfo, Array.Empty<object>()); 199var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 200var handlerModel = new PageHandlerModel(methodInfo, Array.Empty<object>()); 201var parameterModel = new PageParameterModel(parameterInfo, Array.Empty<object>()); 230var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 231var handlerModel = new PageHandlerModel(methodInfo, Array.Empty<object>()); 266var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 267var handlerModel = new PageHandlerModel(methodInfo, Array.Empty<object>()); 268var parameterModel = new PageParameterModel(parameterInfo, Array.Empty<object>()); 299var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 300var handlerModel = new PageHandlerModel(methodInfo, Array.Empty<object>()); 301var propertyModel = new PagePropertyModel(propertyInfo, Array.Empty<object>()); 329var applicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>());
Infrastructure\DefaultPageLoaderTest.cs (7)
25var actionDescriptors = new ActionDescriptorCollection(Array.Empty<ActionDescriptor>(), 1); 44var pageApplicationModel1 = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 45var pageApplicationModel2 = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 125var pageApplicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 173c.PageApplicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 242var pageApplicationModel = new PageApplicationModel(descriptor, typeof(object).GetTypeInfo(), Array.Empty<object>()); 308c.PageApplicationModel = new PageApplicationModel(c.ActionDescriptor, typeof(object).GetTypeInfo(), Array.Empty<object>());
Infrastructure\DisallowOptionsRequestsPageFilterTest.cs (1)
129return new PageHandlerExecutingContext(pageContext, Array.Empty<IFilterMetadata>(), handlerMethodDescriptor, new Dictionary<string, object>(), new object());
Infrastructure\DynamicPageEndpointMatcherPolicyTest.cs (1)
320return new ValueTask<IReadOnlyList<Endpoint>>(Array.Empty<Endpoint>());
Infrastructure\PageActionDescriptorProviderTest.cs (1)
380_models = models ?? Array.Empty<PageRouteModel>();
Infrastructure\PageActionInvokerProviderTest.cs (1)
488FilterDescriptors = Array.Empty<FilterDescriptor>(),
Infrastructure\PageActionInvokerTest.cs (2)
1538handlerBinders = handlerBinders ?? Array.Empty<PageHandlerBinderDelegate>(); 1573filters ?? Array.Empty<IFilterMetadata>(),
Infrastructure\PageHandlerPageFilterTest.cs (8)
27Array.Empty<IFilterMetadata>(), 33Array.Empty<IFilterMetadata>(), 75Array.Empty<IFilterMetadata>(), 81Array.Empty<IFilterMetadata>(), 118Array.Empty<IFilterMetadata>(), 124Array.Empty<IFilterMetadata>(), 151Array.Empty<IFilterMetadata>(), 157Array.Empty<IFilterMetadata>(),
PageModelTest.cs (5)
1853Array.Empty<IFilterMetadata>(), 1859Array.Empty<IFilterMetadata>(), 1887Array.Empty<IFilterMetadata>(), 1893Array.Empty<IFilterMetadata>(), 1922Array.Empty<IFilterMetadata>(),
src\Mvc\Mvc.Core\test\Routing\ActionEndpointDataSourceBaseTest.cs (2)
132Array.Empty<IActionDescriptorProvider>(), 133Array.Empty<IActionDescriptorChangeProvider>(),
Microsoft.AspNetCore.Mvc.TagHelpers (2)
GlobbingUrlBuilder.cs (2)
103return Array.Empty<string>(); 116return Array.Empty<string>();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (8)
PartialTagHelperTest.cs (7)
625.Returns(ViewEngineResult.NotFound(partialName, searchedLocations: Array.Empty<string>())); 627.Returns(ViewEngineResult.NotFound(partialName, searchedLocations: Array.Empty<string>())); 769.Returns(ViewEngineResult.NotFound(partialName, Array.Empty<string>())); 771.Returns(ViewEngineResult.NotFound(partialName, Array.Empty<string>())); 813.Returns(ViewEngineResult.NotFound(partialName, Array.Empty<string>())); 815.Returns(ViewEngineResult.NotFound(partialName, Array.Empty<string>())); 817.Returns(ViewEngineResult.NotFound(fallbackName, Array.Empty<string>()));
SelectTagHelperTest.cs (1)
786var selectList = Array.Empty<SelectListItem>();
Microsoft.AspNetCore.Mvc.Testing (5)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.7.25377.103\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
182return buildMethod?.Invoke(builder, Array.Empty<object>()); 238_entryPoint.Invoke(null, Array.Empty<object>());
WebApplicationFactory.cs (3)
504return Array.Empty<Assembly>(); 535var hostBuilder = HostFactoryResolver.ResolveHostBuilderFactory<IHostBuilder>(typeof(TEntryPoint).Assembly)?.Invoke(Array.Empty<string>()); 552var builder = WebHostBuilderFactory.CreateFromTypesAssemblyEntryPoint<TEntryPoint>(Array.Empty<string>());
Microsoft.AspNetCore.Mvc.ViewFeatures (11)
Buffers\MemoryPoolViewBufferScope.cs (1)
75Array.Clear(segment, 0, segment.Length);
Buffers\PagedCharBuffer.cs (1)
84Array.Copy(
Buffers\ViewBuffer.cs (3)
322Array.Clear(page.Buffer, 0, page.Count); 345Array.Copy( 355Array.Clear(page.Buffer, 0, page.Count);
Infrastructure\DefaultTempDataSerializer.cs (1)
132return Array.Empty<byte>();
MvcViewOptions.cs (1)
19private readonly IReadOnlyList<ICompatibilitySwitch> _switches = Array.Empty<ICompatibilitySwitch>();
RemoteAttributeBase.cs (2)
29private string[] _additionalFieldsSplit = Array.Empty<string>(); 171=> original?.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>();
ValidationHelpers.cs (1)
79return Array.Empty<ModelStateEntry>();
ViewComponents\DefaultViewComponentInvoker.cs (1)
272return Array.Empty<string>();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (7)
Filters\AntiforgeryApplicationModelProviderTest.cs (2)
161actionAttributes ??= Array.Empty<object>(); 162controllerAttributes ??= Array.Empty<object>();
Filters\ControllerViewDataAttributeFilterTest.cs (2)
18var filter = new ControllerViewDataAttributeFilter(Array.Empty<LifecycleProperty>()); 36var filter = new ControllerViewDataAttributeFilter(Array.Empty<LifecycleProperty>());
FormatWeekHelperTest.cs (3)
26Array.Empty<object>(), 27Array.Empty<object>(), 28Array.Empty<object>()));
Microsoft.AspNetCore.Mvc.Views.TestCommon (1)
TestRazorCompiledItem.cs (1)
36Metadata = metadata ?? Array.Empty<object>();
Microsoft.AspNetCore.OpenApi (14)
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (6)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
src\Shared\ParameterBindingMethodCache.cs (1)
321return (constructor, Array.Empty<ConstructorParameter>());
src\Shared\PropertyAsParameterInfo.cs (6)
71return Array.Empty<ParameterInfo>(); 152Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 153Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 172Array.Copy(constructorAttributes, mergedAttributes, constructorAttributes.Length); 173Array.Copy(propertyAttributes, 0, mergedAttributes, constructorAttributes.Length, propertyAttributes.Length); 181_constructionParameterInfo?.GetCustomAttributesData() ?? Array.Empty<CustomAttributeData>());
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.OpenApi.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.OpenApi.Tests (3)
Services\OpenApiDocumentServiceTestsBase.cs (1)
147var apiDescriptionGroup = new ApiDescriptionGroup("testGroupName", (apiDescriptions ?? Array.Empty<ApiDescription>()).AsReadOnly());
Services\OpenApiGeneratorTests.cs (2)
26var operation = GetOpenApiOperation(() => { }, "/", Array.Empty<string>()); 1038metadataItems.AddRange(additionalMetadata ?? Array.Empty<object>());
Microsoft.AspNetCore.OutputCaching (10)
OutputCacheEntryFormatter.cs (1)
58string[] tagsArr = tags is { Count: > 0 } ? tags.ToArray() : Array.Empty<string>();
OutputCacheKeyProvider.cs (6)
175Array.Sort(headerValuesArray, StringComparer.Ordinal); 202Array.Sort(queryArray, QueryKeyComparer.OrdinalIgnoreCase); 217Array.Sort(queryValueArray, StringComparer.Ordinal); 251Array.Sort(queryValueArray, StringComparer.Ordinal); 344return Array.Empty<string>(); 349Array.Sort(newArray, StringComparer.OrdinalIgnoreCase);
OutputCacheMiddleware.cs (1)
217policies = Array.Empty<IOutputCachePolicy>();
RecyclableArrayBufferWriter.cs (2)
28_buffer = Array.Empty<T>(); 36_buffer = Array.Empty<T>();
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (3)
EndToEndBenchmarks.cs (2)
22private byte[] _payloadOversized = Array.Empty<byte>(); 38_payloadOversized = Array.Empty<byte>();
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.OutputCaching.Tests (2)
OutputCachePoliciesTests.cs (2)
187IOutputCachePolicy policy = new VaryByHeaderPolicy(Array.Empty<string>()); 225IOutputCachePolicy policy = new VaryByQueryPolicy(Array.Empty<string>());
Microsoft.AspNetCore.Owin.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.RateLimiting.Tests (1)
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Razor (1)
TagHelpers\ReadOnlyTagHelperAttributeList.cs (1)
136attributes = matchedAttributes ?? (IReadOnlyList<TagHelperAttribute>)Array.Empty<TagHelperAttribute>();
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.RequestDecompression.Tests (5)
RequestDecompressionMiddlewareTests.cs (5)
198var decompressedBytes = Array.Empty<byte>(); 268var outputBytes = Array.Empty<byte>(); 438var decompressedBytes = Array.Empty<byte>(); 524var decompressedBytes = Array.Empty<byte>(); 688var outputContent = Array.Empty<byte>();
Microsoft.AspNetCore.ResponseCaching (5)
ResponseCachingKeyProvider.cs (4)
116Array.Sort(headerValuesArray, StringComparer.Ordinal); 137Array.Sort(queryArray, QueryKeyComparer.OrdinalIgnoreCase); 146Array.Sort(queryValueArray, StringComparer.Ordinal); 170Array.Sort(queryValueArray, StringComparer.Ordinal);
ResponseCachingMiddleware.cs (1)
500Array.Sort(newArray, StringComparer.Ordinal);
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.ResponseCompression.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Routing (49)
ArrayBuilder.cs (3)
108return Array.Empty<T>(); 119Array.Copy(_array, 0, result, 0, _count); 163Array.Copy(_array, 0, next, 0, _count);
Builder\EndpointRouteBuilderExtensions.cs (1)
215Array.Empty<object>();
CompositeEndpointDataSource.cs (1)
83return Array.Empty<Endpoint>();
EndpointNameAddressScheme.cs (2)
30return result ?? Array.Empty<Endpoint>(); 62Array.Copy(existing, newEntry, existing.Length);
Matching\AcceptsMatcherPolicy.cs (2)
176var contentTypes = endpoint.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes ?? Array.Empty<string>(); 272Array.Sort(ordered, static (left, right) => GetScore(left.mediaType).CompareTo(GetScore(right.mediaType)));
Matching\Candidate.cs (4)
54Slots = Array.Empty<KeyValuePair<string, object>>(); 55Captures = Array.Empty<(string parameterName, int segmentIndex, int slotIndex)>(); 57ComplexSegments = Array.Empty<(RoutePatternPathSegment pathSegment, int segmentIndex)>(); 58Constraints = Array.Empty<KeyValuePair<string, IRouteConstraint>>();
Matching\CandidateSet.cs (1)
278Array.Sort<Endpoint>(buffer, comparer);
Matching\DfaMatcher.cs (1)
138Array.Copy(prototype, 0, slots, 0, prototype.Length);
Matching\DfaMatcherBuilder.cs (10)
574Array.Empty<Candidate>(), 575Array.Empty<IEndpointSelectorPolicy>(), 669endpointSelectorPolicies?.ToArray() ?? Array.Empty<IEndpointSelectorPolicy>(), 709return Array.Empty<Candidate>(); 840Array.Empty<KeyValuePair<string, object>>(), 841Array.Empty<(string parameterName, int segmentIndex, int slotIndex)>(), 843Array.Empty<(RoutePatternPathSegment pathSegment, int segmentIndex)>(), 844Array.Empty<KeyValuePair<string, IRouteConstraint>>()); 911if (!nodeBuilder.AppliesToEndpoints(parent.Matches ?? (IReadOnlyList<Endpoint>)Array.Empty<Endpoint>())) 921var edges = nodeBuilder.GetEdges(parent.Matches ?? (IReadOnlyList<Endpoint>)Array.Empty<Endpoint>());
Matching\HostMatcherPolicy.cs (1)
299Array.Sort(ordered, static (left, right) => GetScore(left.host).CompareTo(GetScore(right.host)));
Matching\HttpMethodMatcherPolicy.cs (1)
301return metadata == null ? (Array.Empty<string>(), false) : (metadata.HttpMethods, metadata.AcceptCorsPreflight);
Matching\ILEmitTrieFactory.cs (3)
111Array.Sort(groups, static (a, b) => a.Key.CompareTo(b.Key)); 336Array.Sort(groups, static (a, b) => unchecked((long)a.Key).CompareTo(unchecked((long)b.Key))); 461Array.Sort(groups, static (a, b) => (a.Key | 0x20).CompareTo(b.Key | 0x20));
Matching\NegotiationMatcherPolicy.cs (2)
88values = Array.Empty<StringWithQualityHeaderValue>(); 312Array.Sort(EndpointsQuality);
ParameterPolicyActivator.cs (1)
112var arguments = argumentString?.Split(',', StringSplitOptions.TrimEntries) ?? Array.Empty<string>();
Patterns\RouteParameterParser.cs (1)
22return new RoutePatternParameterPart(string.Empty, null, RoutePatternParameterKind.Standard, Array.Empty<RoutePatternParameterPolicyReference>());
Patterns\RoutePatternFactory.cs (5)
540(IReadOnlyList<RoutePatternParameterPart>?)parameters ?? Array.Empty<RoutePatternParameterPart>(), 638parameterConstraints?.ToArray() ?? Array.Empty<RoutePatternParameterPolicyReference>(), 782parameterPolicies: Array.Empty<RoutePatternParameterPolicyReference>()); 805parameterPolicies: Array.Empty<RoutePatternParameterPolicyReference>()); 837parameterPolicies: Array.Empty<RoutePatternParameterPolicyReference>());
RouteGroupBuilder.cs (3)
51GetGroupedEndpointsWithNullablePrefix(null, Array.Empty<Action<EndpointBuilder>>(), 52Array.Empty<Action<EndpointBuilder>>(), _routeGroupBuilder._outerEndpointRouteBuilder.ServiceProvider); 650 => Array.Empty<Endpoint>(),
RouteGroupContext.cs (2)
26public IReadOnlyList<Action<EndpointBuilder>> Conventions { get; init; } = Array.Empty<Action<EndpointBuilder>>(); 33public IReadOnlyList<Action<EndpointBuilder>> FinallyConventions { get; init; } = Array.Empty<Action<EndpointBuilder>>();
RouteValuesAddressScheme.cs (1)
59return Array.Empty<Endpoint>();
Template\TemplateBinder.cs (4)
79_requiredKeys = requiredKeys?.ToArray() ?? Array.Empty<string>(); 150constraints = constraintList?.ToArray() ?? Array.Empty<(string, IRouteConstraint)>(); 151parameterTransformers = parameterTransformerList?.ToArray() ?? Array.Empty<(string, IOutboundParameterTransformer)>(); 165Array.Copy(_slots, 0, slots, 0, slots.Length);
Microsoft.AspNetCore.Routing.FunctionalTests (1)
RouteHandlerTest.cs (1)
121public override IReadOnlyList<Endpoint> Endpoints => Array.Empty<Endpoint>();
Microsoft.AspNetCore.Routing.Microbenchmarks (6)
EndpointRoutingBenchmarkBase.cs (2)
73message.AppendLine(FormattableString.Invariant($"Validation failed for request {Array.IndexOf(Requests, httpContext)}")); 112var endpointMetadata = new List<object>(metadata ?? Array.Empty<object>());
Matching\TrivialMatcher.cs (1)
45return Array.Empty<Candidate>();
src\Http\Routing\test\UnitTests\Matching\BarebonesMatcher.cs (1)
110return Array.Empty<Candidate>();
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Routing.Tests (58)
CompositeEndpointDataSourceTest.cs (7)
44var conventions = Array.Empty<Action<EndpointBuilder>>(); 45var finallyConventions = Array.Empty<Action<EndpointBuilder>>(); 72Conventions = Array.Empty<Action<EndpointBuilder>>(), 73FinallyConventions = Array.Empty<Action<EndpointBuilder>>(), 295var finallyConventions = Array.Empty<Action<EndpointBuilder>>(); 341var conventions = Array.Empty<Action<EndpointBuilder>>(); 459var conventions = Array.Empty<Action<EndpointBuilder>>();
DefaultEndpointDataSourceTests.cs (1)
35Array.Resize(ref endpoints, 1);
EndpointFactory.cs (1)
35new EndpointMetadataCollection(metadata ?? Array.Empty<object>()),
LinkGeneratorTestBase.cs (1)
43return CreateLinkGenerator(configureServices, new[] { new DefaultEndpointDataSource(endpoints ?? Array.Empty<Endpoint>()) });
LinkParserTestBase.cs (1)
35return CreateLinkParser(configureServices, new[] { new DefaultEndpointDataSource(endpoints ?? Array.Empty<Endpoint>()) });
Matching\AcceptsMatcherPolicyTest.cs (10)
35CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 53CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 72CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 106CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 124CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 143CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 165CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 340CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 409CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 616$"test: {template} - {string.Join(", ", consumesMetadata?.ContentTypes ?? Array.Empty<string>())}");
Matching\BarebonesMatcher.cs (1)
110return Array.Empty<Candidate>();
Matching\CandidateSetTest.cs (3)
128candidateSet.ExpandEndpoint(0, Array.Empty<Endpoint>(), comparer); 321var ex = Assert.Throws<InvalidOperationException>(() => candidateSet.ExpandEndpoint(0, Array.Empty<Endpoint>(), comparer)); 384var dataSource = new CompositeEndpointDataSource(Array.Empty<EndpointDataSource>());
Matching\ContentEncodingNegotiationMatcherPolicyTest.cs (1)
622Array.Sort(endpoints, (policy as IEndpointComparerPolicy).Comparer);
Matching\DfaMatcherBuilderTest.cs (1)
3502var dataSource = new CompositeEndpointDataSource(Array.Empty<EndpointDataSource>());
Matching\FullFeaturedMatcherConformanceTest.cs (1)
429var expected = endpoints[Array.IndexOf(templates, expectedTemplate)];
Matching\HostMatcherPolicyIntegrationTestBase.cs (1)
410metadata.Add(new HostAttribute(hosts ?? Array.Empty<string>()));
Matching\HostMatcherPolicyTest.cs (8)
32CreateEndpoint("/", new HostAttribute(Array.Empty<string>())), 50CreateEndpoint("/", new HostAttribute(Array.Empty<string>())), 69CreateEndpoint("/", new HostAttribute(Array.Empty<string>())), 124CreateEndpoint("/", new HostAttribute(Array.Empty<string>()), new DynamicEndpointMetadata()), 142CreateEndpoint("/", new HostAttribute(Array.Empty<string>())), 161CreateEndpoint("/", new HostAttribute(Array.Empty<string>())), 202CreateEndpoint("/", new HostAttribute(Array.Empty<string>())), 276$"test: {template} - {string.Join(", ", hostMetadata?.Hosts ?? Array.Empty<string>())}");
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (1)
392metadata.Add(new HttpMethodMetadata(httpMethods ?? Array.Empty<string>(), acceptCorsPreflight));
Matching\HttpMethodMatcherPolicyTest.cs (10)
33CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>())), 51CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>())), 70CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>())), 104CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 122CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 141CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>())), 185CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>())), 188CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>())), 230CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>())), 233CreateEndpoint("/", new HttpMethodMetadata(Array.Empty<string>(), acceptCorsPreflight: true)),
Matching\MatcherAssert.cs (2)
43keys = keys ?? Array.Empty<string>(); 44values = values ?? Array.Empty<string>();
Patterns\RoutePatternFactoryTest.cs (7)
421Array.Resize(ref segments, 2); 450Array.Resize(ref segments, 2); 480Array.Resize(ref segments, 2); 520Array.Resize(ref segments, 2); 638Array.Resize(ref policies, 2); 687Array.Resize(ref parts, 2); 708Array.Resize(ref parts, 2);
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Security.Microbenchmarks (2)
AuthorizationPolicyBenchmark.cs (1)
23return AuthorizationPolicy.CombineAsync(_policyProvider, Array.Empty<IAuthorizeData>());
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Server.HttpSys (2)
AuthenticationManager.cs (1)
147return Array.Empty<string>();
src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (1)
10internal static IEnumerable<string> Empty = Array.Empty<string>();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (7)
ResponseBodyTests.cs (1)
418await body.WriteAsync(Array.Empty<byte>());
src\Shared\Http2cat\Http2Utilities.cs (1)
123public static readonly byte[] _noData = Array.Empty<byte>();
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
Microsoft.AspNetCore.Server.HttpSys.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.Server.IIS (5)
Core\ServerAddressesFeature.cs (1)
10public ICollection<string> Addresses { get; set; } = Array.Empty<string>();
src\Shared\ErrorPage\ErrorPageModelBuilder.cs (1)
44errorDetails = Array.Empty<ExceptionDetails>();
src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (1)
10internal static IEnumerable<string> Empty = Array.Empty<string>();
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
26return Array.Empty<StackFrameInfo>(); 36return Array.Empty<StackFrameInfo>();
Microsoft.AspNetCore.Server.Kestrel.Core (17)
KestrelServer.cs (1)
36Array.Empty<IMultiplexedConnectionListenerFactory>(),
KestrelServerOptions.cs (1)
82return Array.Empty<ListenOptions>();
src\Servers\Kestrel\shared\PooledStreamStack.cs (1)
98Array.Resize(ref _array, 2 * _array.Length);
src\Shared\Buffers\BufferSegmentStack.cs (1)
61Array.Resize(ref _array, 2 * _array.Length);
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (26)
HttpRequestHeadersTests.cs (5)
109Assert.Same(Array.Empty<string>(), (string[])headers["custom"]); 110Assert.Same(Array.Empty<string>(), (string[])headers["host"]); 111Assert.Same(Array.Empty<string>(), (string[])headers["Content-Length"]); 114Assert.Same(Array.Empty<string>(), (string[])headers.Host); 115Assert.Same(Array.Empty<string>(), (string[])headers.AltSvc);
KestrelServerTests.cs (5)
324Array.Empty<IMultiplexedConnectionListenerFactory>())); 335Array.Empty<IMultiplexedConnectionListenerFactory>()); 349Array.Empty<IMultiplexedConnectionListenerFactory>()); 369Array.Empty<IMultiplexedConnectionListenerFactory>()); 739using (var server = new KestrelServerImpl(new[] { new MockTransportFactory() }, Array.Empty<IMultiplexedConnectionListenerFactory>(), new HttpsConfigurationService(), testContext))
SniOptionsSelectorTests.cs (3)
474ServerCertificate = new X509Certificate2(Array.Empty<byte>()), 561ServerCertificate = new X509Certificate2(Array.Empty<byte>()), 852ServerCertificate = new X509Certificate2(Array.Empty<byte>()),
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
868{Each(loop.Headers.Where(header => Array.IndexOf(InternalHeaderAccessors, header.Name) >= 0), header => $@"
src\Servers\Kestrel\shared\test\RevocationResponder.cs (3)
183byte[] certData = RespondEmpty ? Array.Empty<byte>() : authority.GetCertData(); 201byte[] crl = RespondEmpty ? Array.Empty<byte>() : authority.GetCrl(); 236byte[] ocspResponse = RespondEmpty ? Array.Empty<byte>() : authority.BuildOcspResponse(certId, nonce);
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (5)
37Array.Copy(data, 0, startSegment, 10, data.Length); 52Array.Copy(data, 0, startSegment, 10, data.Length); 67Array.Copy(data, 0, startSegment, 10, data.Length); 96segments.Add(Array.Empty<byte>()); 100segments.Add(Array.Empty<byte>());
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (1)
938decoder.Decode(Array.Empty<byte>(), endHeaders: false, handler: handler);
src\Shared\test\Shared.Tests\runtime\Http3\QPackDecoderTest.cs (1)
348decoder.Decode(Array.Empty<byte>(), endHeaders: false, handler: handler);
UTF8Decoding.cs (1)
37Array.Copy(bytes, 0, byteRange, position, bytes.Length);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Server.Kestrel.Tests (2)
KestrelConfigurationLoaderTests.cs (1)
711.Concat(password != null ? new[] { new KeyValuePair<string, string>("Certificates:Default:Password", password) } : Array.Empty<KeyValuePair<string, string>>()))
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Servers\Kestrel\shared\PooledStreamStack.cs (1)
98Array.Resize(ref _array, 2 * _array.Length);
Microsoft.AspNetCore.Session (2)
NoOpSessionStore.cs (2)
20public ICollection<EncodedKey> Keys { get; } = Array.Empty<EncodedKey>(); 22public ICollection<byte[]> Values { get; } = Array.Empty<byte[]>();
Microsoft.AspNetCore.Shared.Tests (26)
AdaptiveCapacityDictionaryTests.cs (1)
1319Assert.Same(Array.Empty<KeyValuePair<string, object?>>(), value._arrayStorage);
runtime\Http2\HPackDecoderTest.cs (1)
938decoder.Decode(Array.Empty<byte>(), endHeaders: false, handler: handler);
runtime\Http3\QPackDecoderTest.cs (1)
348decoder.Decode(Array.Empty<byte>(), endHeaders: false, handler: handler);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (7)
74_arrayStorage = Array.Empty<KeyValuePair<TKey, TValue>>(); 258Array.Clear(_arrayStorage, 0, _count); 310Array.Copy(storage, 0, array, arrayIndex, _count); 359Array.Copy(array, index + 1, array, index, _count - index); 391Array.Copy(array, index + 1, array, index, _count - index); 432Array.Copy(array, index + 1, array, index, _count - index); 534Array.Copy(_arrayStorage, 0, array, 0, _count);
src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (1)
10internal static IEnumerable<string> Empty = Array.Empty<string>();
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (6)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
87Array.Copy(_buffer, _removeIndex, newBuffer, 0, headCount); 88Array.Copy(_buffer, 0, newBuffer, headCount, tailCount);
src\Shared\runtime\Http2\Hpack\H2StaticTable.Http2.cs (1)
103value.Length != 0 ? Encoding.ASCII.GetBytes(value) : Array.Empty<byte>());
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
714Array.Resize(ref dstArray, dst.Length * 2); 781Array.Resize(ref dstArray, dst.Length * 2);
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
26return Array.Empty<StackFrameInfo>(); 36return Array.Empty<StackFrameInfo>();
src\Shared\WebEncoders\WebEncoders.cs (2)
72return Array.Empty<byte>(); 129return Array.Empty<byte>();
Microsoft.AspNetCore.SignalR.Client.Core (8)
HubConnection.cs (1)
808: Array.Empty<object?>();
HubConnectionExtensions.InvokeAsync.cs (1)
27return hubConnection.InvokeCoreAsync(methodName, Array.Empty<object?>(), cancellationToken);
HubConnectionExtensions.InvokeAsyncGeneric.cs (1)
31return hubConnection.InvokeCoreAsync<TResult>(methodName, Array.Empty<object>(), cancellationToken);
HubConnectionExtensions.SendAsync.cs (1)
27return hubConnection.SendCoreAsync(methodName, Array.Empty<object>(), cancellationToken);
HubConnectionExtensions.StreamAsChannelAsync.cs (1)
32return hubConnection.StreamAsChannelCoreAsync<TResult>(methodName, Array.Empty<object>(), cancellationToken);
HubConnectionExtensions.StreamAsync.cs (1)
29return hubConnection.StreamAsyncCore<TResult>(methodName, Array.Empty<object>(), cancellationToken);
Internal\SerializedHubMessage.cs (1)
84return Array.Empty<SerializedMessage>();
src\SignalR\common\Shared\MessageBuffer.cs (1)
419Array.Clear(_messages, 0, BufferLength);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
VersionJsonHubProtocol.cs (1)
44message = new InvocationMessage("NewProtocolMethodServer", Array.Empty<object>());
Microsoft.AspNetCore.SignalR.Client.Tests (25)
HttpConnectionTests.cs (1)
94var clientCertificate = new X509Certificate(Array.Empty<byte>());
HubClientProxyGeneratorTests.cs (8)
77Array.Empty<Type>(), 101Array.Empty<Type>(), 128Array.Empty<Type>(), 152Array.Empty<Type>(), 181Array.Empty<Type>(), 229Array.Empty<Type>(), 245await noArgFunc(Array.Empty<object>(), noArgState); 259await returnTaskFunc(Array.Empty<object>(), returnTaskState);
HubConnectionTests.cs (7)
865_ = await hubConnection.StreamAsChannelCoreAsync("stream", typeof(int), Array.Empty<object>(), default); 866_ = await hubConnection.InvokeCoreAsync("test", typeof(int), Array.Empty<object>(), default); 867await hubConnection.SendCoreAsync("test2", Array.Empty<object>(), default); 868_ = hubConnection.StreamAsyncCore<int>("stream2", Array.Empty<object>(), default); 875mockConnection.Verify(c => c.InvokeCoreAsync("test", typeof(int), Array.Empty<object>(), It.IsAny<CancellationToken>()), Times.Once); 876mockConnection.Verify(c => c.SendCoreAsync("test2", Array.Empty<object>(), It.IsAny<CancellationToken>()), Times.Once); 877mockConnection.Verify(c => c.StreamAsyncCore<int>("stream2", Array.Empty<object>(), It.IsAny<CancellationToken>()), Times.Once);
HubServerProxyGeneratorTests.cs (8)
60Array.Empty<object>(), 82Array.Empty<object>(), 105Array.Empty<object>(), 184Array.Empty<object>(), 191Array.Empty<object>(), 197Array.Empty<object>(), 315Array.Empty<object>(), 322Array.Empty<object>(),
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.SignalR.Common (3)
Protocol\HubMethodInvocationMessage.cs (2)
113streamIds = string.Join(", ", StreamIds != null ? StreamIds.Select(id => id?.ToString()) : Array.Empty<string>()); 168streamIds = string.Join(", ", StreamIds != null ? StreamIds.Select(id => id?.ToString()) : Array.Empty<string>());
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.SignalR.Common.Tests (27)
Internal\Protocol\JsonHubProtocolTests.cs (1)
52var binder = new TestBinder(Array.Empty<Type>(), typeof(object));
Internal\Protocol\JsonHubProtocolTestsBase.cs (8)
35new JsonProtocolTestData("InvocationMessage_HasStreamArgument", new InvocationMessage(null, "Target", Array.Empty<object>(), new string[] { "__test_id__" }), true, true, "{\"type\":1,\"target\":\"Target\",\"arguments\":[],\"streamIds\":[\"__test_id__\"]}"), 37new JsonProtocolTestData("InvocationMessage_HasMultipleStreams", new InvocationMessage(null, "Target", Array.Empty<object>(), new string[] { "__test_id__", "__test_id2__" }), true, true, "{\"type\":1,\"target\":\"Target\",\"arguments\":[],\"streamIds\":[\"__test_id__\",\"__test_id2__\"]}"), 78new JsonProtocolTestData("StreamInvocationMessage_HasStreamArgument", new StreamInvocationMessage("123", "Target", Array.Empty<object>(), new string[] { "__test_id__" }), true, true, "{\"type\":4,\"invocationId\":\"123\",\"target\":\"Target\",\"arguments\":[],\"streamIds\":[\"__test_id__\"]}"), 194var binder = new TestBinder(Array.Empty<Type>(), typeof(object)); 205var binder = new TestBinder(Array.Empty<Type>(), typeof(object)); 209Assert.Same(Array.Empty<string>(), (message as InvocationMessage).StreamIds); 376new MessageSizeTestData("StreamInvocationMessage", new StreamInvocationMessage("1", "target", Array.Empty<object>()), 63), 377new MessageSizeTestData("StreamInvocationMessage_WithStreamId", new StreamInvocationMessage("1", "target", Array.Empty<object>(), new [] { "2" }), 81),
Internal\Protocol\MemoryBufferWriterTests.cs (2)
304Array.Clear(data, 0, data.Length); 351Array.Clear(data, 0, data.Length);
Internal\Protocol\MessagePackHubProtocolTestBase.cs (9)
65message: new InvocationMessage("xyz", "method", Array.Empty<object>()), 69message: new InvocationMessage("method", Array.Empty<object>()), 81message: new InvocationMessage(null, "Target", Array.Empty<object>(), new string[] { "__test_id__" }), 89message: new InvocationMessage(null, "Target", Array.Empty<object>(), new string[] { "__test_id__", "__test_id2__" }), 147message: new StreamInvocationMessage("xyz", "method", Array.Empty<object>()), 155message: new StreamInvocationMessage("xyz", "method", Array.Empty<object>(), new string[] { "__test_id__" }), 239var expectedMessage = new InvocationMessage("xyz", "method", Array.Empty<object>()); 428new MessageSizeTestData("StreamInvocationMessage", new StreamInvocationMessage("1", "target", Array.Empty<object>()), 15), 429new MessageSizeTestData("StreamInvocationMessage_WithStreamId", new StreamInvocationMessage("1", "target", Array.Empty<object>(), new [] { "2" }), 17),
Internal\Protocol\NewtonsoftJsonHubProtocolTests.cs (1)
50var binder = new TestBinder(Array.Empty<Type>(), typeof(object));
Internal\Protocol\Utf8BufferTextWriterTests.cs (1)
393return Array.Empty<byte>();
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (5)
37Array.Copy(data, 0, startSegment, 10, data.Length); 52Array.Copy(data, 0, startSegment, 10, data.Length); 67Array.Copy(data, 0, startSegment, 10, data.Length); 96segments.Add(Array.Empty<byte>()); 100segments.Add(Array.Empty<byte>());
Microsoft.AspNetCore.SignalR.Core (16)
ClientProxyExtensions.cs (2)
24return clientProxy.SendCoreAsync(method, Array.Empty<object>(), cancellationToken); 232return clientProxy.InvokeCoreAsync<T>(method, Array.Empty<object>(), cancellationToken);
HubOptionsSetup`T.cs (1)
32options.SupportedProtocols = new List<string>(_hubOptions.SupportedProtocols ?? Array.Empty<string>());
Internal\DefaultHubActivator.cs (1)
30hub = (THub)_objectFactory.Value(_serviceProvider, Array.Empty<object>());
Internal\HubFilterFactory.cs (2)
18_objectFactory = ActivatorUtilities.CreateFactory(filterType, Array.Empty<Type>()); 92filter = (IHubFilter)_objectFactory.Invoke(serviceProvider, Array.Empty<object>());
Internal\Proxies.cs (1)
167return _lifetimeManager.InvokeConnectionAsync<T>(_connectionId, method, args ?? Array.Empty<object?>(), cancellationToken);
Internal\Utf8HashLookup.cs (1)
130Array.Copy(_slots, newSlots, _count);
SerializedHubMessage.cs (1)
82return Array.Empty<SerializedMessage>();
src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (6)
495(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 496(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 497(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_valueTaskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 514(awaitable) => ((MethodInfo)awaitable.GetType().GetMemberWithSameMetadataDefinitionAs(_taskGetAwaiterMethodInfo)).Invoke(awaitable, Array.Empty<object>()), 515(awaiter) => (bool)((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetIsCompletedMethodInfo)).Invoke(awaiter, Array.Empty<object>())!, 516(awaiter) => ((MethodInfo)awaiter.GetType().GetMemberWithSameMetadataDefinitionAs(_taskAwaiterGetResultMethodInfo)).Invoke(awaiter, Array.Empty<object>())!,
src\SignalR\common\Shared\MessageBuffer.cs (1)
419Array.Clear(_messages, 0, BufferLength);
Microsoft.AspNetCore.SignalR.Microbenchmarks (30)
DefaultHubDispatcherBenchmark.cs (12)
215return _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", "Invocation", Array.Empty<object>())); 221return _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", "InvocationAsync", Array.Empty<object>())); 227return _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", "InvocationReturnValue", Array.Empty<object>())); 233return _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", "InvocationReturnAsync", Array.Empty<object>())); 239return _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", "InvocationValueTaskAsync", Array.Empty<object>())); 245return _dispatcher.DispatchMessageAsync(_connectionContext, new StreamInvocationMessage("123", "StreamChannelReader", Array.Empty<object>())); 251return _dispatcher.DispatchMessageAsync(_connectionContext, new StreamInvocationMessage("123", "StreamChannelReaderAsync", Array.Empty<object>())); 257return _dispatcher.DispatchMessageAsync(_connectionContext, new StreamInvocationMessage("123", "StreamChannelReaderValueTaskAsync", Array.Empty<object>())); 344await _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", nameof(TestHub.UploadStream), Array.Empty<object>(), streamIds: new string[] { "1" })); 355await _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", nameof(TestHub.UploadStreamIAsynEnumerable), Array.Empty<object>(), streamIds: new string[] { "1" })); 366await _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", nameof(TestHub.UploadStream), Array.Empty<object>(), streamIds: new string[] { "1" })); 380await _dispatcher.DispatchMessageAsync(_connectionContext, new InvocationMessage("123", nameof(TestHub.UploadStreamIAsynEnumerable), Array.Empty<object>(), streamIds: new string[] { "1" }));
DefaultHubLifetimeManagerBenchmark.cs (9)
75return _hubLifetimeManager.SendAllAsync("MethodName", Array.Empty<object>()); 81return _hubLifetimeManager.SendGroupAsync(_groupNames[0], "MethodName", Array.Empty<object>()); 87return _hubLifetimeManager.SendGroupsAsync(_groupNames, "MethodName", Array.Empty<object>()); 93return _hubLifetimeManager.SendGroupExceptAsync(_groupNames[0], "MethodName", Array.Empty<object>(), _subsetConnectionIds); 99return _hubLifetimeManager.SendAllExceptAsync("MethodName", Array.Empty<object>(), _subsetConnectionIds); 105return _hubLifetimeManager.SendConnectionAsync(_connectionIds[0], "MethodName", Array.Empty<object>()); 111return _hubLifetimeManager.SendConnectionsAsync(_subsetConnectionIds, "MethodName", Array.Empty<object>()); 117return _hubLifetimeManager.SendUserAsync(_userIdentifiers[0], "MethodName", Array.Empty<object>()); 123return _hubLifetimeManager.SendUsersAsync(_userIdentifiers, "MethodName", Array.Empty<object>());
HubProtocolBenchmark.cs (1)
42_hubMessage = new InvocationMessage("Target", Array.Empty<object>());
RedisProtocolBenchmark.cs (1)
39_args = Array.Empty<object>();
ServerSentEventsBenchmark.cs (1)
45hubMessage = new InvocationMessage("Target", Array.Empty<object>());
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (5)
37Array.Copy(data, 0, startSegment, 10, data.Length); 52Array.Copy(data, 0, startSegment, 10, data.Length); 67Array.Copy(data, 0, startSegment, 10, data.Length); 96segments.Add(Array.Empty<byte>()); 100segments.Add(Array.Empty<byte>());
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
190streamIds = newStreamIds?.ToArray() ?? Array.Empty<string>(); 870return arguments ?? Array.Empty<object>();
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (4)
Protocol\NewtonsoftJsonHubProtocol.cs (3)
190streamIds = newStreamIds?.ToArray() ?? Array.Empty<string>(); 833return arguments ?? Array.Empty<object?>(); 906return Array.Empty<object?>();
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
Internal\DefaultHubMessageSerializer.cs (1)
15var supportedProtocols = hubSupportedProtocols ?? globalSupportedProtocols ?? Array.Empty<string>();
Internal\RedisProtocol.cs (1)
256var serialized = reader.ReadBytes()?.ToArray() ?? Array.Empty<byte>();
src\SignalR\common\Shared\MemoryBufferWriter.cs (1)
222return Array.Empty<byte>();
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
DefaultHubMessageSerializerTests.cs (1)
135private static readonly InvocationMessage _testMessage = new InvocationMessage("target", Array.Empty<object>());
RedisProtocolTests.cs (1)
94private static readonly InvocationMessage _testMessage = new InvocationMessage("target", Array.Empty<object>());
Microsoft.AspNetCore.SignalR.Tests (25)
HubConnectionHandlerTests.ClientResult.cs (2)
244_ = await client.SendHubMessageAsync(new InvocationMessage("1", nameof(MethodHub.BlockingMethod), Array.Empty<object>())).DefaultTimeout(); 459var invocationId = await client.BeginUploadStreamAsync("1", nameof(MethodHub.GetClientResultWithStream), new[] { streamId }, Array.Empty<object>()).DefaultTimeout();
HubConnectionHandlerTests.cs (22)
2054await client.SendHubMessageAsync(new StreamInvocationMessage(invocationId, nameof(StreamingHub.BlockingStream), Array.Empty<object>())); 3190await client.SendHubMessageAsync(new StreamInvocationMessage("1", nameof(StreamingHub.BlockingStream), Array.Empty<object>())).DefaultTimeout(); 3296await client.SendHubMessageAsync(new StreamInvocationMessage("123", nameof(StreamingHub.BlockingStream), Array.Empty<object>())).DefaultTimeout(); 3298await client.SendHubMessageAsync(new StreamInvocationMessage("123", nameof(StreamingHub.BlockingStream), Array.Empty<object>())).DefaultTimeout(); 3602await client.BeginUploadStreamAsync("invocationId", nameof(MethodHub.StreamDontRead), new[] { "id" }, Array.Empty<object>()).DefaultTimeout(); 3626await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), new[] { "id" }, Array.Empty<object>()); 3649await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.UploadArray), new[] { "id" }, Array.Empty<object>()); 3681await client.BeginUploadStreamAsync("invocation_" + id, nameof(MethodHub.StreamingConcat), new[] { id }, Array.Empty<object>()); 3741await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.UploadArrayAuth), new[] { "id" }, Array.Empty<object>()); 3777await client.BeginUploadStreamAsync("invocation", nameof(LongRunningHub.Upload), new[] { "id" }, Array.Empty<object>()); 3873await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: new[] { "id" }, Array.Empty<object>()).DefaultTimeout(); 3924await client.BeginUploadStreamAsync("invocationId", nameof(MethodHub.TestTypeCastingErrors), new[] { "channelId" }, Array.Empty<object>()).DefaultTimeout(); 4000await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.TestCustomErrorPassing), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4020await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: new[] { "id", "id2" }, args: Array.Empty<object>()).DefaultTimeout(); 4039await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: Array.Empty<string>(), args: Array.Empty<object>()).DefaultTimeout(); 4062await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.StreamingConcat), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4104await client.BeginUploadStreamAsync(invocationId: null, nameof(MethodHub.StreamingConcat), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4137await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.UploadIgnoreItems), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4174await client.SendStreamInvocationAsync(nameof(MethodHub.StreamAndUploadIgnoreItems), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout(); 4421var messagePromise = client.StreamAsync(nameof(StreamingHub.StreamEcho), new[] { streamId }, Array.Empty<object>()).DefaultTimeout(); 4574await client.BeginUploadStreamAsync("invocation", nameof(MethodHub.UploadDoesWorkOnComplete), streamIds: new[] { "id" }, args: Array.Empty<object>()).DefaultTimeout();
WebSocketsTransportTests.cs (1)
34var clientCertificate = new X509Certificate(Array.Empty<byte>());
Microsoft.AspNetCore.SpaServices.Extensions (2)
Npm\NodeScriptRunner.cs (1)
111var containsNewline = Array.IndexOf(
Util\EventedStreamReader.cs (1)
98while ((lineBreakPos = Array.IndexOf(buf, '\n', startPos, chunkLength - startPos)) >= 0 && startPos < chunkLength)
Microsoft.AspNetCore.TestHost (5)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.7.25377.103\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
182return buildMethod?.Invoke(builder, Array.Empty<object>()); 238_entryPoint.Invoke(null, Array.Empty<object>());
TestWebSocket.cs (3)
143Array.Copy(receiveMessage.Buffer.Array!, receiveMessage.Buffer.Offset, buffer.Array!, buffer.Offset, count); 231Buffer = new ArraySegment<byte>(Array.Empty<byte>()); 291Array.Copy(message.Buffer.Array!, message.Buffer.Offset, array, 0, message.Buffer.Count);
Microsoft.AspNetCore.TestHost.Tests (1)
ResponseBodyTests.cs (1)
146var zeroByteRead = stream.ReadAsync(Array.Empty<byte>(), 0, 0);
Microsoft.AspNetCore.WebSockets.Microbenchmarks (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.AspNetCore.WebUtilities (3)
HttpResponseStreamWriter.cs (1)
414values ??= Array.Empty<char>();
src\Shared\WebEncoders\WebEncoders.cs (2)
72return Array.Empty<byte>(); 129return Array.Empty<byte>();
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (6)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (5)
37Array.Copy(data, 0, startSegment, 10, data.Length); 52Array.Copy(data, 0, startSegment, 10, data.Length); 67Array.Copy(data, 0, startSegment, 10, data.Length); 96segments.Add(Array.Empty<byte>()); 100segments.Add(Array.Empty<byte>());
Microsoft.AspNetCore.WebUtilities.Tests (6)
FormPipeReaderTests.cs (1)
643Array.Fill(keyValue, 'v');
src\Shared\Buffers.Testing\ReadOnlySequenceFactory.cs (5)
37Array.Copy(data, 0, startSegment, 10, data.Length); 52Array.Copy(data, 0, startSegment, 10, data.Length); 67Array.Copy(data, 0, startSegment, 10, data.Length); 96segments.Add(Array.Empty<byte>()); 100segments.Add(Array.Empty<byte>());
Microsoft.Build.Framework (2)
ChangeWaves.cs (2)
143else if (_cachedWave == EnableAllFeatures || Array.IndexOf(AllWaves, _cachedWave) >= 0) 175Debug.Assert(_runningTests || Array.IndexOf(AllWaves, wave) >= 0, $"Change wave version {wave} is invalid");
Microsoft.Build.Tasks.CodeAnalysis (4)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (2)
60MetadataItems = Array.Empty<ITaskItem>(); 61PropertyItems = Array.Empty<ITaskItem>();
src\Compilers\Core\MSBuildTask\Vbc.cs (1)
1003return Array.IndexOf(supportedList, langVersion) < 0;
src\Compilers\Shared\BuildServerConnection.cs (1)
341var buffer = Array.Empty<byte>();
Microsoft.Build.Tasks.CodeAnalysis.Sdk (4)
src\Compilers\Core\MSBuildTask\GenerateMSBuildEditorConfig.cs (2)
60MetadataItems = Array.Empty<ITaskItem>(); 61PropertyItems = Array.Empty<ITaskItem>();
src\Compilers\Core\MSBuildTask\Vbc.cs (1)
1003return Array.IndexOf(supportedList, langVersion) < 0;
src\Compilers\Shared\BuildServerConnection.cs (1)
341var buffer = Array.Empty<byte>();
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
TargetTests.cs (1)
981return Array.Empty<ILogger>();
Microsoft.Cci.Extensions (5)
Dgml\DgmlExtensions.cs (3)
20Array.Sort(assemblyNames, StringComparer.OrdinalIgnoreCase); 24let source = Array.BinarySearch(assemblyNames, a.Name.Value, StringComparer.OrdinalIgnoreCase) 26let target = Array.BinarySearch(assemblyNames, ar.Name.Value, StringComparer.OrdinalIgnoreCase)
Differs\ListMerger.cs (2)
52int findIndex0 = Array.FindIndex(list0, list0Index, list0End - list0Index, t => list1[list1Index].Equals(t)); 64int findIndex1 = Array.FindIndex(list1, list1Index, list1End - list1Index, t => list0[list0Index].Equals(t));
Microsoft.CodeAnalysis (120)
Binding\AbstractLookupSymbolsInfo.cs (1)
37Array.Sort(_arities);
CodeGen\SequencePointList.cs (1)
33_points = Array.Empty<OffsetAndSpan>();
CodeGen\SwitchIntegralJumpTableEmitter.cs (1)
70Array.Sort(caseLabels, CompareIntegralSwitchLabels);
CodeGen\TokenMap.cs (2)
26private object[] _items = Array.Empty<object>(); 76Array.Resize(ref items, Math.Max(8, count * 2));
Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
CommandLine\CommandLineParser.cs (1)
399return Array.Empty<string>();
CommandLine\TouchedFileLogger.cs (2)
75Array.Sort<string>(temp); 100Array.Sort<string>(temp);
Diagnostic\CommonMessageProvider.cs (1)
82return CreateDiagnostic(code, location, Array.Empty<object>());
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
52_messageArgs = messageArgs ?? Array.Empty<object?>();
Diagnostic\DiagnosticBag.cs (1)
368return Array.Empty<object>();
Diagnostic\DiagnosticInfo.cs (2)
42: this(messageProvider, errorCode, Array.Empty<object>()) 363Array.Copy(_arguments, newArguments, newArguments.Length);
Diagnostic\LocalizableResourceString.cs (1)
31: this(nameOfLocalizableResource, resourceManager, resourceSource, Array.Empty<string>())
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
35private static readonly ParameterInfo[] s_noParameters = Array.Empty<ParameterInfo>();
DiaSymReader\Writer\SymUnmanagedSequencePointsWriter.cs (5)
44Array.Resize(ref _offsets, newLength); 45Array.Resize(ref _startLines, newLength); 46Array.Resize(ref _startColumns, newLength); 47Array.Resize(ref _endLines, newLength); 48Array.Resize(ref _endColumns, newLength);
EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
InternalUtilities\WeakList.cs (4)
22_items = Array.Empty<WeakReference<T>>(); 63Array.Copy(_items, 0, newItems, 0, _items.Length); 104Array.Copy(_items, 0, result, 0, firstDead); 208_weakList._items = Array.Empty<WeakReference<T>>();
MetadataReader\MetadataDecoder.cs (5)
1468values = Array.Empty<TypedConstant>(); 1627positionalArgs = Array.Empty<TypedConstant>(); 1628namedArgs = Array.Empty<KeyValuePair<string, TypedConstant>>(); 1674positionalArgs = Array.Empty<TypedConstant>(); 1675namedArgs = Array.Empty<KeyValuePair<String, TypedConstant>>();
PEWriter\CustomDebugInfoWriter.cs (1)
128byte[] result = encoder.ToArray() ?? Array.Empty<byte>();
PEWriter\SigningUtilities.cs (1)
29Array.Reverse(signature);
ReferenceManager\CommonReferenceManager.Binding.cs (3)
618Array.Clear(candidateInputAssemblySymbols, 0, candidateInputAssemblySymbols.Length); 711Array.Clear(candidateInputAssemblySymbols, 0, candidateInputAssemblySymbols.Length); 757Array.Clear(candidateInputAssemblySymbols, 0, candidateInputAssemblySymbols.Length);
SpecialType.cs (1)
141/// Indicates that the type is <see cref="Array"/>.
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (12)
19/// <seealso cref="Array.Clear(Array)"/> 24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
StrongName\CryptoBlobParser.cs (1)
342Array.Reverse(data);
Syntax\AbstractWarningStateMap.cs (1)
57int r = Array.BinarySearch(_warningStateMapEntries, new WarningStateMapEntry(position));
Syntax\GreenNode.cs (3)
49private static readonly DiagnosticInfo[] s_noDiagnostics = Array.Empty<DiagnosticInfo>(); 50private static readonly SyntaxAnnotation[] s_noAnnotations = Array.Empty<SyntaxAnnotation>(); 1052Array.Resize(ref errorInfos, length + 1);
Syntax\InternalSyntax\SyntaxDiagnosticInfoList.cs (1)
142Array.Copy(_stack, tmp, _stack.Length);
Syntax\InternalSyntax\SyntaxList.WithManyChildren.cs (1)
58Array.Copy(this.children, 0, array, offset, this.children.Length);
Syntax\InternalSyntax\SyntaxListBuilder.cs (3)
28Array.Clear(_nodes, 0, _nodes.Length); 147Array.Resize(ref _nodes, newSize); 188Array.Copy(_nodes, tmp, this.Count);
Syntax\InternalSyntax\SyntaxListPool.cs (1)
83Array.Copy(_freeList, tmp, _freeList.Length);
Syntax\SyntaxListBuilder.cs (1)
151Array.Copy(_nodes, tmp, _nodes.Length);
Syntax\SyntaxNode.Iterators.cs (4)
106Array.Resize(ref _stack, checked(_stackPtr * 2)); 125Array.Clear(_stack, 0, _stack.Length); 172Array.Resize(ref _stack, checked(_stackPtr * 2)); 181Array.Clear(_stack, 0, _stack.Length);
Syntax\SyntaxNodeOrTokenListBuilder.cs (1)
126Array.Copy(_nodes, tmp, _nodes.Length);
Syntax\SyntaxTokenListBuilder.cs (1)
85Array.Copy(_nodes, tmp, _nodes.Length);
Syntax\SyntaxTriviaListBuilder.cs (1)
124Array.Copy(_nodes, tmp, _nodes.Length);
Text\LargeText.cs (2)
121Array.Resize(ref chunk, charsRead); 169Array.Copy(chunk, chunkStartOffset, destination, destinationIndex, charsToCopy);
Text\LargeTextWriter.cs (2)
107Array.Copy(chars, index, _buffer, _currentUsed, copy); 141Array.Resize(ref _buffer, _currentUsed);
Text\SourceTextStream.cs (1)
128Array.Copy(preambleBytes, 0, buffer, offset, length);
TreeDumper.cs (1)
193var result = ti?.GetDeclaredMethod("get_IsDefault")?.Invoke(o, Array.Empty<object>());
Microsoft.CodeAnalysis.Analyzers (73)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Microsoft.CodeAnalysis.AnalyzerUtilities (68)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.ValuePool.cs (1)
30Array.Sort(values);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
Microsoft.CodeAnalysis.BannedApiAnalyzers (73)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Microsoft.CodeAnalysis.CodeStyle (68)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
35private static readonly ParameterInfo[] s_noParameters = Array.Empty<ParameterInfo>();
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
Microsoft.CodeAnalysis.CodeStyle.Fixes (6)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Microsoft.CodeAnalysis.Collections.Package (43)
Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
Segmented\SegmentedArray.cs (12)
19/// <seealso cref="Array.Clear(Array)"/> 24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
Microsoft.CodeAnalysis.CSharp (31)
Binder\Binder_QueryErrors.cs (1)
49new DiagnosticInfoWithSymbols(ErrorCode.ERR_BadDynamicQuery, Array.Empty<object>(), symbols),
Compilation\CSharpCompilation.cs (1)
2139args: Array.Empty<object>(),
Compilation\CSharpCompilerDiagnosticAnalyzer.cs (1)
23var errorCodes = Enum.GetValues(typeof(ErrorCode));
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (3)
167return builder == null ? Array.Empty<XNode>() : builder.ToArrayAndFree(); 375return Array.Empty<XNode>(); 417return Array.Empty<XNode>();
Errors\CSDiagnosticInfo.cs (1)
24: this(code, Array.Empty<object>(), ImmutableArray<Symbol>.Empty, ImmutableArray<Location>.Empty)
Errors\SyntaxDiagnosticInfo.cs (1)
25: this(offset, width, code, Array.Empty<object>())
Generated\BoundNodes.xml.Generated.cs (5)
15294new TreeDumperNode("boundDimensionsOpt", null, node.BoundDimensionsOpt.IsDefault ? Array.Empty<TreeDumperNode>() : from x in node.BoundDimensionsOpt select Visit(x, null)), 15897new TreeDumperNode("argumentsOpt", null, node.ArgumentsOpt.IsDefault ? Array.Empty<TreeDumperNode>() : from x in node.ArgumentsOpt select Visit(x, null)), 15944public override TreeDumperNode VisitYieldBreakStatement(BoundYieldBreakStatement node, object? arg) => new TreeDumperNode("yieldBreakStatement", null, Array.Empty<TreeDumperNode>() 17100new TreeDumperNode("deconstruction", null, node.Deconstruction.IsDefault ? Array.Empty<TreeDumperNode>() : from x in node.Deconstruction select Visit(x, null)), 17101new TreeDumperNode("properties", null, node.Properties.IsDefault ? Array.Empty<TreeDumperNode>() : from x in node.Properties select Visit(x, null)),
Lowering\SynthesizedSubmissionFields.cs (1)
52return _previousSubmissionFieldMap == null ? Array.Empty<FieldSymbol>() : (IEnumerable<FieldSymbol>)_previousSubmissionFieldMap.Values;
Parser\Lexer.cs (2)
1302Array.Copy(_identBuffer, tmp, _identBuffer.Length); 3114this.AddError(error.Value, errorArgs ?? Array.Empty<object>());
Parser\SyntaxParser.cs (7)
97Array.Clear(blendedTokens, 0, blendedTokens.Length); 410Array.Copy(_blendedTokens, shiftOffset, _blendedTokens, 0, shiftCount); 420Array.Resize(ref _blendedTokens, _blendedTokens.Length * 2); 437Array.Copy(_lexedTokens, shiftOffset, _lexedTokens, 0, shiftCount); 448Array.Resize(ref _lexedTokens, _lexedTokens.Length * 2); 460Array.Clear(lexedTokens, 0, _maxWrittenLexedTokenIndex + 1); 760return AddError(node, code, Array.Empty<object>());
Symbols\Source\IndexedTypeParameterSymbol.cs (2)
29private static TypeParameterSymbol[] s_parameterPool = Array.Empty<TypeParameterSymbol>(); 64Array.Copy(initialPool, newPool, initialPool.Length);
Symbols\Source\SourceNamespaceSymbol.cs (2)
303Array.Clear(memberOfArity, 0, memberOfArity.Length); 313Array.Resize(ref memberOfArity, arity + 1);
Symbols\Synthesized\RefKindVector.cs (1)
139var bitVector = BitVector.FromWords(firstWord.Value, otherWords?.ToArrayAndFree() ?? Array.Empty<ulong>(), capacity * BitsPerRefKind);
Syntax\CSharpSyntaxTree.cs (1)
678return (map.Entries.Length == 1) ? Array.Empty<LineMapping>() : map.GetLineMappings(GetText(cancellationToken).Lines);
Syntax\SyntaxTreeDiagnosticEnumerator.cs (1)
174Array.Copy(_stack, tmp, _stack.Length);
Utilities\ValueSetFactory.NumericValueSet.cs (1)
300Array.Sort(values);
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
43nameof(Array),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
1083const string EmptyName = nameof(Array.Empty);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
84var arrayLengthProperty = TryGetNoArgInt32Property(arrayType, nameof(Array.Length));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
155Identifier(nameof(Array.Empty)),
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (8)
CommandLineTests.cs (7)
1881Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex - 1]) >= 0); 1882Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex + version.Length]) >= 0); 6051Assert.Equal(Array.Empty<byte>(), assemblyName.GetPublicKeyToken()); 9522? Array.Empty<DiagnosticAnalyzer>() 10051string[] expectedWarningsNone = Array.Empty<string>(); 15092var none = Array.Empty<TempFile>(); 15311var additionalArgs = Array.Empty<string>();
GeneratorDriverCacheTests.cs (1)
101private static GeneratorDriver[] GetDrivers(int count) => Enumerable.Range(0, count).Select(i => CSharpGeneratorDriver.Create(Array.Empty<ISourceGenerator>())).ToArray();
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (1)
41: Array.Empty<TextSpan>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (13)
ChangeSignature\ChangeSignature_Delegates.cs (6)
179var updatedSignature = Array.Empty<int>(); 602var updatedSignature = Array.Empty<int>(); 645var updatedSignature = Array.Empty<int>(); 672var updatedSignature = Array.Empty<int>(); 723var updatedSignature = Array.Empty<int>(); 755var updatedSignature = Array.Empty<int>();
ChangeSignature\RemoveParametersTests.cs (1)
119var updatedSignature = Array.Empty<int>();
CodeActions\SyncNamespace\SyncNamespaceTests_MoveFile.cs (1)
150Array.Empty<string>()
CodeActions\SyncNamespace\SyncNamespaceTests_NoAction.cs (1)
206var folders = Array.Empty<string>();
Completion\CompletionProviders\ConversionCompletionProviderTests.cs (1)
54Array.Sort(completionList);
Debugging\ProximityExpressionsGetterTests.cs (1)
113AssertEx.Equal(expectedTerms, actualTerms ?? Array.Empty<string>());
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (1)
411var selectedStyleIndex0 = Array.IndexOf(setting0.AllStyles, setting0.StyleName);
Intents\IntentTestsBase.cs (1)
84Array.Sort(expectedTexts);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenCapturing.cs (1)
304return Array.Empty<MethodInfo>();
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (15)
Emit\NumericIntPtrTests.cs (15)
2415comp.VerifyDiagnostics(expectedError is null ? Array.Empty<DiagnosticDescription>() : new[] { expectedError }); 5993Array.Empty<DiagnosticDescription>() : 6062unaryOperator(op, opType, opType, expectedSymbol, operand, expectedResult, expectedIL, diagnostic != null ? new[] { diagnostic } : Array.Empty<DiagnosticDescription>()); 6287return diagnostic != null ? new[] { diagnostic } : Array.Empty<DiagnosticDescription>(); 6661return diagnostic != null ? new[] { diagnostic } : Array.Empty<DiagnosticDescription>(); 7061binaryOperator(op, leftType, rightType, expectedSymbol, diagnostics ?? Array.Empty<DiagnosticDescription>()); 8898static DiagnosticDescription[] getNoDiagnostics(string opType, string op, string operand) => Array.Empty<DiagnosticDescription>(); 8940constantExpression(opType, $"unchecked({expr})", expectedResultUnchecked, Array.Empty<DiagnosticDescription>()); 8952constantExpression(opType, expr, expectedResult, Array.Empty<DiagnosticDescription>()); 8953constantExpression(opType, $"checked({expr})", expectedResult, Array.Empty<DiagnosticDescription>()); 8954constantExpression(opType, $"unchecked({expr})", expectedResult, Array.Empty<DiagnosticDescription>()); 8994constantExpression(opType, $"unchecked({expr})", expectedResultUnchecked, Array.Empty<DiagnosticDescription>()); 9006constantExpression(opType, expr, expectedResult, Array.Empty<DiagnosticDescription>()); 9007constantExpression(opType, $"checked({expr})", expectedResult, Array.Empty<DiagnosticDescription>()); 9008constantExpression(opType, $"unchecked({expr})", expectedResult, Array.Empty<DiagnosticDescription>());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (3)
Diagnostics\DiagnosticSuppressorTests.cs (1)
327var severities = Enum.GetValues(typeof(DiagnosticSeverity));
RefReadonlyParameterTests.cs (2)
4837verifier.VerifyDiagnostics(fromMetadata ? Array.Empty<DiagnosticDescription>() : new[] { warning1 }); 7254: Array.Empty<DiagnosticDescription>();
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (2)
EndToEndTests.cs (2)
355Array.Reverse(declarations); 399Array.Reverse(declarations);
Microsoft.CodeAnalysis.CSharp.Features (4)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
43nameof(Array),
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
1083const string EmptyName = nameof(Array.Empty);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (1)
84var arrayLengthProperty = TryGetNoArgInt32Property(arrayType, nameof(Array.Length));
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (1)
155Identifier(nameof(Array.Empty)),
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (51)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
110AssertEx.Equal(Array.Empty<SyntaxKind>(), unhandledKinds); 476var experimentalFeatures = Array.Empty<string>();
EditAndContinue\LineEditTests.cs (45)
209Array.Empty<SequencePointUpdates>(), 446Array.Empty<SequencePointUpdates>(), 506Array.Empty<SequencePointUpdates>(), 540Array.Empty<SequencePointUpdates>(), 610Array.Empty<SequencePointUpdates>(), 615Array.Empty<SequencePointUpdates>(), 647Array.Empty<SequencePointUpdates>(), 652Array.Empty<SequencePointUpdates>(), 686Array.Empty<SequencePointUpdates>(), 750Array.Empty<SequencePointUpdates>(), 788Array.Empty<SequencePointUpdates>(), 825Array.Empty<SequencePointUpdates>(), 932Array.Empty<SequencePointUpdates>(), 1088Array.Empty<SequencePointUpdates>(), 1108Array.Empty<SequencePointUpdates>(), 1128Array.Empty<SequencePointUpdates>(), 1151Array.Empty<SequencePointUpdates>(), 1174Array.Empty<SequencePointUpdates>(), 1199Array.Empty<SequencePointUpdates>(), 1267Array.Empty<SequencePointUpdates>(), 1327Array.Empty<SequencePointUpdates>(), 1332Array.Empty<SequencePointUpdates>(), 1419Array.Empty<SequencePointUpdates>(), 1528Array.Empty<SequencePointUpdates>()); 1552Array.Empty<SequencePointUpdates>()); 1577Array.Empty<SequencePointUpdates>(), 1629Array.Empty<SequencePointUpdates>(), 1683Array.Empty<SequencePointUpdates>(), 1712Array.Empty<SequencePointUpdates>(), 1740Array.Empty<SequencePointUpdates>(), 1768Array.Empty<SequencePointUpdates>(), 1796Array.Empty<SequencePointUpdates>(), 1824Array.Empty<SequencePointUpdates>(), 1851Array.Empty<SequencePointUpdates>(), 1879Array.Empty<SequencePointUpdates>(), 1884Array.Empty<SequencePointUpdates>(), 1914Array.Empty<SequencePointUpdates>(), 1947Array.Empty<SequencePointUpdates>(), 2167Array.Empty<SequencePointUpdates>(), 2196Array.Empty<SequencePointUpdates>(), 2440Array.Empty<SequencePointUpdates>(), 2466Array.Empty<SequencePointUpdates>(), 2606Array.Empty<SequencePointUpdates>(), 2807Array.Empty<SequencePointUpdates>(), 2815Array.Empty<SequencePointUpdates>(),
EditAndContinue\SyntaxComparerTests.cs (4)
127Array.Empty<SyntaxNode>()); 132Array.Empty<SyntaxNode>(), 139Array.Empty<SyntaxToken>()); 144Array.Empty<SyntaxToken>(),
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (18)
CommandLineRunnerTests.cs (2)
777Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex - 1]) >= 0); 778Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex + version.Length]) >= 0);
InteractiveSessionTests.cs (10)
138").ContinueWith<Array>(@" 144var result = script.EvaluateAsync().Result; 147Assert.Equal(2, ((Array)result.GetValue(0)).Length); 148Assert.Equal(2, ((Array)result.GetValue(1)).Length); 192").ContinueWith<Array>(@" 197var result = script.EvaluateAsync().Result; 200Assert.Equal(2, ((Array)result.GetValue(0)).Length); 201Assert.Equal(2, ((Array)result.GetValue(1)).Length); 1723AssertEx.SetEqual(Array.Empty<string>(), aliases); 1789AssertEx.SetEqual(Array.Empty<string>(), aliases);
ObjectFormatterTests.cs (6)
429Array x = Array.CreateInstance(typeof(Object), lengths: new int[] { 2, 3 }, lowerBounds: new int[] { 2, 9 }); 433Array y = Array.CreateInstance(typeof(Object), lengths: new int[] { 1, 1 }, lowerBounds: new int[] { 0, 0 }); 437Array z = Array.CreateInstance(typeof(Object), lengths: new int[] { 0, 0 }, lowerBounds: new int[] { 0, 0 });
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (33)
Semantics\InheritanceBindingTests.cs (8)
5086CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] { 5107CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] { 5128CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] { 5149CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] { 5538CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] { 5605CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] { 5672CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] { 5739CompileAndVerifyDiagnostics(text1, text2, Array.Empty<ErrorDescription>(), new ErrorDescription[] {
Semantics\LookupPositionTests.cs (3)
3127Array.Sort(actualSymbols); 3167Array.Sort(curr); 3178Array.Sort(curr);
Semantics\NativeIntegerTests.cs (16)
2435var compA = CreateVisualBasicCompilation(sourceA, referencedAssemblies: Array.Empty<MetadataReference>()); 6551comp.VerifyDiagnostics(expectedError is null ? Array.Empty<DiagnosticDescription>() : new[] { expectedError }); 9479Array.Empty<DiagnosticDescription>() : 9544unaryOperator(op, opType, opType, expectedSymbol, operand, expectedResult, expectedIL, diagnostic != null ? new[] { diagnostic } : Array.Empty<DiagnosticDescription>()); 9764return diagnostic != null ? new[] { diagnostic } : Array.Empty<DiagnosticDescription>(); 10139return diagnostic != null ? new[] { diagnostic } : Array.Empty<DiagnosticDescription>(); 10518binaryOperator(op, leftType, rightType, expectedSymbol, diagnostics ?? Array.Empty<DiagnosticDescription>()); 13148static DiagnosticDescription[] getNoDiagnostics(string opType, string op, string operand) => Array.Empty<DiagnosticDescription>(); 13190constantExpression(opType, $"unchecked({expr})", expectedResultUnchecked, Array.Empty<DiagnosticDescription>()); 13202constantExpression(opType, expr, expectedResult, Array.Empty<DiagnosticDescription>()); 13203constantExpression(opType, $"checked({expr})", expectedResult, Array.Empty<DiagnosticDescription>()); 13204constantExpression(opType, $"unchecked({expr})", expectedResult, Array.Empty<DiagnosticDescription>()); 13244constantExpression(opType, $"unchecked({expr})", expectedResultUnchecked, Array.Empty<DiagnosticDescription>()); 13256constantExpression(opType, expr, expectedResult, Array.Empty<DiagnosticDescription>()); 13257constantExpression(opType, $"checked({expr})", expectedResult, Array.Empty<DiagnosticDescription>()); 13258constantExpression(opType, $"unchecked({expr})", expectedResult, Array.Empty<DiagnosticDescription>());
Semantics\NullableReferenceTypesTests.cs (4)
144515? Array.Empty<DiagnosticDescription>() 144547? Array.Empty<DiagnosticDescription>() 144572? Array.Empty<DiagnosticDescription>() 150524Array.Empty<DiagnosticDescription>();
Semantics\OverloadResolutionTestBase.cs (1)
31var references = new[] { mscorlibRef }.Concat(additionalRefs ?? Array.Empty<MetadataReference>());
SourceGeneration\GeneratorDriverTests.cs (1)
2261verify(ref driver, compilation, Array.Empty<string>());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (12)
Compilation\CompilationAPITests.cs (3)
2689AssertEx.Equal(Array.Empty<CodeAnalysis.NullableAnnotation>(), GetAnonymousTypeNullableAnnotations(type)); 2777var compilation = CreateCompilation("", references: Array.Empty<MetadataReference>(), targetFramework: TargetFramework.Empty); 2967var compilation = CreateCompilation("", references: Array.Empty<MetadataReference>(), targetFramework: TargetFramework.Empty);
Compilation\UsedAssembliesTests.cs (1)
236System.Array.Copy(input, output = new DiagnosticDescription[input.Length], input.Length);
Symbols\DefaultInterfaceImplementationTests.cs (6)
9429ValidateMethodModifiers_10_02(source1, source2, accessibility, expectedIn9, expectedIn9AcrossAssemblyBoundaries: expectedIn9, expectedAcrossAssemblyBoundaries: Array.Empty<DiagnosticDescription>()); 12488expectedAcrossAssemblyBoundaries: Array.Empty<DiagnosticDescription>(), 14904ValidatePropertyModifiers_11_01(source1, source2, accessibility, expectedIn9, expectedNoImplementation, expectedAcrossAssemblyBoundaries: Array.Empty<DiagnosticDescription>()); 15948ValidatePropertyModifiers_11_11(source1, source2, expectedIn9, expectedAcrossAssemblyBoundaries: Array.Empty<DiagnosticDescription>()); 18452ValidatePropertyModifiers_23(source1, source2, getAccess, setAccess, expectedIn9, expectedAcrossAssemblyBoundaries: Array.Empty<DiagnosticDescription>()); 28413ValidateEventModifiers_11(source1, source2, accessibility, expectedIn9, expectedAcrossAssemblyBoundaries: Array.Empty<DiagnosticDescription>(), expectedNoImplementation);
Symbols\StaticAbstractMembersInInterfacesTests.cs (1)
6361expected = Array.Empty<DiagnosticDescription>();
Symbols\SymbolExtensionTests.cs (1)
282Assert.True(Array.IndexOf(namespaceNames, expectedName) >= 0);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Diagnostics\DiagnosticTest.cs (2)
41if (Array.IndexOf(excludedErrorCodes, code) >= 0) 56var values = Enum.GetValues(typeof(ErrorCode));
Parsing\FileModifierParsingTests.cs (1)
32expectedParsingDiagnostics ??= Array.Empty<DiagnosticDescription>();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CompilationTestUtils.cs (4)
35Array.Sort(descriptions); 36Array.Sort(symbolDescriptions); 50Array.Sort(descriptions); 51Array.Sort(symbolDescriptions);
CSharpTestSource.cs (1)
72return Array.Empty<SyntaxTree>();
DiagnosticTestUtilities.cs (1)
123e.Arguments.Select(x => x != null ? x.ToString() : null).ToArray() : Array.Empty<string>()
Extensions.cs (2)
553var a = (Array)o;
Microsoft.CodeAnalysis.EditorFeatures (1)
Editor\GoToAdjacentMemberCommandHandler.cs (1)
113var index = Array.BinarySearch(starts, caretPosition);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Options\OptionSerializerTests.cs (1)
164var possibleEnumValues = enumType.GetEnumValues();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Extensions\CollectionExtensionsTest.cs (1)
31stack.PushReverse(Array.Empty<int>());
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Compilers\Core\Portable\SpecialType.cs (1)
141/// Indicates that the type is <see cref="Array"/>.
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (4)
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TypeVariablesExpansion.cs (2)
35Debug.Assert(Array.TrueForAll(_typeParameters, t => t.IsGenericParameter)); 36Debug.Assert(Array.TrueForAll(_typeArguments, t => !t.IsGenericParameter));
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (1)
339Array.Reverse(specifiers);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (1)
883var index = Array.IndexOf(declaration.GetInterfacesOnType(), interfaceType);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (10)
Debugger\Engine\DkmClrValue.cs (6)
568var array = (System.Array)RawValue; 584var array = (Array)RawValue; 604var array = (Array)RawValue;
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TypeVariablesExpansion.cs (2)
35Debug.Assert(Array.TrueForAll(_typeParameters, t => t.IsGenericParameter)); 36Debug.Assert(Array.TrueForAll(_typeArguments, t => !t.IsGenericParameter));
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (1)
339Array.Reverse(specifiers);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (1)
883var index = Array.IndexOf(declaration.GetInterfacesOnType(), interfaceType);
Microsoft.CodeAnalysis.Extensions.Package (44)
Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (1)
Remote\RazorRemoteServiceCallbackDispatcherRegistry.cs (1)
14public static readonly RazorRemoteServiceCallbackDispatcherRegistry Empty = new(Array.Empty<(Type, RazorRemoteServiceCallbackDispatcher)>());
Microsoft.CodeAnalysis.Features (6)
Common\AbstractProjectExtensionProvider.cs (1)
106Array.IndexOf(extensionInfo.DocumentExtensions, PathUtilities.GetExtension(document.FilePath)) < 0)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
34private const string Length = nameof(Array.Length);
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (1)
72if (memberAccessName is not nameof(Array.Length) and not nameof(IList.Count))
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexEmbeddedCompletionProvider.cs (1)
37.WithFilterCharacterRule(CharacterSetModificationRule.Create(CharacterSetModificationKind.Replace, Array.Empty<char>()));
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
128var refIndex = Array.LastIndexOf(pathParts, "ref");
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
35private static readonly ParameterInfo[] s_noParameters = Array.Empty<ParameterInfo>();
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditScriptDescription.cs (1)
29=> VerifyEdits(Array.Empty<string>());
Microsoft.CodeAnalysis.InteractiveHost (45)
Interactive\Core\InteractiveHost.RemoteService.cs (2)
146int transcodingMarkerStart = Array.IndexOf(buffer, transcodingMarker[0], startIndex: 0, count: charsRead); 202Array.Resize(ref buffer, newBufferLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Handler\CodeActions\CodeActionResolveHelper.cs (4)
87return new LSP.WorkspaceEdit { DocumentChanges = Array.Empty<TextDocumentEdit>() }; 97return new LSP.WorkspaceEdit { DocumentChanges = Array.Empty<TextDocumentEdit>() }; 108return new LSP.WorkspaceEdit { DocumentChanges = Array.Empty<TextDocumentEdit>() }; 119return new LSP.WorkspaceEdit { DocumentChanges = Array.Empty<TextDocumentEdit>() };
Handler\Symbols\DocumentSymbolsHandler.cs (1)
57return Array.Empty<DocumentSymbol>();
LspServices\AbstractExportLspServiceAttribute.cs (1)
75InterfaceNames = Array.ConvertAll(serviceType.GetInterfaces(), t => t.AssemblyQualifiedName!);
Protocol\SumType.cs (1)
895=> sumType.Match(common => common, derived => Array.ConvertAll(derived, d => (TCommon)d));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Highlights\DocumentHighlightTests.cs (1)
105Array.Sort(results, (h1, h2) =>
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (74)
ExplicitAllocationAnalyzer.cs (1)
65private static readonly object[] EmptyMessageArgs = Array.Empty<object>();
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Microsoft.CodeAnalysis.PublicApiAnalyzers (67)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (3)
DeclarePublicAPIAnalyzerTestsBase.cs (3)
287var expectedDiagnostics = Array.Empty<DiagnosticResult>(); 1217] : Array.Empty<DiagnosticResult>(); 2227""", $@"", System.Array.Empty<DiagnosticResult>());
Microsoft.CodeAnalysis.Rebuild.UnitTests (4)
BasicDeterministicKeyBuilderTests.cs (1)
239Array.Empty<SyntaxTree>(),
CSharpDeterministicKeyBuilderTests.cs (1)
430Array.Empty<SyntaxTree>(),
DeterministicKeyBuilderTests.cs (2)
778CreateCompilation(Array.Empty<SyntaxTree>()), 804CreateCompilation(Array.Empty<SyntaxTree>()),
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\AssetProvider.cs (1)
280Array.Copy(missingChecksums, newMissingChecksums, missingChecksumsCount);
Microsoft.CodeAnalysis.ResxSourceGenerator (70)
AbstractResxGenerator.cs (3)
65return Array.Empty<ResourceInformation>(); 73return Array.Empty<ResourceInformation>(); 121var noWarn = Array.Empty<string>();
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
Microsoft.CodeAnalysis.Scripting (17)
Hosting\CommandLine\CommandLineHelpers.cs (2)
22return options.WithReferences(Array.Empty<MetadataReference>()).WithImports(Array.Empty<string>());
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (8)
122FormatArray(result, (Array)obj); 437Array array; 438if ((array = value as Array) != null) // TODO (tomat): n-dim arrays 527object key = type.GetDeclaredProperty("Key").GetValue(obj, Array.Empty<object>()); 528object value = type.GetDeclaredProperty("Value").GetValue(obj, Array.Empty<object>()); 540if (collection is Array array) 559private void FormatArray(Builder result, Array array) 642private void FormatMultidimensionalArrayElements(Builder result, Array array, bool inline)
Hosting\ObjectFormatter\CommonTypeNameFormatter.cs (1)
131public virtual string FormatArrayTypeName(Type arrayType, Array arrayOpt, CommonTypeNameFormatterOptions options)
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (2)
256: method.Invoke(obj, Array.Empty<object>()); 265return property.GetValue(obj, Array.Empty<object>());
ScriptExecutionState.cs (2)
49Array.Copy(_submissionStates, copy, SubmissionStateCount); 161Array.Resize(ref _submissionStates, Math.Max(SubmissionStateCount, _submissionStates.Length * 2));
src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (2)
264return Array.Empty<byte>(); 280return Array.Empty<byte>();
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
ObjectFormatterFixtures\Custom.cs (1)
420public void CopyTo(Array array, int index)
Microsoft.CodeAnalysis.Test.Utilities (11)
Compilation\TestOperationVisitor.cs (2)
446IEnumerable<IOperation> children = Array.Empty<IOperation>(); 650VisitMemberReference(operation, Array.Empty<IOperation>());
Diagnostics\CommonDiagnosticAnalyzers.cs (3)
1056var customTags = !configurable ? new[] { WellKnownDiagnosticTags.NotConfigurable } : Array.Empty<string>(); 2405var customTags = configurable ? Array.Empty<string>() : new[] { WellKnownDiagnosticTags.NotConfigurable }; 2513var customTags = Array.Empty<string>();
Metadata\ILBuilderVisualizer.cs (2)
217new ILBuilderVisualizer(block.builder.module).DumpILBlock(il, instrCnt, sb, Array.Empty<ILVisualizer.HandlerSpan>(), block.Start); 246new ILBuilderVisualizer(block.builder.module).DumpILBlock(il, il.Length, sb, Array.Empty<HandlerSpan>(), block.Start);
Metadata\ILValidation.cs (1)
109Array.Reverse(reversedSignature);
Platform\Desktop\CLRHelpers.cs (3)
150public void VEHandler(int VECode, tag_VerError Context, Array psa) 253[In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] Array psa); 259void VEHandler([In, MarshalAs(UnmanagedType.Error)] int VECode, [In] tag_VerError Context, [In, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_VARIANT)] Array psa);
Microsoft.CodeAnalysis.Threading.Package (43)
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (12)
19/// <seealso cref="Array.Clear(Array)"/> 24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
Microsoft.CodeAnalysis.UnitTests (49)
Collections\HashSet\ISet_Generic_Tests`1.cs (1)
60while (set.Contains(toAdd) || (InvalidValues != Array.Empty<T>() && InvalidValues.Contains(toAdd, GetIEqualityComparer())))
Collections\ImmutableDictionaryBuilderTestBase.cs (1)
240collection.CopyTo(Array.Empty<object>(), 0);
Collections\ImmutableDictionaryTestBase.cs (1)
140((ICollection)Empty<string, int>()).CopyTo(Array.Empty<object>(), 0);
Collections\ImmutableSetTest.cs (14)
193string[] array = Array.Empty<string>(); 298new SetTriad(SetWith<int>(), Array.Empty<int>(), true), 304new SetTriad(SetWith<int>(5), Array.Empty<int>(), false), 316new SetTriad(Array.Empty<int>(), Array.Empty<int>(), false), 317new SetTriad(new int[] { 1 }, Array.Empty<int>(), false), 321new SetTriad(Array.Empty<int>(), new int[] { 1 }, true), 329new SetTriad(Array.Empty<int>(), Array.Empty<int>(), true), 332new SetTriad(new int[] { 1 }, Array.Empty<int>(), false), 347new SetTriad(Array.Empty<int>(), Array.Empty<int>(), false), 348new SetTriad(Array.Empty<int>(), new int[] { 1 }, false), 452Array.Sort(values, comparer);
Collections\ImmutableSetTest.nonnetstandard.cs (1)
57UnionTestHelper(this.Empty<int>().Union(new[] { 1, 2, 3 }), Array.Empty<int>());
Collections\List\ICollection.Generic.Tests.cs (1)
53protected virtual IEnumerable<T> InvalidValues => Array.Empty<T>();
Collections\List\ICollection.NonGeneric.Tests.cs (4)
192Array arr = new object[count, count]; 203Array arr = Array.CreateInstance(typeof(object), new int[1] { count }, new int[1] { 2 }); 238Array enumArr = Enum.GetValues(typeof(EnumerableType));
Collections\SegmentedArrayTests.cs (5)
64Assert.Throws<NullReferenceException>(() => data.CopyTo(Array.Empty<IntPtr>(), 0)); 65Assert.Throws<NullReferenceException>(() => ((ICollection<IntPtr>)data).CopyTo(Array.Empty<IntPtr>(), 0)); 99Assert.Same(Array.Empty<byte[]>(), SegmentedCollectionsMarshal.AsSegments(new SegmentedArray<byte>(0))); 223Array.Copy(array, sourceStart, array, destinationStart, length); 231Array.Copy(array, sourceStart, array, destinationStart, length);
CryptoBlobParserTests.cs (15)
37Array.Reverse(expectedModulus); 41Array.Reverse(expectedP); 45Array.Reverse(expectedQ); 49Array.Reverse(expectedDP); 53Array.Reverse(expectedDQ); 57Array.Reverse(expectedInverseQ); 61Array.Reverse(expectedD); 80Array.Reverse(expectedModulus); 84Array.Reverse(expectedP); 88Array.Reverse(expectedQ); 92Array.Reverse(expectedDP); 96Array.Reverse(expectedDQ); 100Array.Reverse(expectedInverseQ); 104Array.Reverse(expectedD); 151Array.Copy(snBlob, CryptoBlobParser.s_publicKeyHeaderSize, buf, 0, buf.Length);
Emit\CustomDebugInfoTests.cs (1)
569Array.Copy(array, 0, result, 0, array.Length);
InternalUtilities\StreamExtensionsTests.cs (2)
31Array.Copy(sourceArray, sourceOffset, buf, offset, count); 74Array.Copy(sourceArray, 0, buf, offset, count);
src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (2)
264return Array.Empty<byte>(); 280return Array.Empty<byte>();
Text\LargeTextTests.cs (1)
94Array.Clear(buffer, 0, buffer.Length);
Microsoft.CodeAnalysis.VisualBasic (6)
Generated\BoundNodes.xml.Generated.vb (3)
13846Return New TreeDumperNode("initializer", Nothing, Array.Empty(Of TreeDumperNode)()) 14512Return New TreeDumperNode("stopStatement", Nothing, Array.Empty(Of TreeDumperNode)()) 14516Return New TreeDumperNode("endStatement", Nothing, Array.Empty(Of TreeDumperNode)())
Parser\ParseScan.vb (1)
304Return ResyncAt(ScannerState.VB, Array.Empty(Of SyntaxKind))
Symbols\IndexedTypeParameterSymbol.vb (2)
29Private Shared s_parameterPool As TypeParameterSymbol() = Array.Empty(Of TypeParameterSymbol)() 51Array.Copy(initialPool, newPool, initialPool.Length)
Microsoft.CodeAnalysis.Workspaces (81)
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (1)
32SimpleMutableIntervalTree.Create(new IntervalIntrospector(), Array.Empty<TextChange>());
Differencing\LongestCommonSubsequence.cs (4)
219Array.Clear(_buffer, _start, dstCopyStart); 220Array.Copy(other._buffer, other._start + srcCopyStart, _buffer, _start + dstCopyStart, copyLength); 221Array.Clear(_buffer, _start + dstCopyStart + copyLength, _length - dstCopyStart - copyLength); 225=> Array.Clear(_buffer, _start, _length);
Shared\Extensions\SourceTextExtensions.cs (1)
355Array.Copy(chunk, chunkStartOffset, buffer, index, charsToCopy);
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Storage\SQLite\v2\SQLitePersistentStorage_Helpers.cs (1)
106Array.Clear(bytes, 0, bytes.Length);
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (1)
67Array.Resize(ref hash, 16);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (62)
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Compilers\Core\Portable\InternalUtilities\WeakList.cs (4)
22_items = Array.Empty<WeakReference<T>>(); 63Array.Copy(_items, 0, newItems, 0, _items.Length); 104Array.Copy(_items, 0, result, 0, firstDead); 208_weakList._items = Array.Empty<WeakReference<T>>();
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (12)
19/// <seealso cref="Array.Clear(Array)"/> 24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
NewlyCreatedProjectsFromDotNetNew.cs (1)
77: Array.Empty<string>();
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (2)
TestAnalyzerReferenceByLanguage.cs (1)
27Array.Resize(ref checksumArray, Checksum.HashSize);
TestGeneratorReference.cs (1)
32Array.Resize(ref checksumArray, Checksum.HashSize);
Microsoft.CodeAnalysis.Workspaces.UnitTests (14)
ChecksumTests.cs (1)
169Assert.NotEqual(Checksum.Null, Checksum.Create(Array.Empty<string>()));
Differencing\LongestCommonSubsequenceTests.cs (1)
75Array.ForEach(oldChars, (c) => { Assert.Equal('\0', c); });
ObjectSerializationTests.cs (6)
115|| (value1 is Array && value2 is Array && ArrayEquals((Array)(object)value1, (Array)(object)value2)); 118private static bool ArrayEquals(Array seq1, Array seq2)
UtilityTest\SpecializedTasksTests.cs (1)
40Assert.Same(Array.Empty<int>(), whenAll.Result);
XxHash128Tests.cs (5)
59Array.Clear(destination, 0, destination.Length); 64Array.Clear(destination, 0, destination.Length); 72Array.Clear(destination, 0, destination.Length); 76Array.Clear(destination, 0, destination.Length); 131Array.Clear(destination, 0, destination.Length);
Microsoft.CSharp (23)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (2)
36IEnumerator<CSharpArgumentInfo> arginfosEnum = (arginfos ?? Array.Empty<CSharpArgumentInfo>()).GetEnumerator(); 335internal static T[] ToArray<T>(IEnumerable<T> source) => source == null ? Array.Empty<T>() : source.ToArray();
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
477return Array.Empty<KeyValuePair<string, object>>();
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (1)
65Array.Copy(prgpsz, prgpszNew, cpsz);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (2)
182Array.Copy(args, 1, newArgs, 0, args.Length - 1); 1281Debug.Assert(Array.TrueForAll(arguments, a => a.Type != null));
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (1)
1114Debug.Assert(!Array.Exists(@params.Items, p => p is ArgumentListType)); // We should never have picked a varargs method to bind to.
Microsoft\CSharp\RuntimeBinder\Semantics\SubstitutionContext.cs (2)
17ClassTypes = typeArgsCls?.Items ?? Array.Empty<CType>(); 19MethodTypes = typeArgsMeth?.Items ?? Array.Empty<CType>();
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs (4)
66_optionalParameterIndex = _defaultParameterIndex = _marshalAsIndex = Array.Empty<bool>(); 67_defaultParameters = Array.Empty<ConstVal>(); 68_defaultParameterConstValTypes = Array.Empty<CType>(); 69_marshalAsBuffer = Array.Empty<UnmanagedType>();
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
149new PredefinedTypeInfo(PredefinedType.PT_ARRAY, typeof(Array), "System.Array"),
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (6)
84public static readonly TypeArray Empty = new TypeArray(Array.Empty<CType>()); 102Debug.Assert(Array.TrueForAll(Items, item => item != null)); 105public void CopyItems(int i, int c, CType[] dest) => Array.Copy(Items, i, dest, 0, c); 121Array.ConstrainedCopy(types, offset, newTypes, 0, ctype); 158Array.Copy(prgtype1, combined, prgtype1.Length); 159Array.Copy(prgtype2, 0, combined, prgtype1.Length, prgtype2.Length);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (1)
222Array.Copy(srcs, dsts, i);
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (1)
834return Array.Empty<CType>();
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (1)
67Debug.Assert(Array.TrueForAll(_entries, e => e?.Name.Text != name.Text));
Microsoft.Data.Analysis (2)
TextFieldParser.cs (2)
650Array.Copy(_buffer, _position, tempArray, 0, bufferLength - _position); 671Array.Copy(_buffer, tempArray, _buffer.Length);
Microsoft.Data.Analysis.Tests (2)
src\Microsoft.Data.Analysis\TextFieldParser.cs (2)
650Array.Copy(_buffer, _position, tempArray, 0, bufferLength - _position); 671Array.Copy(_buffer, tempArray, _buffer.Length);
Microsoft.DotNet.Build.Tasks.Feed.Tests (6)
SetupTargetFeedConfigV3Tests.cs (3)
176Array.Empty<ITaskItem>(), 292Array.Empty<ITaskItem>(), 406Array.Empty<ITaskItem>(),
SetupTargetFeedConfigV4Tests.cs (3)
170Array.Empty<ITaskItem>(), 264Array.Empty<ITaskItem>(), 358Array.Empty<ITaskItem>(),
Microsoft.DotNet.Build.Tasks.Installers (10)
src\GenerateGuidFromName.cs (3)
33Array.Copy(namespaceBytes, streamToHash, namespaceBytes.Length); 34Array.Copy(nameBytes, 0, streamToHash, namespaceBytes.Length, nameBytes.Length); 40Array.Copy(hashResult, res, res.Length);
src\RpmHeader.cs (6)
158int nullTerminatorIndex = Array.IndexOf(store, (byte)0, offset); 172int nullTerminatorIndex = Array.IndexOf(store, (byte)0, offset); 185Array contents = Array.CreateInstance(entry.Type switch 306Array contents = (Array)entry.Value;
src\RpmLead.cs (1)
40lead.Name = Encoding.UTF8.GetString(name, 0, Array.IndexOf<byte>(name, 0));
Microsoft.DotNet.Build.Tasks.Packaging.Tests (8)
GenerateNuSpecAndPackTests.cs (8)
92AdditionalLibPackageExcludes = additionalLibPackageExcludes ?? Array.Empty<ITaskItem>(), 93AdditionalSymbolPackageExcludes = additionalSymbolPackageExcludes ?? Array.Empty<ITaskItem>(), 99NuspecProperties = nuspecProperties ?? Array.Empty<ITaskItem>(), 145Dependencies = dependencies ?? Array.Empty<ITaskItem>(), 148Files = files ?? Array.Empty<ITaskItem>(), 149FrameworkReferences = frameworkReferences ?? Array.Empty<ITaskItem>(), 159PackageTypes = packageTypes ?? Array.Empty<string>(), 161References = references ?? Array.Empty<ITaskItem>(),
Microsoft.DotNet.Build.Tasks.Workloads (1)
Utils.cs (1)
155Array.Resize(ref hash, 16);
Microsoft.DotNet.Helix.Client (3)
generated-code\HelixApi.cs (2)
103return HttpPipelineBuilder.Build(options, Array.Empty<HttpPipelinePolicy>(), Array.Empty<HttpPipelinePolicy>(), new HttpPipelineTransportOptions() { IsClientRedirectEnabled = true }, new HelixApiResponseClassifier());
HelixApiTokenAuthenticationPolicy.cs (1)
29var token = await _credential.GetTokenAsync(new TokenRequestContext(Array.Empty<string>(), message.Request.ClientRequestId), message.CancellationToken).ConfigureAwait(false);
Microsoft.DotNet.Helix.Sdk (2)
FindDotNetCliPackage.cs (1)
340string[] versionData = latestVersionContent.Split(Array.Empty<char>(), StringSplitOptions.RemoveEmptyEntries);
GetHelixWorkItems.cs (1)
50return Array.Empty<ITaskItem>();
Microsoft.DotNet.NuGetRepack.Tasks (2)
src\NuGetVersionUpdater.cs (2)
269foreach (var packageType in packageTypesElement.Elements(XName.Get("packageType", nuspecXmlns)) ?? Array.Empty<XElement>()) 293Descendants(XName.Get("dependency", package.NuspecXmlns)) ?? Array.Empty<XElement>();
Microsoft.DotNet.NuGetRepack.Tests (2)
ReplacePackagePartsTests.cs (2)
39AssertEx.Equal(Array.Empty<string>(), engine.LogErrorEvents.Select(w => w.Message)); 40AssertEx.Equal(Array.Empty<string>(), engine.LogWarningEvents.Select(w => $"{w.Code}: {w.Message}"));
Microsoft.DotNet.Open.Api.Tools.Tests (1)
OpenApiAddFileTests.cs (1)
20var run = app.Execute(Array.Empty<string>());
Microsoft.DotNet.RemoteExecutor (6)
Program.cs (2)
36Array.Empty<string>(); 125Array.Copy(arr, offset, newArr, 0, count);
RemoteExecutor.cs (4)
125return Invoke(GetMethodInfo(method), Array.Empty<string>(), options); 193return Invoke(GetMethodInfo(method), Array.Empty<string>(), options); 261return Invoke(GetMethodInfo(method), Array.Empty<string>(), options); 329return Invoke(GetMethodInfo(method), Array.Empty<string>(), options);
Microsoft.DotNet.SharedFramework.Sdk (2)
src\GenerateSharedFrameworkDepsFile.cs (2)
91Array.Empty<Dependency>(), 96IEnumerable<RuntimeFallbacks> runtimeFallbackGraph = Array.Empty<RuntimeFallbacks>();
Microsoft.DotNet.SignTool (2)
src\BatchSignUtil.cs (1)
44_itemsToSkipStrongNameCheck = itemsToSkipStrongNameCheck ?? Array.Empty<string>();
src\SignToolTask.cs (1)
398Array.Resize(ref result, getCommonPrefixLength(result, directoryParts));
Microsoft.DotNet.SignTool.Tests (16)
SignToolTests.cs (15)
399signingInput.FilesToCopy.Select(f => $"{f.Key} -> {f.Value}").Should().BeEquivalentTo(expectedCopyFiles ?? Array.Empty<string>()); 400engine.LogErrorEvents.Select(w => w.Message).Should().BeEquivalentTo(expectedErrors ?? Array.Empty<string>()); 401engine.LogWarningEvents.Select(w => $"{w.Code}: {w.Message}").Should().BeEquivalentTo(expectedWarnings ?? Array.Empty<string>()); 545ItemsToSign = Array.Empty<ITaskItem>(), 546StrongNameSignInfo = Array.Empty<ITaskItem>(), 565ItemsToSign = Array.Empty<ITaskItem>(), 566StrongNameSignInfo = Array.Empty<ITaskItem>(), 666ValidateFileSignInfos(itemsToSign, strongNameSignInfo, fileSignInfo, s_fileExtensionSignInfo, Array.Empty<string>()); 2104ItemsToSign = Array.Empty<ITaskItem>(), 2105StrongNameSignInfo = Array.Empty<ITaskItem>(), 2106FileExtensionSignInfo = Array.Empty<ITaskItem>(), 2451ValidateFileSignInfos(itemsToSign, strongNameSignInfo, fileSignInfo, s_fileExtensionSignInfo, Array.Empty<string>()); 2680ItemsToSign = itemsToSign ?? Array.Empty<ITaskItem>(), 2681StrongNameSignInfo = strongNameSignInfo ?? Array.Empty<ITaskItem>(), 2682FileExtensionSignInfo = fileExtensionSignInfo ?? Array.Empty<ITaskItem>(),
StrongNameSupportHelper.cs (1)
17rsa.SignData(Array.Empty<byte>(), HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1);
Microsoft.DotNet.StrongName (5)
Signing.cs (3)
216Array.Reverse(signature); 366Array.Copy(hash, hash.Length - 8, token, 0, 8); 367Array.Reverse(token); // Reverse the bytes to match the expected format
Utils.cs (1)
370Array.Reverse(data);
Verification.cs (1)
125Array.Reverse(reversedSignature);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (2)
Modeler\ServiceClientModelFactory.cs (2)
163IList<ParameterModel> parameters = (operation.Parameters ?? Array.Empty<OpenApiParameter>()) 431: Array.Empty<PropertyModel>();
Microsoft.DotNet.XliffTasks (1)
Model\TranslatableDocument.cs (1)
19public IReadOnlyList<TranslatableNode> Nodes { get; private set; } = Array.Empty<TranslatableNode>();
Microsoft.DotNet.XUnitAssert.Tests (16)
EqualityAssertsTests.cs (16)
970 var expected = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }); 972 var actual = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }); 981 var expected = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }); 983 var actual = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 0 }); 3273 var expected = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }); 3275 var actual = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }); 3293 var expected = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 1 }); 3295 var actual = Array.CreateInstance(typeof(int), new[] { 1 }, new[] { 0 });
Microsoft.DotNet.XUnitExtensions (5)
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\PlatformSpecificDiscoverer.cs (1)
31Array.Empty<KeyValuePair<string, string>>() :
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\SkipOnCoreClrDiscoverer.cs (1)
58return Array.Empty<KeyValuePair<string, string>>();
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\SkipOnMonoDiscoverer.cs (1)
34return Array.Empty<KeyValuePair<string, string>>();
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\SkipOnPlatformDiscoverer.cs (1)
31return Array.Empty<KeyValuePair<string, string>>();
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\SkipOnTargetFrameworkDiscoverer.cs (1)
31Array.Empty<KeyValuePair<string, string>>();
Microsoft.DotNet.XUnitV3Extensions (5)
src\Microsoft.DotNet.XUnitExtensions.Shared\Attributes\PlatformSpecificAttribute.cs (1)
36Array.Empty<KeyValuePair<string, string>>() :
src\Microsoft.DotNet.XUnitExtensions.Shared\Attributes\SkipOnCoreClrAttribute.cs (1)
44return Array.Empty<KeyValuePair<string, string>>();
src\Microsoft.DotNet.XUnitExtensions.Shared\Attributes\SkipOnMonoAttribute.cs (1)
40return Array.Empty<KeyValuePair<string, string>>();
src\Microsoft.DotNet.XUnitExtensions.Shared\Attributes\SkipOnPlatformAttribute.cs (1)
37return Array.Empty<KeyValuePair<string, string>>();
src\Microsoft.DotNet.XUnitExtensions.Shared\Attributes\SkipOnTargetFrameworkAttribute.cs (1)
36Array.Empty<KeyValuePair<string, string>>();
Microsoft.Extensions.AI (8)
ChatCompletion\DistributedCachingChatClient.cs (2)
144object[] clientValues = _cacheKeyAdditionalValues ?? Array.Empty<object>(); 160Array.Clear(arr, 0, length);
ChatCompletion\FunctionInvocationContext.cs (1)
21private IList<ChatMessage> _messages = Array.Empty<ChatMessage>();
Embeddings\DistributedCachingEmbeddingGenerator.cs (2)
115object[] clientValues = _cacheKeyAdditionalValues ?? Array.Empty<object>(); 129Array.Clear(arr, 0, length);
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Extensions.AI.Abstractions (4)
Embeddings\EmbeddingGeneratorExtensions.cs (1)
193return Array.Empty<(TInput, TEmbedding)>();
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Extensions.AI.Abstractions.Tests (3)
ChatCompletion\ChatMessageTests.cs (1)
77message = new ChatMessage(ChatRole.User, Array.Empty<AIContent>());
Embeddings\GeneratedEmbeddingsTests.cs (1)
48instance.CopyTo(Array.Empty<Embedding<float>>(), 0);
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
690AdditionalValues: [new(true), new(42), new(""), new(new object()), new(Array.Empty<int>())],
Microsoft.Extensions.AI.AzureAIInference (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Extensions.AI.Evaluation.NLP.Tests (1)
NGramTests.cs (1)
24Assert.Throws<ArgumentOutOfRangeException>(() => new NGram<int>(Array.Empty<int>()));
Microsoft.Extensions.AI.OpenAI (6)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
src\Shared\ServerSentEvents\ArrayBuffer.cs (2)
45? Array.Empty<byte>() 85_bytes = Array.Empty<byte>();
src\Shared\ServerSentEvents\SseParser_1.cs (1)
564Array.Copy(toReturn, buffer, toReturn.Length);
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
352var convertedMessages = Array.Empty<ResponseItem>().AsChatMessages().ToArray();
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\ConfigureOptionsChatClientTests.cs (2)
76var response = await client.GetResponseAsync(Array.Empty<ChatMessage>(), providedOptions, cts.Token); 80await using var e = client.GetStreamingResponseAsync(Array.Empty<ChatMessage>(), providedOptions, cts.Token).GetAsyncEnumerator();
Microsoft.Extensions.AsyncState.Tests (1)
FeaturesPooledPolicyTests.cs (1)
26list.Add(Array.Empty<int>());
Microsoft.Extensions.Caching.Hybrid (2)
Internal\DefaultHybridCache.cs (1)
97Array.Reverse(factories);
Internal\TagSet.cs (1)
41Array.Sort(tags, StringComparer.InvariantCulture);
Microsoft.Extensions.Caching.SqlServer (1)
SqlParameterCollectionExtensions.cs (1)
29return parameters.AddWithValue(Columns.Names.CacheItemValue, SqlDbType.VarBinary, Array.Empty<byte>());
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (3)
CacheServiceExtensionsTests.cs (1)
182Array.Reverse(factories);
RedisCacheSetAndRemoveTests.cs (2)
110cache.Set(key, Array.Empty<byte>()); 124await cache.SetAsync(key, Array.Empty<byte>());
Microsoft.Extensions.Compliance.Abstractions (1)
Classification\DataClassificationSet.cs (1)
115Array.Sort(a, (x, y) =>
Microsoft.Extensions.Compliance.Abstractions.Tests (3)
Redaction\RedactorTest.cs (3)
192string redacted = r.Redact(Array.Empty<char>()); 212int written = r.Redact(Array.Empty<char>(), buffer); 298Assert.True(r.TryRedact(Array.Empty<char>(), buffer, out int charsWritten, string.Empty.AsSpan(), null));
Microsoft.Extensions.Compliance.Redaction (2)
src\LegacySupport\StringSyntaxAttribute\StringSyntaxAttribute.cs (1)
21Arguments = Array.Empty<object?>();
src\Shared\Data.Validation\LengthAttribute.cs (1)
18/// The standard <see cref="MinLengthAttribute" /> supports only non generic <see cref="Array"/> or <see cref="string"/> typed objects
Microsoft.Extensions.Compliance.Redaction.Tests (1)
RedactorProviderTests.cs (1)
114Array.Empty<Redactor>(),
Microsoft.Extensions.Configuration.Binder (9)
ConfigurationBinder.cs (9)
366Array a = Array.CreateInstance(type.GetElementType()!, byteArray.Length + convertedByteArray.Length); 367Array.Copy(byteArray, a, byteArray.Length); 368Array.Copy(convertedByteArray, 0, a, byteArray.Length, convertedByteArray.Length); 519bindingPoint.TrySetValue(configValue is null ? null : Array.CreateInstance(type.GetElementType()!, 0)); 843private static Array BindArray(Type type, IEnumerable? source, IConfiguration config, BinderOptions options) 895Array result = Array.CreateInstance(elementType, list.Count); 1014result = value == string.Empty ? Array.Empty<byte>() : Convert.FromBase64String(value);
Microsoft.Extensions.Configuration.CommandLine (1)
CommandLineConfigurationSource.cs (1)
22public IEnumerable<string> Args { get; set; } = Array.Empty<string>();
Microsoft.Extensions.DependencyInjection (11)
ServiceLookup\CallSiteFactory.cs (1)
596Array.Sort(constructors,
ServiceLookup\CallSiteRuntimeResolver.cs (4)
46parameterValues = Array.Empty<object>(); 165Array array = CreateArray( 178static Array CreateArray(Type elementType, int length) 182return Array.CreateInstance(elementType, length);
ServiceLookup\ConstructorCallSite.cs (1)
14public ConstructorCallSite(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo, object? serviceKey) : this(cache, serviceType, constructorInfo, Array.Empty<ServiceCallSite>(), serviceKey)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (2)
140.Invoke(obj: null, parameters: Array.Empty<object>())); 176parameterExpressions = Array.Empty<Expression>();
ServiceLookup\ServiceLookupHelpers.cs (2)
15private static readonly MethodInfo ArrayEmptyMethodInfo = typeof(Array).GetMethod(nameof(Array.Empty))!;
ServiceLookup\ServiceProviderEngineScope.cs (1)
18internal IList<object> Disposables => _disposables ?? (IList<object>)Array.Empty<object>();
Microsoft.Extensions.DependencyModel (3)
Resolution\ReferenceAssemblyPathResolver.cs (3)
96return Array.Empty<string>(); 102return Array.Empty<string>(); 108return Array.Empty<string>();
Microsoft.Extensions.Diagnostics (1)
Metrics\ListenerSubscription.cs (1)
17private IList<InstrumentRule> _rules = Array.Empty<InstrumentRule>();
Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (2)
HealthCheckRegistration.cs (2)
68Tags = new HashSet<string>(tags ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase); 120Tags = new HashSet<string>(tags ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase);
Microsoft.Extensions.Diagnostics.Probes (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
18/// The standard <see cref="MinLengthAttribute" /> supports only non generic <see cref="Array"/> or <see cref="string"/> typed objects
Microsoft.Extensions.Diagnostics.ResourceMonitoring (8)
Linux\Disk\DiskStatsReader.cs (1)
72string[] parts = line.Split(Array.Empty<char>(), StringSplitOptions.RemoveEmptyEntries);
Linux\Disk\LinuxSystemDiskMetrics.cs (2)
163return Array.Empty<DiskStats>(); 189return Array.Empty<DiskStats>();
Linux\LinuxUtilizationProvider.cs (1)
285return Array.Empty<Measurement<T>>();
src\Shared\BufferWriterPool\BufferWriter.cs (3)
36private T[] _buffer = Array.Empty<T>(); 76Array.Resize(ref _buffer, value); 185Array.Resize(ref _buffer, targetCapacity);
src\Shared\Data.Validation\LengthAttribute.cs (1)
18/// The standard <see cref="MinLengthAttribute" /> supports only non generic <see cref="Array"/> or <see cref="string"/> typed objects
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (3)
Helpers\TestMeterFactory.cs (1)
16var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object?>>(), scope: this);
ResourceMonitoringServiceTests.cs (2)
364Array.Empty<IResourceUtilizationPublisher>(), 720Microsoft.Extensions.Options.Options.Create(new ResourceMonitoringOptions()), Array.Empty<IResourceUtilizationPublisher>(), TimeProvider.System);
Microsoft.Extensions.FileProviders.Composite (1)
CompositeFileProvider.cs (1)
25_fileProviders = fileProviders ?? Array.Empty<IFileProvider>();
Microsoft.Extensions.FileProviders.Embedded (4)
Manifest\EmbeddedFilesManifest.cs (2)
66var start = Array.IndexOf(_separators, path[0]) == -1 ? 0 : 1; 72var end = Array.IndexOf(_separators, path[path.Length - 1]) == -1 ? path.Length : path.Length - 1;
Manifest\ManifestDirectoryInfo.cs (1)
57return Array.Empty<IFileInfo>();
Manifest\ManifestSinkDirectory.cs (1)
12: base(name: string.Empty, children: Array.Empty<ManifestEntry>())
Microsoft.Extensions.FileProviders.Embedded.Tests (4)
Manifest\ManifestEntryTests.cs (4)
28var directory = ManifestDirectory.CreateDirectory("a", Array.Empty<ManifestEntry>()); 41var directory = ManifestDirectory.CreateDirectory("a", Array.Empty<ManifestEntry>()); 54var childDirectory = ManifestDirectory.CreateDirectory("b", Array.Empty<ManifestEntry>()); 68var directory = ManifestDirectory.CreateRootDirectory(Array.Empty<ManifestEntry>());
Microsoft.Extensions.FileSystemGlobbing (1)
MatcherExtensions.cs (1)
57return Array.Empty<string>();
Microsoft.Extensions.Http.Diagnostics (7)
Logging\HttpClientLoggingTagNames.cs (1)
64Array.AsReadOnly(new[]
src\Shared\BufferWriterPool\BufferWriter.cs (3)
36private T[] _buffer = Array.Empty<T>(); 76Array.Resize(ref _buffer, value); 185Array.Resize(ref _buffer, targetCapacity);
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Extensions.Http.Diagnostics.Tests (3)
Logging\HttpClientLoggerTest.cs (3)
952new HttpClientLogger(fakeLogger, requestReader, Array.Empty<IHttpClientLogEnricher>(), options), 980var logger = new HttpClientLogger(fakeLogger, requestReaderMock.Object, Array.Empty<IHttpClientLogEnricher>(), new()); 1000var logger = new HttpClientLogger(new FakeLogger<HttpClientLogger>(), requestReader, Array.Empty<IHttpClientLogEnricher>(), options);
Microsoft.Extensions.Http.Resilience (1)
src\Shared\Data.Validation\LengthAttribute.cs (1)
18/// The standard <see cref="MinLengthAttribute" /> supports only non generic <see cref="Array"/> or <see cref="string"/> typed objects
Microsoft.Extensions.Identity.Core (2)
Base32.cs (1)
80return Array.Empty<byte>();
UserManager.cs (1)
2899Logger.LogDebug(LoggerEventIds.PasswordValidationFailed, "User password validation failed: {errors}.", string.Join(";", errors?.Select(e => e.Code) ?? Array.Empty<string>()));
Microsoft.Extensions.Logging (2)
LoggerFactory.cs (2)
35public LoggerFactory() : this(Array.Empty<ILoggerProvider>()) 188Array.Resize(ref loggerInformation, loggerInformation.Length + 1);
Microsoft.Extensions.Logging.Abstractions (3)
LogValuesFormatter.cs (3)
149Array.Copy(values, formattedValues, i); 160return string.Format(CultureInfo.InvariantCulture, _format, formattedValues ?? Array.Empty<object>()); 174return string.Format(CultureInfo.InvariantCulture, _format, values ?? Array.Empty<object>());
Microsoft.Extensions.Logging.AzureAppServices (1)
BlobAppendReferenceWrapper.cs (1)
52Content = new ByteArrayContent(Array.Empty<byte>()),
Microsoft.Extensions.Logging.Console (5)
ConsoleLoggerExtensions.Obsolete.cs (1)
157OptionsFactory<ConsoleLoggerOptions> factory = new(new IConfigureOptions<ConsoleLoggerOptions>[] { adapter }, Array.Empty<IPostConfigureOptions<ConsoleLoggerOptions>>());
ConsoleLoggerProvider.cs (1)
34: this(options, Array.Empty<ConsoleFormatter>()) { }
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
25private static int ArrayMaxLength => Array.MaxLength; 44? Array.Empty<byte>() 84_bytes = Array.Empty<byte>();
Microsoft.Extensions.Logging.EventSource (2)
EventSourceLogger.cs (1)
253return Array.Empty<KeyValuePair<string, string?>>();
LoggingEventSource.cs (1)
121private LoggerFilterRule[] _filterSpec = Array.Empty<LoggerFilterRule>();
Microsoft.Extensions.Logging.Generators (7)
LoggerMessageGenerator.Parser.cs (5)
43return Array.Empty<LoggerClass>(); 50return Array.Empty<LoggerClass>(); 57return Array.Empty<LoggerClass>(); 64return Array.Empty<LoggerClass>(); 598return Array.Empty<LoggerClass>();
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (2)
181Array.Clear(toReturn, 0, _pos); 232Array.Clear(toReturn, 0, _pos);
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
DependencyInjectionPooledObjectPolicy.cs (1)
25public TService Create() => (TService)_factory(_provider, Array.Empty<object?>());
Microsoft.Extensions.ObjectPool.Microbenchmark (1)
src\Shared\BenchmarkRunner\AspNetCoreBenchmarkAttribute.cs (1)
56return (IConfig)Activator.CreateInstance(configType, Array.Empty<object>());
Microsoft.Extensions.Options (1)
OptionsFactory.cs (1)
27public OptionsFactory(IEnumerable<IConfigureOptions<TOptions>> setups, IEnumerable<IPostConfigureOptions<TOptions>> postConfigures) : this(setups, postConfigures, validations: Array.Empty<IValidateOptions<TOptions>>())
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
866_reportDiagnostic(Diagnostic.Create(desc, location, Array.Empty<object?>()));
Microsoft.Extensions.Primitives (6)
StringValues.cs (6)
27public static readonly StringValues Empty = new StringValues(Array.Empty<string>()); 160return Array.Empty<string>()[0]; // throws 279return GetArrayValue() ?? Array.Empty<string>(); 347/// <param name="array">The one-dimensional <see cref="Array" /> that is the destination of the elements copied from. The <see cref="Array" /> must have zero-based indexing.</param> 363Array.Copy(values, 0, array, arrayIndex, values.Length);
Microsoft.Extensions.ServiceDiscovery (2)
Configuration\ConfigurationServiceEndpointProvider.cs (2)
150var index = Array.IndexOf(_schemes, scheme); 162var index = Array.IndexOf(_schemes, scheme);
Microsoft.Extensions.ServiceDiscovery.Dns (3)
FallbackDnsResolver.cs (1)
86: Array.Empty<AddressResult>()
Resolver\DnsResolver.cs (2)
373TResult[] results = Array.Empty<TResult>(); 802Array.Copy(buffer, largerBuffer, bytesRead);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (2)
Resolver\DnsPrimitivesTests.cs (2)
176Array.Fill(labelData, (byte)'a'); 182Array.Fill(lastLabelData, (byte)'a');
Microsoft.Extensions.Telemetry (11)
Enrichment\ApplicationEnricherTags.cs (1)
39Array.AsReadOnly(new[]
Enrichment\ProcessEnricherTagNames.cs (1)
29Array.AsReadOnly(new[]
Latency\Internal\CheckpointTracker.cs (1)
49Array.Clear(_checkpointAdded, 0, _checkpointAdded.Length);
Latency\Internal\MeasureTracker.cs (1)
46Array.Clear(_measurePosition);
Latency\Internal\Registry.cs (1)
28Array.Sort(keys);
Logging\ExtendedLogger.cs (2)
34public MessageLogger[] MessageLoggers { get; set; } = Array.Empty<MessageLogger>(); 35public ScopeLogger[] ScopeLoggers { get; set; } = Array.Empty<ScopeLogger>();
Logging\ExtendedLoggerFactory.cs (2)
186Array.Resize(ref loggerInformation, loggerInformation.Length + 1); 274return (messageLoggers.ToArray(), scopeLoggers?.ToArray() ?? Array.Empty<ScopeLogger>());
Sampling\RandomProbabilisticSampler.cs (1)
74LastKnownGoodSamplerRules = Array.Empty<RandomProbabilisticSamplerFilterRule>();
src\Shared\Data.Validation\LengthAttribute.cs (1)
18/// The standard <see cref="MinLengthAttribute" /> supports only non generic <see cref="Array"/> or <see cref="string"/> typed objects
Microsoft.Extensions.Telemetry.Abstractions (9)
Latency\NullLatencyContext.cs (3)
13private readonly ArraySegment<Checkpoint> _checkpoints = new(Array.Empty<Checkpoint>()); 14private readonly ArraySegment<Tag> _tags = new(Array.Empty<Tag>()); 15private readonly ArraySegment<Measure> _measures = new(Array.Empty<Measure>());
Logging\LoggerMessageState.cs (6)
51Array.Resize(ref _tags, need); 70Array.Resize(ref _classifiedTags, need); 71Array.Resize(ref _redactedTags, need); 107Array.Clear(_tags, 0, TagsCount); 108Array.Clear(_classifiedTags, 0, ClassifiedTagsCount); 109Array.Clear(_redactedTags, 0, ClassifiedTagsCount);
Microsoft.Extensions.Telemetry.Tests (17)
Latency\Internal\LatencyConsoleExporterTests.cs (3)
219ArraySegment<Checkpoint> checkpoints = new(Array.Empty<Checkpoint>()); 220ArraySegment<Measure> measures = new(Array.Empty<Measure>()); 221ArraySegment<Tag> tags = new(Array.Empty<Tag>());
Latency\Internal\LatencyContextRegistrySetTests.cs (1)
47var e = Array.Empty<string>();
Latency\Internal\RegistryTests.cs (1)
36var r = new Registry(Array.Empty<string>(), throwOnUnregistered);
Logging\ExtendedLoggerTests.cs (11)
179staticEnrichers: Array.Empty<IStaticLogEnricher>(), 304enrichers: Array.Empty<ILogEnricher>(), 305staticEnrichers: Array.Empty<IStaticLogEnricher>(), 346enrichers: Array.Empty<ILogEnricher>(), 347staticEnrichers: Array.Empty<IStaticLogEnricher>(), 376enrichers: Array.Empty<ILogEnricher>(), 377staticEnrichers: Array.Empty<IStaticLogEnricher>(), 409enrichers: Array.Empty<ILogEnricher>(), 410staticEnrichers: Array.Empty<IStaticLogEnricher>(), 443enrichers: Array.Empty<ILogEnricher>(), 444staticEnrichers: Array.Empty<IStaticLogEnricher>(),
Logging\SerialExtendedLoggerTests.cs (1)
46staticEnrichers: Array.Empty<IStaticLogEnricher>(),
Microsoft.Extensions.Validation.Tests (2)
ValidatableInfoResolverTests.cs (2)
41Array.Empty<ValidatablePropertyInfo>()).Object; 122var mockTypeInfo = new Mock<ValidatableTypeInfo>(typeof(ValidatableType), Array.Empty<ValidatablePropertyInfo>()).Object;
Microsoft.Gen.ComplianceReports.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Gen.ContextualOptions (1)
src\Generators\Shared\DiagDescriptorsBase.cs (1)
37Array.Empty<string>());
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Gen.Logging (2)
Parsing\Parser.cs (1)
42return Array.Empty<LoggingType>();
src\Generators\Shared\DiagDescriptorsBase.cs (1)
37Array.Empty<string>());
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesExtensions.cs (1)
167public int[] TransitivePropertyArray { get; set; } = Array.Empty<int>();
Microsoft.Gen.Logging.Unit.Tests (5)
LogParserUtilitiesTests.cs (1)
91.Returns(Array.Empty<AttributeData>().ToImmutableArray());
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
SymbolLoaderTests.cs (1)
30Array.Empty<MetadataReference>().ToImmutableArray(),
Microsoft.Gen.MetadataExtractor (3)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
62return Array.Empty<MetricType>(); 598_reportDiagnostic(Diagnostic.Create(desc, location, Array.Empty<object?>()));
src\Generators\Shared\DiagDescriptorsBase.cs (1)
37Array.Empty<string>());
Microsoft.Gen.MetadataExtractor.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Gen.Metrics (3)
Parser.cs (2)
62return Array.Empty<MetricType>(); 598_reportDiagnostic(Diagnostic.Create(desc, location, Array.Empty<object?>()));
src\Generators\Shared\DiagDescriptorsBase.cs (1)
37Array.Empty<string>());
Microsoft.Gen.Metrics.Unit.Tests (3)
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Gen.MetricsReports (3)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
62return Array.Empty<MetricType>(); 598_reportDiagnostic(Diagnostic.Create(desc, location, Array.Empty<object?>()));
src\Generators\Shared\DiagDescriptorsBase.cs (1)
37Array.Empty<string>());
Microsoft.Gen.MetricsReports.Unit.Tests (4)
EmitterTests.cs (1)
102Assert.Equal(string.Empty, emitter.GenerateReport(Array.Empty<ReportedMetricClass>(), CancellationToken.None));
src\Shared\EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
src\Shared\EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
Microsoft.Interop.JavaScript.JSImportGenerator (3)
JSGeneratorFactory.cs (2)
305var gen = Create(info, context, isToJs ^ (!isReturn), argTypes[i], Array.Empty<KnownManagedType>(), argJSTypes[i], Array.Empty<JSTypeFlags>());
JSManagedTypeInfo.cs (1)
145return new JSFunctionTypeInfo(true, Array.Empty<JSSimpleTypeInfo>());
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
564int index = System.Array.IndexOf(s_preferredAttributeArgumentOrder, name);
Microsoft.Interop.SourceGeneration (17)
BoundGenerators.cs (1)
166return Array.Empty<(bool, int)>();
Marshalling\CustomTypeMarshallingGenerator.cs (1)
88return Array.Empty<StatementSyntax>();
Marshalling\Forwarder.cs (1)
29return Array.Empty<StatementSyntax>();
Marshalling\MarshallerHelpers.cs (2)
222public bool AnyEdges => Array.IndexOf(_edgeMap, true) != -1; 228return Array.IndexOf(_edgeMap, true, to * NodeCount, NodeCount) != -1;
Marshalling\StatelessMarshallingStrategy.cs (12)
27public IEnumerable<StatementSyntax> GenerateCleanupCallerAllocatedResourcesStatements(StubIdentifierContext context) => Array.Empty<StatementSyntax>(); 29public IEnumerable<StatementSyntax> GenerateCleanupCalleeAllocatedResourcesStatements(StubIdentifierContext context) => Array.Empty<StatementSyntax>(); 100return Array.Empty<StatementSyntax>(); 125return Array.Empty<StatementSyntax>(); 130return Array.Empty<StatementSyntax>(); 135return Array.Empty<StatementSyntax>(); 140return Array.Empty<StatementSyntax>(); 415public IEnumerable<StatementSyntax> GenerateNotifyForSuccessfulInvokeStatements(StubIdentifierContext context) => Array.Empty<StatementSyntax>(); 416public IEnumerable<StatementSyntax> GeneratePinnedMarshalStatements(StubIdentifierContext context) => Array.Empty<StatementSyntax>(); 417public IEnumerable<StatementSyntax> GeneratePinStatements(StubIdentifierContext context) => Array.Empty<StatementSyntax>(); 436public IEnumerable<StatementSyntax> GenerateUnmarshalCaptureStatements(StubIdentifierContext context) => Array.Empty<StatementSyntax>(); 696public IEnumerable<StatementSyntax> GenerateUnmarshalCaptureStatements(StubIdentifierContext context) => Array.Empty<StatementSyntax>();
Microsoft.JSInterop (5)
Infrastructure\DotNetDispatcher.cs (1)
219return Array.Empty<object>();
src\Components\Shared\src\ArrayBuilder.cs (4)
37private static readonly T[] Empty = Array.Empty<T>(); 153Array.Copy(_items, index, _items, index + 1, _itemsInUse - index); 183Array.Copy(_items, newItems, _itemsInUse); 196Array.Clear(_items, 0, _itemsInUse);
Microsoft.JSInterop.Tests (9)
JSRuntimeTest.cs (9)
110var unrelatedTask = runtime.InvokeAsync<string>("unrelated call", Array.Empty<object>()); 111var task = runtime.InvokeAsync<string>("test identifier", Array.Empty<object>()); 135var task = runtime.InvokeAsync<TestPoco>("test identifier", Array.Empty<object>()); 159var task = runtime.InvokeAsync<TestPoco>("test identifier", Array.Empty<object>()); 185var unrelatedTask = runtime.InvokeAsync<string>("unrelated call", Array.Empty<object>()); 186var task = runtime.InvokeAsync<string>("test identifier", Array.Empty<object>()); 213var unrelatedTask = runtime.InvokeAsync<string>("unrelated call", Array.Empty<object>()); 214var task = runtime.InvokeAsync<int>("test identifier", Array.Empty<object>()); 243var task = runtime.InvokeAsync<string>("test identifier", Array.Empty<object>());
Microsoft.Maui (10)
Extensions\ArrayExtensions.cs (4)
19 Array.Copy(self, result, index); 24 Array.Copy(self, index, result, index + 1, result.Length - index - 1); 52 Array.Copy(self, result, index); 55 Array.Copy(self, index + 1, result, index, self.Length - index - 1);
Extensions\EnumerableExtensions.cs (4)
77 return Array.IndexOf(array, item); 113 if (enumerable is Array array) 115 return Array.IndexOf(array, item); 159 return Array.FindIndex(array, arrayPredicate);
Layouts\Flex.cs (1)
863 Array.Resize(ref layout.lines, (layout.lines?.Length ?? 0) + 1);
Layouts\GridLayoutManager.cs (1)
136 Array.Resize(ref _childrenToLayOut, currentChild);
Microsoft.Maui.Controls (30)
BindableProperty.cs (1)
222 if (SimpleConvertTypes.TryGetValue(valueType, out Type[] convertibleTo) && Array.IndexOf(convertibleTo, returnType) != -1)
DoubleCollection.cs (1)
24 => f == null ? new() : new(Array.ConvertAll(f, x => (double)x));
Element\Element.cs (1)
51 internal static readonly ReadOnlyCollection<Element> EmptyChildren = new ReadOnlyCollection<Element>(Array.Empty<Element>());
LegacyLayouts\ConstraintExpression.cs (2)
44 return Constraint.RelativeToParent(p => (double)minfo.Invoke(p, Array.Empty<object>()) * Factor + Constant); 66 { return (double)minfo.Invoke(v, Array.Empty<object>()) * Factor + Constant; });
ListProxy.cs (1)
438 void ICollection.CopyTo(Array array, int index)
Menu\MenuItemTracker.cs (1)
78 return Array.Empty<TMenuItem>();
ObservableWrapper.cs (2)
58 public void CopyTo(Array array, int destIndex) 69 public void CopyTo(TRestrict[] array, int index) => CopyTo((Array)array, index);
PlatformBindingHelpers.cs (2)
46 var defaultValue = targetPropertyInfo?.GetMethod.Invoke(target, Array.Empty<object>()); 95 SetValueFromRenderer(proxy, bindableProperty, target.GetType().GetProperty(targetProperty)?.GetMethod.Invoke(target, Array.Empty<object>()));
ReadOnlyListAdapter.cs (1)
26 public void CopyTo(Array array, int index)
Registrar.cs (2)
393 Array.Copy(effectAttributes, typedEffectAttributes, effectAttributes.Length); 456 int indexOfExecuting = Array.IndexOf(assemblies, defaultRendererAssembly);
SetterSpecificityList.cs (10)
30 _keys = Array.Empty<SetterSpecificity>(); 31 _values = Array.Empty<T>(); 38 _keys = Array.Empty<SetterSpecificity>(); 39 _values = Array.Empty<T>(); 143 Array.Copy(_keys, lo, _keys, lo + 1, count - lo); 144 Array.Copy(_values, lo, _values, lo + 1, count - lo); 197 Array.Copy(_keys, nextIndex, _keys, index, count - nextIndex); 198 Array.Copy(_values, nextIndex, _values, index, count - nextIndex); 228 Array.Copy(_keys, newKeys, currentCapacity); 229 Array.Copy(_values, newValues, currentCapacity);
Shell\ShellUriHandler.cs (2)
959 results = Array.Empty<object>(); 1008 return Array.Empty<object>();
TemplatedItemsList.cs (4)
73 ListProxy = new ListProxy(Array.Empty<object>(), dispatcher: _itemsView.Dispatcher); 95 ListProxy = new ListProxy(Array.Empty<object>(), dispatcher: _itemsView.Dispatcher); 221 void ICollection.CopyTo(Array array, int arrayIndex) 957 ListProxy = new ListProxy(Array.Empty<object>(), dispatcher: _itemsView.Dispatcher);
Microsoft.Maui.Controls.BindingSourceGen (1)
Result.cs (1)
11 return new Result<T>(value, new EquatableArray<DiagnosticInfo>(Array.Empty<DiagnosticInfo>()));
Microsoft.Maui.Controls.Foldable (3)
DualScreenInfo.cs (3)
72 _spanningBounds = Array.Empty<Rect>(); 182 return Array.Empty<Rect>(); 185 return Array.Empty<Rect>();
Microsoft.Maui.Controls.SourceGen (3)
CodeBehindGenerator.cs (3)
451 var indexOfCompile = Array.IndexOf(parts, "compile"); 758 public static readonly AssemblyCaches Empty = new(Array.Empty<XmlnsDefinitionAttribute>(), Array.Empty<IAssemblySymbol>());
Microsoft.Maui.Controls.Xaml (8)
ApplyPropertiesVisitor.cs (1)
715 value = getter.Invoke(element, Array.Empty<object>());
CreateValuesVisitor.cs (1)
252 Type[] types = arguments == null ? Array.Empty<Type>() : arguments.Select(a => a.GetType()).ToArray();
MarkupExtensions\ArrayExtension.cs (5)
13 public class ArrayExtension : IMarkupExtension<Array> 24 public Array ProvideValue(IServiceProvider serviceProvider) 32 var array = Array.CreateInstance(Type, Items.Count); 41 return (this as IMarkupExtension<Array>).ProvideValue(serviceProvider);
MarkupExtensions\StaticExtension.cs (1)
34 return pinfo.GetMethod.Invoke(null, Array.Empty<object>());
Microsoft.Maui.Essentials (2)
Share\Share.shared.cs (1)
358 => files?.Select(file => new ShareFile(file)) ?? Array.Empty<ShareFile>();
VersionTracking\VersionTracking.shared.cs (1)
329 => preferences.Get<string?>(key, null, sharedName)?.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>();
Microsoft.Maui.Graphics (3)
GradientPaint.cs (2)
119 Array.Copy(_gradientStops, vStops, _gradientStops.Length); 120 Array.Sort(vStops);
PathF.cs (1)
669 return Array.Empty<PointF>();
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (1)
src\Graphics\src\Graphics\Platforms\Windows\PlatformCanvasState.cs (1)
29 private static readonly float[] _emptyFloatArray = Array.Empty<float>();
Microsoft.Maui.Resizetizer (2)
GeneratePackageAppxManifest.cs (1)
357 var parts = displayVersion?.Split('.') ?? Array.Empty<string>();
GenerateTizenManifest.cs (1)
212 var parts = displayVersion?.Split('.') ?? Array.Empty<string>();
Microsoft.ML.AutoML (14)
AutoMLExperiment\ITrialResultManager.cs (1)
132return Array.Empty<TrialResult>();
ColumnInference\ColumnGroupingInference.cs (1)
133Array.Sort(indices);
ColumnInference\TextFileSample.cs (5)
121var firstNewline = Array.FindIndex(firstChunk, x => x == '\n'); 152Array.Resize(ref chunk, chunkSize); 166Array.Resize(ref buf, readCount); 189int iMin = (i == 0) ? 0 : Array.FindIndex(chunks[i], x => x == '\n') + 1; 192: Array.FindLastIndex(chunks[i], x => x == '\n') + 1;
Sweepers\ISweeper.cs (1)
269Array.Copy(_metricDistribution, result, _metricDistribution.Length);
Sweepers\SmacSweeper.cs (2)
165Array.Copy(eiChallengers, 0, configs, 0, eiChallengers.Length); 166Array.Copy(randomChallengers, 0, configs, eiChallengers.Length, randomChallengers.Length);
TransformInference\TransformInference.cs (1)
179var lastLabelColId = Array.FindLastIndex(columns, x => x.Purpose == ColumnPurpose.Label);
Utils\ArrayMath.cs (3)
61Array.Copy(array, 0, ret, 0, index); 63Array.Copy(array, index, ret, index + 1, array.Length - index); 100int index = Array.BinarySearch(array, item);
Microsoft.ML.AutoML.Tests (1)
DatasetUtil.cs (1)
163Array.Sort(files);
Microsoft.ML.Core (43)
CommandLine\CmdParser.cs (20)
1148string[] argsArray = string.IsNullOrEmpty(args) ? Array.Empty<string>() : new string[] { args }; 1260Array.Sort(args, 0, args.Length, Comparer<Arg>.Create((x, y) => x.SortOrder.CompareTo(y.SortOrder))); 1513Field.SetValue(destination, Array.CreateInstance(ItemType, 0)); 1593var arr = Array.CreateInstance(ItemType, comList.Count); 1628var arr = Array.CreateInstance(ItemValueType, comList.Count); 1636var res = Array.CreateInstance(ItemType, Utils.Size(values)); 1646var res = Array.CreateInstance(ItemType, Utils.Size(values)); 1913else if (value is Array) 1916foreach (object o in (System.Array)value) 1966Contracts.Assert(value == null || value is Array); 1968IList vals = (Array)value; 1976IList defs = (Array)def; 2065Contracts.Assert(value == null || value is Array); 2067IList vals = (Array)value; 2075IList defs = (Array)def; 2347settings = Array.Empty<string>();
Utilities\ArrayUtils.cs (1)
96Array.Resize(ref array, newSize);
Utilities\BigArray.cs (8)
252Array.Resize(ref _entries, newBlockCount); 253Array.Resize(ref _entries[newBlockCount - 1], newLastBlockLength); 267Array.Resize(ref _entries[0], Math.Min(BlockSize, Math.Max(2 * curLastBlockSize, newLastBlockLength))); 272Array.Resize(ref _entries[newBlockCount - 1], BlockSize); 280Array.Resize(ref _entries, newBlockCount); 281Array.Resize(ref _entries[curBlockCount - 1], BlockSize); 306Array.Resize(ref _entries[maMax], miLim); 307Array.Resize(ref _entries, maMax + 1);
Utilities\BinFinder.cs (3)
56Array.Sort(_valuesSng, 0, numValues); 134Array.Sort(_valuesDbl, 0, numValues); 372Array.Sort(_path, 0, CountBins + 1);
Utilities\HashArray.cs (1)
196Array.Sort(_entries, 0, _ct);
Utilities\MathUtils.cs (1)
711Array.Sort(src, 0, count);
Utilities\NormStr.cs (2)
227Array.Resize(ref _rgmeta, size); 228Array.Resize(ref _rgns, size);
Utilities\SupervisedBinFinder.cs (3)
79Array.Sort(valuePairs); 157Array.Sort(valuePairs); 339Array.Sort(results);
Utilities\Utils.cs (4)
60public static int Size(Array x) 867Array.Copy(a, res, a.Length); 868Array.Copy(b, 0, res, a.Length, b.Length); 907Array.Copy(a, 0, res, ivDst, cv);
Microsoft.ML.Core.Tests (1)
UnitTests\TestVBuffer.cs (1)
1000Array.Sort(indices, 0, count);
Microsoft.ML.CpuMath (3)
AlignedArray.cs (3)
87Array.Copy(Items, _base, Items, newBase, _size); 166Array.Copy(src.Items, src._base, Items, _base, _size); 171Array.Clear(Items, _base, _size);
Microsoft.ML.Data (69)
Commands\ScoreCommand.cs (1)
232if (ImplOptions.OutputColumns != null && Array.FindIndex(ImplOptions.OutputColumns, schema[i].Name.Equals) >= 0)
Data\BufferBuilder.cs (7)
122Array.Clear(_values, 0, _length); 181Array.Resize(ref _values, Math.Max(Math.Min(_length, checked(_count * 2)), 8)); 183Array.Resize(ref _indices, Math.Max(Math.Min(_length, checked(_count * 2)), 8)); 209Array.Resize(ref _values, Math.Max(Math.Min(_length, checked(_count * 2)), 8)); 211Array.Resize(ref _indices, Math.Max(Math.Min(_length, checked(_count * 2)), 8)); 267Array.Sort(_indices, _values, 0, _count); 323Array.Resize(ref _values, _length);
DataLoadSave\Database\DatabaseLoader.cs (1)
425Array.Sort(order, (x, y) => segs[x].Min.CompareTo(segs[y].Min));
DataLoadSave\EstimatorExtensions.cs (1)
157Array.Copy(array, result, result.Length - 1);
DataLoadSave\Text\TextLoader.cs (1)
641Array.Sort(order, (x, y) => segs[x].Min.CompareTo(segs[y].Min));
DataLoadSave\Text\TextLoaderCursor.cs (1)
812Array.Resize(ref infos, index);
DataLoadSave\Text\TextLoaderParser.cs (8)
370Array.Resize(ref _values, 2 * _count); 372Array.Resize(ref _indices, 2 * _count); 383Array.Clear(_values, _count, _size - _count); 387Array.Clear(_values, _count, _values.Length - _count); 388Array.Resize(ref _values, _size); 643Array.Resize(ref Spans, size); 644Array.Resize(ref Indices, size); 652Array.Clear(Spans, 0, Count);
DataLoadSave\Text\TextSaver.cs (3)
662Array.Resize(ref _rgch, checked(_rgch.Length * 2)); 664Array.Resize(ref _mpslotdst, checked(_mpslotdst.Length * 2)); 666Array.Resize(ref _mpslotichLim, checked(_mpslotichLim.Length * 2));
DataView\CacheDataView.cs (6)
123Array.Copy(prefetch, tmp, prefetch.Length); 124Array.Sort(tmp); 1413Array.Resize(ref _indexBoundaries, _rowCount + 1); 1414Array.Resize(ref _valueBoundaries, _rowCount + 1); 1415Array.Resize(ref _lengths, _rowCount); 1456Array.Resize(ref _values, _rowCount);
DataView\Transposer.cs (4)
526Array.Clear(_rbuffIndices, 0, _rbuffIndices.Length); 547Array.Clear(_counts, 0, vecLen); 633Array.Clear(_rbuffIndices, 0, irbuff); 1237Array.Clear(_srcIndicesLims, 0, _srcIndicesLims.Length);
Deprecated\Instances\HeaderSchema.cs (1)
305Array.Copy(names, _names, size);
Deprecated\Vector\VectorUtils.cs (1)
538Array.Clear(dst, 0, dst.Length);
EntryPoints\EntryPointNode.cs (4)
865var arr = Array.CreateInstance(type, bindings.Count); 1184var arr = variable.Value as Array;
EntryPoints\InputBuilder.cs (2)
314var array = (Array)instanceVal;
Evaluators\RankingEvaluator.cs (3)
391Array.Copy(_groupMaxDcgCur, maxDcg, TruncationLevel); 399Array.Copy(_groupDcgCur, groupDcg, TruncationLevel); 1041Array.Sort(permutation, GetCompareItems(queryLabels, queryOutputs));
Prediction\Calibrator.cs (1)
1396Array.Sort(_data, 0, Math.Min(_itemsSeen, _capacity), comp);
Transforms\InvertHashUtils.cs (2)
208Array.Sort(buffer, 0, count, Comparer<Pair>.Create((x, y) => x.Order - y.Order)); 252Array.Sort(indices, values);
Transforms\KeyToValue.cs (6)
528var keys = Array.ConvertAll<int, long>(Enumerable.Range(1, _values.Length).ToArray(), item => Convert.ToInt64(item)); 536string[] values = Array.ConvertAll<TValue, string>(_values.GetValues().ToArray(), item => Convert.ToString(item)); 544float[] values = Array.ConvertAll<TValue, float>(_values.GetValues().ToArray(), item => Convert.ToSingle(item)); 550float[] values = Array.ConvertAll<TValue, float>(_values.GetValues().ToArray(), item => Convert.ToSingle(item)); 559string[] values = Array.ConvertAll<TValue, string>(_values.GetValues().ToArray(), item => Convert.ToString(item)); 564float[] values = Array.ConvertAll<TValue, float>(_values.GetValues().ToArray(), item => Convert.ToSingle(item));
Transforms\SlotsDroppingTransformer.cs (4)
365Array.Sort(slotsMin, slotsMax); 398Array.Sort(slotsMin[i], slotsMax[i]); 412Array.Resize(ref slotsMin[i], iDst); 413Array.Resize(ref slotsMax[i], iDst);
Transforms\ValueMapping.cs (4)
1093node.AddAttribute("keys_strings", Array.ConvertAll(_valueMap.GetKeys<T>(), item => Convert.ToString(item))); 1095node.AddAttribute("keys_floats", Array.ConvertAll(_valueMap.GetKeys<T>(), item => Convert.ToSingle(item))); 1097node.AddAttribute("keys_int64s", Array.ConvertAll(_valueMap.GetKeys<T>(), item => Convert.ToInt64(item))); 1205var values = Array.ConvertAll(_valueMap.GetKeys<bool>(), item => Convert.ToString(Convert.ToByte(item)));
Transforms\ValueToKeyMappingTransformerImpl.cs (1)
126Array.Sort(perm, comp);
Utils\SequencePool.cs (7)
77Array.Resize(ref _start, 11); 79Array.Resize(ref _bytes, 40); 241Array.Resize(ref _start, size); 251Array.Resize(ref _hash, size); 252Array.Resize(ref _next, size); 262Array.Resize(ref _bytes, size); 356Array.Resize(ref sequence, lim - min);
Microsoft.ML.DataView (1)
src\Microsoft.ML.Core\Utilities\ArrayUtils.cs (1)
96Array.Resize(ref array, newSize);
Microsoft.ML.Ensemble (5)
OutputCombiners\BaseStacking.cs (2)
206Array.Resize(ref labels, count); 207Array.Resize(ref features, count);
Selector\SubModelSelector\BaseBestPerformanceSelector.cs (1)
36Array.Sort(sortedModels, new ModelPerformanceComparer(MetricName, IsAscMetric));
Selector\SubModelSelector\BaseDiverseSelector.cs (2)
58Array.Resize(ref preds, count); 80Array.Sort(sortedModels, new ModelDiversityComparer());
Microsoft.ML.EntryPoints (3)
JsonUtils\JsonManifestUtils.cs (2)
426var valArray = value as Array;
ScoreColumnSelector.cs (1)
53if (extraColumns != null && Array.FindIndex(extraColumns, columnName.Equals) >= 0)
Microsoft.ML.FastTree (79)
BinFile\BinFinder.cs (1)
70Array.Sort(valueBuffer, 0, explicitValuesCount);
Dataset\Dataset.cs (18)
394Array.Copy(activeFeatures, 0, truncatedActiveFeatures, 0, NumFeatures); 401public Array Data; 410qdd.Data = Array.CreateInstance(arrayDataType, docArray.Length); 601Array.Copy(perm, posInPerm, queries[p], 0, numQueries[p]); 602Array.Sort(queries[p]); 683Array newData = Array.CreateInstance(arrayDataType, mapping.Length); 716Array.Copy(parts[p].Ratings, 0, concatRatings, docBegin, numDocs); 717Array.Copy(parts[p].DocIds, 0, concatDocIds, docBegin, numDocs); 718Array.Copy(parts[p].QueryIds, 0, concatQueryIds, queryBegin, numQueries); 763Array.Clear(labelCounts, 0, relevancyLevel); 828Array concatArray = ConcatArrays(partsDatas.Select(pd => pd.Data).ToArray(), isQuery ? queryLengths : docLengths, name); 833private static Array ConcatArrays(Array[] arrays, int[] lengths, string name) 849Array a = Array.CreateInstance(t, newLength); 854Array.Copy(arrays[i], 0, a, start, lengths[i]); 866public void SetData(string name, Array array, bool queryLevel)
Dataset\FeatureFlock.cs (1)
121Array.Copy(active, featureOffset, _active, 0, _active.Length);
Dataset\FeatureHistogram.cs (3)
116Array.Clear(SumTargetsByBin, 0, SumTargetsByBin.Length); 121Array.Clear(SumWeightsByBin, 0, SumWeightsByBin.Length); 124Array.Clear(CountByBin, 0, CountByBin.Length);
FastTree.cs (2)
1229Array.Clear(binnedValues, 0, values.Length); 2703Array.Clear(_perFeaturePosition, 0, _featureIndices.Length);
FastTreeRanking.cs (8)
749Array.Clear(Gradient, begin, numDocuments); 750Array.Clear(Weights, begin, numDocuments); 763Array.Copy(_labels, begin, _labelsCopy, begin, numDocuments); 770Array.Copy(Scores, begin, _scoresCopy, begin, numDocuments); 794Array.Copy(_oneTwoThree, permutation, numDocuments); 858Array.Sort(permutation, 0, numDocuments, comparer); 977Array.Copy(_oneTwoThree, permutation, numDocuments); 995Array.Sort(permutation, 0, numDocs,
GamModelParameters.cs (1)
253Array.Copy(_binsAtAllZero, bins, NumberOfShapeFunctions);
RandomForestRegression.cs (1)
63Array.Sort(_data);
Training\BaggingProvider.cs (1)
129Array.Copy(tmpTrainQueryIndices, currentTrainQueryIndices, currentTrainQueryIndices.Length);
Training\DcgCalculator.cs (5)
127Array.Clear(labelCounts, 0, LabelMap.Length); 446Array.Copy(_oneTwoThree, permutation, count); 456Array.Sort(permutation, 0, count, comparer); 467Array.Sort(permutation, 0, Math.Min(count, _secondLevelcomparers[threadIndex].CompareFirstN), _secondLevelcomparers[threadIndex]); 547Array.Copy(permutation, 0, result, begin, count);
Training\DocumentPartitioning.cs (4)
151Array.Clear(_leafCount, 0, _leafCount.Length); 229Array.Copy(_tempDocuments, begin, _documents, newEnd, gtCount); 277Array.Copy(_tempDocuments, begin, _documents, newEnd, gtCount); 353Array.Copy(_documents, _leafBegin[leaf], documents, 0, _leafCount[leaf]);
Training\OptimizationAlgorithms\GradientDescent.cs (1)
45Array.Clear(_droppedScores, 0, _droppedScores.Length);
Training\ScoreTracker.cs (2)
50Array.Copy(scores1.Scores, Scores, Scores.Length); 64Array.Clear(Scores, 0, Scores.Length);
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (2)
496Array.Sort(BestSplitInfoPerLeaf[leaf].CategoricalFeatureIndices); 535Array.Copy(ParentHistogramArray[flock].IsSplittable, smallStats.IsSplittable, smallStats.IsSplittable.Length);
Training\WinLossCalculator.cs (2)
94Array.Copy(_oneTwoThree, permutation, count); 95Array.Sort(permutation, 0, count, comparer);
TreeEnsemble\InternalRegressionTree.cs (6)
1026int parent = Array.FindIndex(LteChild, x => x == ~leaf); 1031parent = Array.FindIndex(GtChild, x => x == ~leaf); 1470int parentOfLteChild1 = Array.IndexOf(LteChild, pos1); 1471int parentOfGtChild1 = Array.IndexOf(GtChild, pos1); 1472int parentOfLteChild2 = Array.IndexOf(LteChild, pos2); 1473int parentOfGtChild2 = Array.IndexOf(GtChild, pos2);
Utils\Algorithms.cs (4)
158Array.Copy(arrays[i], 0, working, begin, arrays[i].Length); 166Array.Copy(working, output, length); 179Array.Copy(tmp, begins[fromArray], working, begins[fromArray], length); 188Array.Copy(tmp, begins[fromArray], working, begins[fromArray], length);
Utils\BufferPoolManager.cs (10)
30private static readonly ConcurrentDictionary<Type, SortedList<int, List<Array>>> _bufferPools = new ConcurrentDictionary<Type, SortedList<int, List<Array>>>(); 41SortedList<int, List<Array>> availableBuffers = null; 53List<Array> buffers = availableBuffers.FirstOrDefault(x => x.Value.Count > 0 && x.Key >= size && (x.Key - size) < (size * 0.2)).Value as List<Array>; 83SortedList<int, List<Array>> availableBuffers = null; 84List<Array> buffers = null; 97buffers = new List<Array>(); 112SortedList<int, List<Array>> availableBuffers = null; 153_bufferPools[type] = new SortedList<int, List<Array>>();
Utils\CompressUtils.cs (2)
49Array.Copy(block.Buffer, block.Offset, block.Buffer, 0, block.Length); 56Array.Resize(ref block.Buffer, (block.Offset + block.Length + loadSize) * 2);
Utils\MappedObjectPool.cs (1)
84Array.Clear(_lastAccessTime, 0, _lastAccessTime.Length);
Utils\ToByteArrayExtensions.cs (4)
231Array.Copy(bytes, 0, buffer, position, bytes.Length); 241Array.Copy(bytes, 0, allBytes, position, bytes.Length); 263Array.Copy(a, 0, buffer, position, a.Length); 272Array.Copy(buffer, position, a, 0, length);
Microsoft.ML.GenAI.Core (2)
CausalLMPipelineChatClient.cs (2)
39var stopSequences = options?.StopSequences ?? Array.Empty<string>(); 64var stopSequences = options?.StopSequences ?? Array.Empty<string>();
Microsoft.ML.GenAI.LLaMA (1)
LlamaTextCompletionService.cs (1)
46var stopTokenSequence = executionSettings?.ExtensionData?["stop_token_sequence"] as string[] ?? Array.Empty<string>();
Microsoft.ML.GenAI.Phi (1)
Phi3\Phi3CausalLMTextGenerationService.cs (1)
60var stopTokenSequence = executionSettings?.ExtensionData?["stop_token_sequence"] as string[] ?? Array.Empty<string>();
Microsoft.ML.InternalCodeAnalyzer (1)
NameAnalyzer.cs (1)
40Array.Copy(args, 0, newArgs, 1, args.Length);
Microsoft.ML.KMeansClustering (1)
KMeansPlusPlusTrainer.cs (1)
1086Array.Clear(ClusterSizes, 0, K);
Microsoft.ML.LightGbm (1)
WrappedLightGbmBooster.cs (1)
93Array.Copy(buffer, content, size);
Microsoft.ML.Parquet (1)
ParquetLoader.cs (1)
730Array.Resize(ref arr, 16);
Microsoft.ML.PCA (4)
PcaTrainer.cs (1)
306Array.Clear(y[i], 0, y[i].Length);
PcaTransformer.cs (3)
401Array.Clear(y[iinfo][i], 0, y[iinfo][i].Length); 643Array.Copy(transformInfo.Eigenvectors[i], 0, principalComponents, i * transformInfo.Dimension, transformInfo.Dimension); 651Array.Copy(transformInfo.MeanProjected, zeroMean, transformInfo.Rank);
Microsoft.ML.Samples (1)
Dynamic\TensorFlow\TextClassification.cs (1)
95Array.Resize(ref features, MaxSentenceLength);
Microsoft.ML.Samples.GPU (1)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
95Array.Resize(ref features, MaxSentenceLength);
Microsoft.ML.Samples.OneDal (3)
Program.cs (3)
29columns.Add(new TextLoader.Column(column, DataKind.Boolean, Array.IndexOf(headerArray, column))); 31columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column))); 35columns.Add(new TextLoader.Column(column, DataKind.Single, Array.IndexOf(headerArray, column)));
Microsoft.ML.SearchSpace (1)
Option\ChoiceOption.cs (1)
68var x = Array.IndexOf(Choices, param);
Microsoft.ML.SearchSpace.Tests (1)
ChoiceOptionTest.cs (1)
59option.Default.Should().BeEquivalentTo(System.Array.Empty<double>());
Microsoft.ML.StandardTrainers (17)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (1)
246Array.Copy(_linearWeights, linearWeights, _linearWeights.Length);
LdSvm\LdSvmTrainer.cs (3)
208Array.Clear(gradTheta, 0, numLeaf - 1); 589Array.Sort(_indices2); 630Array.Sort(_indices, 0, sampleSize);
Optimizer\Optimizer.cs (4)
289Array.Clear(_sList, 0, _sList.Length); 290Array.Clear(_yList, 0, _yList.Length); 346Array.Copy(_sList, 1, _sList, 0, _m - 1); 348Array.Copy(_yList, 1, _yList, 0, _m - 1);
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (9)
199Array.Resize(ref labelHistogram, labelCount); 200Array.Resize(ref featureHistogram, labelCount); 265public IReadOnlyList<int> GetLabelHistogram() => Array.ConvertAll(_labelHistogram, x => (int)x); 277public IReadOnlyList<IReadOnlyList<int>> GetFeatureHistogram() => Array.ConvertAll(_featureHistogram, x => Array.ConvertAll(x, y => (int)y)); 326_labelHistogram = Array.ConvertAll(ctx.Reader.ReadIntArray() ?? new int[0], x => (long)x); 343_featureHistogram[iLabel] = Array.ConvertAll(ctx.Reader.ReadIntArray(_featureCount) ?? new int[0], x => (long)x); 432Array.Copy(_featureHistogram[i], 0, featureHistogram, i * _featureHistogram[i].Length, _featureHistogram[i].Length); 436Array.Copy(_labelHistogram, 0, labelHistogramExpanded, i * _featureHistogram.Length, _featureHistogram.Length);
Microsoft.ML.Sweeper (3)
Algorithms\SmacSweeper.cs (2)
176Array.Copy(eiChallengers, 0, configs, 0, eiChallengers.Length); 177Array.Copy(randomChallengers, 0, configs, eiChallengers.Length, randomChallengers.Length);
ISweeper.cs (1)
305Array.Copy(_metricDistribution, result, _metricDistribution.Length);
Microsoft.ML.TensorFlow (1)
TensorflowTransform.cs (1)
577_fullySpecifiedShapes[i] = new Shape(Array.Empty<long>());
Microsoft.ML.TensorFlow.Tests (6)
TensorflowTests.cs (6)
1298Array.Resize(ref processedData.Features, 600); 1588Assert.True(Array.IndexOf(labels, predictionFirst.PredictedLabel) > -1); 1589Assert.True(Array.IndexOf(labels, predictionSecond.PredictedLabel) > -1); 1747Assert.True(Array.IndexOf(labels, predictionFirst.PredictedLabel) > -1); 1748Assert.True(Array.IndexOf(labels, predictionSecond.PredictedLabel) > -1); 1921Array.Sort(files);
Microsoft.ML.TestFramework (3)
DataPipe\TestDataPipeBase.cs (2)
453Array.Copy(args1, res, args1.Length); 454Array.Copy(args2, 0, res, args1.Length, args2.Length);
GlobalBase.cs (1)
38Mkl.PptrfInternal(Mkl.Layout.RowMajor, Mkl.UpLo.Up, 0, Array.Empty<double>());
Microsoft.ML.Tests (8)
CollectionsDataViewTest.cs (6)
62if (!CompareArrayValues(xvalue as Array, yvalue as Array)) 81if (!CompareArrayValues(xvalue as Array, yvalue as Array)) 93public bool CompareArrayValues(Array x, Array y)
ImagesTests.cs (2)
1268Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Unknown, Array.Empty<byte>())); 1269Assert.Throws<ArgumentException>(() => MLImage.CreateFromPixels(10, 10, MLPixelFormat.Bgra32, Array.Empty<byte>()));
Microsoft.ML.TimeSeries (55)
AdaptiveSingularSpectrumSequenceModeler.cs (8)
323Array.Copy(model._alpha, _alpha, _windowSize - 1); 325Array.Copy(model._state, _state, _windowSize - 1); 420Array.Copy(_alpha, _info.AutoRegressiveCoefficients, _windowSize - 1); 723Array.Copy(x, outputSignal, inputSeriesLength); 882Array.Copy(roots, _info.RootsBeforeStabilization, _windowSize - 1); 1196Array.Resize(ref dataArray, count); 1244Array.Resize(ref dataArray, count); 1406Array.Copy(_alpha, _info.AutoRegressiveCoefficients, _windowSize - 1);
Deseasonality.cs (3)
27Array.Resize(ref _circularComponent, period); 69Array.Resize(ref _circularComponent, period); 70Array.Resize(ref _subSeries, period);
EigenUtils.cs (1)
527Array.Copy(input, 0, a, 0, n2);
PolynomialUtils.cs (1)
106Array.Copy(coefficients, i, coeff, 0, n - i);
SrCnnEntireAnomalyDetector.cs (29)
493Array.Resize<double[]>(ref results, values.Length); 502Array.Resize(ref _seriesToDetect, values.Length); 555Array.Resize(ref _fftRe, length); 556Array.Resize(ref _fftIm, length); 558Array.Resize(ref _zeroArray, length); 562Array.Resize(ref _magList, length); 563Array.Resize(ref _magLogList, length); 579Array.Resize(ref _spectralList, length); 586Array.Resize(ref _transRe, length); 587Array.Resize(ref _transIm, length); 602Array.Resize(ref _ifftRe, length); 603Array.Resize(ref _ifftIm, length); 607Array.Resize(ref _ifftMagList, length); 656Array.Resize(ref _backAddArray, data.Length + _backAddWindowSize); 683Array.Resize(ref _cumSumList, length); 684Array.Resize(ref _cumSumShift, length); 899Array.Resize(ref _deAnomalyData, data.Length); 900Array.Copy(data, _deAnomalyData, data.Length); 956Array.Resize(ref _fftRe, length); 957Array.Resize(ref _fftIm, length); 958Array.Resize(ref _zeroArray, length); 970Array.Resize(ref _ifftRe, length); 971Array.Resize(ref _ifftIm, length); 1004Array.Resize(ref _units, _trends.Length); 1026Array.Resize(ref _val, tLen); 1027Array.Copy(data, _val, tLen); 1028Array.Resize(ref _trends, tLen); 1029Array.Copy(data, _trends, tLen); 1030Array.Resize(ref _curWindow, wLen);
STL\InnerStl.cs (10)
126Array.Resize(ref _seasonalComponent, length); 127Array.Resize(ref _trendComponent, length); 128Array.Resize(ref _residual, length); 130Array.Resize(ref _s, length); 131Array.Resize(ref _t, length); 132Array.Resize(ref _detrendedY, length); 133Array.Resize(ref _c, length + np * 2); 134Array.Resize(ref _deseasonSeries, length); 136Array.Resize(ref _cycleSubSeries, np); 137Array.Resize(ref _smoothedSubseries, np);
STL\LocalRegression.cs (1)
208Array.Sort(absErrors);
TrajectoryMatrix.cs (2)
244Array.Sort(ind, (a, b) => sVal[b].CompareTo(sVal[a])); 248Array.Copy(sVec, _windowSize * ind[i], leftSingularvectors, _windowSize * i, _windowSize);
Microsoft.ML.Tokenizers (7)
Model\BertTokenizer.cs (1)
238return Array.Empty<int>();
Model\SentencePieceUnigramModel.cs (2)
106return Array.Empty<EncodedToken>(); 567return Array.Empty<int>();
Utils\DoubleArrayTrie.cs (3)
96private T[] _buf = Array.Empty<T>(); 115_buf = Array.Empty<T>(); 145Array.Copy(_buf, buf, _size);
Utils\Vec.cs (1)
56Array.Resize(ref _buffer, _buffer.Length << 1);
Microsoft.ML.Tokenizers.Tests (15)
LlamaTests.cs (6)
277Assert.Equal(isEmptyInput ? Array.Empty<int>() : ids.Skip(1).Concat(new[] { bpe.EndOfSentenceId }), bpeTokens.Select(token => token.Id)); 278Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Skip(1).Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.Value)); 283Assert.Equal(isEmptyInput ? Array.Empty<int>() : ids.Skip(1).Concat(new[] { bpe.EndOfSentenceId }), encodedIds); 287Assert.Equal(isEmptyInput ? Array.Empty<int>() : ids.Concat(new[] { bpe.EndOfSentenceId }), bpeTokens.Select(token => token.Id)); 288Assert.Equal(isEmptyInput ? Array.Empty<string>() : tokens.Concat(new[] { bpe.EndOfSentenceToken }), bpeTokens.Select(token => token.Value)); 293Assert.Equal(isEmptyInput ? Array.Empty<int>() : ids.Concat(new[] { bpe.EndOfSentenceId }), encodedIds);
src\Microsoft.ML.Tokenizers\Utils\DoubleArrayTrie.cs (3)
96private T[] _buf = Array.Empty<T>(); 115_buf = Array.Empty<T>(); 145Array.Copy(_buf, buf, _size);
UnigramTests.cs (6)
359Array.Copy(ids, 0, expectedIds, 1, ids.Length); 361Array.Copy(ids, 0, expectedIds, ids.Length + 2, ids.Length); 367Array.Copy(tokens, 0, expectedTokens, 1, tokens.Length); 369Array.Copy(tokens, 0, expectedTokens, tokens.Length + 2, tokens.Length); 467Array.Copy(ids, 0, expectedIds, 1, ids.Length); 469Array.Copy(ids, 0, expectedIds, ids.Length + 2, ids.Length);
Microsoft.ML.TorchSharp (1)
Extensions\TensorExtensions.cs (1)
32return Array.Empty<T>();
Microsoft.ML.Transforms (23)
Expression\CodeGen.cs (1)
73Array.Copy(types, 0, types, 1, types.Length - 1);
Expression\LambdaBinder.cs (3)
1447Array rest = Array.CreateInstance(type, tail); 1450Array.Resize(ref args, head + 1);
Expression\TokenCursor.cs (1)
125Array.Resize(ref _buffer, 2 * _buffer.Length);
GroupTransform.cs (1)
489Array.Resize(ref _buffer, size);
MissingValueReplacing.cs (7)
41private static readonly FuncInstanceMethodInfo1<MissingValueReplacingTransformer, DataViewType, Array, BitArray> _computeDefaultSlotsMethodInfo 42= FuncInstanceMethodInfo1<MissingValueReplacingTransformer, DataViewType, Array, BitArray>.Create(target => target.ComputeDefaultSlots<int>); 360if (repValues[slot] is Array) 362slotIsDefault[slot] = Utils.MarshalInvoke(_computeDefaultSlotsMethodInfo, this, types[slot].GetItemType().RawType, types[slot], (Array)repValues[slot]); 367private BitArray ComputeDefaultSlots<T>(DataViewType type, Array values) 510Host.Assert(repValue is Array); 516Host.Assert(!(repValue is Array));
MutualInformationFeatureSelection.cs (5)
690Array.Resize(ref _contingencyTable[i], numFeatures); 691Array.Resize(ref _featureSums, numFeatures); 694Array.Clear(_contingencyTable[i], 0, numFeatures); 695Array.Clear(_labelSums, 0, _numLabels); 696Array.Clear(_featureSums, 0, numFeatures);
PermutationFeatureImportance.cs (2)
238Array.Clear(featureValuesBuffer, 0, featureValuesBuffer.Length); 240Array.Clear(nextValues, 0, nextValues.Length);
Text\LdaSingleBox.cs (2)
361Array.Copy(topicID, _topics, topicNum); 362Array.Copy(topicProb, _probabilities, topicNum);
Text\NgramHashingTransformer.cs (1)
705Array.Copy(Grams, ngram, Lim);
Microsoft.ML.Vision (2)
DnnRetrainTransform.cs (1)
306Array.Copy(_tfInputNodes, tfInputs, _tfInputNodes.Length);
ImageClassificationTrainer.cs (1)
1569Array.Empty<long>(),
Microsoft.VisualBasic.Core (37)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (3)
981Array.Resize(packedIndexes, packedIndexes.Length + 1) 1054Array.Resize(packedIndexes, packedIndexes.Length + 1) 1238argNames = Array.Empty(Of String)()
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (4)
517Dim ary As Array 519ary = CType(o, Array) 753Dim ary As Array 756ary = CType(o, Array)
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (1)
854Instance, Nothing, MemberName, Arguments, Array.Empty(Of String)(),
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (3)
387ElseIf TypeOf obj1 Is Char() AndAlso CType(obj1, Array).Rank = 1 Then 399ElseIf TypeOf obj2 Is Char() AndAlso CType(obj2, Array).Rank = 1 Then 434ElseIf TypeOf obj1 Is Char() AndAlso CType(obj1, Array).Rank = 1 Then
Microsoft\VisualBasic\CompilerServices\Symbols.vb (9)
58Friend Shared ReadOnly NoArguments As Object() = Array.Empty(Of Object)() 59Friend Shared ReadOnly NoArgumentNames As String() = Array.Empty(Of String)() 60Friend Shared ReadOnly NoTypeArguments As Type() = Array.Empty(Of Type)() 61Friend Shared ReadOnly NoTypeParameters As Type() = Array.Empty(Of Type)() 857Private Shared ReadOnly s_noMembers As MemberInfo() = Array.Empty(Of MemberInfo)() 989Array.Sort(Of MemberInfo)(result, InheritanceSorter.Instance) 1044Array.Sort(result, InheritanceSorter.Instance) 1150Dim arrayInstance As Array = DirectCast(_instance, System.Array) 1199Dim arrayInstance As Array = DirectCast(_instance, System.Array)
Microsoft\VisualBasic\CompilerServices\Utils.vb (6)
80Public Shared Function CopyArray(arySrc As Global.System.Array, aryDest As Global.System.Array) As Global.System.Array 111Global.System.Array.Copy(arySrc, i * lenSrcLastRank, aryDest, i * lenDestLastRank, lenCopy) 114Global.System.Array.Copy(arySrc, aryDest, lLength) 351Dim [property] As PropertyInfo = MemberInfo.GetProperty("MetadataToken", GetType(Integer), Array.Empty(Of Type)())
Microsoft\VisualBasic\CompilerServices\VB6File.vb (1)
2295If TypeOf value Is Char() AndAlso CType(value, Array).Rank = 1 Then
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (1)
1998args = Array.Empty(Of Object)()
Microsoft\VisualBasic\FileIO\FileSystem.vb (3)
2205Array.Copy(sourceArray:=m_PreviousCharBuffer, sourceIndex:=0, 2218Array.Copy(sourceArray:=CharBuffer, sourceIndex:=(CharBuffer.Length - m_SearchText.Length), 2260Private m_PreviousCharBuffer() As Char = Array.Empty(Of Char)() ' The cached character array from previous call to IsTextExist.
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (3)
696Array.Copy(m_Buffer, m_Position, m_Buffer, 0, ContentLength) 734Array.Copy(m_Buffer, TempArray, m_Buffer.Length) 1431Private m_CommentTokens() As String = Array.Empty(Of String)()
Microsoft\VisualBasic\Information.vb (2)
488Dim ary As Array 489ary = CType(VarName, Array)
Microsoft\VisualBasic\Strings.vb (1)
2240Private Function IsArrayEmpty(ByVal array As System.Array) As Boolean
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (1)
250sendData(pipeName, Array.Empty<string>()); // valid
Microsoft.VisualStudio.LanguageServices (2)
EditorConfigSettings\NamingStyle\ViewModel\ColumnViewModels\NamingStylesStyleViewModel.cs (2)
22var selectedStyleIndex = Array.IndexOf(_setting.AllStyles, _setting.StyleName); 62var selectedStyleIndex = Array.IndexOf(_setting.AllStyles, _setting.StyleName);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ProjectSystemShim\CSharpProjectShim.ICSharpProjectSite.cs (1)
162Array.Copy(_startupClasses, classNames, _startupClasses.Length);
MinimalSample (1)
Program.cs (1)
33tags ??= endpoint?.Metadata.GetMetadata<ITagsMetadata>()?.Tags ?? Array.Empty<string>();
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
52[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Array))]
Mvc.Api.Analyzers.Test (2)
ApiConventionAnalyzerIntegrationTest.cs (1)
274=> RunTest(descriptor, Array.Empty<object>(), testMethod);
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (1)
48return GetDiagnosticsAsync(new[] { project }, Analyzer, Array.Empty<string>());
Mvc.RoutingWebSite (2)
StartupForDynamic.cs (1)
73return new ValueTask<IReadOnlyList<Endpoint>>(Array.Empty<Endpoint>());
StartupForDynamicOrder.cs (1)
93var kvps = ((string)values?["slug"])?.Split("/")?.LastOrDefault()?.Split(",") ?? Array.Empty<string>();
netstandard (1)
netstandard.cs (1)
45[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Array))]
PresentationBuildTasks (12)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (3)
593_generatedCodeFiles = Array.Empty<TaskItem>(); 612_generatedBamlFiles = Array.Empty<TaskItem>(); 631_generatedLocalizationFiles = Array.Empty<TaskItem>();
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (2)
366_generatedBaml = Array.Empty<TaskItem>(); 563localXamlPageFileList = Array.Empty<FileUnit>();
MS\Internal\MarkupCompiler\MarkupCompiler.cs (2)
984Array.Empty<CodeExpression>())); 3159coce = new CodeObjectCreateExpression(appClassName, Array.Empty<CodeExpression>());
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypesHelper.cs (1)
70Array.Clear(_typeTable, 0, _typeTable.Length);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (1)
230|| ReflectionHelper.GetMscorlibType(typeof(Array)).IsAssignableFrom(type));
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
4435return Array.Empty<NamespaceMapEntry>();
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (2)
255public void CopyTo(Array array, int index) 636Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
PresentationCore (184)
MS\Internal\FontCache\BufferCache.cs (5)
163private static Array GetBuffer(int length, int index) 165Array buffer = null; 191private static void ReleaseBuffer(Array buffer, int index) 199_buffers = new Array[BuffersLength]; 243private static Array[] _buffers;
MS\Internal\FontCache\FontCacheUtil.cs (1)
446if (Array.IndexOf<char>(InvalidFileNameChars, unescapedChar) >= 0)
MS\Internal\FontCache\FontFaceLayoutInfo.cs (1)
391Array.Clear(glyphBits, 0, glyphBitsLength);
MS\Internal\FontCache\FontSource.cs (2)
322Array.Copy(fileReadBuffer, newBuffer, memoryFontSize); 342Array.Copy(fileReadBuffer, memoryFont, memoryFontSize);
MS\Internal\FontFace\CompositeFontInfo.cs (1)
271Array.Copy(ranges, temp, count);
MS\Internal\Ink\ExtendedProperty.cs (10)
61Array array1 = (Array)this.Value; 62Array array2 = (Array)that.Value; 196Array newArray = Array.CreateInstance(elementType, ((Array)_value).Length); 197Array.Copy((Array)_value, newArray, ((Array)_value).Length);
MS\Internal\Ink\ExtendedPropertyCollection.cs (1)
208return Array.Empty<Guid>();
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (3)
129GestureRecognitionResult[] recResults = Array.Empty<GestureRecognitionResult>(); 586GestureRecognitionResult[] recResults = Array.Empty<GestureRecognitionResult>(); 649GestureRecognitionResult[] recResults = Array.Empty<GestureRecognitionResult>();
MS\Internal\Ink\Lasso.cs (2)
193return Array.Empty<StrokeIntersection>(); 306return Array.Empty<StrokeIntersection>();
MS\Internal\PartialArray.cs (1)
98int index = Array.IndexOf<T>(_array, item, _initialIndex, _count);
MS\Internal\Shaping\OpenTypeLayout.cs (4)
1215Array.Clear(_lookupUsageFlags, 0, requiredLookupUsageArraySize); 1317Array.Copy(_cachePointers, tmp, firstGlyphChanged); 1318Array.Copy(_cachePointers, oldAfterLastGlyphChanged, tmp, afterLastGlyphChanged, oldLength - oldAfterLastGlyphChanged); 1324Array.Copy(_cachePointers, oldAfterLastGlyphChanged, _cachePointers, afterLastGlyphChanged, oldLength - oldAfterLastGlyphChanged);
MS\Internal\Shaping\OpenTypeLayoutCache.cs (1)
507Array.Sort(records, 0, recordCount);
MS\Internal\SynchronizedInputHelper.cs (2)
89if (Array.IndexOf(InputManager.SynchronizedInputEvents, args.RoutedEvent) >= 0) 103Array.IndexOf(InputManager.SynchronizedInputEvents, args.RoutedEvent) >= 0)
MS\Internal\TextFormatting\FullTextLine.cs (1)
2059return Array.Empty<TextSpan<TextRun>>();
MS\Internal\TextFormatting\TextStore.cs (1)
506Array.Sort(bounds); // sort the TextEffect bounds.
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (2)
1959Array.Sort(doubleArray, 0, countX); 1965Array.Sort(doubleArray, countX, countY);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Ink\KnownIds.cs (1)
313null, null, Array.Empty<object>(),
System\Windows\ClassHandlersStore.cs (1)
62Array.Copy(handlers.Handlers, 0, mergedHandlers, 0, length);
System\Windows\FreezableCollection.cs (1)
467void ICollection.CopyTo(Array array, int index)
System\Windows\Generated\TextDecorationCollection.cs (1)
379void ICollection.CopyTo(Array array, int index)
System\Windows\GlobalEventManager.cs (2)
118if(Array.IndexOf(routedEvents, routedEvent) < 0) 137if(Array.IndexOf(routedEvents, routedEvent) < 0)
System\Windows\Ink\GestureRecognizer.cs (1)
119_enabledGestures = Array.Empty<ApplicationGesture>();
System\Windows\Ink\Stroke2.cs (3)
567return Array.Empty<StrokeIntersection>(); 586return Array.Empty<StrokeIntersection>(); 593return Array.Empty<StrokeIntersection>();
System\Windows\Input\Command\CommandBindingCollection.cs (1)
64void ICollection.CopyTo(System.Array array, int index)
System\Windows\Input\Command\InputBindingCollection.cs (1)
72void ICollection.CopyTo(System.Array array, int index)
System\Windows\Input\Command\InputGestureCollection.cs (1)
63void ICollection.CopyTo(System.Array array, int index)
System\Windows\Input\InputManager.cs (2)
751Array.IndexOf(SynchronizedInputEvents, input.RoutedEvent) < 0 && 752Array.IndexOf(PairedSynchronizedInputEvents, input.RoutedEvent) < 0)
System\Windows\Input\Stylus\Common\RawStylusSystemGestureInputReport.cs (2)
98stylusDeviceId, Array.Empty<int>()) 148: base(mode, timestamp, inputSource, penContext, RawStylusActions.SystemGesture, tabletId, stylusDeviceId, Array.Empty<int>())
System\Windows\Input\Stylus\Common\TabletDeviceCollection.cs (2)
48void ICollection.CopyTo(Array array, int index) 50Array.Copy(TabletDevices.ToArray(), 0, array, index, Count);
System\Windows\Input\Stylus\Pointer\PointerData.cs (1)
108_history = Array.Empty<POINTER_INFO>();
System\Windows\Input\Stylus\Wisp\PenContexts.cs (5)
105ProcessInput(RawStylusActions.OutOfRange, penContext, tabletDeviceId, stylusPointerId, Array.Empty<int>(), timestamp); 210Array.Copy(_contexts, 0, ctxs, 0, preCopyCount); 213Array.Copy(_contexts, index, ctxs, index+1, postCopyCount); 237Array.Copy(_contexts, 0, ctxs, 0, preCopyCount); 238Array.Copy(_contexts, index+1, ctxs, index, postCopyCount);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (6)
29private IntPtr [] _handles = Array.Empty<IntPtr>(); 31private WeakReference [] _penContexts = Array.Empty<WeakReference>(); 33private IPimcContext3 [] _pimcContexts = Array.Empty<IPimcContext3>(); 38private UInt32[] _wispContextKeys = Array.Empty<UInt32>(); 155private TabletDeviceInfo[] _tabletDevicesInfo = Array.Empty<TabletDeviceInfo>(); 320private StylusDeviceInfo[] _stylusDevicesInfo = Array.Empty<StylusDeviceInfo>();
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (7)
370Array.Copy(tablets, 0, _tablets, 0, count); 379Array.Copy(tablets, 0, updatedTablets, 0, tabletsIndex); 547Array.Copy(_tablets, 0, newTablets, 0, preCopyCount); 549Array.Copy(_tablets, index, newTablets, index+1, postCopyCount); 568Array.Copy(_tablets, 0, tablets, 0, preCopyCount); 569Array.Copy(_tablets, index+1, tablets, index, postCopyCount); 695private TabletDevice[] _tablets = Array.Empty<TabletDevice>();
System\Windows\InterOp\HwndPointerInputProvider.cs (2)
141int[] data = Array.Empty<int>(); 168Array.Copy(rawPointerData, j, data, i, rawDataPointSize);
System\Windows\Media\Animation\Clock.cs (1)
4218Array.Sort(idTable);
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (1)
796Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (1)
796Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (1)
796Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (1)
796Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (1)
796Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\TimelineCollection.cs (1)
378void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Animation\Timeline.cs (1)
997Array.Sort(idTable);
System\Windows\Media\CharacterMetricsDictionary.cs (1)
171void SC.ICollection.CopyTo(Array array, int index)
System\Windows\Media\CultureSpecificStringDictionary.cs (2)
140void SC.ICollection.CopyTo(Array array, int index) 442public void CopyTo(Array array, int index)
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (1)
381void ICollection.CopyTo(Array array, int index)
System\Windows\Media\FamilyMapCollection.cs (3)
83Array.Copy(_items, 0, array, index, _count); 86void SC.ICollection.CopyTo(Array array, int index) 104Array.Copy(_items, 0, array, index, _count);
System\Windows\Media\FamilyTypefaceCollection.cs (3)
89void SC.ICollection.CopyTo(Array array, int index) 364private void CopyItems(Array array, int index) 384Array.Copy(_items, 0, array, index, _count);
System\Windows\Media\Fonts.cs (1)
247return Array.AsReadOnly<FontFamily>(fontFamilyList);
System\Windows\Media\Generated\DoubleCollection.cs (1)
353void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\DrawingCollection.cs (1)
400void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\GeneralTransformCollection.cs (1)
388void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\GeometryCollection.cs (1)
400void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\GradientStopCollection.cs (1)
388void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\Int32Collection.cs (1)
353void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\PathFigureCollection.cs (1)
389void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\PathSegmentCollection.cs (1)
388void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\PointCollection.cs (1)
353void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\TextEffectCollection.cs (1)
388void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\TransformCollection.cs (1)
400void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Generated\VectorCollection.cs (1)
353void ICollection.CopyTo(Array array, int index)
System\Windows\Media\Imaging\BitmapSource.cs (6)
43System.Array pixels, 343public virtual void CopyPixels(Int32Rect sourceRect, Array pixels, int stride, int offset) 361public virtual void CopyPixels(Array pixels, int stride, int offset) 634internal unsafe void CriticalCopyPixels(Int32Rect sourceRect, Array pixels, int stride, int offset) 994int i = Array.IndexOf(s_supportedDUCEFormats, format); 1583return (Array.IndexOf(s_supportedDUCEFormats, format) != -1);
System\Windows\Media\Imaging\CachedBitmap.cs (1)
108System.Array pixels,
System\Windows\Media\Imaging\PropVariant.cs (14)
117internal void InitVector(Array array, Type type, VarEnum varEnum) 122internal void Init(Array array, Type type, VarEnum vt) 225else if (value is Array) 231InitVector(value as Array, typeof(sbyte), VarEnum.VT_I1); 235InitVector(value as Array, typeof(byte), VarEnum.VT_UI1); 257InitVector(value as Array, typeof(short), VarEnum.VT_I2); 261InitVector(value as Array, typeof(ushort), VarEnum.VT_UI2); 265InitVector(value as Array, typeof(int), VarEnum.VT_I4); 269InitVector(value as Array, typeof(uint), VarEnum.VT_UI4); 273InitVector(value as Array, typeof(Int64), VarEnum.VT_I8); 277InitVector(value as Array, typeof(UInt64), VarEnum.VT_UI8); 281InitVector(value as Array, typeof(float), VarEnum.VT_R4); 285InitVector(value as Array, typeof(double), VarEnum.VT_R8); 289InitVector(value as Array, typeof(Guid), VarEnum.VT_CLSID);
System\Windows\Media\Imaging\WriteableBitmap.cs (3)
375Array sourceBuffer, 464Array pixels, 1037private static void ValidateArrayAndGetInfo(Array sourceBuffer,
System\Windows\Media\MatrixStack.cs (1)
44Array.Copy(_items, newItems, _size);
System\Windows\Media\textformatting\TextRunCache.cs (1)
87return Array.Empty<TextSpan<TextRun>>();
System\Windows\Media\UniqueEventHelper.cs (1)
135return Array.Empty<TEventHandler>();
System\Windows\Media\VisualCollection.cs (2)
166public void CopyTo(Array array, int index) 254Array.Copy(_items, 0, newItems, 0, _size);
System\Windows\Media\VisualProxy.cs (1)
571Array.Copy(_tail, reallocatedTail, Math.Min(_tail.Length, newLength));
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (1)
386void ICollection.CopyTo(Array array, int index)
System\Windows\Media3D\Generated\MaterialCollection.cs (1)
398void ICollection.CopyTo(Array array, int index)
System\Windows\Media3D\Generated\Model3DCollection.cs (1)
398void ICollection.CopyTo(Array array, int index)
System\Windows\Media3D\Generated\Point3DCollection.cs (1)
351void ICollection.CopyTo(Array array, int index)
System\Windows\Media3D\Generated\Transform3DCollection.cs (1)
398void ICollection.CopyTo(Array array, int index)
System\Windows\Media3D\Generated\Vector3DCollection.cs (1)
351void ICollection.CopyTo(Array array, int index)
System\Windows\Media3D\Visual3DCollection.cs (1)
144void ICollection.CopyTo(Array array, int index)
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
211/// Tries to get this object as an <see cref="Array"/> of primitive types.
PresentationCore.Tests (3)
System\Windows\ClipboardTests.cs (1)
41byte[] audioBytes = Array.Empty<byte>();
System\Windows\Media\Animation\KeySplineConverter.Tests.cs (1)
302yield return new object[] { new KeySpline(0.6, 0.7, 0.8, 0.9), typeof(Array), CultureInfo.InvariantCulture };
System\Windows\Media\Imaging\WriteableBitmap.Tests.cs (1)
136Array.Fill(bigRect, 0xFF00E6FF);
PresentationFramework (148)
Microsoft\Win32\CommonItemDialog.cs (1)
492return Array.Empty<string>();
Microsoft\Win32\FileDialog.cs (1)
653return extensions ?? Array.Empty<COMDLG_FILTERSPEC>();
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (1)
282private static readonly XmlQualifiedName[] LocatorPartTypeNames = Array.Empty<XmlQualifiedName>();
MS\Internal\Annotations\Anchoring\TreeNodeSelectionProcessor.cs (1)
204private static readonly XmlQualifiedName[] LocatorPartTypeNames = Array.Empty<XmlQualifiedName>();
MS\Internal\Annotations\Serializer.cs (2)
54_ctor = type.GetConstructor(Array.Empty<Type>()); 87IXmlSerializable serializable = (IXmlSerializable)_ctor.Invoke(Array.Empty<object>());
MS\Internal\Controls\InnerItemCollectionView.cs (1)
347void ICollection.CopyTo(Array array, int index)
MS\Internal\Data\IndexedEnumerable.cs (1)
293internal static void CopyTo(IEnumerable collection, Array array, int index)
MS\Internal\Data\IndexerPropertyInfo.cs (1)
56return Array.Empty<ParameterInfo>();
MS\Internal\Data\LiveShapingList.cs (4)
147_sortInfos = Array.Empty<LivePropertyInfo>(); 169_filterInfos = Array.Empty<LivePropertyInfo>(); 211_groupInfos = Array.Empty<LivePropertyInfo>(); 615public void CopyTo(Array array, int index)
MS\Internal\Data\PathParser.cs (2)
143return Array.Empty<SourceValueInfo>(); 164return _error is null ? _sourceValueInfos.ToArray() : Array.Empty<SourceValueInfo>();
MS\Internal\Data\RBNode.cs (2)
47public int OffsetOf(T x) { return Array.IndexOf(_data, x); } 303Array.Copy(sourceNode._data, sourceOffset, destNode._data, destOffset, count);
MS\Internal\Data\SortFieldComparer.cs (1)
98Array.Sort(list, sfc);
MS\Internal\Documents\ContentElementCollection.cs (4)
64public void CopyTo(Array array, int index) 80Array.Copy(Items, 0, array, index, Size); 112Array.Copy(Items, 0, array, index, Size); 765Array.Copy(Items, 0, newItems, 0, Size);
MS\Internal\Globalization\BamlTreeMap.cs (2)
717LocalizationAttributes = Array.Empty<PropertyComment>(); 718LocalizationComments = Array.Empty<PropertyComment>();
MS\Internal\IO\Packaging\ByteStream.cs (1)
298Array.Copy(localBuffer, 0, buffer, offset, read);
MS\Internal\Printing\PrintDlgExMarshaler.cs (1)
761Array.Clear(nulls, 0, nulls.Length);
MS\Internal\PtsHost\DtrList.cs (2)
126Array.Copy(_dtrs, i, _dtrs, i+1, _count-i); 314Array.Copy(_dtrs, newdtrs, _dtrs.Length);
MS\Internal\PtsHost\PtsContext.cs (1)
448Array.Copy(_unmanagedHandles, newItems, _unmanagedHandles.Length);
MS\Internal\PtsHost\RowParagraph.cs (1)
314_spannedCells = Array.Empty<CellParagraph>();
MS\Internal\PtsHost\TableParaClient.cs (1)
1924Array.Copy(
MS\Internal\PtsTable\RowSpanVector.cs (2)
207cells = Array.Empty<TableCell>(); 252Array.Copy(_entries, newEntries, _entries.Length);
MS\Internal\UncommonValueTable.cs (4)
50Array.Copy(_table, 0, newTable, 0, index); 51Array.Copy(_table, index, newTable, index+1, n-index); 77Array.Copy(_table, 0, newTable, 0, index); 78Array.Copy(_table, index+1, newTable, index, n-index);
MS\Internal\WindowsRuntime\Generated\WinRT\GuidGenerator.cs (1)
36return (string)sigMethod.Invoke(null, Array.Empty<Type>());
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (5)
276public MarshalerArray(Array array) => _gchandle = GCHandle.Alloc(array, GCHandleType.Pinned); 282public static MarshalerArray CreateMarshalerArray(Array array) => new MarshalerArray(array); 287return (((Array)m._gchandle.Target).Length, m._gchandle.AddrOfPinnedObject()); 301public static unsafe (int length, IntPtr data) FromManagedArray(Array array) 314public static unsafe void CopyManagedArray(Array array, IntPtr data)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\ItemMap.cs (2)
42Array.Copy(Entries, 0, destEntries, 0, index); 46Array.Copy(Entries, index, destEntries, index + 1, Count - index);
System\Windows\Automation\Peers\GridViewAutomationPeer.cs (2)
149return Array.Empty<IRawElementProviderSimple>(); 158return Array.Empty<IRawElementProviderSimple>();
System\Windows\Automation\Peers\GridViewCellAutomationPeer.cs (2)
96return Array.Empty<IRawElementProviderSimple>(); 115return Array.Empty<IRawElementProviderSimple>();
System\Windows\Automation\Peers\TreeViewAutomationPeer.cs (1)
169selection = Array.Empty<IRawElementProviderSimple>();
System\Windows\Controls\ColumnDefinition.cs (4)
73void ICollection.CopyTo(Array array, int index) 92Array.Copy(_items, 0, array, index, _size); 114Array.Copy(_items, 0, array, index, _size); 753Array.Copy(_items, 0, newItems, 0, _size);
System\Windows\Controls\CustomDictionarySources.cs (1)
271void ICollection.CopyTo(Array array, int index)
System\Windows\Controls\Grid.cs (10)
438Array.Clear(_definitionIndices, 0, _definitionIndices.Length); 446Array.Clear(_roundingErrors, 0, _roundingErrors.Length); 2211Array.Sort(definitionIndices, 0, starDefinitionsCount, new StarDistributionOrderIndexComparer(definitions)); 2258Array.Sort(definitionIndices, 0, definitions.Length, new DistributionOrderIndexComparer(definitions)); 2296Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2491Array.Sort(definitionIndices, 0, minCount, new MinRatioIndexComparer(definitions)); 2492Array.Sort(definitionIndices, defCount, maxCount, new MaxRatioIndexComparer(definitions)); 2665Array.Sort(definitionIndices, 0, starCount, new StarWeightIndexComparer(definitions)); 2765Array.Sort(definitionIndices, 0, definitions.Length, new RoundingErrorIndexComparer(roundingErrors)); 2915Array.Clear(extData.TempDefinitions, 0, Math.Max(DefinitionsU.Length, DefinitionsV.Length));
System\Windows\Controls\GridViewColumnCollectionChangedEventArgs.cs (1)
35_clearedColumns = System.Array.AsReadOnly<GridViewColumn>(clearedColumns);
System\Windows\Controls\InkCanvas.cs (3)
2311ChangeInkCanvasSelection(new StrokeCollection(), Array.Empty<UIElement>()); 2327CoreChangeSelection(new StrokeCollection(), Array.Empty<UIElement>(), raiseSelectionChangedEvent); 2512return Array.Empty<UIElement>();
System\Windows\Controls\ItemCollection.cs (1)
282public void CopyTo(Array array, int index)
System\Windows\Controls\MultipleCopiesCollection.cs (1)
298public void CopyTo(Array array, int index)
System\Windows\Controls\Primitives\TabPanel.cs (2)
231int[] solution = Array.Empty<int>(); 431return Array.Empty<int>();
System\Windows\Controls\Primitives\Track.cs (1)
136Array.Copy(_visualChildren, itemIndex + 1, _visualChildren, itemIndex, nullIndex - itemIndex);
System\Windows\Controls\RowDefinition.cs (4)
68void ICollection.CopyTo(Array array, int index) 87Array.Copy(_items, 0, array, index, _size); 109Array.Copy(_items, 0, array, index, _size); 748Array.Copy(_items, 0, newItems, 0, _size);
System\Windows\Controls\Slider.cs (1)
947return Array.Empty<CustomPopupPlacement>();
System\Windows\Controls\TextAdaptor.cs (3)
93return Array.Empty<Rect>(); 111return Array.Empty<Rect>(); 127return Array.Empty<Rect>();
System\Windows\Controls\UIElementCollection.cs (1)
75public virtual void CopyTo(Array array, int index)
System\Windows\Controls\WebBrowser.cs (1)
297Array.Reverse(args);
System\Windows\Data\BindingExpression.cs (1)
1232Array.Copy(newWorkerSources, 0, newSources, offset, n);
System\Windows\Data\BindingExpressionBase.cs (2)
472Array.Copy(temp, 0, result, 0, j); 2884Array.Copy(sources, 0, temp, 0, n);
System\Windows\Data\CompositeCollection.cs (1)
88public void CopyTo(Array array, int index)
System\Windows\Data\MultiBindingExpression.cs (2)
600Array.Clear(_tempTypes, 0, _tempTypes.Length); 1259Array.Clear(_tempValues, 0, _tempValues.Length);
System\Windows\Diagnostics\BindingFailedEventArgs.cs (1)
50this.Parameters = parameters ?? Array.Empty<object>();
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (4)
271=> Array.Empty<ResourceDictionary>(); 314=> Array.Empty<FrameworkElement>(); 316=> Array.Empty<FrameworkContentElement>(); 318=> Array.Empty<Application>();
System\Windows\Documents\FixedFindEngine.cs (1)
424Array.Reverse(chars);
System\Windows\Documents\FixedSOMContainer.cs (1)
174return Array.Empty<FixedElement.ElementType>();
System\Windows\Documents\FlowPosition.cs (2)
224Array.Copy(text.ToCharArray(flow._offset, maxLength), 0, chars, startIndex, maxLength); 228Array.Copy(text.ToCharArray(flow._offset - maxLength, maxLength), 0, chars, startIndex, maxLength);
System\Windows\Documents\ImmComposition.cs (2)
928Array.Copy(resultChars, 0, compositionText, 0, resultLength); 929Array.Copy(compositionChars, 0, compositionText, resultLength, compositionLength);
System\Windows\Documents\PageContent.cs (1)
435children = Array.Empty<FixedPage>();
System\Windows\Documents\TableCellCollection.cs (1)
59public void CopyTo(Array array, int index)
System\Windows\Documents\TableColumnCollection.cs (1)
59public void CopyTo(Array array, int index)
System\Windows\Documents\TableRowCollection.cs (1)
59public void CopyTo(Array array, int index)
System\Windows\Documents\TableRowGroupCollection.cs (1)
59public void CopyTo(Array array, int index)
System\Windows\Documents\TextElementCollection.cs (1)
593void ICollection.CopyTo(Array array, int arrayIndex)
System\Windows\Documents\TextElementCollectionHelper.cs (1)
116Array.Copy(_cleanParentList, 0, _cleanParentList, 1, index);
System\Windows\Documents\TextPointerBase.cs (2)
1459Array.Copy(preceedingText, SelectionWordBreaker.MinContextLength - preceedingCount, text, 0, preceedingCount); 1460Array.Copy(followingText, 0, text, preceedingCount, followingCount);
System\Windows\Documents\TextSchema.cs (8)
55Array.Copy(textElementPropertyList, 0, _inheritableTextElementProperties, 0, textElementPropertyList.Length); 56Array.Copy(Typography.TypographyPropertiesList, 0, _inheritableTextElementProperties, textElementPropertyList.Length, Typography.TypographyPropertiesList.Length); 67Array.Copy(blockPropertyList, 0, _inheritableBlockProperties, 0, blockPropertyList.Length); 68Array.Copy(_inheritableTextElementProperties, 0, _inheritableBlockProperties, blockPropertyList.Length, _inheritableTextElementProperties.Length); 78Array.Copy(tableCellPropertyList, _inheritableTableCellProperties, tableCellPropertyList.Length); 79Array.Copy(_inheritableTextElementProperties, 0, _inheritableTableCellProperties, tableCellPropertyList.Length, _inheritableTextElementProperties.Length); 504return Array.Empty<DependencyProperty>(); 562return Array.Empty<DependencyProperty>(); // to make compiler happy
System\Windows\Documents\TextTreeTextBlock.cs (8)
94Array.Copy(_text, 0, newText, 0, _gapOffset); 96Array.Copy(_text, _gapOffset + _gapSize, newText, newText.Length - rightOfGapLength, rightOfGapLength); 121Array.Copy(textChars, textStartIndex, _text, logicalOffset, count); 149Array.Copy(_text, 0, newBlock._text, 0, _gapOffset); 163Array.Copy(_text, _gapOffset, newBlock._text, _gapOffset, MaxBlockSize - _gapOffset); 248Array.Copy(_text, logicalOffset, chars, charsStartIndex, copyCount); 263Array.Copy(_text, logicalOffset, chars, charsStartIndex, copyCount); 481Array.Copy(_text, sourceOffset, _text, destinationOffset, count);
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (2)
59IReadOnlyList<WordSegment> tokens = segmenter?.GetTokens(text) ?? Array.Empty<WordSegment>(); 62return Array.Empty<SpellerSegment>();
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
1436throw new ArgumentException(SR.Format(SR.IntegerCollectionLengthLessThanZero, Array.Empty<object>()));
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
18: base(Array.Empty<Assembly>())
System\Windows\Markup\Baml2006\WpfKnownType.cs (1)
373s_EmptyAttributes = Array.Empty<Attribute>();
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (1)
354void ICollection.CopyTo(Array array, int index)
System\Windows\Markup\Primitives\ElementMarkupObject.cs (4)
503Array.Sort(entries, delegate(DictionaryEntry one, DictionaryEntry two) 939Array array = value as Array; 1053get { return Array.Empty<Type>(); }
System\Windows\Markup\Primitives\FrameworkElementFactoryMarkupObject.cs (1)
323return Array.Empty<MarkupObject>();
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
1150typeof(Array).IsAssignableFrom(type);
System\Windows\Markup\XamlTypeMapper.cs (1)
4435return Array.Empty<NamespaceMapEntry>();
System\Windows\Markup\XmlnsDictionary.cs (3)
208CopyTo((Array)array, index); 255public void CopyTo(Array array, int index) 636Array.Copy(_nsDeclarations, 0, new_nsDeclarations, 0, _nsDeclarations.Length);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (1)
888Array.Sort(_sortedResolvedKeyFrames);
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (1)
247void ICollection.CopyTo(Array array, int index)
System\Windows\ResourceDictionary.cs (2)
958void ICollection.CopyTo(Array array, int arrayIndex) 2288void ICollection.CopyTo(Array array, int index)
System\Windows\TriggerActionCollection.cs (1)
235void ICollection.CopyTo(Array array, int index)
System\Windows\WindowCollection.cs (1)
89void ICollection.CopyTo(Array array, int index)
PresentationFramework.Tests (1)
System\Windows\Controls\VirtualizationCacheLengthConverter.Tests.cs (1)
283yield return new object[] { new VirtualizationCacheLength(255848), typeof(Array), CultureInfo.InvariantCulture };
PresentationFramework-SystemCore (3)
DynamicAccessorImpl.cs (3)
113Array.Copy(args, 0, delegateArgs, 2, rank); 124Array.Copy(args, 0, delegateArgs, 2, rank); 140Array.Copy(_accessors, 0, newAccessors, 0, _accessors.Length);
PresentationUI (2)
MS\Internal\Documents\PeoplePickerWrapper.cs (2)
75String[] ldapPaths = Array.Empty<String>(); 96return Array.Empty<String>();
ReachFramework (31)
AlphaFlattener\SegmentTree.cs (3)
222Array.Sort(_xCoord, (x, y) => x.value.CompareTo(y.value)); 225Array.Sort(_yCoord, (x, y) => x.value.CompareTo(y.value)); 249int p = Array.BinarySearch(_yCoord, y0, new CoordinateSearcher());
AlphaFlattener\Utility.cs (1)
1404Array.Copy(
MS\Internal\Printing\Configuration\DevMode.cs (1)
473Array.Copy(ticketDevMode.ByteData, this.dmFieldsByteOffset, this.ByteData, this.dmFieldsByteOffset, this.ByteData.Length - this.dmFieldsByteOffset);
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (1)
417return Array.Empty<T>();
PrintConfig\PrintSchema.cs (17)
1983internal static int[] CollationEnums = (int[])(Array)Enum.GetValues<Collation>(); 1993internal static int[] DuplexEnums = (int[])(Array)Enum.GetValues<Duplexing>(); 2005internal static int[] DirectionEnums = (int[])(Array)Enum.GetValues<PagesPerSheetDirection>(); 2015internal static int[] StaplingEnums = (int[])(Array)Enum.GetValues<Stapling>(); 2025internal static int[] SubstitutionEnums = (int[])(Array)Enum.GetValues<DeviceFontSubstitution>(); 2044internal static int[] MediaSizeEnums = (int[])(Array)Enum.GetValues<PageMediaSizeName>(); 2070internal static int[] MediaTypeEnums = (int[])(Array)Enum.GetValues<PageMediaType>(); 2080internal static int[] OrientationEnums = (int[])(Array)Enum.GetValues<PageOrientation>(); 2090internal static int[] ColorEnums = (int[])(Array)Enum.GetValues<OutputColor>(); 2103internal static int[] QualityEnums = (int[])(Array)Enum.GetValues<PageQualitativeResolution>(); 2116internal static int[] ScalingEnums = (int[])(Array)Enum.GetValues<PageScaling>(); 2126internal static int[] ModeEnums = (int[])(Array)Enum.GetValues<TrueTypeFontMode>(); 2136internal static int[] PageOrderEnums = (int[])(Array)Enum.GetValues<PageOrder>(); 2146internal static int[] PhotoIntentEnums = (int[])(Array)Enum.GetValues<PhotoPrintingIntent>(); 2156internal static int[] BorderlessEnums = (int[])(Array)Enum.GetValues<PageBorderless>(); 2166internal static int[] OutputQualityEnums = (int[])(Array)Enum.GetValues<OutputQuality>(); 2178internal static int[] InputBinEnums = (int[])(Array)Enum.GetValues<InputBin>();
PrintConfig\PTProvider.cs (3)
676Array.Copy(src, (int)totalBytesWritten, data, 0, bytesToWrite); 730Array.Clear(data, 0, data.Length); 743Array.Copy(data, 0, dst, (int)totalBytesRead, bytesRead);
Serialization\Manager\ReachSerializationUtils.cs (5)
200Array.Sort(List, 0, Count); 222Array.Copy(List, 0, array, 0, Count); 243Array.Clear(List, 0, Count); 258Array.Copy(List, index + 1, List, index, (Count - index - 1)); 261Array.Clear(List, Count - 1, 1);
Replay (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
341var buffer = Array.Empty<byte>();
Roslyn.Diagnostics.Analyzers (73)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Roslyn.Test.PdbUtilities (2)
Reader\MockSymUnmanagedReader.cs (1)
309Array.Copy(_constants, constants, constants.Length);
Reader\Token2SourceLineExporter.cs (1)
84Array.Copy(_buffer, newBuffer, _buffer.Length);
Shared (10)
BufferWriterPool\BufferWriter.cs (3)
36private T[] _buffer = Array.Empty<T>(); 76Array.Resize(ref _buffer, value); 185Array.Resize(ref _buffer, targetCapacity);
Data.Validation\LengthAttribute.cs (1)
18/// The standard <see cref="MinLengthAttribute" /> supports only non generic <see cref="Array"/> or <see cref="string"/> typed objects
EmptyCollections\EmptyCollectionExtensions.cs (1)
87=> array == null || array.Length == 0 ? Array.Empty<T>() : array;
EmptyCollections\EmptyReadonlyDictionary.cs (2)
30ICollection<TKey> IDictionary<TKey, TValue>.Keys => Array.Empty<TKey>(); 31ICollection<TValue> IDictionary<TKey, TValue>.Values => Array.Empty<TValue>();
ServerSentEvents\ArrayBuffer.cs (2)
45? Array.Empty<byte>() 85_bytes = Array.Empty<byte>();
ServerSentEvents\SseParser_1.cs (1)
564Array.Copy(toReturn, buffer, toReturn.Length);
Shared.Tests (3)
EmptyCollections\EmptyReadonlyDictionaryTests.cs (1)
52dict.CopyTo(Array.Empty<KeyValuePair<int, string>>(), 0);
EmptyCollections\EmptyReadOnlyListTests.cs (1)
64coll.CopyTo(Array.Empty<int>(), 0);
JsonSchemaExporter\TestTypes.cs (1)
690AdditionalValues: [new(true), new(42), new(""), new(new object()), new(Array.Empty<int>())],
Sockets.BindTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
99return new KestrelServerImpl(sp.GetServices<IConnectionListenerFactory>(), Array.Empty<IMultiplexedConnectionListenerFactory>(), sp.GetRequiredService<IHttpsConfigurationService>(), context);
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
99return new KestrelServerImpl(sp.GetServices<IConnectionListenerFactory>(), Array.Empty<IMultiplexedConnectionListenerFactory>(), sp.GetRequiredService<IHttpsConfigurationService>(), context);
src\Shared\Metrics\TestMeterFactory.cs (1)
25var meter = new Meter(options.Name, options.Version, Array.Empty<KeyValuePair<string, object>>(), scope: this);
System.CodeDom (2)
src\libraries\Common\src\System\IO\TempFileCollection.cs (1)
100void ICollection.CopyTo(Array array, int start) => _files.Keys.CopyTo(array, start);
System\CodeDom\CodeNamespaceImportCollection.cs (1)
82void ICollection.CopyTo(Array array, int index) => _data.CopyTo(array, index);
System.Collections (68)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (4)
19((IEnumerable<T>)Array.Empty<T>()).GetEnumerator(); 33Debug.Assert(Array.MaxLength == ArrayMaxLength); 79Array.Resize(ref arr, newLength); 92return Array.Empty<T>();
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (2)
10internal static void ValidateCopyToArguments(int sourceCount, Array array, int index) 44internal static void CopyTo<T>(ICollection<T> collection, Array array, int index)
System\Collections\Generic\LinkedList.cs (1)
447void ICollection.CopyTo(Array array, int index)
System\Collections\Generic\OrderedDictionary.cs (6)
534Array.Clear(_buckets, 0, _buckets.Length); 535Array.Clear(_entries, 0, _count); 1099Array.Copy(_entries, newEntries, count); 1279void ICollection.CopyTo(Array array, int index) 1522void ICollection.CopyTo(Array array, int index) 1831void ICollection.CopyTo(Array array, int index)
System\Collections\Generic\PriorityQueue.cs (9)
66_nodes = Array.Empty<(TElement, TPriority)>(); 93_nodes = Array.Empty<(TElement, TPriority)>(); 575Array.Clear(_nodes, 0, _size); 616Array.Resize(ref _nodes, _size); 635if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength; 644Array.Resize(ref _nodes, newcapacity); 949void ICollection.CopyTo(Array array, int index) 975Array.Copy(_queue._nodes, 0, array, index, _queue._size);
System\Collections\Generic\SortedDictionary.cs (3)
271void ICollection.CopyTo(Array array, int index) 548void ICollection.CopyTo(Array array, int index) 709void ICollection.CopyTo(Array array, int index)
System\Collections\Generic\SortedList.cs (28)
75keys = Array.Empty<TKey>(); 76values = Array.Empty<TValue>(); 162Array.Sort<TKey, TValue>(keys, values, comparer); 183int i = Array.BinarySearch<TKey>(keys, 0, _size, key, comparer); 242Array.Copy(keys, newKeys, _size); 243Array.Copy(values, newValues, _size); 250keys = Array.Empty<TKey>(); 251values = Array.Empty<TValue>(); 396Array.Clear(keys, 0, _size); 400Array.Clear(values, 0, _size); 452void ICollection.CopyTo(Array array, int index) 513if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength; 584int i = Array.BinarySearch<TKey>(keys, 0, _size, key, comparer); 642int ret = Array.BinarySearch<TKey>(keys, 0, _size, key, comparer); 653return Array.IndexOf(values, value, 0, _size); 662Array.Copy(keys, index, keys, index + 1, _size - index); 663Array.Copy(values, index, values, index + 1, _size - index); 693Array.Copy(keys, index + 1, keys, index, _size - index); 694Array.Copy(values, index + 1, values, index, _size - index); 1049Array.Copy(_dict.keys, 0, array, arrayIndex, _dict.Count); 1052void ICollection.CopyTo(Array array, int arrayIndex) 1060Array.Copy(_dict.keys, 0, array!, arrayIndex, _dict.Count); 1095int i = Array.BinarySearch<TKey>(_dict.keys, 0, 1163Array.Copy(_dict.values, 0, array, arrayIndex, _dict.Count); 1166void ICollection.CopyTo(Array array, int index) 1174Array.Copy(_dict.values, 0, array!, index, _dict.Count); 1207return Array.IndexOf(_dict.values, value, 0, _dict.Count);
System\Collections\Generic\SortedSet.cs (3)
110Array.Sort(elements, 0, count, comparer); 540void ICollection.CopyTo(Array array, int index) 1132Array.Sort(elements, 0, length, Comparer);
System\Collections\Generic\Stack.cs (12)
37_array = Array.Empty<T>(); 75Array.Clear(_array, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references. 93return _size != 0 && Array.LastIndexOf(_array, item, _size - 1) != -1; 120void ICollection.CopyTo(Array array, int arrayIndex) 146Array.Copy(_array, 0, array, arrayIndex, _size); 147Array.Reverse(array, arrayIndex, _size); 170Array.Resize(ref _array, _size); 187Array.Resize(ref _array, capacity); 321if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength; 327Array.Resize(ref _array, newcapacity); 334return Array.Empty<T>();
System.Collections.Concurrent (33)
System\Collections\Concurrent\BlockingCollection.cs (2)
1556void ICollection.CopyTo(Array array, int index) 1566Array.Copy(collectionSnapShot, 0, array, index, collectionSnapShot.Length);
System\Collections\Concurrent\ConcurrentBag.cs (13)
259/// one-dimensional <see cref="System.Array">Array</see>, starting at the specified array 262/// <param name="array">The one-dimensional <see cref="System.Array">Array</see> that is the 265/// cref="System.Array">Array</see> must have zero-based indexing.</param> 333/// cref="System.Array"/>, starting at a particular 334/// <see cref="System.Array"/> index. 336/// <param name="array">The one-dimensional <see cref="System.Array">Array</see> that is the 339/// cref="System.Array">Array</see> must have zero-based indexing.</param> 356void ICollection.CopyTo(Array array, int index) 403return Array.Empty<T>(); 795Array.Copy(_array, newArray, _array.Length); 799Array.Copy(_array, headIdx, newArray, 0, _array.Length - headIdx); 800Array.Copy(_array, 0, newArray, _array.Length - headIdx, headIdx); 852Array.Clear(_array);
System\Collections\Concurrent\ConcurrentDictionary.cs (5)
792return Array.Empty<KeyValuePair<TKey, TValue>>(); 1865void ICollection.CopyTo(Array array, int index) 1986(newLength = HashHelpers.GetPrime(newLength)) > Array.MaxLength) 1988newLength = Array.MaxLength; 2005Array.Copy(tables._locks, newLocks, tables._locks.Length);
System\Collections\Concurrent\ConcurrentStack.cs (11)
202/// cref="System.Array"/>, starting at a particular 203/// <see cref="System.Array"/> index. 205/// <param name="array">The one-dimensional <see cref="System.Array"/> that is the destination of 207/// <see cref="ConcurrentStack{T}"/>. The <see cref="System.Array"/> must 225void ICollection.CopyTo(Array array, int index) 238/// cref="System.Array"/>, starting at the specified array index. 240/// <param name="array">The one-dimensional <see cref="System.Array"/> that is the destination of 242/// <see cref="ConcurrentStack{T}"/>. The <see cref="System.Array"/> must have zero-based 483/// The <see cref="System.Array"/> to which objects popped from the top of the <see 510/// The <see cref="System.Array"/> to which objects popped from the top of the <see 683Array.Empty<T>() :
System\Collections\Concurrent\PartitionerStatic.cs (2)
103/// Creates an orderable partitioner from a <see cref="System.Array"/> instance. 652Array.Copy(fillBufferLocalRef, beginPos, destArray, 0, actualNumElementsGrabbed);
System.Collections.Immutable (160)
System\Collections\Frozen\EmptyFrozenDictionary.cs (4)
17private protected override TKey[] KeysCore => Array.Empty<TKey>(); 20private protected override TValue[] ValuesCore => Array.Empty<TValue>(); 23private protected override Enumerator GetEnumeratorCore() => new Enumerator(Array.Empty<TKey>(), Array.Empty<TValue>());
System\Collections\Frozen\EmptyFrozenSet.cs (2)
15private protected override T[] ItemsCore => Array.Empty<T>(); 24private protected override Enumerator GetEnumeratorCore() => new Enumerator(Array.Empty<T>());
System\Collections\Frozen\FrozenDictionary.cs (5)
335Keys is { Length: > 0 } keys ? keys : Array.Empty<TKey>(); 356Values is { Length: > 0 } values ? values : Array.Empty<TValue>(); 400void ICollection.CopyTo(Array array, int index) 635Count == 0 ? ((IList<KeyValuePair<TKey, TValue>>)Array.Empty<KeyValuePair<TKey, TValue>>()).GetEnumerator() : 640Count == 0 ? Array.Empty<KeyValuePair<TKey, TValue>>().GetEnumerator() :
System\Collections\Frozen\FrozenHashTable.cs (1)
226Array.Clear(seenBuckets, 0, Math.Min(numBuckets, seenBuckets.Length));
System\Collections\Frozen\FrozenSet.cs (4)
284void ICollection.CopyTo(Array array, int index) 292Array.Copy(items, 0, array!, index, items.Length); 392Count == 0 ? ((IList<T>)Array.Empty<T>()).GetEnumerator() : 397Count == 0 ? Array.Empty<T>().GetEnumerator() :
System\Collections\Frozen\Integer\DenseIntegralFrozenDictionary.cs (1)
71long maxAllowedLength = Math.Min((long)count * LengthToCountFactor, Array.MaxLength);
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (1)
36Array.Sort(_keys, _values);
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (1)
34Array.Sort(_items);
System\Collections\Frozen\String\LengthBuckets.cs (2)
32if (arraySize > Array.MaxLength) 93Array.Copy(buckets, copy, arraySize);
System\Collections\Immutable\IImmutableArray.cs (1)
23Array? Array { get; }
System\Collections\Immutable\ImmutableArray.cs (7)
153Array? array = immutableArray.Array; 201Array.Copy(items, tmp, items.Length); 263Array.Copy(items.array!, start, array, 0, length); 475return Array.BinarySearch<T>(array.array!, value); 505return Array.BinarySearch<T>(array.array!, value, comparer); 539return Array.BinarySearch<T>(array.array!, index, length, value); 579return Array.BinarySearch<T>(array.array!, index, length, value, comparer);
System\Collections\Immutable\ImmutableArray_1.Builder.cs (25)
70Array.Copy(_elements, temp, _count); 109Array.Clear(_elements, value, _count - value); 260Array.Copy(_elements, index, _elements, index + 1, this.Count - index); 282Array.Copy(_elements, index, _elements, index + count, _count - index); 314Array.Copy(_elements, index, _elements, index + items.Length, _count - index); 317Array.Copy(items.array!, 0, _elements, index, items.Length); 371Array.Copy(items, 0, _elements, offset, items.Length); 386Array.Copy(items, 0, _elements, offset, items.Length); 402Array.Copy(items, 0, _elements, offset, length); 569Array.Copy(_elements, index + 1, _elements, index, this.Count - index - 1); 596Array.Clear(_elements, index, length); // Clear the elements so that the gc can reclaim the references. 599Array.Copy(_elements, index + length, _elements, index, this.Count - index - length); 691Array.Copy(_elements, result, this.Count); 704Array.Copy(_elements, 0, array, index, this.Count); 714Array.Copy(_elements, 0, destination, 0, this.Count); 730Array.Copy(_elements, sourceIndex, destination, destinationIndex, length); 742Array.Resize(ref _elements, newCapacity); 805return Array.IndexOf(_elements, item, startIndex, count); 902return Array.LastIndexOf(_elements, item, startIndex, count); 924Array.Reverse<T>(_elements, 0, _count); 949Array.Sort(_elements, 0, this.Count, Comparer<T>.Default); 989Array.Sort(_elements, 0, _count, comparer); 1008Array.Sort(_elements, index, count, comparer); 1088Array.Copy(_elements, copied + removed, _elements, copied, copyLength); 1094Array.Copy(_elements, copied + removed, _elements, copied, _elements.Length - (copied + removed));
System\Collections\Immutable\ImmutableArray_1.cs (29)
182return Array.IndexOf(self.array!, item, startIndex, count); 267return Array.LastIndexOf(self.array!, item, startIndex, count); 329Array.Copy(self.array!, tmp, index); 333Array.Copy(self.array!, index, tmp, index + 1, self.Length - index); 367Array.Copy(self.array!, tmp, index); 371Array.Copy(self.array!, index, tmp, index + count, self.Length - index); 467Array.Copy(self.array!, tmp, self.Length); 468Array.Copy(items, 0, tmp, self.Length, length); 491Array.Copy(self.array!, tmp, self.Length); 492Array.Copy(items, 0, tmp, self.Length, items.Length); 561Array.Copy(self.array!, tmp, self.Length); 661Array.Copy(self.array!, tmp, index); 662Array.Copy(self.array!, index + length, tmp, index, self.Length - index - length); 851Array.Copy(self.array!, tmp, self.Length); 852Array.Sort(tmp, index, count, comparer); 1367/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 1369/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 1371void ICollection.CopyTo(Array array, int index) 1375Array.Copy(self.array!, 0, array, index, self.Length); 1387Array? otherArray = other as Array; 1437Array? otherArray = other as Array; 1497Array.Copy(self.array!, copied + removed, newArray, copied, copyLength); 1503Array.Copy(self.array!, copied + removed, newArray, copied, self.Length - (copied + removed)); 1517Array.Copy(array!, tmp, index); 1522Array.Copy(array!, index, tmp, index + items.Length, Length - index);
System\Collections\Immutable\ImmutableArray_1.Minimal.cs (4)
204Array? IImmutableArray.Array 230Array.Copy(self.array!, destination, self.Length); 242Array.Copy(self.array!, 0, destination, destinationIndex, self.Length); 256Array.Copy(self.array!, sourceIndex, destination, destinationIndex, length);
System\Collections\Immutable\ImmutableDictionary_2.Builder.cs (5)
325/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 327/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 329void ICollection.CopyTo(Array array, int arrayIndex)
System\Collections\Immutable\ImmutableDictionary_2.cs (5)
752/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 754/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 756void ICollection.CopyTo(Array array, int arrayIndex)
System\Collections\Immutable\ImmutableExtensions.cs (4)
65/// avoids a call into the runtime's implementation of <see cref="Array.Clear(Array, int, int)"/>, helping performance, 67/// <see cref="Stack{T}.Clear"/> and <see cref="Array.Clear(Array, int, int)"/> typically don't.
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (2)
120Array.Copy(sourceArray, 0, array, arrayIndex, sourceArray.Length); 126Array.Copy(immutable.array!, 0, array, arrayIndex, immutable.Length);
System\Collections\Immutable\ImmutableHashSet_1.cs (5)
533/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 535/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 537void ICollection.CopyTo(Array array, int arrayIndex)
System\Collections\Immutable\ImmutableList_1.Builder.cs (5)
1134/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 1136/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 1138void ICollection.CopyTo(Array array, int arrayIndex)
System\Collections\Immutable\ImmutableList_1.cs (7)
503/// The one-dimensional <see cref="Array"/> that is the destination of the elements 504/// copied from <see cref="ImmutableList{T}"/>. The <see cref="Array"/> must have 514/// The one-dimensional <see cref="Array"/> that is the destination of the elements 515/// copied from <see cref="ImmutableList{T}"/>. The <see cref="Array"/> must have 533/// The one-dimensional <see cref="Array"/> that is the destination of the elements 534/// copied from <see cref="ImmutableList{T}"/>. The <see cref="Array"/> must have 985void System.Collections.ICollection.CopyTo(Array array, int arrayIndex) => _root.CopyTo(array, arrayIndex);
System\Collections\Immutable\ImmutableList_1.Node.cs (13)
579Array.Sort(array, comparison); 618Array.Sort(array, index, count, comparer); 830/// The one-dimensional <see cref="Array"/> that is the destination of the elements 831/// copied from <see cref="ImmutableList{T}"/>. The <see cref="Array"/> must have 851/// The one-dimensional <see cref="Array"/> that is the destination of the elements 852/// copied from <see cref="ImmutableList{T}"/>. The <see cref="Array"/> must have 880/// The one-dimensional <see cref="Array"/> that is the destination of the elements 881/// copied from <see cref="ImmutableList{T}"/>. The <see cref="Array"/> must have 905/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 907/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 909internal void CopyTo(Array array, int arrayIndex)
System\Collections\Immutable\ImmutableSortedDictionary_2.Builder.cs (5)
400/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 402/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 404void ICollection.CopyTo(Array array, int index)
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (5)
649/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 651/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 653void ICollection.CopyTo(Array array, int index)
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (1)
214internal void CopyTo(Array array, int arrayIndex, int dictionarySize)
System\Collections\Immutable\ImmutableSortedSet_1.Builder.cs (5)
480/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 482/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 484void ICollection.CopyTo(Array array, int arrayIndex)
System\Collections\Immutable\ImmutableSortedSet_1.cs (5)
938/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 940/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 942void ICollection.CopyTo(Array array, int index)
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (1)
320internal void CopyTo(Array array, int arrayIndex)
System\Collections\Immutable\KeysOrValuesCollectionAccessor.cs (5)
127/// Copies the elements of the <see cref="ICollection"/> to an <see cref="Array"/>, starting at a particular <see cref="Array"/> index. 129/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ICollection"/>. The <see cref="Array"/> must have zero-based indexing.</param> 131void ICollection.CopyTo(Array array, int arrayIndex)
System.Collections.NonGeneric (54)
System\Collections\CollectionBase.cs (1)
110void ICollection.CopyTo(Array array, int index)
System\Collections\DictionaryBase.cs (1)
64public void CopyTo(Array array, int index)
System\Collections\Queue.cs (16)
88Array.Copy(_array, _head, q._array, 0, firstPart); 91Array.Copy(_array, 0, q._array, _array.Length - _head, numToCopy); 110Array.Clear(_array, _head, _size); 113Array.Clear(_array, _head, _array.Length - _head); 114Array.Clear(_array, 0, _tail); 128public virtual void CopyTo(Array array, int index) 144Array.Copy(_array, _head, array, index, firstPart); 147Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy); 252return Array.Empty<object>(); 257Array.Copy(_array, _head, arr, 0, _size); 261Array.Copy(_array, _head, arr, 0, _array.Length - _head); 262Array.Copy(_array, 0, arr, _array.Length - _head, _tail); 278Array.Copy(_array, _head, newarray, 0, _size); 282Array.Copy(_array, _head, newarray, 0, _array.Length - _head); 283Array.Copy(_array, 0, newarray, _array.Length - _head, _tail); 359public override void CopyTo(Array array, int arrayIndex)
System\Collections\ReadOnlyCollectionBase.cs (1)
36void ICollection.CopyTo(Array array, int index)
System\Collections\SortedList.cs (29)
82keys = Array.Empty<object>(); 83values = Array.Empty<object>(); 162Array.Sort(keys, comparer); 177int i = Array.BinarySearch(keys, 0, _size, key, comparer); 210Array.Copy(keys, newKeys, _size); 211Array.Copy(values, newValues, _size); 220keys = Array.Empty<object>(); 221values = Array.Empty<object>(); 286Array.Clear(keys, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references. 287Array.Clear(values, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references. 297Array.Copy(keys, sl.keys, _size); 298Array.Copy(values, sl.values, _size); 334public virtual void CopyTo(Array array, int arrayIndex) 374if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength; 457int i = Array.BinarySearch(keys, 0, _size, key, comparer); 479int ret = Array.BinarySearch(keys, 0, _size, key, comparer); 491return Array.IndexOf(values, value, 0, _size); 500Array.Copy(keys, index, keys, index + 1, _size - index); 501Array.Copy(values, index, values, index + 1, _size - index); 518Array.Copy(keys, index + 1, keys, index, _size - index); 519Array.Copy(values, index + 1, values, index, _size - index); 680public override void CopyTo(Array array, int index) 938public void CopyTo(Array array, int arrayIndex) 944Array.Copy(sortedList.keys, 0, array!, arrayIndex, sortedList.Count); 973int i = Array.BinarySearch(sortedList.keys, 0, 1041public void CopyTo(Array array, int arrayIndex) 1047Array.Copy(sortedList.values, 0, array!, arrayIndex, sortedList.Count); 1074return Array.IndexOf(sortedList.values, value, 0, sortedList.Count);
System\Collections\Stack.cs (6)
80Array.Clear(_array, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references. 89Array.Copy(_array, s._array, _size); 114public virtual void CopyTo(Array array, int index) 180Array.Copy(_array, newArray, _size); 201return Array.Empty<object>(); 272public override void CopyTo(Array array, int arrayIndex)
System.Collections.Specialized (13)
System\Collections\Specialized\HybridDictionary.cs (1)
287public void CopyTo(Array array, int index)
System\Collections\Specialized\ListDictionary.cs (2)
204public void CopyTo(Array array, int index) 362void ICollection.CopyTo(Array array, int index)
System\Collections\Specialized\NameObjectCollectionBase.cs (3)
371void ICollection.CopyTo(Array array, int index) 443object?[] allValues = (object?[])Array.CreateInstance(type, n); 595void ICollection.CopyTo(Array array, int index)
System\Collections\Specialized\NameValueCollection.cs (1)
196public void CopyTo(Array dest, int index)
System\Collections\Specialized\OrderedDictionary.cs (2)
274public void CopyTo(Array array, int index) 556void ICollection.CopyTo(Array array, int index)
System\Collections\Specialized\StringCollection.cs (2)
99/// <para>Copies the <see cref='System.Collections.Specialized.StringCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the 224void ICollection.CopyTo(Array array, int index)
System\Collections\Specialized\StringDictionary.cs (2)
152/// <para>Copies the string dictionary values to a one-dimensional <see cref='System.Array'/> instance at the 155public virtual void CopyTo(Array array, int index)
System.ComponentModel.Annotations (8)
System\ComponentModel\DataAnnotations\AssociatedMetadataTypeTypeDescriptor.cs (1)
191attributes = Array.Empty<Attribute>();
System\ComponentModel\DataAnnotations\AssociationAttribute.cs (1)
75return Array.Empty<string>();
System\ComponentModel\DataAnnotations\FilterUIHintAttribute.cs (2)
43: this(filterUIHint, null, Array.Empty<object>()) 55: this(filterUIHint, presentationLayer, Array.Empty<object>())
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (3)
25: this(uiHint, null, Array.Empty<object>()) 35: this(uiHint, presentationLayer, Array.Empty<object>()) 84Array.Copy(controlParameters, _inputControlParameters, controlParameters.Length);
System\ComponentModel\DataAnnotations\ValidationResult.cs (1)
60MemberNames = memberNames ?? Array.Empty<string>();
System.ComponentModel.Composition (33)
Microsoft\Internal\Collections\CollectionServices.cs (1)
63return Array.AsReadOnly(source.AsArray());
System\ComponentModel\Composition\CompositionException.cs (2)
95_errors = Array.AsReadOnly(errors == null ? Array.Empty<CompositionError>() : errors.ToArray<CompositionError>());
System\ComponentModel\Composition\ExportServices.cs (1)
44Array.Empty<ParameterModifier>()) != null;
System\ComponentModel\Composition\Hosting\AggregateCatalog.cs (1)
37/// An <see cref="Array"/> of <see cref="ComposablePartCatalog"/> objects to add to the
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (2)
61copiedProviders = Array.Empty<ExportProvider>(); 65_readOnlyProviders = Array.AsReadOnly(_providers);
System\ComponentModel\Composition\Hosting\AtomicComposition.cs (1)
308Array.Copy(_values, newQueries, _valueCount);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (2)
840new ExportsChangeEventArgs(resurrectedExports, Array.Empty<ExportDefinition>(), localAtomicComposition)); 843new ExportsChangeEventArgs(resurrectedExports, Array.Empty<ExportDefinition>(), null)));
System\ComponentModel\Composition\Hosting\ComposablePartExportProvider.cs (2)
367Array.Empty<ExportDefinition>(); 371Array.Empty<ExportDefinition>();
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (7)
30private static readonly ReadOnlyCollection<ExportProvider> EmptyProviders = new ReadOnlyCollection<ExportProvider>(Array.Empty<ExportProvider>()); 45/// A <see cref="Array"/> of <see cref="ExportProvider"/> objects which provide 66/// A <see cref="Array"/> of <see cref="ExportProvider"/> objects which provide 85/// A <see cref="Array"/> of <see cref="ExportProvider"/> objects which provide 107/// A <see cref="Array"/> of <see cref="ExportProvider"/> objects which provide 129/// A <see cref="Array"/> of <see cref="ExportProvider"/> objects which provide 226_providers = (providers != null) ? Array.AsReadOnly((ExportProvider[])providers.Clone()) : EmptyProviders;
System\ComponentModel\Composition\Hosting\CompositionServices.cs (3)
424public Array ToArray() 437Array array = Array.CreateInstance(_arrayType, _innerList.Count);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (3)
635_loadedFiles = Array.AsReadOnly(afterFiles); 736return Array.ConvertAll<string, string>(files, (file) => file.ToUpperInvariant()); 759_loadedFiles = Array.AsReadOnly(GetFiles());
System\ComponentModel\Composition\Hosting\ExportProvider.cs (1)
227exports ??= Array.Empty<Export>();
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
39/// An <see cref="Array"/> of attributed <see cref="Type"/> objects to add to the
System\ComponentModel\Composition\MetadataViewGenerator.cs (2)
223Array.Reverse(optionalModifiers); 224Array.Reverse(requiredModifiers);
System\ComponentModel\Composition\ReflectionModel\ImportingItem.cs (3)
45private Array CastExportsToCollectionImportType(Export[] exports) 53Array array = Array.CreateInstance(elementType, exports.Length);
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (1)
500value = import.CastExportsToImportType(Array.Empty<Export>());
System.ComponentModel.TypeConverter (68)
System\ComponentModel\ArrayConverter.cs (5)
10/// Provides a type converter to convert <see cref='System.Array'/> 20if (destinationType == typeof(string) && value is Array) 39if (!(value is Array valueArray)) 75if (instance is Array array && array.GetLength(0) > _index) 85if (instance is Array array)
System\ComponentModel\AttributeCollection.cs (7)
46_attributes = attributes ?? Array.Empty<Attribute>(); 54protected AttributeCollection() : this(Array.Empty<Attribute>()) 65newAttributes ??= Array.Empty<Attribute>(); 99Array.Copy(newArray, attributes, actualCount); 272attr = (Attribute)ci.Invoke(Array.Empty<object>()); 342public void CopyTo(Array array, int index) => Array.Copy(Attributes, 0, array, index, Attributes.Length);
System\ComponentModel\Container.cs (2)
63Array.Copy(_sites, newSites, _siteCount); 203Array.Copy(_sites, i + 1, _sites, i, _siteCount - i);
System\ComponentModel\CultureInfoConverter.cs (3)
179int invariantIndex = Array.IndexOf(installedCultures, CultureInfo.InvariantCulture); 193Array.Copy(installedCultures, array, installedCultures.Length); 194Array.Sort(array, new CultureComparer(this));
System\ComponentModel\Design\DesignerCollection.cs (1)
63void ICollection.CopyTo(Array array, int index) => _designers.CopyTo(array, index);
System\ComponentModel\Design\DesignerOptionService.cs (1)
244public void CopyTo(Array array, int index)
System\ComponentModel\Design\PropertyTabAttribute.cs (2)
26TabScopes = Array.Empty<PropertyTabScope>(); 27_tabClassNames = Array.Empty<string>();
System\ComponentModel\Design\Serialization\InstanceDescriptor.cs (1)
33Arguments = Array.Empty<object>();
System\ComponentModel\EnumConverter.cs (2)
182Array objValues = Enum.GetValuesAsUnderlyingType(EnumType); 306Array? arr = objValues?.ToArray();
System\ComponentModel\EventDescriptorCollection.cs (11)
35_events = Array.Empty<EventDescriptor>(); 117void ICollection.CopyTo(Array array, int index) 120Array.Copy(_events, 0, array, index, Count); 131Array.Copy(_events, newEvents, Count); 161Array.Copy(_events, newEvents, Count); 199public int IndexOf(EventDescriptor? value) => Array.IndexOf(_events, value, 0, Count); 211Array.Copy(_events, index, _events, index + 1, Count - index); 241Array.Copy(_events, index + 1, _events, index, Count - index - 1); 364Array.Sort(_events, sorter); 415private readonly Array? _array; 419public ArraySubsetEnumerator(Array? array, int count)
System\ComponentModel\LicenseManager.cs (1)
123return CreateWithContext(type, creationContext, Array.Empty<object>());
System\ComponentModel\ListSortDescriptionCollection.cs (1)
68public void CopyTo(Array array, int index) => _sorts.CopyTo(array, index);
System\ComponentModel\PropertyDescriptor.cs (2)
342Array.Copy(_editorTypes, newTypes, _editorTypes.Length); 343Array.Copy(_editors, newEditors, _editors.Length);
System\ComponentModel\PropertyDescriptorCollection.cs (11)
40_properties = Array.Empty<PropertyDescriptor>(); 124public void CopyTo(Array array, int index) 127Array.Copy(_properties, 0, array, index, Count); 138Array.Copy(_properties, newProps, Count); 168Array.Copy(_properties, newProps, Count); 232public int IndexOf(PropertyDescriptor? value) => Array.IndexOf(_properties, value, 0, Count); 244Array.Copy(_properties, index, _properties, index + 1, Count - index); 274Array.Copy(_properties, index + 1, _properties, index, Count - index - 1); 382Array.Sort(_properties, sorter); 396Array.Copy(_properties, enumProps, Count); 527Array.Copy(_properties, newProps, Count);
System\ComponentModel\ReflectEventDescriptor.cs (1)
97: base(eventInfo.Name, Array.Empty<Attribute>())
System\ComponentModel\ReflectPropertyDescriptor.cs (3)
335_propInfo = _componentClass.GetProperty(Name, bindingFlags, binder: null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>()); 448_propInfo = _componentClass.GetProperty(Name, bindingFlags, binder: null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>()); 818memberInfo = currentReflectType.GetProperty(Name, bindingFlags, binder: null, PropertyType, Type.EmptyTypes, Array.Empty<ParameterModifier>());
System\ComponentModel\ReflectTypeDescriptionProvider.cs (6)
183[typeof(Array)] = new IntrinsicTypeConverterData((type) => new ArrayConverter()), 672return Array.Empty<IExtenderProvider>(); 1202Array.Copy(events, newEvents, eventCount); 1402Array.Copy(properties, newProperties, propertyCount); 1406Debug.Assert(Array.TrueForAll(properties, dbgProp => dbgProp is not null), $"Holes in property array for type {type}"); 1572converterData = IntrinsicTypeConverters[typeof(Array)];
System\ComponentModel\TypeConverter.cs (5)
349protected SimplePropertyDescriptor(Type componentType, string name, Type propertyType) : this(componentType, name, propertyType, Array.Empty<Attribute>()) 420private Array? _valueArray; 429values ??= Array.Empty<object>(); 431if (values is Array a) 485public void CopyTo(Array array, int index) => _values.CopyTo(array, index);
System\ComponentModel\TypeDescriptionProvider.cs (1)
151return Array.Empty<IExtenderProvider>();
System\ComponentModel\TypeDescriptor.cs (1)
2962Array.Copy(newArray, finalAttr, actualCount);
System\ComponentModel\TypeListConverter.cs (1)
99Array.Copy(_types, objTypes, _types.Length);
System.Composition.AttributedModel (1)
System\Composition\SharingBoundaryAttribute.cs (1)
38public ReadOnlyCollection<string> SharingBoundaryNames => Array.AsReadOnly(_sharingBoundaryNames);
System.Composition.Hosting (7)
System\Composition\Hosting\CompositionHost.cs (1)
21private static readonly string[] s_noBoundaries = Array.Empty<string>();
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
17private static readonly CompositionDependency[] s_noDependenciesValue = Array.Empty<CompositionDependency>();
System\Composition\Hosting\Core\UpdateResult.cs (1)
14private static readonly ExportDescriptorPromise[] s_noPromises = Array.Empty<ExportDescriptorPromise>();
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryExportDescriptorProvider.cs (2)
29var boundaries = Array.Empty<string>(); 36boundaries = (specifiedBoundaries ?? Array.Empty<string>()).ToArray();
System\Composition\Hosting\Providers\ExportFactory\ExportFactoryWithMetadataExportDescriptorProvider.cs (2)
32var boundaries = Array.Empty<string>(); 39boundaries = (specifiedBoundaries ?? Array.Empty<string>()).ToArray();
System.Composition.TypedParts (9)
System\Composition\TypedParts\ActivationFeatures\ActivationFeature.cs (1)
18protected static readonly CompositionDependency[] NoDependencies = Array.Empty<CompositionDependency>();
System\Composition\TypedParts\Discovery\TypeInspector.cs (7)
131var existingArray = existingValue as Array; 134var newArray = Array.CreateInstance(valueType, existingArray.Length + 1); 135Array.Copy(existingArray, newArray, existingArray.Length); 141var newArray = Array.CreateInstance(valueType, 2);
System\Composition\TypedParts\Util\DirectAttributeContext.cs (1)
18return Array.Empty<Attribute>();
System.Configuration.ConfigurationManager (14)
src\libraries\Common\src\System\IO\TempFileCollection.cs (1)
100void ICollection.CopyTo(Array array, int start) => _files.Keys.CopyTo(array, start);
System\Configuration\ConfigurationElementCollection.cs (1)
125void ICollection.CopyTo(Array arr, int index)
System\Configuration\ConfigurationLockCollection.cs (1)
110void ICollection.CopyTo(Array array, int index)
System\Configuration\ConfigurationPropertyCollection.cs (1)
34void ICollection.CopyTo(Array array, int index)
System\Configuration\DpapiProtectedConfigurationProvider.cs (1)
120return (s != null) ? Encoding.Unicode.GetBytes(s) : Array.Empty<byte>();
System\Configuration\Provider\ProviderCollection.cs (1)
31void ICollection.CopyTo(Array array, int index)
System\Configuration\SectionUpdates.cs (4)
182Array.Sort(sectionNames); 201Array.Sort(sectionNames); 222Array.Sort(groupNames); 243Array.Sort(groupNames);
System\Configuration\SettingsPropertyCollection.cs (1)
113public void CopyTo(Array array, int index)
System\Configuration\SettingsPropertyValueCollection.cs (1)
115public void CopyTo(Array array, int index)
System\Diagnostics\TraceUtils.cs (2)
57ConstructorInfo ctorInfo = objectType.GetConstructor(Array.Empty<Type>()); 60newObject = ctorInfo.Invoke(Array.Empty<object>());
System.Data.Common (129)
System\Data\BaseCollection.cs (1)
23public virtual void CopyTo(Array ar, int index) => List.CopyTo(ar, index);
System\Data\ColumnTypeConverter.cs (1)
141Array.Copy(s_types, objTypes, s_types.Length);
System\Data\Common\AdapterUtil.Common.cs (1)
55internal static void CheckArgumentLength(Array value, string parameterName)
System\Data\Common\BigIntegerStorage.cs (1)
144Array.Resize(ref _values, capacity);
System\Data\Common\BooleanStorage.cs (1)
164Array.Resize(ref _values, capacity);
System\Data\Common\ByteStorage.cs (1)
236Array.Resize(ref _values, capacity);
System\Data\Common\CharStorage.cs (1)
168Array.Resize(ref _values, capacity);
System\Data\Common\DataAdapter.cs (2)
363value = Array.Empty<DataTable>(); 723public virtual IDataParameter[] GetFillParameters() => Array.Empty<IDataParameter>();
System\Data\Common\DataColumnMappingCollection.cs (3)
144public void AddRange(System.Array values) 154private void AddEnumerableRange(Array values, bool doClone) 228public void CopyTo(Array array, int index)
System\Data\Common\DataRecordInternal.cs (2)
140Array.Copy(data, ndataIndex, buffer, bufferIndex, cbytes); 216Array.Copy(data, ndataIndex, buffer, bufferIndex, cchars);
System\Data\Common\DataTableMappingCollection.cs (3)
106public void AddRange(System.Array values) => AddEnumerableRange(values, false); 108private void AddEnumerableRange(Array values, bool doClone) 174public void CopyTo(Array array, int index) => ((ICollection)ArrayList()).CopyTo(array, index);
System\Data\Common\DateTimeOffsetStorage.cs (1)
171Array.Resize(ref _values, capacity);
System\Data\Common\DateTimeStorage.cs (1)
210Array.Resize(ref _values, capacity);
System\Data\Common\DbConnectionStringBuilder.cs (2)
308void ICollection.CopyTo(Array array, int index) 585Array.Copy(propertiesArray, filteredPropertiesArray, index);
System\Data\Common\DbDataAdapter.cs (3)
316return Array.Empty<DataTable>(); // design-time support 709value = Array.Empty<IDataParameter>(); 1305Array.Copy(rowBatch, finalRowBatch, commandCount);
System\Data\Common\DbParameterCollection.cs (2)
76public abstract void AddRange(System.Array values); 94public abstract void CopyTo(System.Array array, int index);
System\Data\Common\DecimalStorage.cs (1)
232Array.Resize(ref _values, capacity);
System\Data\Common\DoubleStorage.cs (1)
236Array.Resize(ref _values, capacity);
System\Data\Common\Int16Storage.cs (1)
250Array.Resize(ref _values, capacity);
System\Data\Common\Int32Storage.cs (1)
249Array.Resize(ref _values, capacity);
System\Data\Common\Int64Storage.cs (1)
241Array.Resize(ref _values, capacity);
System\Data\Common\ObjectStorage.cs (5)
152Array arr1 = (Array)valueNo1; 153Array arr2 = (Array)valueNo2; 310Array.Copy(_values, newValues, Math.Min(capacity, _values.Length));
System\Data\Common\SByteStorage.cs (1)
238Array.Resize(ref _values, capacity);
System\Data\Common\SingleStorage.cs (1)
237Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (1)
94Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (1)
128Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLBytesStorage.cs (1)
92Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLByteStorage.cs (1)
204Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLCharsStorage.cs (1)
94Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (1)
130Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (1)
202Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (1)
203Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLGuidStorage.cs (1)
95Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLInt16Storage.cs (1)
203Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLInt32Storage.cs (1)
203Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLInt64Storage.cs (1)
204Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (1)
203Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLSingleStorage.cs (1)
201Array.Resize(ref _values, capacity);
System\Data\Common\SQLTypes\SQLStringStorage.cs (1)
156Array.Resize(ref _values, capacity);
System\Data\Common\SqlUDTStorage.cs (1)
140Array.Resize(ref _values, capacity);
System\Data\Common\StringStorage.cs (1)
185Array.Copy(_values, newValues, Math.Min(capacity, _values.Length));
System\Data\Common\TimeSpanStorage.cs (1)
256Array.Resize(ref _values, capacity);
System\Data\Common\UInt16Storage.cs (1)
249Array.Resize(ref _values, capacity);
System\Data\Common\UInt32Storage.cs (1)
248Array.Resize(ref _values, capacity);
System\Data\Common\UInt64Storage.cs (1)
239Array.Resize(ref _values, capacity);
System\Data\ConstraintCollection.cs (2)
449BaseGroupSwitch(constraints, oldLength, Array.Empty<Constraint>(), 0); 454BaseGroupSwitch(Array.Empty<Constraint>(), 0, constraints, oldLength);
System\Data\DataColumnCollection.cs (3)
31private DataColumn[] _columnsImplementingIChangeTracking = Array.Empty<DataColumn>(); 605BaseGroupSwitch(columns, oldLength, Array.Empty<DataColumn>(), 0); 612BaseGroupSwitch(Array.Empty<DataColumn>(), 0, columns, oldLength);
System\Data\DataError.cs (2)
85Array.Copy(_errorList, i + 1, _errorList, i, _count - i - 1); 143Array.Copy(_errorList, biggerList, _count);
System\Data\DataRow.cs (1)
799Array.Empty<DataColumn>() : _error.GetColumnsInError();
System\Data\DataRowCollection.cs (1)
168public override void CopyTo(Array ar, int index) => _list.CopyTo(ar, index);
System\Data\DataRowComparer.cs (6)
33return (a.Equals(b) || (a.GetType().IsArray && CompareArray((Array)a, b as Array))); 52private static bool CompareArray(Array a, Array? b) 195Array array = (Array)value;
System\Data\DataSet.cs (2)
2405excludedNamespaces = Array.Empty<string>(); 3253Array.Empty<DataTable>() :
System\Data\DataTable.cs (11)
98internal IndexField[] _primaryIndex = Array.Empty<IndexField>(); 123private DataRelation[] _nestedParentRelations = Array.Empty<DataRelation>(); 1602Array.Empty<DataRelation>() : 1639return Array.Empty<DataColumn>(); 1731_primaryIndex = (key != null) ? key.Key.GetIndexDesc() : Array.Empty<IndexField>(); 3376Array.Copy(indexDesc, newIndexDesc, indexDesc.Length); 3538_emptyDataRowArray = (DataRow[])Array.CreateInstance(GetRowType(), 0); 3542return (DataRow[])Array.CreateInstance(GetRowType(), size); 3546return ((0 == size) ? Array.Empty<DataRow>() : new DataRow[size]); 3707IndexField[] indexDesc = Array.Empty<IndexField>(); 5014int[] primaryKeyIndex = Array.Empty<int>();
System\Data\DataTableCollection.cs (1)
476BaseGroupSwitch(tables, oldLength, Array.Empty<DataTable>(), 0);
System\Data\DataTableReader.cs (3)
380Array.Copy(tempBuffer, dataIndex, buffer, bufferIndex, byteCount); 443Array.Copy(tempBuffer, dataIndex, buffer, bufferIndex, charCount); 680Array.Copy(_currentDataRow!.ItemArray, values, _currentDataRow.ItemArray.Length > values.Length ? values.Length : _currentDataRow.ItemArray.Length);
System\Data\DataView.cs (5)
635public void CopyTo(Array array, int index) 771return Array.Empty<DataRowView>(); 1125ListSortDescription[] sortDescArray = Array.Empty<ListSortDescription>(); 1669ToTable(null, false, Array.Empty<string>()); 1672ToTable(tableName, false, Array.Empty<string>());
System\Data\DataViewManager.cs (1)
158void ICollection.CopyTo(Array array, int index)
System\Data\DataViewSettingCollection.cs (2)
111public void CopyTo(Array ar, int index) 174_tableEnumerator = Array.Empty<DataTable>().GetEnumerator();
System\Data\FillErrorEventArgs.cs (1)
16_values = values ?? Array.Empty<object?>();
System\Data\Filter\DataExpression.cs (1)
22private DataColumn[] _dependency = Array.Empty<DataColumn>();
System\Data\Filter\FunctionNode.cs (1)
79Array.Copy(_arguments, bigger, _argumentCount);
System\Data\PrimaryKeyTypeConverter.cs (1)
28Array.Empty<DataColumn>().GetType().Name :
System\Data\ProviderBase\SchemaMapping.cs (1)
526Array.Copy(rgcol, tmp, len);
System\Data\RbTree.cs (3)
166Array.Copy(_pageTable, newPageTable, _pageTable.Length); 168Array.Copy(_pageTableMap, newPageTableMap, _pageTableMap.Length); 1624public void CopyTo(Array array, int index)
System\Data\RecordManager.cs (1)
39Array.Copy(_rows, newRows, Math.Min(_lastFreeRecord, _rows.Length));
System\Data\Selection.cs (1)
497return Array.Empty<object>();
System\Data\SqlDbType.cs (4)
17/// <see cref="Array"/> of type <see cref="byte"/>. A fixed-length stream of binary data ranging between 1 and 8,000 bytes. 47/// <see cref="Array"/> of type <see cref="byte"/>. A variable-length stream of binary data ranging from 0 to 2 <sup>31</sup> -1 113/// <see cref="System.Array"/> of type <see cref="byte"/>. Automatically generated binary numbers, which are guaranteed to be unique within a database. <see langword="timestamp"/> is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes. 123/// <see cref="System.Array"/> of type <see cref="byte"/>. A variable-length stream of binary data ranging between 1 and 8,000 bytes.
System\Data\SQLTypes\SQLBinary.cs (2)
428_value = Array.Empty<byte>(); 436_value = Array.Empty<byte>();
System\Data\SQLTypes\SQLBytes.cs (3)
181Array.Copy(_rgbBuf!, buffer, (int)_lCurLen); 541value = Array.Empty<byte>(); 547value = Array.Empty<byte>();
System\Data\SQLTypes\SQLChars.cs (3)
181Array.Copy(_rgchBuf!, buffer, (int)_lCurLen); 321Array.Copy(_rgchBuf!, offset, buffer, offsetInBuffer, count); 385Array.Copy(buffer, offsetInBuffer, _rgchBuf, offset, count);
System\Data\XDRSchema.cs (1)
278int index = Array.BinarySearch(s_mapNameTypeXdr, name);
System\Data\xmlsaver.cs (3)
533return Array.Empty<DataTable>(); 764DataRelation[] rels = Array.Empty<DataRelation>(); 2755return Array.Empty<DataTable>();
System\Data\XMLSchema.cs (3)
1792int index = Array.BinarySearch(s_mapNameTypeXsd, xsdTypeName); 1858int index = Array.BinarySearch(s_mapNameTypeXsd, name); 1906int index = Array.BinarySearch(s_mapNameTypeXsd, name);
System\Xml\XmlDataDocument.cs (1)
3046retValue = Array.Empty<DataTable>();
System.Data.Odbc (15)
Common\System\Data\Common\DBConnectionString.cs (6)
352return ((null == _restrictionValues) || (0 > Array.BinarySearch(_restrictionValues, key, StringComparer.Ordinal))); 398if (0 > Array.BinarySearch(preventusage, allowonly[i], StringComparer.Ordinal)) 421if (0 <= Array.BinarySearch(b, a[i], StringComparer.Ordinal)) 454if (0 > Array.BinarySearch(a, b[i], StringComparer.Ordinal)) 460Array.Sort(restrictionValues, StringComparer.Ordinal); 496Array.Sort(restrictions, StringComparer.Ordinal);
src\libraries\Common\src\System\Data\ProviderBase\DbReferenceCollection.cs (1)
131Array.Resize<CollectionEntry>(ref _items, _items.Length * 2);
System\Data\Odbc\OdbcDataReader.cs (3)
1081private long GetBytesOrChars(int i, long dataIndex, Array? buffer, bool isCharsBuffer, int bufferIndex, int length) 1194Array.Copy((byte[])cachedObj, (int)dataIndex, (byte[])buffer, bufferIndex, lengthOfCopy); 1337private int readBytesOrCharsSequentialAccess(int i, Array? buffer, bool isCharsBuffer, int bufferIndex, long bytesOrCharsLength)
System\Data\Odbc\OdbcErrorCollection.cs (1)
49public void CopyTo(Array array, int i)
System\Data\Odbc\OdbcParameterCollection.cs (2)
98AddRange((Array)values); 152CopyTo((Array)array, index);
System\Data\Odbc\OdbcParameterCollectionHelper.cs (2)
79public override void AddRange(System.Array values) 127public override void CopyTo(Array array, int index)
System.Data.OleDb (3)
artifacts\obj\System.Data.OleDb\Debug\net10.0\System.Data.OleDb.notsupported.cs (3)
253public void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } 402public override void AddRange(System.Array values) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } 409public override void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); }
System.Diagnostics.DiagnosticSource (15)
System\Diagnostics\ActivityEvent.cs (1)
14private static readonly IEnumerable<KeyValuePair<string, object?>> s_emptyTags = Array.Empty<KeyValuePair<string, object?>>();
System\Diagnostics\ActivitySource.cs (6)
438Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items 449int index = Array.IndexOf(_volatileArray, item); 458Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items 471int index = Array.IndexOf(_volatileArray, item); 480Array.Copy(_volatileArray, newArray, index);// copy existing items before index 482Array.Copy(
System\Diagnostics\Metrics\AggregatorStore.cs (1)
335Array.Sort(instructions, (LabelInstruction a, LabelInstruction b) => string.CompareOrdinal(a.LabelName, b.LabelName));
System\Diagnostics\Metrics\CircularBufferBuckets.cs (2)
269return Array.Empty<long>(); 287Array.Clear(_trait);
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (2)
13Array.Sort(Quantiles); 127return new HistogramStatistics(Array.Empty<QuantileValue>(), count, sum);
System\Diagnostics\Metrics\Instrument.cs (1)
15internal static KeyValuePair<string, object?>[] EmptyTags => Array.Empty<KeyValuePair<string, object?>>();
System\Diagnostics\Metrics\TagList.netcore.cs (2)
128Array.Resize(ref _overflowTags, _tagsCount + OverflowAdditionalCapacity); 192Array.Resize(ref _overflowTags, _tagsCount + OverflowAdditionalCapacity);
System.Diagnostics.EventLog (1)
artifacts\obj\System.Diagnostics.EventLog\Debug\net10.0\System.Diagnostics.EventLog.notsupported.cs (1)
132void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_EventLog); }
System.Diagnostics.TraceSource (4)
System\Diagnostics\CorrelationManager.cs (2)
87public override void CopyTo(Array array, int index) 125return Array.Empty<object>();
System\Diagnostics\TraceListeners.cs (2)
136((ICollection)this).CopyTo((Array)listeners, index); 315void ICollection.CopyTo(Array array, int index)
System.DirectoryServices (3)
artifacts\obj\System.DirectoryServices\Debug\net10.0\System.DirectoryServices.notsupported.cs (3)
381void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 458void System.Collections.ICollection.CopyTo(System.Array? array, int index) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); } 488void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServices_PlatformNotSupported); }
System.DirectoryServices.AccountManagement (2)
artifacts\obj\System.DirectoryServices.AccountManagement\Debug\net10.0\System.DirectoryServices.AccountManagement.notsupported.cs (2)
254void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); } 377void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.DirectoryServicesAccountManagement_PlatformNotSupported); }
System.Drawing.Common (4)
Special\NotSupported.cs (4)
3059void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 3075void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 3091void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } 3107void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); }
System.Drawing.Common.Tests (49)
mono\System.Drawing\GraphicsTests.cs (6)
1158Assert.Throws<ArgumentException>(() => g.FillRectangles(Brushes.Red, Array.Empty<Rectangle>())); 1182Assert.Throws<ArgumentException>(() => g.FillRectangles(Brushes.Red, Array.Empty<RectangleF>())); 2436Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, Array.Empty<PointF>())); 2452Assert.Throws<ArgumentException>(() => g.DrawImage(bmp, Array.Empty<PointF>())); 2510Assert.Throws<ArgumentNullException>(() => g.DrawImage(null, Array.Empty<Point>())); 2526Assert.Throws<ArgumentException>(() => g.DrawImage(bmp, Array.Empty<Point>()));
System\Drawing\Drawing2D\GraphicsPathTests.cs (9)
323AssertExtensions.Throws<ArgumentException>("points", null, () => new GraphicsPath().AddLines(Array.Empty<Point>())); 324AssertExtensions.Throws<ArgumentException>("points", null, () => new GraphicsPath().AddLines(Array.Empty<PointF>())); 433yield return new object[] { Array.Empty<PointF>() }; 564yield return new object[] { Array.Empty<PointF>() }; 579yield return new object[] { Array.Empty<Point>() }; 672yield return new object[] { Array.Empty<Point>() }; 687yield return new object[] { Array.Empty<PointF>() }; 945yield return new object[] { Array.Empty<PointF>() }; 960yield return new object[] { Array.Empty<Point>() };
System\Drawing\Drawing2D\MatrixTests.cs (4)
739AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformPoints(Array.Empty<Point>())); 740AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformPoints(Array.Empty<PointF>())); 807AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformVectors(Array.Empty<Point>())); 808AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformVectors(Array.Empty<PointF>()));
System\Drawing\Drawing2D\PathGradientBrushTests.cs (1)
199yield return new object[] { new Point[2] { new(1, 1), new(2, 2) }, Array.Empty<Color>() };
System\Drawing\Graphics_DrawBezierTests.cs (2)
153AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, Array.Empty<Point>())); 154AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, Array.Empty<PointF>()));
System\Drawing\GraphicsTests.cs (4)
1883AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, Array.Empty<Point>())); 1884AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, Array.Empty<PointF>())); 2131AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, Array.Empty<Rectangle>())); 2132AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, Array.Empty<RectangleF>()));
System\Drawing\IconTests.cs (1)
153yield return new object[] { Array.Empty<byte>(), typeof(ArgumentException) };
System\Drawing\Imaging\ColorMatrixTests.cs (1)
72yield return new object[] { Array.Empty<float[]>(), typeof(IndexOutOfRangeException) };
System\Drawing\Imaging\EncoderParameterTests.cs (10)
275yield return new object[] { new Action(() => new EncoderParameter(null, Array.Empty<byte>())) }; 277yield return new object[] { new Action(() => new EncoderParameter(null, Array.Empty<short>())) }; 278yield return new object[] { new Action(() => new EncoderParameter(null, Array.Empty<long>())) }; 279yield return new object[] { new Action(() => new EncoderParameter(null, Array.Empty<int>(), [])) }; 280yield return new object[] { new Action(() => new EncoderParameter(null, Array.Empty<long>(), [])) }; 294Assert.Throws<NullReferenceException>(() => new EncoderParameter(null, Array.Empty<byte>())); 296Assert.Throws<NullReferenceException>(() => new EncoderParameter(null, Array.Empty<short>())); 297Assert.Throws<NullReferenceException>(() => new EncoderParameter(null, Array.Empty<long>())); 298Assert.Throws<NullReferenceException>(() => new EncoderParameter(null, Array.Empty<int>(), [])); 299Assert.Throws<NullReferenceException>(() => new EncoderParameter(null, Array.Empty<long>(), []));
System\Drawing\Imaging\PropertyItemTests.cs (2)
49yield return new object[] { Array.Empty<byte>() }; 67yield return new object[] { 0, 0, 0, Array.Empty<byte>() };
System\Drawing\RegionTests.cs (8)
324Array.Empty<RectangleF>() 331Array.Empty<RectangleF>() 628Array.Empty<RectangleF>() 1070Array.Empty<RectangleF>() 1077Array.Empty<RectangleF>() 1091Array.Empty<RectangleF>() 1110Array.Empty<RectangleF>() 1977Array.Empty<RectangleF>()
System\Drawing\StringFormatTests.cs (1)
200yield return new object[] { Array.Empty<CharacterRange>() };
System.Formats.Asn1 (6)
src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (1)
33Array.Clear(array, 0, clearSize);
System\Formats\Asn1\AsnCharacterStringEncodings.cs (1)
63bytes = Array.Empty<byte>();
System\Formats\Asn1\AsnDecoder.Oid.cs (1)
180Array.Clear(tmpBytes, 0, tmpBytes.Length);
System\Formats\Asn1\AsnWriter.cs (3)
94Array.Clear(_buffer, 0, _offset); 204return Array.Empty<byte>(); 421Array.Resize(ref _buffer, BlockSize * blocks);
System.Formats.Cbor (3)
System\Formats\Cbor\Writer\CborWriter.cs (3)
97DefaultCapacitySentinel or 0 => Array.Empty<byte>(), 108Array.Clear(_buffer, 0, _offset); 245Debug.Assert(MaxArrayLength == Array.MaxLength);
System.Formats.Nrbf (19)
System\Formats\Nrbf\ArrayInfo.cs (1)
20internal static int MaxArrayLength => Array.MaxLength; // dynamic lookup in case the value changes in a future runtime
System\Formats\Nrbf\ArrayRecord.cs (5)
18private protected Array? _arrayNullsAllowed; 19private protected Array? _arrayNullsNotAllowed; 72public Array GetArray(Type expectedArrayType, bool allowNulls = true) 87private protected abstract Array Deserialize(Type arrayType, bool allowNulls); 117internal static void Populate(List<SerializationRecord> source, Array destination, int[] lengths, AllowedRecordTypes allowedRecordTypes, bool allowNulls)
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (3)
43private protected override Array Deserialize(Type arrayType, bool allowNulls) 45Array result = 47Array.CreateInstanceFromArrayType(arrayType, _lengths);
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (1)
52return Array.Empty<T>(); // Empty arrays are allowed.
System\Formats\Nrbf\JaggedArrayRecord.cs (3)
46private protected override Array Deserialize(Type arrayType, bool allowNulls) 49Array array = _lengths.Length switch 53_ => Array.CreateInstance(typeof(ArrayRecord), _lengths)
System\Formats\Nrbf\NrbfDecoder.cs (1)
144/// Decodes the provided NRBF payload that is expected to contain an instance of any class (or struct) that is not an <see cref="Array"/> or a primitive type.
System\Formats\Nrbf\RectangularArrayRecord.cs (4)
45private protected override Array Deserialize(Type arrayType, bool allowNulls) 51Array result = 54? Array.CreateInstanceFromArrayType(arrayType, _lengths) 55: Array.CreateInstance(_elementType, _lengths);
System\Formats\Nrbf\SZArrayRecord.cs (1)
45private protected override Array Deserialize(Type arrayType, bool allowNulls) => GetArray(allowNulls);
System.Formats.Tar (3)
System\Formats\Tar\TarHeader.Read.cs (1)
622if ((uint)_size > (uint)Array.MaxLength)
System\Formats\Tar\TarHeader.Write.cs (1)
855Array.Clear(buffer, 0, paddingAfterData);
System\Formats\Tar\TarWriter.cs (1)
376Array.Clear(twoEmptyRecords, 0, TwoRecordSize);
System.IO.FileSystem.Watcher (4)
System\IO\FileSystemWatcher.cs (4)
706public string[] Items = Array.Empty<string>(); 734public void Clear() => Items = Array.Empty<string>(); 736public bool Contains(string item) => Array.IndexOf(Items, item) != -1; 742public int IndexOf(string item) => Array.IndexOf(Items, item);
System.IO.Packaging (4)
System\IO\Packaging\ContentType.cs (2)
480Array.IndexOf(s_allowedCharacters, character) >= 0; 500ch <= ' ' && Array.IndexOf(s_linearWhiteSpaceChars, ch) != -1;
System\IO\Packaging\Package.cs (1)
409Array.Sort(parts, Comparer<PackagePart>.Create((partA, partB) => uriComparer.Compare((PackUriHelper.ValidatedPartUri)partA.Uri, (PackUriHelper.ValidatedPartUri)partB.Uri)));
System\IO\Packaging\PartBasedPackageProperties.cs (1)
542if (Array.IndexOf(s_validProperties, xmlStringIndex) == -1) // An unexpected element is an error.
System.IO.Pipelines (1)
System\IO\Pipelines\BufferSegmentStack.cs (1)
63Array.Resize(ref _array, 2 * _array.Length);
System.Linq (14)
System\Linq\Chunk.cs (2)
100Array.Resize(ref array, arraySize); 120Array.Resize(ref array, i);
System\Linq\Enumerable.cs (1)
20Array.Empty<TResult>(); // explicitly not using [] in case the compiler ever changed to using Enumerable.Empty
System\Linq\Grouping.cs (5)
374Array.Resize(ref _elements, checked(_count * 2)); 385Array.Resize(ref _elements, _count); 407bool ICollection<TElement>.Contains(TElement item) => Array.IndexOf(_elements, item, 0, _count) >= 0; 410Array.Copy(_elements, 0, array, arrayIndex, _count); 414int IList<TElement>.IndexOf(TElement item) => Array.IndexOf(_elements, item, 0, _count);
System\Linq\Repeat.SpeedOpt.cs (1)
18Array.Fill(array, _current);
System\Linq\Reverse.SpeedOpt.cs (1)
15Array.Reverse(array);
System\Linq\SegmentedArrayBuilder.cs (4)
73Array.Clear(segment); 79Array.Clear(currentSegment, 0, _countInCurrentSegment); 344if (_countInFinishedSegments > Array.MaxLength) 354int newSegmentLength = (int)Math.Min(Math.Max(minimumRequired, currentSegmentLength * 2L), Array.MaxLength);
System.Linq.AsyncEnumerable (7)
System\Linq\Chunk.cs (2)
68Array.Resize(ref array, arraySize); 88Array.Resize(ref array, i);
System\Linq\GroupBy.cs (5)
409Array.Resize(ref _elements, checked(_count * 2)); 420Array.Resize(ref _elements, _count); 445bool ICollection<TElement>.Contains(TElement item) => Array.IndexOf(_elements, item, 0, _count) >= 0; 448Array.Copy(_elements, 0, array, arrayIndex, _count); 452int IList<TElement>.IndexOf(TElement item) => Array.IndexOf(_elements, item, 0, _count);
System.Linq.Expressions (72)
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (5)
101return Array.Empty<T>(); 112Array.Copy(_array, result, _count); 146if ((uint)nextCapacity > (uint)Array.MaxLength) 148nextCapacity = Math.Max(capacity + 1, Array.MaxLength); 156Array.Copy(_array!, next, _count);
System\Dynamic\DynamicMetaObject.cs (2)
19public static readonly DynamicMetaObject[] EmptyMetaObjects = Array.Empty<DynamicMetaObject>(); 247public virtual IEnumerable<string> GetDynamicMemberNames() => Array.Empty<string>();
System\Dynamic\DynamicObject.cs (1)
203public virtual IEnumerable<string> GetDynamicMemberNames() => Array.Empty<string>();
System\Dynamic\ExpandoClass.cs (2)
30_keys = Array.Empty<string>(); 77Array.Copy(_keys, keys, _keys.Length);
System\Dynamic\ExpandoObject.cs (2)
1072_dataArray = Array.Empty<object>(); 1106Array.Copy(_dataArray, arr, _dataArray.Length);
System\Dynamic\Utils\CollectionExtensions.cs (2)
40Array.Copy(array, 1, result, 0, result.Length); 47Array.Copy(array, result, result.Length);
System\Dynamic\Utils\DelegateHelpers.cs (3)
50handler(Array.Empty<object?>()); 65return (TReturn)handler(Array.Empty<object>()); 78private static MethodInfo GetEmptyObjectArrayMethod() => ((Func<object[]>)Array.Empty<object>).GetMethodInfo();
System\Dynamic\Utils\TypeUtils.cs (1)
430return IsImplicitReferenceConversion(typeof(Array), source);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (1)
457Array.Copy(_expressions, first, clone, 0, count);
System\Linq\Expressions\Interpreter\ArrayOperations.cs (10)
26Array array = Array.CreateInstance(_elementType, _elementCount); 56frame.Push(length < 0 ? new int[length] : Array.CreateInstance(_elementType, length)); 92Array array = Array.CreateInstance(_elementType, lengths); 111Array array = (Array)frame.Pop()!; 130Array array = (Array)frame.Pop()!; 149frame.Push(((Array)obj).Length);
System\Linq\Expressions\Interpreter\CallInstruction.cs (7)
129typeof(Array).GetMethod("GetValue", new[] { typeof(int) }) : 135typeof(Array).GetMethod("GetValue", new[] { typeof(int), typeof(int) }) : 141typeof(Array).GetMethod("GetValue", new[] { typeof(int), typeof(int), typeof(int) }) : 154public static void ArrayItemSetter1(Array array, int index0, object value) 159public static void ArrayItemSetter2(Array array, int index0, int index1, object value) 164public static void ArrayItemSetter3(Array array, int index0, int index1, int index2, object value) 370return Array.Empty<object>();
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (2)
264InterpretLambdaInvoke(targetLambda, Array.Empty<object>()); 442result = InterpretLambdaInvoke(targetLambda, Array.Empty<object>());
System\Linq\Expressions\Interpreter\InstructionList.cs (1)
119IEnumerator<KeyValuePair<int, object?>> cookieEnumerator = (debugCookies ?? Array.Empty<KeyValuePair<int, object?>>()).GetEnumerator();
System\Linq\Expressions\Interpreter\LightCompiler.cs (5)
234int i = Array.BinarySearch<DebugInfo>(debugInfos, d, s_debugComparer); 294private static readonly LocalDefinition[] s_emptyLocals = Array.Empty<LocalDefinition>(); 2502_instructions.EmitNullableCall(method, Array.Empty<ParameterInfo>()); 2828IEnumerable<ParameterExpression> parameters = Array.Empty<ParameterExpression>(); 3173((Array)frame.Data[_array.Index]!).SetValue(value, (int)index!);
System\Linq\Expressions\Interpreter\NewInstruction.cs (1)
63return Array.Empty<object>();
System\Linq\Expressions\MethodCallExpression.cs (2)
1146arguments ??= Array.Empty<Expression>(); 1175arguments ??= Array.Empty<Expression>();
System\Linq\Expressions\UnaryExpression.cs (1)
817if (!array.Type.IsArray || !typeof(Array).IsAssignableFrom(array.Type))
System\Runtime\CompilerServices\CallSite.cs (5)
253Array.Copy(rules, 0, temp, 1, rules.Length); 258Array.Copy(rules, 0, temp, 1, MaxRules - 1); 368ParameterExpression[] @params = Array.ConvertAll(invoke.GetParametersCached(), p => Expression.Parameter(p.ParameterType, p.Name)); 597Expression[] argsElements = Array.ConvertAll(arguments, p => Convert(p, typeof(object))); 671ParameterExpression[] @params = Array.ConvertAll(invoke.GetParametersCached(), p => Expression.Parameter(p.ParameterType, p.Name));
System\Runtime\CompilerServices\ReadOnlyCollectionBuilder.cs (16)
28_items = Array.Empty<T>(); 91Array.Copy(_items, newItems, _size); 97_items = Array.Empty<T>(); 117return Array.IndexOf(_items, item, 0, _size); 135Array.Copy(_items, index, _items, index + 1, _size - index); 154Array.Copy(_items, index + 1, _items, index, _size - index); 207Array.Clear(_items, 0, _size); 221/// Copies the elements of the <see cref="ReadOnlyCollectionBuilder{T}"/> to an <see cref="Array"/>, 222/// starting at particular <see cref="Array"/> index. 224/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="ReadOnlyCollectionBuilder{T}"/>.</param> 226public void CopyTo(T[] array, int arrayIndex) => Array.Copy(_items, 0, array, arrayIndex, _size); 351void ICollection.CopyTo(Array array, int index) 358Array.Copy(_items, 0, array, index, _size); 385Array.Reverse(_items, index, count); 396Array.Copy(_items, array, _size); 423_items = Array.Empty<T>();
System\Runtime\CompilerServices\RuleCache.cs (3)
18private T[] _rules = Array.Empty<T>(); 97Array.Copy(rules, newRules, InsertPosition); 101Array.Copy(rules, InsertPosition, newRules, InsertPosition + 1, newLength - InsertPosition - 1);
System.Linq.Parallel (6)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (1)
385Array.Copy(_producerChunk, leftOverChunk, _producerChunkIndex);
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (1)
805Array.Sort(orderKeys, values, _orderComparer);
System\Linq\Parallel\Utils\GrowingArray.cs (1)
72Array.Copy(otherArray, 0, _array, _count, otherCount);
System\Linq\Parallel\Utils\HashLookup.cs (1)
119Array.Copy(slots, newSlots, count);
System\Linq\Parallel\Utils\Sorting.cs (2)
476Array.Copy(myValues, mergedValues, leftCount); 554Array.Copy(myValues, 0, mergedValues, leftCount, myValues.Length);
System.Management (4)
artifacts\obj\System.Management\Debug\net10.0\System.Management.notsupported.cs (4)
338public void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 564public void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 634public void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); } 684public void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_SystemManagement); }
System.Memory (7)
src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (2)
34_buffer = Array.Empty<T>(); 237Array.Resize(ref _buffer, newSize);
System\Buffers\ArrayMemoryPool.cs (2)
10public sealed override int MaxBufferSize => Array.MaxLength; 16else if (((uint)minimumBufferSize) > Array.MaxLength)
System\Buffers\ReadOnlySequence.cs (1)
26public static readonly ReadOnlySequence<T> Empty = new ReadOnlySequence<T>(Array.Empty<T>());
System\ThrowHelper.cs (2)
79public static void ThrowArgumentValidationException(Array? array, int start) 82private static Exception CreateArgumentValidationException(Array? array, int start)
System.Net.HttpListener (8)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
135if (value is Array arr) 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]";
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
48arg3 ??= Array.Empty<byte>();
System\Net\HttpListenerPrefixCollection.cs (1)
38public void CopyTo(Array array, int offset)
System\Net\Managed\HttpListenerContext.Managed.cs (1)
50new GenericPrincipal(new HttpListenerBasicIdentity(username, password), Array.Empty<string>()) :
System\Net\Managed\WebSockets\HttpWebSocket.Managed.cs (1)
76secWebSocketProtocols ?? Array.Empty<string>(),
System\Net\ServiceNameStore.cs (2)
286return Array.Empty<string>(); 290return Array.Empty<string>();
System.Net.Mail (9)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
135if (value is Array arr) 137return $"{arr.GetType().GetElementType()}[{((Array)value).Length}]";
System\Net\Mail\SmtpFailedRecipientsException.cs (4)
19_innerExceptions = Array.Empty<SmtpFailedRecipientException>(); 24_innerExceptions = Array.Empty<SmtpFailedRecipientException>(); 30_innerExceptions = smtpException == null ? Array.Empty<SmtpFailedRecipientException>() : new SmtpFailedRecipientException[] { smtpException }; 45_innerExceptions = innerExceptions ?? Array.Empty<SmtpFailedRecipientException>();
System\Net\Mail\SmtpReplyReaderFactory.cs (1)
263return Array.Empty<LineInfo>();
System\Net\Mime\WriteStateInfoBase.cs (2)
21_header = Array.Empty<byte>(); 22_footer = Array.Empty<byte>();
System.Net.Ping (2)
System\Net\NetworkInformation\Ping.PingUtility.cs (1)
30if (buffer != DefaultSendBuffer && buffer != Array.Empty<byte>())
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
391return new PingReply(address ?? new IPAddress(0), null, status, rtt, Array.Empty<byte>());
System.Net.Primitives (1)
artifacts\obj\System.Net.Primitives\Debug\net10.0\System.Net.Primitives.notsupported.cs (1)
62public void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_NetPrimitives); }
System.Net.ServerSentEvents (4)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
25private static int ArrayMaxLength => Array.MaxLength; 44? Array.Empty<byte>() 84_bytes = Array.Empty<byte>();
System\Net\ServerSentEvents\SseParser_1.cs (1)
540Array.Copy(toReturn, buffer, toReturn.Length);
System.Net.WebClient (2)
System\Net\WebClient.cs (2)
520formHeaderBytes = Array.Empty<byte>(); 521boundaryBytes = Array.Empty<byte>();
System.Net.WebHeaderCollection (1)
System\Net\HeaderInfoTable.cs (1)
22if (isSetCookie && (!value.Contains('='))) return Array.Empty<string>();
System.Net.WebProxy (2)
System\Net\WebProxy.cs (1)
77return Array.Empty<string>();
System\Net\WebProxy.NonWasm.cs (1)
29return Array.IndexOf(localAddresses, hostAddress) != -1;
System.Numerics.Tensors (12)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan_1.cs (3)
154public ReadOnlyTensorSpan(Array? array) 181public ReadOnlyTensorSpan(Array? array, scoped ReadOnlySpan<int> start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 568Array.Clear(_indexes);
System\Numerics\Tensors\netcore\Tensor_1.cs (1)
422Array.Clear(_indexes);
System\Numerics\Tensors\netcore\TensorShape.cs (2)
697public static TensorShape Create(Array? array) 740public static TensorShape Create(Array? array, scoped ReadOnlySpan<int> start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides, out nint linearOffset)
System\Numerics\Tensors\netcore\TensorSpan_1.cs (5)
96/// <inheritdoc cref="ReadOnlyTensorSpan{T}.ReadOnlyTensorSpan(Array)"/> 98public TensorSpan(Array? array) 108/// <inheritdoc cref="ReadOnlyTensorSpan{T}.ReadOnlyTensorSpan(Array, ReadOnlySpan{int}, ReadOnlySpan{nint}, ReadOnlySpan{nint})" /> 110public TensorSpan(Array? array, scoped ReadOnlySpan<int> start, scoped ReadOnlySpan<nint> lengths, scoped ReadOnlySpan<nint> strides) 504Array.Clear(_indexes);
System\ThrowHelper.cs (1)
30public static void ThrowIfArrayTypeMismatch<T>(Array? array)
System.ObjectModel (3)
System\Collections\CollectionHelpers.cs (1)
10internal static void ValidateCopyToArguments(int sourceCount, Array array, int index)
System\Collections\Specialized\NotifyCollectionChangedEventArgs.cs (2)
308public void CopyTo(Array array, int index) => _list.CopyTo(array, index); 356public void CopyTo(Array array, int index)
System.Private.CoreLib (607)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
163Array.Copy(bytes, temp, bytes.Length);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
39Debug.Assert(Array.IndexOf<byte>(version, 0) != -1);
src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (5)
101return Array.Empty<T>(); 112Array.Copy(_array, result, _count); 146if ((uint)nextCapacity > (uint)Array.MaxLength) 148nextCapacity = Math.Max(capacity + 1, Array.MaxLength); 156Array.Copy(_array!, next, _count);
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (4)
19((IEnumerable<T>)Array.Empty<T>()).GetEnumerator(); 33Debug.Assert(Array.MaxLength == ArrayMaxLength); 79Array.Resize(ref arr, newLength); 92return Array.Empty<T>();
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
306result = Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
45_innerExceptions = Array.Empty<Exception>();
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
192public Assembly[] ReflectionOnlyGetAssemblies() => Array.Empty<Assembly>();
src\libraries\System.Private.CoreLib\src\System\Array.cs (80)
74public static unsafe Array CreateInstance(Type elementType, int length) 88public static unsafe Array CreateInstance(Type elementType, int length1, int length2) 104public static unsafe Array CreateInstance(Type elementType, int length1, int length2, int length3) 120public static unsafe Array CreateInstance(Type elementType, params int[] lengths) 145public static unsafe Array CreateInstance(Type elementType, int[] lengths, int[] lowerBounds) 174public static Array CreateInstance(Type elementType, params long[] lengths) 193/// Creates a one-dimensional <see cref="Array"/> of the specified array type and length, with zero-based indexing. 196/// <param name="length">The size of the <see cref="Array"/> to create.</param> 197/// <returns>A new one-dimensional <see cref="Array"/> of the specified <see cref="Type"/> with the specified length.</returns> 206public static unsafe Array CreateInstanceFromArrayType(Type arrayType, int length) 225/// Creates a multidimensional <see cref="Array"/> of the specified <see cref="Type"/> and dimension lengths, with zero-based indexing. 229/// <returns>A new multidimensional <see cref="Array"/> of the specified Type with the specified length for each dimension, using zero-based indexing.</returns> 243public static unsafe Array CreateInstanceFromArrayType(Type arrayType, params int[] lengths) 271/// Creates a multidimensional <see cref="Array"/> of the specified <see cref="Type"/> and dimension lengths, with the specified lower bounds. 275/// <param name="lowerBounds">A one-dimensional array that contains the lower bound (starting index) of each dimension of the <see cref="Array"/> to create.</param> 276/// <returns>A new multidimensional <see cref="Array"/> of the specified <see cref="Type"/> with the specified length and lower bound for each dimension.</returns> 295public static unsafe Array CreateInstanceFromArrayType(Type arrayType, int[] lengths, int[] lowerBounds) 330public static void Copy(Array sourceArray, Array destinationArray, long length) 339public static void Copy(Array sourceArray, long sourceIndex, Array destinationArray, long destinationIndex, long length) 360public static void ConstrainedCopy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 369public static unsafe void Copy(Array sourceArray, Array destinationArray, int length) 399public static unsafe void Copy(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 432private static unsafe void CopyImpl(Array? sourceArray, int sourceIndex, Array? destinationArray, int destinationIndex, int length, bool reliable) 484private static void CopySlow(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length, ArrayAssignType assignType) 529private static unsafe void CopyImplUnBoxEachElement(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 574private static unsafe void CopyImplBoxEachElement(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 599private static unsafe void CopyImplCastCheckEachElement(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 625private static unsafe void CopyImplPrimitiveWiden(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 659public static unsafe void Clear(Array array) 684public static unsafe void Clear(Array array, int index, int length) 1085Array? o = other as Array; 1119if (other is not Array o || o.Length != this.Length) 1168public static int BinarySearch(Array array, object? value) 1188public static int BinarySearch(Array array, int index, int length, object? value) 1207public static int BinarySearch(Array array, object? value, IComparer? comparer) 1229public static int BinarySearch(Array array, int index, int length, object? value, IComparer? comparer) 1338static int GenericBinarySearch<T>(Array array, int adjustedIndex, int length, object value) where T : struct, IComparable<T> 1432public void CopyTo(Array array, int index) 1440public void CopyTo(Array array, long index) 1723public static int IndexOf(Array array, object? value) 1736public static int IndexOf(Array array, object? value, int startIndex) 1750public static int IndexOf(Array array, object? value, int startIndex, int count) 1834static int GenericIndexOf<T>(Array array, object value, int adjustedIndex, int length) where T : struct, IEquatable<T> 1944public static int LastIndexOf(Array array, object? value) 1957public static int LastIndexOf(Array array, object? value, int startIndex) 1971public static int LastIndexOf(Array array, object? value, int startIndex, int count) 2061static int GenericLastIndexOf<T>(Array array, object value, int adjustedIndex, int length) where T : struct, IEquatable<T> 2197public static void Reverse(Array array) 2210public static void Reverse(Array array, int index, int length) 2304public static void Sort(Array array) 2317public static void Sort(Array keys, Array? items) 2328public static void Sort(Array array, int index, int length) 2339public static void Sort(Array keys, Array? items, int index, int length) 2350public static void Sort(Array array, IComparer? comparer) 2365public static void Sort(Array keys, Array? items, IComparer? comparer) 2378public static void Sort(Array array, int index, int length, IComparer? comparer) 2391public static void Sort(Array keys, Array? items, int index, int length, IComparer? comparer) 2473static void GenericSort<T>(Array keys, Array? items, int adjustedIndex, int length) where T : struct 2848private readonly Array keys; 2849private readonly Array? items; 2852internal SorterGenericArray(Array keys, Array? items, IComparer comparer) 3059private static Span<T> UnsafeArrayAsSpan<T>(Array array, int adjustedIndex, int length) =>
src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (3)
14private readonly Array _array; 17internal ArrayEnumerator(Array array) 46Array array = _array;
src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (5)
109System.Array.Copy(_array!, _offset, destination, destinationIndex, _count); 122System.Array.Copy(_array!, _offset, destination._array!, destination._offset, _count); 165System.Array.Copy(_array!, _offset, array, 0, _count); 201int index = System.Array.IndexOf(_array!, item, _offset, _count); 242int index = System.Array.IndexOf(_array!, item, _offset, _count);
src\libraries\System.Private.CoreLib\src\System\Attribute.cs (4)
107Array thisValueArray = (Array)thisValue; 108Array thatValueArray = (Array)thatValue;
src\libraries\System.Private.CoreLib\src\System\Buffer.cs (5)
17public static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count) 56public static int ByteLength(Array array) 77public static byte GetByte(Array array, int index) 88public static void SetByte(Array array, int index, byte value)
src\libraries\System.Private.CoreLib\src\System\Buffers\ConfigurableArrayPool.cs (2)
63return Array.Empty<T>(); 135Array.Clear(array);
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (17)
103return Array.Empty<T>(); 147Array.Clear(array); 160Array? prev = tla.Array; 214Array.Clear(tlsBuckets.Key); 305public Array? Array; 309public SharedArrayPoolThreadLocalArray(Array array) 339public bool TryPush(Array array) 359public Array? TryPop() 362Array? arr; 386private readonly Array?[] _arrays = new Array[SharedArrayPoolStatics.s_maxArraysPerPartition]; 393public bool TryPush(Array array) 397Array?[] arrays = _arrays; 417public Array? TryPop() 419Array? arr = null; 421Array?[] arrays = _arrays; 476Array? array = _arrays[--_count];
src\libraries\System.Private.CoreLib\src\System\Collections\ArrayList.cs (62)
30_items = Array.Empty<object>(); 42_items = Array.Empty<object>(); 58_items = Array.Empty<object>(); 90Array.Copy(_items, newItems, _size); 197return Array.BinarySearch((Array)_items, index, count, value, comparer); 216Array.Clear(_items, 0, _size); // Don't need to doc this but we clear the elements so that the gc can reclaim the references. 230Array.Copy(_items, la._items, _size); 239public virtual bool Contains(object? item) => Array.IndexOf(_items, item, 0, _size) >= 0; 244public virtual void CopyTo(Array array) => CopyTo(array, 0); 249public virtual void CopyTo(Array array, int arrayIndex) 255Array.Copy(_items, 0, array!, arrayIndex, _size); 262public virtual void CopyTo(int index, Array array, int arrayIndex, int count) 270Array.Copy(_items, index, array!, arrayIndex, count); 284if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength; 344return Array.IndexOf((Array)_items, value, 0, _size); 360return Array.IndexOf((Array)_items, value, startIndex, _size - startIndex); 377return Array.IndexOf((Array)_items, value, startIndex, count); 392Array.Copy(_items, index, _items, index + 1, _size - index); 417Array.Copy(_items, index, _items, index + count, _size - index); 480return Array.LastIndexOf((Array)_items, value, startIndex, count); 521Array.Copy(_items, index + 1, _items, index, _size - index); 542Array.Copy(_items, index + count, _items, index, _size - index); 582Array.Reverse(_items, index, count); 641Array.Sort(_items, index, count, comparer); 668return Array.Empty<object>(); 671Array.Copy(_items, array, _size); 681public virtual Array ToArray(Type type) 685Array array = Array.CreateInstance(type, _size); 686Array.Copy(_items, array, _size); 813public override void CopyTo(Array array, int index) 818public override void CopyTo(int index, Array array, int arrayIndex, int count) 1041Array.Sort(array, 0, count, comparer); 1052return Array.Empty<object?>(); 1060public override Array ToArray(Type type) 1064Array array = Array.CreateInstance(type, _list.Count); 1268public override void CopyTo(Array array) 1276public override void CopyTo(Array array, int index) 1284public override void CopyTo(int index, Array array, int arrayIndex, int count) 1453public override Array ToArray(Type type) 1539public void CopyTo(Array array, int index) 1628public void CopyTo(Array array, int index) 1727public override void CopyTo(Array array, int index) 1732public override void CopyTo(int index, Array array, int arrayIndex, int count) 1836public override Array ToArray(Type type) 1887public void CopyTo(Array array, int index) 1982public override void CopyTo(Array array, int index) 1987public override void CopyTo(int index, Array array, int arrayIndex, int count) 2088public override Array ToArray(Type type) 2277public override void CopyTo(Array array, int index) 2291public override void CopyTo(int index, Array array, int arrayIndex, int count) 2526return Array.Empty<object?>(); 2533public override Array ToArray(Type type) 2538Array array = Array.CreateInstance(type, _baseSize);
src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (6)
72Array.Fill(_array, (byte)0xFF); 142Array.Copy(bytes, _array, bytes.Length); 268Array.Copy(bits._array, _array, _array.Length); 631Array.Resize(ref _array, newByteLength); 646Array.Resize(ref _array, newByteLength); 659public unsafe void CopyTo(Array array, int index)
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (7)
111/// cref="Array"/>, starting at a particular <see cref="Array"/> index. 114/// The one-dimensional <see cref="Array">Array</see> that is the destination of the 133void ICollection.CopyTo(Array array, int index) 421/// cref="Array">Array</see>, starting at the specified array index. 423/// <param name="array">The one-dimensional <see cref="Array">Array</see> that is the 425/// <see cref="ConcurrentQueue{T}"/>. The <see cref="Array">Array</see> must have zero-based
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\IProducerConsumerCollection.cs (2)
23/// <see cref="Array"/>, starting at a specified index. 25/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (8)
143if (partitionSize <= Array.IntrosortSizeThreshold) 181Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 419if (partitionSize <= Array.IntrosortSizeThreshold) 460Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 687if (partitionSize <= Array.IntrosortSizeThreshold) 725Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 916if (partitionSize <= Array.IntrosortSizeThreshold) 954Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (1)
146Array.Copy(list._items, index, list._items, index + source.Length, list._size - index);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (6)
288Array.Clear(_buckets); 293Array.Clear(_entries, 0, count); 1258Array.Copy(_entries, entries, count); 1463void ICollection.CopyTo(Array array, int index) 1952void ICollection.CopyTo(Array array, int index) 2146void ICollection.CopyTo(Array array, int index)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (3)
205Array.Clear(_buckets); 209Array.Clear(_entries, 0, count); 1296Array.Copy(_entries, entries, count);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (27)
114Array.Copy(_items, newItems, _size); 309return Array.BinarySearch(_items, index, count, item, comparer); 329Array.Clear(_items, 0, size); // Clear the elements so that the gc can reclaim the references. 387void ICollection.CopyTo(Array array, int arrayIndex) 397Array.Copy(_items, 0, array!, arrayIndex, _size); 417Array.Copy(_items, index, array, arrayIndex, count); 423Array.Copy(_items, 0, array, arrayIndex, _size); 476Array.Copy(_items, newItems, length: indexToInsert); 481Array.Copy(_items, indexToInsert, newItems, indexToInsert + insertionCount, _size - indexToInsert); 496if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength; 691Array.Copy(_items, index, list._items, 0, count); 719=> Array.IndexOf(_items, item, 0, _size); 743return Array.IndexOf(_items, item, index, _size - index); 763return Array.IndexOf(_items, item, index, count); 783Array.Copy(_items, index, _items, index + 1, _size - index); 832Array.Copy(_items, index, _items, index + count, _size - index); 839Array.Copy(_items, 0, _items, index, index); 841Array.Copy(_items, index + count, _items, index * 2, _size - index); 935return Array.LastIndexOf(_items, item, index, count); 990Array.Clear(_items, freeIndex, _size - freeIndex); // Clear the elements so that the gc can reclaim the references. 1010Array.Copy(_items, index + 1, _items, index, _size - index); 1040Array.Copy(_items, index + count, _items, index, _size - index); 1046Array.Clear(_items, _size, count); 1077Array.Reverse(_items, index, count); 1117Array.Sort(_items, index, count, comparer); 1146Array.Copy(_items, array, _size);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (21)
34_array = Array.Empty<T>(); 76Array.Clear(_array, _head, _size); 80Array.Clear(_array, _head, _array.Length - _head); 81Array.Clear(_array, 0, _tail); 113Array.Copy(_array, _head, array, arrayIndex, firstPart); 117Array.Copy(_array, 0, array, arrayIndex + _array.Length - _head, numToCopy); 121void ICollection.CopyTo(Array array, int index) 152Array.Copy(_array, _head, array, index, firstPart); 157Array.Copy(_array, 0, array, index + _array.Length - _head, numToCopy); 273return Array.IndexOf(_array, item, _head, _size) >= 0; 278Array.IndexOf(_array, item, _head, _array.Length - _head) >= 0 || 279Array.IndexOf(_array, item, 0, _tail) >= 0; 290return Array.Empty<T>(); 297Array.Copy(_array, _head, arr, 0, _size); 301Array.Copy(_array, _head, arr, 0, _array.Length - _head); 302Array.Copy(_array, 0, arr, _array.Length - _head, _tail); 318Array.Copy(_array, _head, newarray, 0, _size); 322Array.Copy(_array, _head, newarray, 0, _array.Length - _head); 323Array.Copy(_array, 0, newarray, _array.Length - _head, _tail); 406if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (7)
534private void CopyKeys(Array array, int arrayIndex) 553private void CopyEntries(Array array, int arrayIndex) 572public virtual void CopyTo(Array array, int arrayIndex) 605private void CopyValues(Array array, int arrayIndex) 1189public void CopyTo(Array array, int arrayIndex) 1224public void CopyTo(Array array, int arrayIndex) 1322public override void CopyTo(Array array, int arrayIndex)
src\libraries\System.Private.CoreLib\src\System\Collections\ICollection.cs (1)
14void CopyTo(Array array, int index);
src\libraries\System.Private.CoreLib\src\System\Collections\ListDictionaryInternal.cs (2)
148public void CopyTo(Array array, int index) 303void ICollection.CopyTo(Array array, int index)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\Collection.cs (1)
170void ICollection.CopyTo(Array array, int index)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\CollectionHelpers.cs (2)
10internal static void ValidateCopyToArguments(int sourceCount, Array array, int index) 44internal static void CopyTo<T>(ICollection<T> collection, Array array, int index)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyCollection.cs (2)
31public static ReadOnlyCollection<T> Empty { get; } = new ReadOnlyCollection<T>(Array.Empty<T>()); 101void ICollection.CopyTo(Array array, int index)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlyDictionary.cs (3)
175void ICollection.CopyTo(Array array, int index) 291void ICollection.CopyTo(Array array, int index) 343void ICollection.CopyTo(Array array, int index)
src\libraries\System.Private.CoreLib\src\System\Collections\ObjectModel\ReadOnlySet.cs (2)
38_set.Count == 0 ? ((IEnumerable<T>)Array.Empty<T>()).GetEnumerator() : 69void ICollection.CopyTo(Array array, int index) => CollectionHelpers.CopyTo(_set, array, index);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
2803return Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (18)
317Array.Copy(args, objs, lastPos); 318objs[lastPos] = Array.CreateInstance(paramArrayTypes[0], 1); 319((Array)objs[lastPos]).SetValue(args[lastPos], 0); 338objs[i] = Array.CreateInstance(paramArrayTypes[0], 0); // create an empty array for the 355Array.Copy(args, objs, paramArrayPos); 356objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[0], args.Length - paramArrayPos); 357Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 407Array.Copy(args, objs, lastPos); 408objs[lastPos] = Array.CreateInstance(paramArrayTypes[currentMin], 1); 409((Array)objs[lastPos]).SetValue(args[lastPos], 0); 425objs[i] = Array.CreateInstance(paramArrayTypes[currentMin], 0); 440Array.Copy(args, objs, paramArrayPos); 441objs[paramArrayPos] = Array.CreateInstance(paramArrayTypes[currentMin], args.Length - paramArrayPos); 442Array.Copy(args, paramArrayPos, (Array)objs[paramArrayPos], 0, args.Length - paramArrayPos); 770Array.Copy(args, newArgs, paramArrayPos); 783Array.Copy(args, newArgs, binderState._originalSize);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\CodeAnalysis\StringSyntaxAttribute.cs (1)
20Arguments = Array.Empty<object?>();
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (2)
174return Array.Empty<StackFrame>(); 179Array.Copy(_stackFrames, _methodsToSkip, array, 0, _numOfFrames);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (1)
119Array.Copy(s_counterGroups, newCounterGroups, s_counterGroups.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (4)
93parameters = Array.Empty<EventParameterInfo>(); 124parameters = Array.Empty<EventParameterInfo>(); 172return GenerateMetadata(eventId, eventName, keywords, level, version, opcode, Array.Empty<EventParameterInfo>()); 202return GenerateMetadata(eventId, eventName, keywords, level, version, opcode, Array.Empty<EventParameterInfo>());
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (7)
469return Array.Empty<EventSource>(); 1772Array.Resize(ref bytes, 16); 1926decoded = Array.Empty<byte>(); 3473Array.Copy(args, 1, newargs, 0, args.Length - 1); 5448return Array.Empty<ulong>(); 5617return (str != "") ? Encoding.UTF8.GetBytes(str) : Array.Empty<byte>(); 5817Array.Sort(sortedStrings, StringComparer.Ordinal);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs (4)
31Array? array = (Array?)value.ReferenceValue; 47var array = (Array)value;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ConcurrentSet.cs (2)
102Array.Copy(oldItems, newItems, lo); 104Array.Copy(oldItems, lo, newItems, lo + 1, oldLength - lo);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (3)
181internal void AddBinary(Array value, int size) 186internal void AddArray(Array? value, int length, int itemSize) 306Array.Resize(ref this.buffer, newSize);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingDataCollector.cs (2)
94Array? array = (Array?)value.ReferenceValue;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (1)
52Array.Copy(m_innerTable, newTable, m_innerTable.Length);
src\libraries\System.Private.CoreLib\src\System\Enum.cs (7)
292Array values = GetValuesAsUnderlyingTypeNoCopy((RuntimeType)typeof(TEnum)); 294Array.Copy(values, result, values.Length); 307public static Array GetValues(Type enumType) 320public static Array GetValuesAsUnderlyingType<TEnum>() where TEnum : struct, Enum => 332public static Array GetValuesAsUnderlyingType(Type enumType) 339internal static Array GetValuesAsUnderlyingType(RuntimeType enumType) 369internal static Array GetValuesAsUnderlyingTypeNoCopy(RuntimeType enumType)
src\libraries\System.Private.CoreLib\src\System\Enum.EnumInfo.cs (1)
29Array.Sort(values, names);
src\libraries\System.Private.CoreLib\src\System\Environment.Unix.cs (1)
42return Array.Empty<string>();
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (1)
24keyData = Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (2)
1691Array.Copy(calendars, 1, calendars, 2, 23 - 1 - 1); 1698Array.Copy(calendars, temp, count);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (3)
525return Array.Empty<CultureInfo>(); 542return Array.Empty<CultureInfo>(); 560return Array.Empty<CultureInfo>();
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (1)
1410Array.Copy(patterns, 0, newPatterns, 1, patterns.Length);
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseLunisolarCalendar.cs (1)
198Array.Resize(ref newEras!, newIndex);
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (1)
15private static ushort[] NoCasingPage => Array.Empty<ushort>();
src\libraries\System.Private.CoreLib\src\System\Globalization\StringInfo.cs (1)
76int[] indexes = Indexes ?? Array.Empty<int>();
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (3)
400return Array.Empty<char>(); 441return Array.Empty<byte>(); 506int n = _stream.Read(Array.Empty<byte>(), 0, 0);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (6)
701if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 1180if (sfh.CanSeek && (fileLength = sfh.GetFileLength()) > Array.MaxLength) 1229if (newLength > Array.MaxLength) 1231newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1); 1471if (newLength > Array.MaxLength) 1473newLength = (uint)Math.Max(Array.MaxLength, buffer.Length + 1);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (9)
48_buffer = capacity != 0 ? new byte[capacity] : Array.Empty<byte>(); 148if ((uint)(_capacity * 2) > Array.MaxLength) 150newCapacity = Math.Max(value, Array.MaxLength); 285_buffer = Array.Empty<byte>(); 562Array.Clear(_buffer, _length, newLength - _length); 572return Array.Empty<byte>(); 602Array.Clear(_buffer, _length, i - _length); 653Array.Clear(_buffer, _length, i - _length); 735Array.Clear(_buffer, _length, _position - _length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
169_charBuffer = Array.Empty<char>();
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
546Array.Resize(ref decodedBytes, decodedBytesCount);
src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (1)
410return Array.Empty<T>();
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (1)
64Array.Copy(moduleTypes[i], 0, ret, current, length);
src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyNameHelpers.StrongName.cs (1)
17return Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs (1)
245_parameterTypes = Array.Empty<RuntimeType>();
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\EmptyCAHolder.cs (2)
10object[] ICustomAttributeProvider.GetCustomAttributes(Type attributeType, bool inherit) => Array.Empty<object>(); 12object[] ICustomAttributeProvider.GetCustomAttributes(bool inherit) => Array.Empty<object>();
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (3)
239Array.Copy(_iaLowerBound, iaTemp, _rank); 241Array.Copy(_iaUpperBound, iaTemp, _rank); 368public override Type BaseType => typeof(Array);
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (1)
342NullabilityInfo[] genericArgumentsState = Array.Empty<NullabilityInfo>();
src\libraries\System.Private.CoreLib\src\System\Reflection\ParameterInfo.cs (2)
44public virtual object[] GetCustomAttributes(bool inherit) => Array.Empty<object>(); 48return Array.Empty<object>();
src\libraries\System.Private.CoreLib\src\System\Reflection\ReflectionTypeLoadException.cs (2)
24LoaderExceptions = exceptions ?? Array.Empty<Exception>(); 33LoaderExceptions = (Exception?[]?)info.GetValue("Exceptions", typeof(Exception[])) ?? Array.Empty<Exception?>();
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeMethodBody.cs (2)
21public override IList<LocalVariableInfo> LocalVariables => Array.AsReadOnly(_localVariables); 25public override IList<ExceptionHandlingClause> ExceptionHandlingClauses => Array.AsReadOnly(_exceptionHandlingClauses);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureType.cs (1)
103public sealed override Array GetEnumValues() => throw new NotSupportedException(SR.NotSupported_SignatureType);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (2)
160Array.Sort(sortedDataPositions); 162int index = Array.BinarySearch(sortedDataPositions, dataPos);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (2)
43return Array.Empty<T>(); 54dest = Unsafe.As<T[]>(Array.CreateInstanceFromArrayType(array.GetType(), length));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ArrayWithOffset.cs (1)
23if (array is not Array arrayObj || (arrayObj.Rank != 1) || !Marshal.IsPinnable(arrayObj))
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (1)
155Array.Clear(list._items, count, list._size - count);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (2)
141Debug.Assert(target is Array); 142return (IntPtr)Unsafe.AsPointer(ref MemoryMarshal.GetArrayDataReference(Unsafe.As<Array>(target)));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (1)
164public static unsafe IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (1)
431if (Array.IndexOf(requiredType, VarType) == -1)
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (1)
386return Array.Empty<T>();
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyDependencyResolver.cs (1)
196return Array.Empty<string>();
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
422if (((ulong)length) > (ulong)Array.MaxLength)
src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (3)
123Array.Copy(_names, newMembers, _count); 124Array.Copy(_values, newData, _count); 125Array.Copy(_types, newTypes, _count);
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (13)
93return members ?? Array.Empty<MemberInfo>(); 128public override Array GetEnumValues() 134Array values = Enum.GetValuesAsUnderlyingTypeNoCopy(this); 135Array ret = Array.CreateInstance(this, values.Length); 136Array.Copy(values, ret, values.Length); 152public override Array GetEnumValuesAsUnderlyingType() 221return Array.IndexOf(Enum.GetNamesNoCopy(this), (string)value) >= 0; 393if (namedParams != null && Array.IndexOf(namedParams, null!) >= 0) 471if (selFld.FieldType.IsArray || ReferenceEquals(selFld.FieldType, typeof(Array))) 501Array a = (Array)selFld.GetValue(target)!; 666providedArgs ??= Array.Empty<object>();
src\libraries\System.Private.CoreLib\src\System\SearchValues\EmptySearchValues.cs (1)
10Array.Empty<T>();
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (2)
13private static object EmptyChildrenSentinel => Array.Empty<int>(); 159Array.Fill(table, -1);
src\libraries\System.Private.CoreLib\src\System\Security\PermissionSet.cs (2)
28public virtual void CopyTo(Array array, int index) { } 35protected virtual IEnumerator GetEnumeratorImpl() { return Array.Empty<object>().GetEnumerator(); }
src\libraries\System.Private.CoreLib\src\System\Span.cs (1)
440return Array.Empty<T>();
src\libraries\System.Private.CoreLib\src\System\String.cs (2)
467return Array.Empty<char>(); 490return Array.Empty<char>();
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (2)
1835return Array.Empty<string>(); 1966Array.Resize(ref splitStrings, arrIndex);
src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (1)
75byte[] byteTemp = Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Text\DecoderExceptionFallback.cs (1)
47bytesUnknown ??= Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (1)
295bytesUnknown ??= Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (1)
75char[] charTemp = Array.Empty<char>();
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (2)
323public virtual byte[] GetPreamble() => Array.Empty<byte>(); 651return Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Text\EncodingProvider.cs (3)
44public virtual IEnumerable<EncodingInfo> GetEncodings() => Array.Empty<EncodingInfo>(); 64if (Array.IndexOf(providers, provider) >= 0) 70Array.Copy(providers, newProviders, providers.Length);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (1)
438return Array.Empty<char>();
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
283Array.Copy(m_ChunkChars, newArray, m_ChunkLength); 424Array.Copy(chunk.m_ChunkChars, newArray, chunk.m_ChunkLength);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (4)
248char[] chars = Array.Empty<char>(); 249int charCount = _thisDecoder.GetCharCount(Array.Empty<byte>(), 0, 0, flush: true); 253charCount = _thisDecoder.GetChars(Array.Empty<byte>(), 0, 0, chars, 0, flush: true); 260byte[] bytes = Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (8)
699if ((uint)newLength > Array.MaxLength) 701newLength = length == Array.MaxLength ? 702Array.MaxLength + 1 : // force OOM 703Array.MaxLength; 746if ((uint)newLength > Array.MaxLength) 748newLength = length == Array.MaxLength ? 749Array.MaxLength + 1 : // force OOM 750Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (1)
1736return Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (1)
1128return Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (1)
869return Array.Empty<byte>();
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (3)
429if (i != 0) Array.Copy(_keyValues, newValues, i); 430if (i != _keyValues.Length - 1) Array.Copy(_keyValues, i + 1, newValues, i, _keyValues.Length - i - 1); 449Array.Copy(_keyValues, newValues, _keyValues.Length);
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (2)
514Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0); 523Array.Resize(ref newChangeNotifications, newNotificationIndex + 1);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (4)
331Array.Copy(_registeredWaits, removeAt + 1, _registeredWaits, removeAt, count - (removeAt + 1)); 337Array.Copy(_waitHandles, removeAt + 1, _waitHandles, removeAt, count - (removeAt + 1)); 445if (Array.IndexOf(_registeredWaits, handle) >= 0) 447if (Array.IndexOf(_pendingRemoves, handle) < 0)
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (4)
5361signaledTaskIndex = Array.IndexOf(tasks, firstCompleted.Result); 6266return new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default); 6300new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default) : 6377return new Task<TResult[]>(false, Array.Empty<TResult>(), TaskCreationOptions.None, default);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (3)
552if ((uint)minSize > Array.MaxLength) 562if (newSize > Array.MaxLength) 564newSize = (uint)Array.MaxLength;
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (8)
46Debug.Assert(Array.IndexOf(oldQueues, queue) < 0); 49Array.Copy(oldQueues, newQueues, oldQueues.Length); 69int pos = Array.IndexOf(oldQueues, queue); 79Array.Copy(oldQueues, 1, newQueues, 0, newQueues.Length); 83Array.Copy(oldQueues, newQueues, newQueues.Length); 87Array.Copy(oldQueues, newQueues, pos); 88Array.Copy(oldQueues, pos + 1, newQueues, pos, newQueues.Length - pos); 432s_assignableWorkItemQueueCount > 0 ? new int[s_assignableWorkItemQueueCount] : Array.Empty<int>();
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (2)
91Array.Resize(ref newDataArray, newLength); 135Array.Resize(ref data._pinnedData, objArray.Length);
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (2)
594internal static void ThrowArraySegmentCtorValidationFailedExceptions(Array? array, int offset, int count) 717private static Exception GetArraySegmentCtorValidationFailedException(Array? array, int offset, int count)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (1)
916Array.Sort(array, static (x, y) =>
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (2)
65_adjustmentRules = Array.Empty<AdjustmentRule>(); 148return Array.Empty<AdjustmentRule>();
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
179return Array.Empty<string>();
src\libraries\System.Private.CoreLib\src\System\Type.cs (3)
621public virtual Array GetEnumValues() 640public virtual Array GetEnumValuesAsUnderlyingType() => throw new NotSupportedException(SR.NotSupported_SubclassOverride); 732public static readonly Type[] EmptyTypes = Array.Empty<Type>();
src\libraries\System.Private.CoreLib\src\System\Type.Enum.cs (8)
43if (Array.IndexOf(names, value) >= 0) 57Array values = GetEnumRawConstantValues(); 78Array values = GetEnumRawConstantValues(); 100private Array GetEnumRawConstantValues() 102GetEnumData(out _, out Array values); 109private void GetEnumData(out string[] enumNames, out Array enumValues) 156private static int BinarySearch(Array array, object value) 164return Array.BinarySearch(ulArray, ulValue);
src\System\Array.CoreCLR.cs (10)
22private static unsafe Array InternalCreate(RuntimeType elementType, int rank, int* pLengths, int* pLowerBounds) 24Array? retArray = null; 30private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, int rank, int* pLengths, int* pLowerBounds) 32Array? retArray = null; 47Array? arr = null; 67private static unsafe ArrayAssignType CanAssignArrayType(Array sourceArray, Array destinationArray) 415Array.Copy(@this, 0, array, index, @this.Length); 463return Array.IndexOf(@this, value, 0, @this.Length) >= 0; 484return Array.IndexOf(@this, value, 0, @this.Length);
src\System\Attribute.CoreCLR.cs (2)
313Array.Copy(temp, ret, temp.Length); 437elementType.ContainsGenericParameters ? new Attribute[elementCount] : (Attribute[])Array.CreateInstance(elementType, elementCount);
src\System\Collections\EmptyReadOnlyDictionaryInternal.cs (3)
36public void CopyTo(Array array, int index) 75public ICollection Keys => Array.Empty<object>(); 77public ICollection Values => Array.Empty<object>();
src\System\Reflection\Emit\CustomAttributeBuilder.cs (11)
35this(con, constructorArgs, Array.Empty<PropertyInfo>(), Array.Empty<object>(), Array.Empty<FieldInfo>(), Array.Empty<object>()) 42this(con, constructorArgs, namedProperties, propertyValues, Array.Empty<FieldInfo>(), Array.Empty<object>()) 49this(con, constructorArgs, Array.Empty<PropertyInfo>(), Array.Empty<object>(), namedFields, fieldValues) 83Array.Copy(constructorArgs, m_constructorArgs, constructorArgs.Length); 430Array a = (Array)value;
src\System\Reflection\Emit\DynamicILGenerator.cs (6)
861m_exceptions = Array.Empty<byte>(); 862m_code = Array.Empty<byte>(); 863m_localSignature = Array.Empty<byte>(); 886m_code = (code != null) ? (byte[])code.Clone() : Array.Empty<byte>(); 903m_exceptions = (exceptions != null) ? (byte[])exceptions.Clone() : Array.Empty<byte>(); 919m_localSignature = (localSignature != null) ? (byte[])localSignature.Clone() : Array.Empty<byte>();
src\System\Reflection\Emit\RuntimeILGenerator.cs (8)
33Array.Copy(incoming, temp, incoming.Length); 200Array.Copy(m_ILStream, newBytes, m_length); 245Array.Copy(m_exceptions!, temp, m_exceptionCount); 262Array.Copy(m_ILStream, temp, m_ILStream.Length); 367Array.Copy(m_RelocFixupList!, narrowTokens, m_RelocFixupCount); 1581Array.Copy(m_iOffsets, temp, m_iCount); 1585Array.Copy(m_ScopeActions, tempSA, m_iCount); 1589Array.Copy(m_localSymInfos, tempLSI, m_iCount);
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (8)
101Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length); 632Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length); 749Array.Copy(m_namespace, strTemp, m_iNameSpaceCount); 771Array.Copy(m_iLocalSlot, temp, m_iLocalSymCount); 775Array.Copy(m_iStartOffset, temp, m_iLocalSymCount); 779Array.Copy(m_iEndOffset, temp, m_iLocalSymCount); 783Array.Copy(m_strName, strTemp, m_iLocalSymCount); 787Array.Copy(m_ubSignature, ubTemp, m_iLocalSymCount);
src\System\Reflection\Emit\SignatureHelper.cs (1)
888Array.Copy(m_signature, temp, m_currSig);
src\System\Reflection\Emit\SymbolMethod.cs (1)
38Array.Copy(parameterTypes, m_parameterTypes, parameterTypes.Length);
src\System\Reflection\RuntimeCustomAttributeData.cs (24)
109return Array.AsReadOnly(pca); 188return Array.Empty<CustomAttributeData>(); 195return Array.AsReadOnly(customAttributes); 208return Array.Empty<CustomAttributeRecord>(); 272m_ctorParams = Array.Empty<CustomAttributeCtorParameter>(); 320m_typedCtorArgs = Array.AsReadOnly(new CustomAttributeTypedArgument[] 325m_namedArgs = Array.AsReadOnly(new CustomAttributeNamedArgument[] 340m_typedCtorArgs = Array.AsReadOnly(new CustomAttributeTypedArgument[] { 343m_namedArgs = Array.Empty<CustomAttributeNamedArgument>(); 349m_typedCtorArgs = Array.AsReadOnly(new CustomAttributeTypedArgument[] 380m_namedArgs = Array.AsReadOnly(namedArgs); 390m_typedCtorArgs = Array.AsReadOnly(typedArgs); 392m_namedArgs = Array.Empty<CustomAttributeNamedArgument>(); 409m_typedCtorArgs = Array.Empty<CustomAttributeTypedArgument>(); 410m_namedArgs = Array.Empty<CustomAttributeNamedArgument>(); 434m_typedCtorArgs = Array.AsReadOnly(typedCtorArgs); 438m_typedCtorArgs = Array.Empty<CustomAttributeTypedArgument>(); 482m_namedArgs = Array.AsReadOnly(namedArgs); 486m_namedArgs = Array.Empty<CustomAttributeNamedArgument>(); 507CustomAttributeEncoding.Array => typeof(Array), 603_value = Array.AsReadOnly(arrayValue); 1826return elementCount == 0 ? Array.Empty<Attribute>() : new Attribute[elementCount]; 1830return elementCount == 0 ? Array.Empty<object>() : new object[elementCount]; 1832return elementCount == 0 ? caType.GetEmptyArray() : (object[])Array.CreateInstance(caType, elementCount);
src\System\Reflection\RuntimeEventInfo.cs (1)
141return Array.Empty<MethodInfo>();
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (1)
255Array.Copy(parameters, ret, parameters.Length);
src\System\Reflection\RuntimeModule.cs (2)
457return Array.Empty<FieldInfo>(); 474return Array.Empty<MethodInfo>();
src\System\Reflection\RuntimeParameterInfo.cs (2)
41sigArgCount == 0 ? Array.Empty<ParameterInfo>() : 458return Array.Empty<object>();
src\System\Reflection\RuntimePropertyInfo.cs (1)
305Array.Empty<ParameterInfo>();
src\System\Runtime\CompilerServices\CastHelpers.cs (1)
500private static void ArrayTypeCheck(object obj, Array array)
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (4)
18public static unsafe void InitializeArray(Array array, RuntimeFieldHandle fldHandle) 410internal static unsafe ushort GetElementSize(this Array array) 418internal static ref int GetMultiDimensionalArrayBounds(this Array array) 426internal static unsafe int GetMultiDimensionalArrayRank(this Array array)
src\System\Runtime\InteropServices\MemoryMarshal.CoreCLR.cs (1)
38public static ref byte GetArrayDataReference(Array array)
src\System\RuntimeType.CoreCLR.cs (13)
84return Array.Empty<T>(); 88Array.Resize(ref _items, _count); 104Array.Copy(_items!, 0, array, index, _count); 127Array.Resize(ref _items, newCapacity); 452Array.Resize(ref m_allMembers, memberCount); 566Array.Resize(ref cachedMembers2, newSize); 747return Array.Empty<RuntimeConstructorInfo>(); 1076return Array.Empty<RuntimeType>(); 1608internal object[] GetEmptyArray() => _emptyArray ??= (object[])Array.CreateInstance(m_runtimeType, 0); 2783Array.Resize(ref im.InterfaceMethods, actualCount); 2784Array.Resize(ref im.TargetMethods, actualCount); 3869args ??= Array.Empty<object>(); 3914Array.Resize(ref cons, consCount);
src\System\RuntimeType.GenericCache.cs (1)
23internal Array.ArrayInitializeCache? _arrayInitializeCache;
src\System\StubHelpers.cs (2)
693Array arr = (Array)pManagedHome;
System.Private.CoreLib.Generators (15)
EventSourceGenerator.Parser.cs (1)
121Array.Resize(ref bytes, 16);
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (12)
233return Array.Empty<INamedTypeSymbol>(); 243return Array.Empty<INamedTypeSymbol>(); 259Array.Copy(decomposedLeft, retVal, decomposedLeft.Length); 260Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length); 265return Array.Empty<INamedTypeSymbol>(); 270return Array.Empty<INamedTypeSymbol>(); 278return Array.Empty<INamedTypeSymbol[]>(); 306return Array.Empty<INamedTypeSymbol[]>(); 345return Array.Empty<INamedTypeSymbol[]>(); 348Array.Copy(decomposedLeft, retVal, decomposedLeft.Length); 349Array.Copy(decomposedRight, 0, retVal, decomposedLeft.Length, decomposedRight.Length); 376return Array.Empty<INamedTypeSymbol[]>();
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (2)
181Array.Clear(toReturn, 0, _pos); 232Array.Clear(toReturn, 0, _pos);
System.Private.DataContractSerialization (86)
System\Runtime\Serialization\ClassDataContract.cs (6)
179obj = ci.Invoke(Array.Empty<object>()); 365Array.Copy(baseChildElementNamespaces!, childElementNamespaces, baseChildElementNamespaces!.Length); 627ContractNamespaces = MemberNames = MemberNamespaces = Array.Empty<XmlDictionaryString>(); 701Array.Copy(BaseClassContract.MemberNames, MemberNames, baseMemberCount); 703Array.Copy(BaseClassContract.MemberNamespaces!, MemberNamespaces, baseMemberCount); 706Array.Copy(BaseClassContract.ContractNamespaces, ContractNamespaces, baseContractCount);
System\Runtime\Serialization\CodeGenerator.cs (1)
52s_arraySetValue = typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) });
System\Runtime\Serialization\CollectionDataContract.cs (4)
767_incrementCollectionCountDelegate = (IncrementCollectionCountDelegate)buildIncrementCollectionCountDelegate.Invoke(null, Array.Empty<object>())!; 773_incrementCollectionCountDelegate = (IncrementCollectionCountDelegate)buildIncrementCollectionCountDelegate.Invoke(null, Array.Empty<object>())!; 822_createGenericDictionaryEnumeratorDelegate = (CreateGenericDictionaryEnumeratorDelegate)buildCreateGenericDictionaryEnumerator.Invoke(null, Array.Empty<object>())!; 1326Array.Sort(parentInterfaceTypes, (x, y) => string.Compare(x.FullName, y.FullName));
System\Runtime\Serialization\ContextAware.cs (1)
46Array.Resize<(DataContract?, WeakReference<DataContract>?)>(ref _contracts, newSize);
System\Runtime\Serialization\DataContract.cs (4)
665"Array" => typeof(Array), 754else if (type == typeof(Array)) 868dataContract = new CollectionDataContract(typeof(Array)); 2008object? types = method.Invoke(null, Array.Empty<object>());
System\Runtime\Serialization\DataContractSet.cs (1)
660SchemaImporter importer = new SchemaImporter(schemaSet, Array.Empty<XmlQualifiedName>() /* Needs to be empty, not null for 'elements' to be used. */, elements, this, importXmlDataType);
System\Runtime\Serialization\EnumDataContract.cs (2)
430Array.Sort(memberNames1); 431Array.Sort(memberNames2);
System\Runtime\Serialization\ExtensionDataObject.cs (1)
254internal sealed class CollectionDataNode : DataNode<Array>
System\Runtime\Serialization\ExtensionDataReader.cs (2)
779Array.Copy(_elements, newElements, _elements.Length); 856Array.Copy(attributes, newAttributes, attributes.Length);
System\Runtime\Serialization\Globals.cs (1)
30internal static Type TypeOfArray => field ??= typeof(Array);
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
207Array.Resize<JsonDataContract>(ref s_dataContractCache, newSize);
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (2)
75return Array.Empty<byte>(); 104buffer = Array.Empty<byte>();
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (3)
42context.IncrementArrayCount(jsonWriter, (Array)obj); 48Array array = (Array)obj;
System\Runtime\Serialization\Json\XmlJsonReader.cs (2)
816internal static void CheckArray(Array array, int offset, int count) 1014Array.Copy(_scopes, newScopes, _scopeDepth);
System\Runtime\Serialization\Json\XmlJsonWriter.cs (4)
1036if (value is Array) 1038WriteValue((Array)value); 1133Array.Copy(_scopes, newScopes, _depth); 1459private void WriteValue(Array array)
System\Runtime\Serialization\ObjectReferenceStack.cs (2)
31Array.Resize<object>(ref _objectArray, _objectArray.Length * 2); 65Array.Resize<bool>(ref _isReferenceArray, _objectArray.Length);
System\Runtime\Serialization\ReflectionClassWriter.cs (1)
76memberValue = getValue.Invoke(memberValue, Array.Empty<object>())!;
System\Runtime\Serialization\ReflectionReader.cs (3)
491object newGenericDict = ci.Invoke(Array.Empty<object>()); 509object newCollection = ci.Invoke(Array.Empty<object>()); 530int arraySize = ((Array)resultCollectionObject).Length;
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (3)
40context.IncrementArrayCount(xmlWriter, (Array)obj); 44Array array = (Array)obj;
System\Runtime\Serialization\ScopedKnownTypes.cs (1)
24Array.Resize<DataContractDictionary>(ref dataContractDictionaries, dataContractDictionaries.Length * 2);
System\Runtime\Serialization\XmlDataContract.cs (1)
378o = ctor.Invoke(Array.Empty<object>());
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (2)
629s_getArrayLengthMethod = typeof(Array).GetProperty("Length")!.GetMethod; 771return GetDefaultValueMethod.MakeGenericMethod(type).Invoke(null, Array.Empty<object>());
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
461Array.Copy(array, newArray, array.Length); 472Array.Copy(array, newArray, size);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (1)
415internal void IncrementArrayCount(XmlWriterDelegator xmlWriter, Array array)
System\Runtime\Serialization\XmlReaderDelegator.cs (2)
461return Array.Empty<byte>(); 480return Array.Empty<byte>();
System\Xml\ArrayHelper.cs (2)
56Array.Copy(arrays![i], 0, newArray, offset, arrays[i].Length); 59Array.Copy(array, 0, newArray, offset, totalRead - offset);
System\Xml\XmlBaseReader.cs (7)
275Array.Copy(_elementNodes, newElementNodes, _depth); 309Array.Copy(_attributeNodes, newAttributeNodes, attributeIndex); 1452Array.Copy(_trailChars!, 0, chars, charCount, _trailCharCount); 1484Array.Copy(chars, charCount, _trailChars, 0, _trailCharCount); 2642Array.Sort(_indices, 0, _attributeCount, this); 2866Array.Copy(_attributes, newAttributes, _attributeCount); 2904Array.Copy(_namespaces, newNamespaces, _nsCount);
System\Xml\XmlBaseWriter.cs (6)
673Array.Copy(_elements, newElementNodes, _depth); 1152else if (value is Array) 1154WriteValue((Array)value); 1794private void WriteValue(Array array) 2083Array.Copy(_attributes, newAttributes, _attributeCount); 2177Array.Copy(_namespaces, newNamespaces, _nsCount);
System\Xml\XmlBinaryReader.cs (1)
1225private static void CheckArray(Array array, int offset, int count)
System\Xml\XmlBinaryReaderSession.cs (2)
48Array.Copy(_strings, newStrings, _strings.Length); 121Array.Clear(_strings);
System\Xml\XmlBinaryWriter.cs (1)
1275private static void CheckArray(Array array, int offset, int count)
System\Xml\XmlBinaryWriterSession.cs (2)
117Array.Clear(_list); 248Array.Copy(_array, newArray, _array.Length);
System\Xml\XmlBufferReader.cs (2)
36private static readonly XmlBufferReader s_empty = new XmlBufferReader(Array.Empty<byte>()); 109_buffer = Array.Empty<byte>();
System\Xml\XmlCanonicalWriter.cs (5)
156Array.Copy(_scopes, newScopes, _depth); 666Array.Copy(_attributes, newAttributes, _attributeCount); 684Array.Copy(_xmlnsAttributes, newXmlnsAttributes, _xmlnsAttributeCount); 732Array.Copy(_xmlnsAttributes, xmlnsAttributeIndex, _xmlnsAttributes, xmlnsAttributeIndex + 1, _xmlnsAttributeCount - xmlnsAttributeIndex); 882Array.Sort(indices, this);
System\Xml\XmlDictionary.cs (1)
52Array.Resize(ref _strings, newSize);
System\Xml\XmlDictionaryReader.cs (3)
949buffer = Array.Empty<byte>(); 969buffer = Array.Empty<byte>(); 1005private static void CheckArray(Array array, int offset, int count)
System\Xml\XmlDictionaryWriter.cs (1)
436private static void CheckArray(Array array, int offset, int count)
System.Private.Uri (3)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (2)
181Array.Clear(toReturn, 0, _pos); 232Array.Clear(toReturn, 0, _pos);
System\Uri.cs (1)
949segments = Array.Empty<string>();
System.Private.Windows.Core (24)
System\Collections\Generic\ArrayBuilder.cs (1)
63Array.Resize(ref _items, newCapacity);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (3)
500public static bool TryWriteArray(Stream stream, Array array) 504static bool Write(Stream stream, Array array) 691case Array arrayValue:
System\Private\Windows\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (5)
12private readonly Array _arrayOfClassRecords; 13private readonly Array _arrayOfT; 42Object = _arrayOfT = Array.CreateInstance(_elementType, _lengths); 100internal static Array GetArraySinglePrimitive(SerializationRecord record) => record switch 121internal static Array? GetSimpleBinaryArray(ArrayRecord arrayRecord, ITypeResolver typeResolver)
System\Private\Windows\BinaryFormat\Deserializer\ArrayUpdater.cs (2)
20Array array = (Array)objects[ObjectId];
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
410/// Tries to get this object as an <see cref="Array"/> of primitive types.
Windows\Win32\System\Variant\VARIANT.cs (12)
247private static Array? ToArray(SAFEARRAY* psa, VARENUM vt) 262Array array = CreateArrayFromSafeArray(psa, arrayType); 439private static void TransposeArray(SAFEARRAY* psa, Array array, VARENUM arrayType) 451static void StackTransposeArray(SAFEARRAY* psa, Array array, VARENUM arrayType) 459static void HeapTransposeArray(SAFEARRAY* psa, Array array, VARENUM arrayType) 467static void InternalTransposeArray(SAFEARRAY* psa, Array array, VARENUM arrayType, Span<int> indices, Span<int> lower, Span<int> upper) 504private static void SetArrayValue(SAFEARRAY* psa, Array array, Span<int> indices, Span<int> lowerBounds, VARENUM arrayType) 506static void SetValue<T>(Array array, T value, Span<int> indices, Span<int> lowerBounds) 621private static Array CreateArrayFromSafeArray(SAFEARRAY* psa, VARENUM vt) 674return Array.CreateInstance(elementType, (int)psa->GetBounds().cElements); 689return Array.CreateInstance(elementType, lengths, bounds); 867private static Span<T> GetSpan<T>(Array array)
System.Private.Windows.Core.Tests (10)
System\Private\Windows\Ole\BinaryFormatUtilitiesTests.cs (9)
85public static TheoryData<Array> PrimitiveArrayObjects_TheoryData => 231public void TryReadObjectFromStream_Primitives_BaseResolver(Array value) 244BinaryFormatUtilities.TryReadObjectFromStream(stream, in request, out Array? result).Should().BeTrue(); 261Action action = () => BinaryFormatUtilities.TryReadObjectFromStream(stream, in request, out Array? _); 304BinaryFormatUtilities.TryReadObjectFromStream(stream, in request, out Array? result).Should().BeTrue(); 388Array value = Array.CreateInstance(typeof(uint), lengths: [2, 3], lowerBounds: [1, 2]); 673Array value = Array.CreateInstance(typeof(uint), lengths: [2, 3], lowerBounds: [1, 2]);
System\Private\Windows\Ole\ClipboardCoreTests.cs (1)
421yield return new object[] { new MemoryStream([]), Array.Empty<byte>() };
System.Private.Windows.Core.TestUtilities (2)
XUnit\CommonMemberDataAttribute.cs (1)
18: this(memberType, memberName, Array.Empty<object>()) { }
XUnit\SkipOnArchitectureAttribute.cs (1)
37return Array.Empty<KeyValuePair<string, string>>();
System.Private.Xml (210)
System\Xml\Base64Decoder.cs (1)
84internal override void SetNextOutputBuffer(Array buffer, int index, int count)
System\Xml\BinaryXml\XmlBinaryReader.cs (11)
1902System.Array.Copy(symtable, n, symNum); 1918System.Array.Copy(qnametable, n, qnameNum); 1962Array.Clear(_symbolTables.symtable, 1, _symbolTables.symtable.Length - 1); 1963Array.Clear(_symbolTables.qnametable); 2011System.Array.Copy(data, mark, newdata, 0, cbKeep); 2016System.Array.Copy(data, mark, data, 0, cbKeep); 2414System.Array.Copy(_elementStack, n, _elementStack.Length); 2423System.Array.Copy(_attributes, n, _attrCount); 2736Array.Clear(_attrHashTbl, 0, tblSize); 4140Array.Copy(_data, _tokDataPos, data, 0, _tokLen); 4320Array.Copy(_data, _tokDataPos, data, 0, _tokLen);
System\Xml\BinHexDecoder.cs (3)
88internal override void SetNextOutputBuffer(Array buffer, int index, int count) 110return Array.Empty<byte>(); 126Array.Resize(ref bytes, bytesDecoded);
System\Xml\BitStack.cs (1)
95Array.Copy(_bitStack, bitStackNew, len);
System\Xml\Core\IncrementalReadDecoders.cs (3)
15internal abstract void SetNextOutputBuffer(Array array, int offset, int len); 29internal override void SetNextOutputBuffer(Array array, int offset, int len) { } 109internal override void SetNextOutputBuffer(Array buffer, int index, int count)
System\Xml\Core\XmlEncodedRawTextWriter.cs (1)
1700Array.Copy(_textContentMarks, newTextContentMarks, _textContentMarks.Length);
System\Xml\Core\XmlEventCache.cs (1)
571Array.Copy(buffer, index, bufferNew, 0, count);
System\Xml\Core\XmlSubtreeReader.cs (2)
1308Array.Copy(_nsAttributes, newNsAttrs, index); 1580private static void CheckBuffer(Array buffer, int index, int count)
System\Xml\Core\XmlTextReaderImpl.cs (8)
4502Array.Copy(_nodes, _index + 1, nameSortedAttributes, 0, _attrCount); 4503Array.Sort<object>(nameSortedAttributes, DtdDefaultAttributeInfoToNodeDataComparer.Instance); 5007Array.Copy(_nodes, _index + 1, _attrDuplSortingArray, 0, _attrCount); 5008Array.Sort(_attrDuplSortingArray, 0, _attrCount); 7641Array.Copy(_nodes, newNodes, _nodes.Length); 8104Array.Copy(_parsingStatesStack, newParsingStateStack, _parsingStatesStack.Length); 8136private int IncrementalRead(Array array, int index, int count) 9203if (Array.BinarySearch<object>(nameSortedNodeData, defAttrInfo, DtdDefaultAttributeInfoToNodeDataComparer.Instance) >= 0)
System\Xml\Core\XmlTextWriter.cs (3)
147Array.Fill(result, DefaultIndentChar); 1525Array.Copy(_nsStack, newStack, nsIndex); 1786if (_top > 0) Array.Copy(_stack, na, _top + 1);
System\Xml\Core\XmlWellFormedWriter.cs (3)
475Array.Copy(_elemScopeStack, newStack, top); 1755Array.Copy(_nsStack, newStack, top); 2101Array.Copy(_attrStack, newStack, top);
System\Xml\Core\XmlWellFormedWriterAsync.cs (1)
282Array.Copy(_elemScopeStack, newStack, top);
System\Xml\Core\XmlWellFormedWriterHelpers.cs (1)
524Array.Copy(_items, newItems, newItemIndex);
System\Xml\Core\XsdCachingReader.cs (2)
663Array.Copy(_attributeEvents, newAttributeEvents, _attributeEvents.Length); 682Array.Copy(_contentEvents, newContentEvents, _contentEvents.Length);
System\Xml\Core\XsdValidatingReader.cs (1)
2316Array.Copy(_attributePSVINodes, newPSVINodes, _attributePSVINodes.Length);
System\Xml\Dom\DocumentSchemaValidator.cs (1)
544Array.Copy(_nodeSequenceToValidate, newNodeSequence, _nodeSequenceToValidate.Length);
System\Xml\Dom\XmlAttributeCollection.cs (1)
269void ICollection.CopyTo(Array array, int index)
System\Xml\HWStack.cs (1)
40System.Array.Copy(_stack, newstack, _used);
System\Xml\Schema\BitSet.cs (1)
245Array.Copy(_bits, newBits, _bits.Length);
System\Xml\Schema\ConstraintStruct.cs (9)
246_dim = ((Array)obj!).Length; 286_dstruct.Dvalue[i] = Convert.ToDecimal(((Array)_ovalue!).GetValue(i), NumberFormatInfo.InvariantInfo); 355Array? arr1 = this.Value as System.Array; 370Array? arr2 = other.Value as System.Array; 461if (_ks[i].Value is Array arr) 473for (int j = 0; j < ((Array)_ks[i].Value!).Length; j++) 475_hashcode += ((Array)_ks[i].Value!).GetValue(j)!.GetHashCode();
System\Xml\Schema\ContentValidator.cs (2)
1985Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length); 2009Array.Copy(rposInfo.rangeCounters, newRPosInfo.rangeCounters, rposInfo.rangeCounters.Length);
System\Xml\Schema\DataTypeImplementation.cs (10)
154int i = Array.BinarySearch(s_xdrTypes, name, null); 160int i = Array.BinarySearch(s_xsdTypes, name, null); 950System.Array arr1 = (System.Array)value1; 951System.Array arr2 = (System.Array)value2; 1029Array valuesToCheck = (valueToCheck as Array)!; 1137Array array = Array.CreateInstanceFromArrayType(arrayType, values.Count);
System\Xml\Schema\DtdParser.cs (1)
1434Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length);
System\Xml\Schema\DtdParserAsync.cs (1)
1056Array.Copy(_condSectionEntityIds, tmp, _condSectionEntityIds.Length);
System\Xml\Schema\FacetChecker.cs (6)
1628Array values = (value as Array)!; 1673Array values = (value as Array)!; 1682Array enumValue = (enumeration[i] as Array)!;
System\Xml\Schema\XmlSchemaCollection.cs (1)
227void ICollection.CopyTo(Array array, int index)
System\Xml\Schema\XmlSchemaObjectTable.cs (2)
189public void CopyTo(Array array, int arrayIndex) 242public void CopyTo(Array array, int arrayIndex)
System\Xml\Schema\XmlSchemaValidator.cs (3)
940return Array.Empty<XmlSchemaParticle>(); 965return Array.Empty<XmlSchemaParticle>(); 1008return Array.Empty<XmlSchemaAttribute>();
System\Xml\Schema\XsdBuilder.cs (2)
2270builder._markup = Array.Empty<XmlNode>(); 2294builder._markup = Array.Empty<XmlNode>();
System\Xml\Serialization\CodeGenerator.cs (2)
459if (arrayType == typeof(Array)) 462Call(typeof(Array).GetMethod("SetValue", new Type[] { typeof(object), typeof(int) })!);
System\Xml\Serialization\CodeIdentifiers.cs (2)
176Array array = Array.CreateInstance(type, _list.Count);
System\Xml\Serialization\Compilation.cs (1)
625return _methods[mapping.Key!].readMethod!.Invoke(reader, Array.Empty<object>());
System\Xml\Serialization\Mappings.cs (3)
402Array.Copy(_elements, _sortedElements, _elements.Length); 744Array.Sort(elements, new AccessorComparer()); 774Array.Copy(_elements, _sortedElements, _elements.Length);
System\Xml\Serialization\NameTable.cs (3)
98internal Array ToArray(Type type) 100Array a = Array.CreateInstance(type, _table.Count);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (11)
545Array a; 546if (collection is Array currentArray && currentArray.Length == collectionMember.Count) 552a = Array.CreateInstanceFromArrayType(collectionType, collectionMember.Count); 1311obj = ci.Invoke(Array.Empty<object>()); 1988Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.Type!.GetElementType()!, vals.Length); 2032var currentArray = (Array?)GetMemberValue(o, memberInfo); 2043var newArray = Array.CreateInstance(memberType.GetElementType()!, length + 1); 2046Array.Copy(currentArray, newArray, length);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (6)
144if (choiceSource == null || ((Array)choiceSource).Length < ((Array)o).Length) 162var choiceSource = ((Array?)choiceSources)?.GetValue(i); 178var choiceSource = ((Array?)choiceSources)?.GetValue(c++); 666shouldPersist = (bool)method.Invoke(o, Array.Empty<object>())!; 698shouldPersist = (bool)method.Invoke(o, Array.Empty<object>())!;
System\Xml\Serialization\SchemaImporter.cs (1)
115mapping.Members = Array.Empty<MemberMapping>();
System\Xml\Serialization\SoapReflectionImporter.cs (2)
230mapping.Members = Array.Empty<MemberMapping>(); 709accessor.Elements = Array.Empty<ElementAccessor>();
System\Xml\Serialization\Types.cs (4)
530AddNonXsdPrimitive(typeof(char), "char", UrtTypes.Namespace, "Char", new XmlQualifiedName("unsignedShort", XmlSchema.Namespace), Array.Empty<XmlSchemaFacet>(), TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.HasCustomFormatter | TypeFlags.IgnoreDefault); 531AddNonXsdPrimitive(typeof(TimeSpan), "TimeSpan", UrtTypes.Namespace, "TimeSpan", new XmlQualifiedName("duration", XmlSchema.Namespace), Array.Empty<XmlSchemaFacet>(), TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.XmlEncodingNotRequired); 532AddNonXsdPrimitive(typeof(DateTimeOffset), "dateTimeOffset", UrtTypes.Namespace, "DateTimeOffset", new XmlQualifiedName("dateTime", XmlSchema.Namespace), Array.Empty<XmlSchemaFacet>(), TypeFlags.CanBeAttributeValue | TypeFlags.CanBeElementValue | TypeFlags.XmlEncodingNotRequired); 659AddNonXsdPrimitive(type, dataTypeName, ns, formatterName, baseTypeName, Array.Empty<XmlSchemaFacet>(), flags);
System\Xml\Serialization\Xmlcustomformatter.cs (1)
443return Array.Empty<byte>();
System\Xml\Serialization\XmlReflectionImporter.cs (1)
641mapping.Members = Array.Empty<MemberMapping>();
System\Xml\Serialization\XmlSchemaImporter.cs (6)
777Array.Sort(member.Elements, new ElementComparer()); 1139member.Elements = Array.Empty<ElementAccessor>(); 1468member.Elements = Array.Empty<ElementAccessor>(); 1499member.Elements = Array.Empty<ElementAccessor>(); 1554xmlnsMapping.Members = Array.Empty<MemberMapping>(); 1809Array.Sort(choice, new ElementComparer());
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
92Array.Copy(a, b, index);
System\Xml\Serialization\XmlSerializationILGen.cs (7)
135Array.Copy(a, b, index); 164Array.Empty<string>(), 287Array.Empty<string>(), 299Array.Empty<string>(), 499Array.Empty<string>(), 519Array.Empty<string>(), 545Array.Empty<string>(),
System\Xml\Serialization\XmlSerializationReader.cs (22)
1049dimensions = Array.Empty<string>(); 1345protected Array EnsureArrayIndex(Array? a, int index, Type elementType) 1347if (a == null) return Array.CreateInstance(elementType, 32); 1349Array b = Array.CreateInstance(elementType, a.Length * 2); 1350Array.Copy(a, b, index); 1355protected Array? ShrinkArray(Array? a, int length, Type elementType, bool isNullable) 1360return Array.CreateInstance(elementType, 0); 1363Array b = Array.CreateInstance(elementType, length); 1364Array.Copy(a, b, length); 1535Array array = (Array)f.Source!; 1554private Array? ReadArray(string? typeName, string? typeNs) 1653return Array.CreateInstance(elementType, 0); 1660Array? array = null; 2758item = typeof(Array).FullName!; 2775Writer.Write($"{RaCodeGen.GetReflectionVariable(typeof(Array).FullName!, "0")}[ci , i]"); 3134Writer.Write(typeof(Array).FullName); 3442members = Array.Empty<Member>();
System\Xml\Serialization\XmlSerializationReaderILGen.cs (7)
228ilg.BeginMethod(typeof(void), "InitIDs", Type.EmptyTypes, Array.Empty<string>(), 343ilg.BeginMethod(typeof(void), "InitCallbacks", Type.EmptyTypes, Array.Empty<string>(), 393Array.Empty<string>(), 636Array.Empty<string>(), 965Array.Empty<string>(), 2638new Type[] { typeof(Array), typeof(int), typeof(Type), typeof(bool) } 2720new Type[] { typeof(Array), typeof(int), typeof(Type) }
System\Xml\Serialization\XmlSerializationWriter.cs (5)
1264Array a = (Array)o; 1689WriteDefaultIndexerInit(typeof(IList), typeof(Array).FullName!, false, false); 1981string typeFullName = arrayTypeDesc.IsCollection ? arrayTypeDesc.CSharpName : typeof(Array).FullName!; 2098typeName = typeof(Array).FullName!;
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
89ilg.BeginMethod(typeof(void), "InitCallbacks", Type.EmptyTypes, Array.Empty<string>(),
System\Xml\Serialization\XmlSerializer.cs (3)
579if (mappings == null || mappings.Length == 0) return Array.Empty<XmlSerializer>(); 609return Array.Empty<XmlSerializer>(); 756return Array.Empty<XmlSerializer>();
System\Xml\Serialization\XmlSerializerNamespaces.cs (1)
86return Array.Empty<XmlQualifiedName>();
System\Xml\XmlNamespacemanager.cs (1)
161Array.Copy(_nsdecls, newNsdecls, _nsdecls.Length);
System\Xml\XPath\Internal\XPathMultyIterator.cs (1)
55Array.Copy(arr, firstNotEmpty, arr, firstNotEmpty + 1, pos - firstNotEmpty);
System\Xml\XPath\Internal\XPathParser.cs (1)
780private static readonly XPathResultType[] s_temparray1 = Array.Empty<XPathResultType>();
System\Xml\Xsl\IlGen\XmlILModule.cs (5)
45asmBldr.SetCustomAttribute(new CustomAttributeBuilder(XmlILConstructors.Transparent, Array.Empty<object>())); 99asmBldr.SetCustomAttribute(new CustomAttributeBuilder(XmlILConstructors.Transparent, Array.Empty<object>())); 139Array.Copy(paramTypes, 0, paramTypesNew, 1, paramTypes.Length); 154methBldr.SetCustomAttribute(new CustomAttributeBuilder(XmlILConstructors.StepThrough, Array.Empty<object>())); 155methBldr.SetCustomAttribute(new CustomAttributeBuilder(XmlILConstructors.NonUserCode, Array.Empty<object>()));
System\Xml\Xsl\ListBase.cs (1)
125void System.Collections.ICollection.CopyTo(Array array, int index)
System\Xml\Xsl\QIL\QilList.cs (3)
125Array.Copy(_members, membersNew, _count); 130Array.Copy(_members, index, _members, index + 1, _count - index); 146Array.Copy(_members, index + 1, _members, index, _count - index);
System\Xml\Xsl\Runtime\EarlyBoundInfo.cs (1)
48public object CreateObject() { return _constrInfo.Invoke(Array.Empty<object>()); }
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (1)
363Array.Copy(_arrAttrs, arrNew, _numEntries);
System\Xml\Xsl\Runtime\XmlNavigatorStack.cs (1)
41Array.Copy(stkOld, _stkNav, _sp);
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (1)
942Array.Copy(_indexes, indexesNew, _indexes.Length);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (6)
158void System.Collections.ICollection.CopyTo(Array array, int index) 163Array.Copy(_items, 0, array, index, _size); 335int index = Array.IndexOf(_items, value); 382public void SortByKeys(Array keys) 388Array.Sort(keys, _items, 0, _size); 611Array.Sort(sortArray, 0, Count, comparer);
System\Xml\Xsl\Runtime\XmlSortKeyAccumulator.cs (2)
84Array.Copy(_keys, keysNew, _keys.Length); 107public Array Keys
System\Xml\Xsl\XmlIlGenerator.cs (3)
132MethodInfo methExec = _module.DefineMethod("Execute", typeof(void), Type.EmptyTypes, Array.Empty<string>(), XmlILMethodAttributes.NonUser); 138MethodInfo methRoot = _module.DefineMethod("Root", typeof(void), Type.EmptyTypes, Array.Empty<string>(), methAttrs); 261methInfo = _module!.DefineMethod(ndRef.DebugName!.ToString(), typReturn, Type.EmptyTypes, Array.Empty<string>(), methAttrs);
System\Xml\Xsl\XmlQueryType.cs (1)
445Array.Sort(sa);
System\Xml\Xsl\Xslt\Compiler.cs (1)
355Array.Sort<CompilerError>(errors, new CompilerErrorComparer(_moduleOrder));
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (1)
140Array.Copy(_records, newRecords, _lastRecord);
System\Xml\Xsl\Xslt\OutputScopeManager.cs (1)
73Array.Copy(_records, newRecords, _lastRecord);
System\Xml\Xsl\Xslt\XsltInput.cs (2)
92Array.Copy(_records, tmp, _records.Length); 709return GetAttributes(Array.Empty<XsltAttribute>());
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
76Array.Copy(this.TextInfo, newArr, this.TextInfoCount);
System\Xml\Xsl\XsltOld\UseAttributeSetsAction.cs (2)
34_useAttributeSets = Array.Empty<XmlQualifiedName>(); 58_useAttributeSets = Array.Empty<XmlQualifiedName>();
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (1)
744public FuncCurrent() : base(0, 0, XPathResultType.NodeSet, Array.Empty<XPathResultType>()) { }
System.Private.Xml.Linq (8)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (4)
19((IEnumerable<T>)Array.Empty<T>()).GetEnumerator(); 33Debug.Assert(Array.MaxLength == ArrayMaxLength); 79Array.Resize(ref arr, newLength); 92return Array.Empty<T>();
System\Xml\Linq\Extensions.cs (1)
302Array.Sort(items, 0, count, XNode.DocumentOrderComparer);
System\Xml\Linq\XAttribute.cs (1)
30return Array.Empty<XAttribute>();
System\Xml\Linq\XElement.cs (1)
45return Array.Empty<XElement>();
System\Xml\Linq\XObject.cs (1)
101Array.Resize(ref a, i * 2);
System.Reflection.Context (12)
System\Reflection\Context\CollectionServices.cs (3)
12return Array.Empty<T>(); 45Array typedArray = Array.CreateInstance(arrayType, list.Count);
System\Reflection\Context\Delegation\DelegatingType.cs (1)
190public override Array GetEnumValues()
System\Reflection\Context\Projection\ProjectingType.cs (6)
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;
System\Reflection\Context\Projection\Projector.cs (1)
20return Array.AsReadOnly(projected);
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (1)
123Array.Copy(index, args, index.Length);
System.Reflection.Emit (6)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (3)
239Array.Copy(_iaLowerBound, iaTemp, _rank); 241Array.Copy(_iaUpperBound, iaTemp, _rank); 368public override Type BaseType => typeof(Array);
System\Reflection\Emit\MethodBuilderImpl.cs (1)
289return Array.Empty<ParameterInfo>();
System\Reflection\Emit\SignatureHelper.cs (2)
43parameters ??= Array.Empty<ParameterInfo>(); 51WriteParametersSignature(module, Array.ConvertAll(parameters, p => p.ParameterType), parameterEncoder);
System.Reflection.Metadata (10)
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
306result = Array.Empty<byte>();
System\Reflection\Internal\Utilities\EnumerableExtensions.cs (1)
34Array.Sort(map, (int left, int right) =>
System\Reflection\Internal\Utilities\MemoryBlock.cs (1)
827Array.Sort(ptrTable, (int a, int b) => { return unsortedReferences[a - 1].CompareTo(unsortedReferences[b - 1]); });
System\Reflection\Internal\Utilities\PathUtilities.cs (1)
20(Array.IndexOf(Path.GetInvalidFileNameChars(), '*') >= 0 ? DirectorySeparatorChar : AltDirectorySeparatorChar).ToString();
System\Reflection\Metadata\BlobBuilder.cs (1)
290Array.Copy(chunk._buffer, bufferStart - chunkStart, result, bufferStart - start, bytesToCopy);
System\Reflection\Metadata\Ecma335\Encoding\BlobEncoders.cs (1)
573/// Encodes <c>null</c> literal of type <see cref="Array"/>.
System\Reflection\Metadata\Internal\BlobHeap.cs (1)
101return Array.Empty<byte>();
System\Reflection\Metadata\MetadataReader.netstandard.cs (1)
22byte[]? publicKeyOrToken = !publicKeyOrTokenHandle.IsNil ? GetBlobBytes(publicKeyOrTokenHandle) : Array.Empty<byte>();
System\Reflection\Metadata\Signatures\SignatureTypeCode.cs (2)
110/// Represents a generalized <see cref="System.Array"/> in signatures. 145/// Represents a single dimensional <see cref="System.Array"/> with 0 lower bound.
System.Reflection.MetadataLoadContext (87)
System\Reflection\MetadataLoadContext.Loading.cs (1)
33byte[] pkt = defNameData.PublicKeyToken ?? Array.Empty<byte>();
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (4)
167Array.Resize(ref _members, _totalCount); 168Array.Resize(ref _allFlagsThatMustMatch, _totalCount); 182Array.Resize(ref _members, count + Grow); 183Array.Resize(ref _allFlagsThatMustMatch, count + Grow);
System\Reflection\Runtime\BindingFlagSupport\QueryResult.cs (1)
67return Array.Empty<M>();
System\Reflection\Runtime\General\ListBuilder.cs (4)
41return Array.Empty<T>(); 45Array.Resize(ref _items, _count); 65Array.Copy(_items!, 0, array, index, _count); 94Array.Resize(ref _items, newCapacity);
System\Reflection\TypeLoading\Assemblies\RoAssembly.cs (1)
26_loadedModules = (assemblyFileCount == 0) ? Array.Empty<RoModule>() : new RoModule[assemblyFileCount];
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (1)
34public sealed override IEnumerable<CustomAttributeData> CustomAttributes => Array.Empty<CustomAttributeData>();
System\Reflection\TypeLoading\CustomAttributes\CustomAttributeHelpers.cs (6)
32CustomAttributeTypedArgument[] clones = count != 0 ? new CustomAttributeTypedArgument[count] : Array.Empty<CustomAttributeTypedArgument>(); 37return Array.AsReadOnly(clones); 46CustomAttributeNamedArgument[] clones = count != 0 ? new CustomAttributeNamedArgument[count] : Array.Empty<CustomAttributeNamedArgument>(); 51return Array.AsReadOnly(clones); 66CustomAttributeTypedArgument[] cads = count != 0 ? new CustomAttributeTypedArgument[count] : Array.Empty<CustomAttributeTypedArgument>(); 71return new CustomAttributeTypedArgument(type, Array.AsReadOnly(cads));
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeHelpers.cs (4)
109CustomAttributeTypedArgument[] cats = count != 0 ? new CustomAttributeTypedArgument[count] : Array.Empty<CustomAttributeTypedArgument>(); 114return Array.AsReadOnly(cats); 140CustomAttributeNamedArgument[] cans = count != 0 ? new CustomAttributeNamedArgument[count] : Array.Empty<CustomAttributeNamedArgument>(); 145return Array.AsReadOnly(cans);
System\Reflection\TypeLoading\CustomAttributes\RoPseudoCustomAttributeData.cs (2)
28_lazyFixedArguments = fixedArguments ?? Array.Empty<CustomAttributeTypedArgument>(); 29_lazyNamedArguments = namedArguments ?? Array.Empty<CustomAttributeNamedArgument>();
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (1)
62Array.Copy(_table, skip, newArray, 0, newArray.Length);
System\Reflection\TypeLoading\General\Helpers.cs (3)
28return Array.Empty<T>(); 33Array.Copy(sourceArray: original, sourceIndex: 0, destinationArray: copy, destinationIndex: 0, length: original.Length); 61return Array.AsReadOnly(list.ToArray());
System\Reflection\TypeLoading\General\RoAssemblyName.cs (1)
43PublicKeyToken = publicKeyToken ?? Array.Empty<byte>();
System\Reflection\TypeLoading\MethodBase\Ecma\EcmaMethodBody.cs (4)
37return Array.Empty<LocalVariableInfo>(); 41LocalVariableInfo[] lvis = count != 0 ? new LocalVariableInfo[count] : Array.Empty<LocalVariableInfo>(); 54return Array.AsReadOnly(lvis); 64ExceptionHandlingClause[] clauses = count != 0 ? new ExceptionHandlingClause[count] : Array.Empty<ExceptionHandlingClause>();
System\Reflection\TypeLoading\MethodBase\Ecma\EcmaMethodDecoder.cs (1)
36return Array.Empty<RoType>();
System\Reflection\TypeLoading\Methods\RoConstructedGenericMethod.cs (1)
47internal sealed override RoType[] GetGenericTypeParametersNoCopy() => Array.Empty<RoType>();
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (1)
128internal sealed override RoType[] GetGenericTypeArgumentsNoCopy() => Array.Empty<RoType>();
System\Reflection\TypeLoading\Methods\RoSyntheticMethod.cs (4)
37public sealed override IEnumerable<CustomAttributeData> CustomAttributes => Array.Empty<CustomAttributeData>(); 89protected sealed override RoType[] ComputeGenericArgumentsOrParameters() => Array.Empty<RoType>(); 90internal sealed override RoType[] GetGenericTypeArgumentsNoCopy() => Array.Empty<RoType>(); 91internal sealed override RoType[] GetGenericTypeParametersNoCopy() => Array.Empty<RoType>();
System\Reflection\TypeLoading\Modules\RoResourceModule.cs (3)
44public sealed override IEnumerable<CustomAttributeData> CustomAttributes => Array.Empty<CustomAttributeData>(); 47public sealed override FieldInfo[] GetFields(BindingFlags bindingFlags) => Array.Empty<FieldInfo>(); 48public sealed override MethodInfo[] GetMethods(BindingFlags bindingFlags) => Array.Empty<MethodInfo>();
System\Reflection\TypeLoading\Parameters\RoThinMethodParameter.cs (1)
25public sealed override IEnumerable<CustomAttributeData> CustomAttributes => Array.Empty<CustomAttributeData>();
System\Reflection\TypeLoading\Properties\RoProperty.cs (1)
141return Array.Empty<RoPropertyIndexParameter>();
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.cs (1)
88return Array.Empty<RoType>();
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericParameterType.cs (1)
45return Array.Empty<RoType>();
System\Reflection\TypeLoading\Types\RoByRefType.cs (3)
33internal sealed override IEnumerable<RoType> ComputeDirectlyImplementedInterfaces() => Array.Empty<RoType>(); 35internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>(); 36internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>();
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (1)
121internal sealed override RoType[] GetGenericTypeParametersNoCopy() => Array.Empty<RoType>();
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (1)
224internal sealed override RoType[] GetGenericTypeArgumentsNoCopy() => Array.Empty<RoType>();
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (11)
175public sealed override IEnumerable<CustomAttributeData> CustomAttributes => Array.Empty<CustomAttributeData>(); 184internal sealed override RoType[] GetGenericTypeParametersNoCopy() => Array.Empty<RoType>(); 185internal sealed override RoType[] GetGenericTypeArgumentsNoCopy() => Array.Empty<RoType>(); 186protected internal sealed override RoType[] GetGenericArgumentsNoCopy() => Array.Empty<RoType>(); 199internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => Array.Empty<EventInfo>(); 200internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => Array.Empty<FieldInfo>(); 201internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => Array.Empty<PropertyInfo>(); 202internal sealed override IEnumerable<RoType> GetNestedTypesCore(NameFilter? filter) => Array.Empty<RoType>(); 208internal sealed override IEnumerable<RoType> ComputeDirectlyImplementedInterfaces() => Array.Empty<RoType>(); 210internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>(); 211internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>();
System\Reflection\TypeLoading\Types\RoGenericParameterType.cs (9)
45internal sealed override RoType[] GetGenericTypeParametersNoCopy() => Array.Empty<RoType>(); 46internal sealed override RoType[] GetGenericTypeArgumentsNoCopy() => Array.Empty<RoType>(); 47protected internal sealed override RoType[] GetGenericArgumentsNoCopy() => Array.Empty<RoType>(); 88internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>(); 89internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>(); 90internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => Array.Empty<EventInfo>(); 91internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => Array.Empty<FieldInfo>(); 92internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => Array.Empty<PropertyInfo>(); 93internal sealed override IEnumerable<RoType> GetNestedTypesCore(NameFilter? filter) => Array.Empty<RoType>();
System\Reflection\TypeLoading\Types\RoHasElementType.cs (7)
54public sealed override IEnumerable<CustomAttributeData> CustomAttributes => Array.Empty<CustomAttributeData>(); 63internal sealed override RoType[] GetGenericTypeParametersNoCopy() => Array.Empty<RoType>(); 64internal sealed override RoType[] GetGenericTypeArgumentsNoCopy() => Array.Empty<RoType>(); 82internal sealed override IEnumerable<EventInfo> GetEventsCore(NameFilter? filter, Type reflectedType) => Array.Empty<EventInfo>(); 83internal sealed override IEnumerable<FieldInfo> GetFieldsCore(NameFilter? filter, Type reflectedType) => Array.Empty<FieldInfo>(); 84internal sealed override IEnumerable<PropertyInfo> GetPropertiesCore(NameFilter? filter, Type reflectedType) => Array.Empty<PropertyInfo>(); 85internal sealed override IEnumerable<RoType> GetNestedTypesCore(NameFilter? filter) => Array.Empty<RoType>();
System\Reflection\TypeLoading\Types\RoPointerType.cs (3)
33internal sealed override IEnumerable<RoType> ComputeDirectlyImplementedInterfaces() => Array.Empty<RoType>(); 35internal sealed override IEnumerable<ConstructorInfo> GetConstructorsCore(NameFilter? filter) => Array.Empty<ConstructorInfo>(); 36internal sealed override IEnumerable<MethodInfo> GetMethodsCore(NameFilter? filter, Type reflectedType) => Array.Empty<MethodInfo>();
System\Reflection\TypeLoading\Types\RoType.cs (5)
234return Array.Empty<RoType>(); 291return defaultMemberName != null ? GetMember(defaultMemberName) : Array.Empty<MemberInfo>(); 328public sealed override Array GetEnumValues() => throw new InvalidOperationException(SR.Arg_InvalidOperation_Reflection); 333public override Array GetEnumValuesAsUnderlyingType() 340Array ret = Type.GetTypeCode(GetEnumUnderlyingType()) switch
System.Resources.Extensions (8)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
353Array.Sort(nameHashes, namePositions);
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (5)
15private readonly Array _arrayOfClassRecords; 16private readonly Array _arrayOfT; 45Object = _arrayOfT = Array.CreateInstance(_elementType, _lengths); 103internal static Array GetArraySinglePrimitive(SerializationRecord record) => record switch 124internal static Array? GetRectangularArrayOfPrimitives(ArrayRecord arrayRecord, BinaryFormattedObject.ITypeResolver typeResolver)
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayUpdater.cs (2)
21Array array = (Array)objects[ObjectId];
System.Resources.Writer (1)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
353Array.Sort(nameHashes, namePositions);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
40[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Array))]
System.Runtime.InteropServices (2)
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (2)
79implementation.SetCustomAttribute(new CustomAttributeBuilder(typeof(DynamicInterfaceCastableImplementationAttribute).GetConstructor(Array.Empty<Type>())!, Array.Empty<object>()));
System.Runtime.Numerics (8)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (2)
181Array.Clear(toReturn, 0, _pos); 232Array.Clear(toReturn, 0, _pos);
System\Number.BigInteger.cs (2)
654if (tmpCharCount > Array.MaxLength) 664Debug.Assert(digits < Array.MaxLength);
System\Numerics\BigInteger.cs (4)
37internal static int MaxLength => Array.MaxLength / kcbitUint; 461Array.Copy(val, _bits, len); 1346return Array.Empty<byte>(); 1444array = Array.Empty<byte>();
System.Runtime.Serialization.Formatters (12)
System\Runtime\Serialization\FormatterServices.cs (3)
31return Array.Empty<FieldInfo>(); 78Array.Copy(typeMembers, membersTemp, typeMembers.Length); 157Array.Resize(ref parentTypes, Math.Max(parentTypeCount * 2, 12));
System\Runtime\Serialization\ObjectManager.cs (9)
119Array.Copy(_objects, temp, _objects.Length); 297Array.Copy(fieldsTemp, temp, fieldsTemp.Length); 343if (!(holder.ObjectValue is Array) && holder.ObjectValue != null) 383((Array)(holder.ObjectValue)).SetValue(fixupObj, arrayIndex); 499Debug.Assert(holder.ObjectValue is Array); 506((Array)(holder.ObjectValue)).SetValue(tempObjectHolder.ObjectValue, ((int[])fixupInfo)); 1435Array.Copy(_values, temp, _count); 1519Array.Copy(_values, temp, _count); 1562Array.Copy(_values, temp, _count);
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
35private static readonly XmlQualifiedName[] s_emptyTypeNameArray = Array.Empty<XmlQualifiedName>();
System.Security.AccessControl (2)
artifacts\obj\System.Security.AccessControl\Debug\net10.0\System.Security.AccessControl.notsupported.cs (2)
294void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } 560public void CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); }
System.Security.Cryptography (4)
artifacts\obj\System.Security.Cryptography\Debug\net10.0\System.Security.Cryptography.notsupported.cs (4)
206void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 2210void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 4008void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); } 4123void System.Collections.ICollection.CopyTo(System.Array array, int index) { throw new System.PlatformNotSupportedException(System.SR.SystemSecurityCryptography_PlatformNotSupported); }
System.Security.Cryptography.Pkcs (41)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (1)
57byte[] parameters = Array.Empty<byte>();
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decode.cs (1)
35data.EncryptedContentInfo.EncryptedContent?.ToArray() ?? Array.Empty<byte>());
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decrypt.cs (3)
77Array.Clear(cek, 0, cek.Length); 105Array.Empty<byte>()); 154return Array.Empty<byte>();
Internal\Cryptography\Pal\AnyOS\ManagedPal.Encrypt.cs (1)
49Array.Clear(cek, 0, cek.Length);
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (1)
123Array.Reverse(serial);
Internal\Cryptography\PkcsHelpers.cs (6)
79Array.Resize(ref a, size); 94arr = Array.Empty<T>(); 102Array.Copy(arr, tmp, idx); 107Array.Copy(arr, idx + 1, tmp, idx, tmp.Length - idx); 246Array.Reverse(ba); 253Array.Reverse(serialBytes);
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (1)
133void ICollection.CopyTo(Array array, int index)
src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (4)
52if (Array.IndexOf(validOids, spki.Algorithm.Algorithm) < 0) 83if (Array.IndexOf(validOids, spki.Algorithm.Algorithm) < 0) 119if (Array.IndexOf(validOids, privateKeyInfo.PrivateKeyAlgorithm.Algorithm) < 0) 146if (Array.IndexOf(validOids, privateKeyInfo.PrivateKeyAlgorithm.Algorithm) < 0)
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (2)
339pwdTmpBytes = Array.Empty<byte>(); 953byte[] tmpEnd = decryptor.TransformFinalBlock(Array.Empty<byte>(), 0, 0);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (1)
124authSafe = new ReadOnlyCollection<Pkcs12SafeContents>(Array.Empty<Pkcs12SafeContents>());
System\Security\Cryptography\Pkcs\AlgorithmIdentifier.cs (1)
33public byte[] Parameters { get; set; } = Array.Empty<byte>();
System\Security\Cryptography\Pkcs\CmsRecipientCollection.cs (1)
82public void CopyTo(Array array, int index)
System\Security\Cryptography\Pkcs\CmsSigner.cs (1)
343Array.Reverse(serial);
System\Security\Cryptography\Pkcs\EnvelopedCms.cs (1)
19: this(new ContentInfo(Array.Empty<byte>()))
System\Security\Cryptography\Pkcs\RecipientInfoCollection.cs (2)
15_recipientInfos = Array.Empty<RecipientInfo>(); 57public void CopyTo(Array array, int index)
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (2)
498Array.Reverse(serialNumber); 547Array.Reverse(serialNumber);
System\Security\Cryptography\Pkcs\SignedCms.cs (6)
354DigestAlgorithms = Array.Empty<AlgorithmIdentifierAsn>(), 355SignerInfos = Array.Empty<SignerInfoAsn>(), 373Array.Resize(ref _signedData.SignerInfos, newIdx + 1); 516Array.Resize(ref _signedData.DigestAlgorithms, curLength + 1); 588Array.Resize(ref _signedData.CertificateSet, existingLength + newCerts.Count); 693Array.Resize(ref _signedData.CertificateSet, existingLength + 1);
System\Security\Cryptography\Pkcs\SignedCms.CtorOverloads.cs (1)
11new ContentInfo(Oids.Pkcs7DataOid.CopyOid(), Array.Empty<byte>());
System\Security\Cryptography\Pkcs\SignerInfo.cs (3)
209Array.Resize(ref mySigner.UnsignedAttributes, newAttributeIdx + 1); 219Array.Resize(ref modifiedAttr.AttrValues, newIndex + 1); 337Array.Resize(ref mySigner.UnsignedAttributes, newExtensionIdx + 1);
System\Security\Cryptography\Pkcs\SignerInfoCollection.cs (2)
18_signerInfos = Array.Empty<SignerInfo>(); 55public void CopyTo(Array array, int index)
System.Security.Cryptography.ProtectedData (1)
src\libraries\Common\src\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs (1)
27return Array.Empty<byte>();
System.Security.Cryptography.Xml (9)
System\Security\Cryptography\Xml\CanonicalXml.cs (1)
108hash.TransformFinalBlock(Array.Empty<byte>(), 0, 0);
System\Security\Cryptography\Xml\CanonicalXmlNodeList.cs (1)
94public void CopyTo(Array array, int index)
System\Security\Cryptography\Xml\EncryptionPropertyCollection.cs (1)
148public void CopyTo(Array array, int index)
System\Security\Cryptography\Xml\ExcCanonicalXml.cs (1)
61hash.TransformFinalBlock(Array.Empty<byte>(), 0, 0);
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (1)
170Array.Resize(ref bytes, bytes.Length + 1);
System\Security\Cryptography\Xml\ReferenceList.cs (1)
109public void CopyTo(Array array, int index)
System\Security\Cryptography\Xml\SignedInfo.cs (1)
39public void CopyTo(Array array, int index)
System\Security\Cryptography\Xml\SymmetricKeyWrap.cs (2)
58Array.Reverse(temp2); 90Array.Reverse(temp2);
System.Security.Permissions (6)
System\Security\Permissions\KeyContainerPermissionAccessEntryCollection.cs (1)
21public void CopyTo(Array array, int index) { throw new NotImplementedException(); }
System\Security\Permissions\PrincipalPermission.cs (3)
193Array.Copy(_idArray, idrolesArray, _idArray.Length); 194Array.Copy(operand._idArray, 0, idrolesArray, _idArray.Length, operand._idArray.Length); 294_idArray = Array.Empty<IDRole>();
System\Security\Policy\ApplicationTrustCollection.cs (1)
27void ICollection.CopyTo(Array array, int index) { }
System\Xaml\Permissions\XamlLoadPermission.cs (1)
26public IList<XamlAccessLevel> AllowedAccess { get; } = new ReadOnlyCollection<XamlAccessLevel>(Array.Empty<XamlAccessLevel>());
System.ServiceModel.NetNamedPipe (1)
System\ServiceModel\Channels\PipeConnection.cs (1)
21private static readonly byte[] s_zeroBuffer = Array.Empty<byte>();
System.Text.Json (13)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (3)
25private static int ArrayMaxLength => Array.MaxLength; 44? Array.Empty<byte>() 84_bytes = Array.Empty<byte>();
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
147Array.Resize(ref adjacencyRow, index + 1);
System\Text\Json\BitStack.cs (1)
171Array.Resize(ref _array, nextDouble);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (1)
244Debug.Assert(MaxArrayLength == Array.MaxLength);
System\Text\Json\JsonEncodedText.cs (2)
70return new JsonEncodedText(Array.Empty<byte>()); 117return new JsonEncodedText(Array.Empty<byte>());
System\Text\Json\Nodes\JsonArray.IList.cs (2)
189/// Copies the entire <see cref="Array"/> to a compatible one-dimensional array, 193/// The one-dimensional <see cref="Array"/> that is the destination of the elements copied
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
687Array.Sort(indices);
System\Text\Json\Serialization\ReadStack.cs (1)
92Array.Resize(ref _stack, 2 * _stack.Length);
System\Text\Json\Serialization\WriteStack.cs (1)
140Array.Resize(ref _stack, 2 * _stack.Length);
System.Text.Json.SourceGeneration (7)
Helpers\RoslynExtensions.cs (1)
233return Array.Empty<INamedTypeSymbol>();
src\libraries\Common\src\SourceGenerators\DiagnosticInfo.cs (1)
29MessageArgs = messageArgs ?? Array.Empty<object?>()
src\libraries\Common\src\SourceGenerators\ImmutableEquatableArray.cs (1)
18public static ImmutableEquatableArray<T> Empty { get; } = new ImmutableEquatableArray<T>(Array.Empty<T>());
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (2)
181Array.Clear(toReturn, 0, _pos); 232Array.Clear(toReturn, 0, _pos);
src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
96Array.Sort(keys, arrayCopy); 147Array.Resize(ref adjacencyRow, index + 1);
System.Text.RegularExpressions (22)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (2)
181Array.Clear(toReturn, 0, _pos); 232Array.Clear(toReturn, 0, _pos);
System\Text\RegularExpressions\CaptureCollection.cs (1)
80public void CopyTo(Array array, int arrayIndex)
System\Text\RegularExpressions\GroupCollection.cs (1)
94public void CopyTo(Array array, int arrayIndex)
System\Text\RegularExpressions\MatchCollection.cs (1)
119public void CopyTo(Array array, int arrayIndex)
System\Text\RegularExpressions\Regex.cs (1)
360Array.Sort(result);
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (1)
113_ilg!.Emit(OpCodes.Call, typeof(Regex).GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, Array.Empty<ParameterModifier>())!);
System\Text\RegularExpressions\RegexCompiler.cs (1)
103private static MethodInfo ArrayResizeMethod => field ??= typeof(Array).GetMethod("Resize")!.MakeGenericMethod(typeof(int));
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
306public string[] LeadingPrefixes { get; } = Array.Empty<string>();
System\Text\RegularExpressions\RegexParser.cs (1)
1857Array.Sort(_capnumlist);
System\Text\RegularExpressions\RegexRunner.cs (3)
472Array.Copy(runtrack, 0, newtrack, runtrack.Length, runtrack.Length); 485Array.Copy(runstack, 0, newstack, runstack.Length, runstack.Length); 497Array.Copy(runcrawl, 0, newcrawl, runcrawl.Length, runcrawl.Length);
System\Text\RegularExpressions\Symbolic\BitVector.cs (1)
55Array.Fill(bv._blocks, ulong.MaxValue);
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (1)
80Array.Resize(ref _sparse, newLength);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (2)
100/// Implements a version of <see cref="Array.Resize"/> that is guaranteed to not publish an array before values 113Array.Copy(array, newArray, array.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (4)
1013Array.Fill(initialRegisters.CaptureStarts, -1); 1014Array.Fill(initialRegisters.CaptureEnds, -1); 1160Array.Copy(other.CaptureStarts, CaptureStarts, CaptureStarts.Length); 1161Array.Copy(other.CaptureEnds, CaptureEnds, CaptureEnds.Length);
System\Text\StructListBuilder.cs (1)
67Array.Copy(array, newArray, _count);
System.Text.RegularExpressions.Generator (6)
RegexGenerator.Emitter.cs (1)
511Array.Sort(chars);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (2)
181Array.Clear(toReturn, 0, _pos); 232Array.Clear(toReturn, 0, _pos);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
306public string[] LeadingPrefixes { get; } = Array.Empty<string>();
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (1)
1857Array.Sort(_capnumlist);
UpgradeToGeneratedRegexCodeFixer.cs (1)
228_ => Array.Empty<SyntaxNode>(),
System.Threading.Channels (3)
src\libraries\Common\src\System\Collections\Generic\Deque.cs (3)
127Array.Copy(_array, newArray, _size); 131Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 132Array.Copy(_array, 0, newArray, _array.Length - _head, _tail);
System.Threading.RateLimiting (4)
src\libraries\Common\src\System\Collections\Generic\Deque.cs (3)
127Array.Copy(_array, newArray, _size); 131Array.Copy(_array, _head, newArray, 0, _array.Length - _head); 132Array.Copy(_array, 0, newArray, _array.Length - _head, _tail);
System\Threading\RateLimiting\NoopLimiter.cs (1)
46public override IEnumerable<string> MetadataNames => Array.Empty<string>();
System.Threading.Tasks.Dataflow (7)
Blocks\BatchBlock.cs (2)
797Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long 911Array.Clear(postponedTemp, 0, postponedTemp.Length); // clear out the temp array so as not to hold onto messages too long
Internal\ImmutableArray.cs (5)
53Array.Copy(_array, newArray, _array.Length); 64int index = Array.IndexOf(_array, item); 72Array.Copy(_array, newArray, index); 73Array.Copy(_array, index + 1, newArray, index, _array.Length - index - 1); 83public bool Contains(T item) { return Array.IndexOf(_array, item) >= 0; }
System.Transactions.Local (3)
System\Transactions\Transaction.cs (1)
466Array.Copy(internalPromotedToken, toReturn, toReturn.Length);
System\Transactions\TransactionInteropNonWindows.cs (1)
252Array.Copy(propagationToken, propagationTokenCopy, propagationToken.Length);
System\Transactions\TransactionState.cs (1)
492Array.Copy(
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (1)
466Array.Copy(handleTypes, 0, newTypes, 0, handleTypeCount);
System.Windows.Forms (162)
misc\CollectionHelper.cs (1)
14public static void HashtableCopyTo<TKey, TValue>(this IDictionary<TKey, TValue> source, Array target, int index)
System\Drawing\Design\UITypeEditor.cs (1)
40[typeof(Array)] = $"System.ComponentModel.Design.ArrayEditor, {Assemblies.SystemDesign}",
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (2)
159index = Array.IndexOf(ctrls, owner); 171index = Array.IndexOf(ctrls, owner);
System\Windows\Forms\ActiveX\AxHost.AxPerPropertyBrowsingEnum.cs (1)
116Array.Copy(_names, 0, strings, 0, itemCount);
System\Windows\Forms\ActiveX\AxHost.cs (2)
3828o = ((Array)o).GetValue(0)!; 3839o = ((Array)o).GetValue(0)!;
System\Windows\Forms\ActiveX\AxHost.StateConverter.cs (1)
46return Array.Empty<byte>();
System\Windows\Forms\AutoCompleteStringCollection.cs (2)
119/// Copies the <see cref="AutoCompleteStringCollection"/> values to a one-dimensional <see cref="Array"/> instance at the 197void ICollection.CopyTo(Array array, int index) => ((ICollection)_data).CopyTo(array, index);
System\Windows\Forms\BaseCollection.cs (1)
21public void CopyTo(Array ar, int index) => List!.CopyTo(ar, index);
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (3)
139Array.Copy(_names, i, _names, i + 1, itemCount); 140Array.Copy(valueItems, i, valueItems, i + 1, itemCount); 146Array.Copy(_names, 0, strings, 0, itemCount);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (1)
470(Attribute[])(_baseAttributes?.Clone() ?? Array.Empty<Attribute>()),
System\Windows\Forms\Control.cs (1)
12865return Array.Empty<Rectangle>();
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.cs (1)
279void ICollection.CopyTo(Array destination, int index)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (2)
1587Array.Copy(clonedColumns, finalClonedColumns, clonedColumnsCount); 1591Array.Sort(finalClonedColumns, DataGridViewColumnCollection.ColumnCollectionOrderComparer);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (1)
44void ICollection.CopyTo(Array array, int index) => ((ICollection)_items).CopyTo(array, index);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellConverter.cs (1)
33return new InstanceDescriptor(ctor, Array.Empty<object>(), false);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyleConverter.cs (1)
41return new InstanceDescriptor(ctor, Array.Empty<object>(), false);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (1)
59void ICollection.CopyTo(Array array, int index) => ((ICollection)_items).CopyTo(array, index);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnConverter.cs (1)
54return new InstanceDescriptor(ctor, Array.Empty<object>(), false);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.ObjectCollection.cs (1)
194void ICollection.CopyTo(Array destination, int index) =>
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (1)
65void ICollection.CopyTo(Array array, int index)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowConverter.cs (1)
32return new InstanceDescriptor(ctor, Array.Empty<object>(), isComplete: false);
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedCellCollection.cs (1)
57void ICollection.CopyTo(Array array, int index) => ((ICollection)_items).CopyTo(array, index);
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedColumnCollection.cs (1)
53void ICollection.CopyTo(Array array, int index) => ((ICollection)_items).CopyTo(array, index);
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedRowCollection.cs (1)
42void ICollection.CopyTo(Array array, int index) => ((ICollection)_items).CopyTo(array, index);
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (1)
506void ICollection.CopyTo(Array dest, int index)
System\Windows\Forms\Controls\Labels\LinkLabel.LinkCollection.cs (2)
317void ICollection.CopyTo(Array dest, int index) 330return Array.Empty<Link>().GetEnumerator();
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedIndexCollection.cs (1)
131public void CopyTo(Array dest, int index)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedItemCollection.cs (1)
136public void CopyTo(Array dest, int index)
System\Windows\Forms\Controls\ListBoxes\ListBox.IntegerCollection.cs (3)
93index = Array.IndexOf(_innerArray, item); 131Array.Sort(_innerArray, 0, _count); 317public void CopyTo(Array destination, int index)
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
282void ICollection.CopyTo(Array destination, int index)
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedIndexCollection.cs (1)
171public void CopyTo(Array destination, int index)
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (1)
204public void CopyTo(Array destination, int index)
System\Windows\Forms\Controls\ListView\ColumnHeaderConverter.cs (1)
68return new InstanceDescriptor(ctor, Array.Empty<object>(), false);
System\Windows\Forms\Controls\ListView\ListView.CheckedIndexCollection.cs (3)
218void ICollection.CopyTo(Array dest, int index) 222Array.Copy(IndicesArray, 0, dest, index, Count); 235return Array.Empty<int>().GetEnumerator();
System\Windows\Forms\Controls\ListView\ListView.CheckedListViewItemCollection.cs (3)
315public void CopyTo(Array dest, int index) 324Array.Copy(ItemArray, 0, dest, index, Count); 342return Array.Empty<ListViewItem>().GetEnumerator();
System\Windows\Forms\Controls\ListView\ListView.ColumnHeaderCollection.cs (5)
369void ICollection.CopyTo(Array dest, int index) 373Array.Copy(_owner._columnHeaders!, 0, dest, index, Count); 547Array.Copy(_owner._columnHeaders, 0, newHeaders, 0, index); 552Array.Copy(_owner._columnHeaders, index + 1, newHeaders, index, columnCount - index); 592return Array.Empty<ColumnHeader>().GetEnumerator();
System\Windows\Forms\Controls\ListView\ListView.cs (2)
3850Array.Copy(_columnHeaders!, 0, newHeaders, 0, columnCount); 3862Array.Copy(_columnHeaders, idx, _columnHeaders, idx + 1, columnCount - idx);
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.cs (1)
256public void CopyTo(Array dest, int index)
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.IInnerList.cs (1)
23void CopyTo(Array dest, int index);
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (1)
441public void CopyTo(Array dest, int index)
System\Windows\Forms\Controls\ListView\ListView.SelectedIndexCollection.cs (3)
294public void CopyTo(Array dest, int index) 298Array.Copy(IndicesArray, 0, dest, index, Count); 311return Array.Empty<int>().GetEnumerator();
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (3)
318public void CopyTo(Array dest, int index) 327Array.Copy(SelectedItemArray, 0, dest, index, Count); 345return Array.Empty<ListViewItem>().GetEnumerator();
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (1)
221public void CopyTo(Array array, int index) => ((ICollection)List).CopyTo(array, index);
System\Windows\Forms\Controls\ListView\ListViewGroupItemCollection.cs (1)
84public void CopyTo(Array dest, int index) => ((ICollection)Items).CopyTo(dest, index);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (1)
373void ICollection.CopyTo(Array dest, int index)
System\Windows\Forms\Controls\ListView\ListViewItemStateImageIndexConverter.cs (1)
101return new StandardValuesCollection(Array.Empty<object>());
System\Windows\Forms\Controls\PropertyGrid\GridItemCollection.cs (2)
19_entries = entries ?? Array.Empty<GridItem>(); 52void ICollection.CopyTo(Array dest, int index)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (9)
1543Array.Copy(tabComponents, newComponents, oldArraySize); 2148return Array.Empty<Type>(); 2153return Array.Empty<Type>(); 2172return Array.Empty<Type>(); 2492Array.Copy(_selectedObjects, 0, newObjects, 0, i); 2496Array.Copy(_selectedObjects, i + 1, newObjects, i, newObjects.Length - i); 3490index = Array.IndexOf(components, component); 3496Array.Copy(components, 0, newComponents, 0, index); 3497Array.Copy(components, index + 1, newComponents, index, components.Length - index - 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.PropertyTabCollection.cs (3)
91void ICollection.CopyTo(Array dest, int index) 100Array.Copy( 116return Array.Empty<PropertyTab>().GetEnumerator();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\ArrayElementGridEntry.cs (4)
30Debug.Assert(owner is Array, "Owner is not array type!"); 31return ((Array)owner).GetValue(_index); 36Debug.Assert(owner is Array, "Owner is not array type!"); 37((Array)owner).SetValue(value, _index);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (2)
1334var objArray = (Array)value;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (18)
86Debug.Assert(component is Array, "MergePropertyDescriptor::CanResetValue called with non-array value"); 90var a = (Array)component; 180private object? GetPropertyOwnerForComponent(Array a, int i) 196Debug.Assert(component is Array, "MergePropertyDescriptor::GetValue called with non-array value"); 197return GetValue((Array)component, out _); 200public object? GetValue(Array components, out bool allEqual) 252internal object?[] GetValues(Array components) 266Debug.Assert(component is Array, "MergePropertyDescriptor::ResetValue called with non-array value"); 267var array = (Array)component; 274private void SetCollectionValues(Array a, IList listValue) 307Debug.Assert(component is Array, "MergePropertyDescriptor::SetValue called with non-array value"); 308var array = (Array)component; 325Debug.Assert(component is Array, "MergePropertyDescriptor::ShouldSerializeValue called with non-array value"); 326var array = (Array)component;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.MultiMergeCollection.cs (3)
33public void CopyTo(Array array, int index) 40Array.Copy(_items, 0, array, index, _items.Length); 43public IEnumerator GetEnumerator() => _items?.GetEnumerator() ?? Array.Empty<object>().GetEnumerator();
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (5)
160Array.Copy(_objects, 0, copy, 0, _objects.Length); 229if (owner is Array ownerArray) 337if (owner1 is not Array) 343if (owner1 is Array a1 && owner2 is Array a2 && a1.Length == a2.Length)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.cs (1)
41foreach (object target in (Array)Target)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (2)
633if (PropertyDescriptor is MergePropertyDescriptor && owner is Array objArray) 805if (owner is Array array && array.Length > 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (2)
3573Array.Copy(entries, 0, newEntries, 0, parentIndex + 1); 3576Array.Copy(
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (2)
78Array.Sort(currentAttributes, AttributeTypeSorter); 79Array.Sort(newAttributes, AttributeTypeSorter);
System\Windows\Forms\Controls\TabControl\TabControl.cs (2)
1079return Array.Empty<TabPage>(); 1088object[] result = (object[])Array.CreateInstance(baseType, tabPageCount);
System\Windows\Forms\Controls\TabControl\TabControl.TabPageCollection.cs (3)
296void ICollection.CopyTo(Array dest, int index) 300Array.Copy(_owner.GetTabPages(), 0, dest, index, Count); 309return Array.Empty<TabPage>().GetEnumerator();
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1841int focusIndex = Array.IndexOf(displayedItems, item);
System\Windows\Forms\Controls\TreeView\TreeNode.cs (1)
1620Array.Copy(_children, 0, bigger, 0, _childCount);
System\Windows\Forms\Controls\TreeView\TreeNodeCollection.cs (3)
582public void CopyTo(Array dest, int index) 586Array.Copy(_owner._children, 0, dest, index, _owner._childCount); 628return Array.Empty<TreeNode>().GetEnumerator();
System\Windows\Forms\Controls\Unsupported\ContextMenu\Menu.MenuItemCollection.cs (1)
70public void CopyTo(Array dest, int index) { }
System\Windows\Forms\Controls\Unsupported\DataGrid\GridColumnStylesCollection.cs (1)
52void ICollection.CopyTo(Array array, int index) { }
System\Windows\Forms\Controls\Unsupported\DataGrid\GridTableStylesCollection.cs (1)
50void ICollection.CopyTo(Array array, int index) { }
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBar.StatusBarPanelCollection.cs (1)
88void ICollection.CopyTo(Array dest, int index) { }
System\Windows\Forms\Controls\Unsupported\ToolBar\ToolBar.ToolBarButtonCollection.cs (1)
68void ICollection.CopyTo(Array dest, int index) { }
System\Windows\Forms\Controls\WebBrowser\HtmlDocument.cs (1)
525Array.Reverse(args);
System\Windows\Forms\Controls\WebBrowser\HtmlElement.cs (1)
595Array.Reverse(parameter);
System\Windows\Forms\Controls\WebBrowser\HtmlElementCollection.cs (1)
160void ICollection.CopyTo(Array dest, int index)
System\Windows\Forms\Controls\WebBrowser\HtmlWindowCollection.cs (1)
97void ICollection.CopyTo(Array dest, int index)
System\Windows\Forms\DataBinding\Binding.BindToObject.cs (1)
152if (typeof(Array).IsAssignableFrom(type))
System\Windows\Forms\DataBinding\BindingContext.cs (1)
43void ICollection.CopyTo(Array ar, int index)
System\Windows\Forms\DataBinding\BindingSource.cs (1)
1423public virtual void CopyTo(Array arr, int index) => List.CopyTo(arr, index);
System\Windows\Forms\DataBinding\Command.cs (1)
95Array.Copy(s_cmds, 0, newCmds, 0, icmd);
System\Windows\Forms\DataBinding\CurrencyManager.cs (1)
154if (tempList is Array array)
System\Windows\Forms\DataBinding\ListBindingConverter.cs (1)
150Array.Copy(ConstructorParamaterTypes, 0, ctorParams, 0, ctorParams.Length);
System\Windows\Forms\DataBinding\ListBindingHelper.cs (3)
223if (typeof(Array).IsAssignableFrom(listType)) 309if (typeof(Array).IsAssignableFrom(type)) 576if (typeof(Array).IsAssignableFrom(targetType))
System\Windows\Forms\Design\EventsTab.cs (1)
127Array.Copy(attributes, 0, specifiedAttributesPlusContent, 0, attributes.Length);
System\Windows\Forms\Dialogs\MessageBox.cs (2)
93Array.Copy(t_helpInfoTable, newTable, newCount); 118Array.Copy(t_helpInfoTable, newTable, lastCount);
System\Windows\Forms\ImageIndexConverter.cs (1)
172return new StandardValuesCollection(Array.Empty<object>());
System\Windows\Forms\ImageKeyConverter.cs (1)
183return new StandardValuesCollection(Array.Empty<object>());
System\Windows\Forms\Input\CursorConverter.cs (1)
138return Array.Empty<byte>();
System\Windows\Forms\Input\InputLanguageCollection.cs (2)
20Debug.Assert(Array.IndexOf(value, null!) == -1, "Should not contain null"); 37/// Copies the <see cref="InputLanguageCollection"/> values to a one-dimensional <see cref="Array"/> instance at the
System\Windows\Forms\Layout\ArrangedElementCollection.cs (1)
148public void CopyTo(Array array, int index) => ((ICollection)InnerList).CopyTo(array, index);
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (1)
270Array.Copy(childInfo, trimmedChildInfo, trimmedChildInfo.Length);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.StyleConverter.cs (1)
33Array.Empty<object>());
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyleCollection.cs (1)
129void ICollection.CopyTo(Array array, int startIndex) => ((ICollection)_innerList).CopyTo(array, startIndex);
System\Windows\Forms\StringSource.cs (1)
68Array.Clear(_strings, 0, _size);
System.Windows.Forms.Analyzers.Tests (1)
Analyzers\AppManifestAnalyzer\FontStyleTests.cs (1)
14var values = Enum.GetValues(typeof(FontStyle));
System.Windows.Forms.Design (61)
System\ComponentModel\Design\ArrayEditor.cs (6)
34if (editValue is Array valueArray) 37Array.Copy(valueArray, items, items.Length); 49if (editValue is not null and not Array) 59Array newArray = Array.CreateInstance(CollectionItemType, value.Length); 60Array.Copy(value, newArray, value.Length);
System\ComponentModel\Design\ComponentDesigner.cs (3)
34public virtual ICollection AssociatedComponents => Array.Empty<IComponent>(); 211Array.Resize(ref designers, idx); 216return Array.Empty<object>();
System\ComponentModel\Design\DesignerActionList.cs (2)
29ReadOnlyCollection<MethodInfo> originalMethods = Array.AsReadOnly( 31ReadOnlyCollection<PropertyInfo> originalProperties = Array.AsReadOnly(
System\ComponentModel\Design\DesignSurface.cs (1)
90public ICollection LoadErrors => _loadErrors ?? Array.Empty<object>();
System\ComponentModel\Design\DesignSurfaceCollection.cs (1)
56void ICollection.CopyTo(Array array, int index)
System\ComponentModel\Design\InheritedPropertyDescriptor.cs (1)
256collection.CopyTo((Array)OriginalValue, 0);
System\ComponentModel\Design\LoadedEventArgs.cs (1)
19Errors = errors ?? Array.Empty<object>();
System\ComponentModel\Design\SelectionService.cs (1)
367components ??= Array.Empty<IComponent>();
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (1)
75_errors ??= Array.Empty<object>();
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (1)
987objects ??= Array.Empty<object>();
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (6)
636if (array is Array arr) 954Array? array = null; 988array = Array.CreateInstance(arrayType, arrayList.Count); 999array = Array.CreateInstance(arrayType, size); 1004array = Array.CreateInstance(arrayType, arrayCreateEx.Size); 1025if (DeserializeExpression(manager, name, arrayIndexerEx.TargetObject) is Array array)
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (4)
168bool isArray = typeof(Array).IsAssignableFrom(collectionType); 305if (typeof(Array).IsAssignableFrom(targetType)) 307CodeArrayCreateExpression? arrayCreate = SerializeArray(manager, targetType, (Array)originalCollection, valuesToSerialize); 386private CodeArrayCreateExpression? SerializeArray(IDesignerSerializationManager manager, Type targetType, Array array, ICollection valuesToSerialize)
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (1)
178Array.Sort(statementArray, StatementOrderComparer.s_default);
System\Drawing\Design\ColorEditor.ColorUI.cs (2)
205Array.Sort(ColorValues, StandardColorComparer.Instance); 206Array.Sort(SystemColorValues, comparer: new SystemColorComparer());
System\Drawing\Design\ToolboxItem.cs (1)
419value ??= Array.Empty<ToolboxItemFilterAttribute>();
System\Drawing\Design\ToolboxItemCollection.cs (1)
41/// Copies the <see cref="ToolboxItemCollection"/> values to a one-dimensional <see cref="Array"/> instance at the
System\Windows\Forms\Design\Behavior\AdornerCollection.cs (3)
142/// one-dimensional <see cref="Array"/> instance at the 146/// The one-dimensional <see cref="Array"/> that is the destination of the values copied from 165/// <seealso cref="Array"/>
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (1)
982Array.Sort(_dragComponents, this);
System\Windows\Forms\Design\Behavior\GlyphCollection.cs (1)
87/// <see cref="Array"/> instance at the specified index.
System\Windows\Forms\Design\ColumnHeaderCollectionEditor.cs (1)
38Array.Copy(value, 0, colHeaders, 0, value.Length);
System\Windows\Forms\Design\CommandSet.cs (5)
1478SelectionService.SetSelectedComponents(Array.Empty<object>(), SelectionTypes.Replace); 1606SelectionService.SetSelectedComponents(Array.Empty<object>(), SelectionTypes.Replace); 2066else if (associatedComps.Contains(curComp) && Array.IndexOf(allComponents, parentComp) == -1) 2589primaryIndex = Array.IndexOf(selectedObjects, primary); 3197Array.Sort(selectedObjects, comp);
System\Windows\Forms\Design\ControlCommandSet.cs (1)
1006Array.Sort(selectedComponents, new ControlComparer());
System\Windows\Forms\Design\ControlDesigner.DesignerControlCollection.cs (1)
40public new void CopyTo(Array dest, int index) => _realCollection.CopyTo(dest, index);
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
1478if (dataSource is not (IListSource or IList or Array))
System\Windows\Forms\Design\DesignBindingValueUIHandler.cs (1)
40if ((binding.DataSource is IListSource || binding.DataSource is IList || binding.DataSource is Array) && binding.PropertyName.Equals(propDesc.Name))
System\Windows\Forms\Design\ImageListDesigner.OriginalImageCollection.cs (1)
194void ICollection.CopyTo(Array array, int index) => ((ICollection)_items).CopyTo(array, index);
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (1)
169return Array.IndexOf(GetFormats(), format) != -1;
System\Windows\Forms\Design\OleDragDropHandler.cs (1)
710components = Array.Empty<IComponent>();
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (2)
426Array.Copy(s_activeCursorArrays, _cursors, _cursors.Length); 427Array.Copy(s_activeSizeArray, _sizes, _sizes.Length);
System\Windows\Forms\Design\StringArrayEditor.cs (6)
23if (editValue is not Array valueArray) 29Array.Copy(valueArray, items, items.Length); 40if (editValue is Array or null && value is not null) 42Array newArray = Array.CreateInstance(CollectionItemType, value.Length); 43Array.Copy(value, newArray, value.Length);
System\Windows\Forms\Design\StringCollectionEditor.StringCollectionForm.cs (1)
174Array.Resize(ref newLines, newLines.Length - 1);
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2171public new void CopyTo(Array dest, int index) => _realCollection.CopyTo(dest, index);
System.Windows.Forms.Design.Tests (79)
EnsureEditorsTests.cs (1)
43[InlineData(typeof(Array), typeof(ArrayEditor))]
System\ComponentModel\Design\ArrayEditorTests.cs (7)
138yield return new object[] { null, Array.Empty<object>() }; 139yield return new object[] { new(), Array.Empty<object>() }; 141yield return new object[] { new ArrayList { 1, 2, 3 }, Array.Empty<object>() }; 165yield return new object[] { null, Array.Empty<object>(), Array.Empty<object>() }; 186yield return new object[] { editValue, Array.Empty<object>(), editValue }; 187yield return new object[] { Array.Empty<object>(), null, null };
System\ComponentModel\Design\ByteViewerTests.cs (10)
457yield return new object[] { Array.Empty<byte>(), displayMode }; 613control.SetBytes(Array.Empty<byte>()); 623control.SetBytes(Array.Empty<byte>()); 677yield return new object[] { Array.Empty<byte>() }; 882control.SetBytes(Array.Empty<byte>()); 892control.SetBytes(Array.Empty<byte>()); 913yield return new object[] { Array.Empty<byte>(), -1 }; 914yield return new object[] { Array.Empty<byte>(), 0 }; 915yield return new object[] { Array.Empty<byte>(), 1 }; 916yield return new object[] { Array.Empty<byte>(), int.MaxValue };
System\ComponentModel\Design\CollectionEditorTests.cs (8)
762yield return new object[] { null, Array.Empty<object>() }; 763yield return new object[] { new(), Array.Empty<object>() }; 843yield return new object[] { null, Array.Empty<object>(), null }; 848yield return new object[] { o, Array.Empty<object>(), o }; 851yield return new object[] { new int[] { 1, 2, 3 }, Array.Empty<object>(), new object[] { 0, 0, 0 } }; 855yield return new object[] { new ArrayList { 1, 2, 3 }, Array.Empty<object>(), Array.Empty<object>() }; 856yield return new object[] { new ArrayList { 1, 2, 3 }, null, Array.Empty<object>() };
System\ComponentModel\Design\CollectionFormTests.cs (5)
59yield return new object[] { Array.Empty<object>() }; 206Assert.Equal(value ?? Array.Empty<object>(), form.EditValue); 207Assert.Equal(value ?? Array.Empty<object>(), form.Items); 214Assert.Equal(value ?? Array.Empty<object>(), form.EditValue); 215Assert.Equal(value ?? Array.Empty<object>(), form.Items);
System\ComponentModel\Design\ComponentDesignerTests.cs (7)
176foreach (ICollection associatedComponents in new object[] { null, Array.Empty<object>(), new object[] { new Component() } }) 746yield return new object[] { property, Array.Empty<object>(), 1, null }; 747yield return new object[] { property, Array.Empty<object>(), 1, string.Empty }; 748yield return new object[] { property, Array.Empty<object>(), 1, "UniqueMethod" }; 898.Returns(Array.Empty<object>()); 1679yield return new object[] { Array.Empty<object>() }; 1889.Returns(Array.Empty<object>())
System\ComponentModel\Design\DesignerActionListCollectionTests.cs (1)
19yield return new object[] { Array.Empty<DesignerActionList>() };
System\ComponentModel\Design\DesignerCommandSetTests.cs (2)
45.Returns(Array.Empty<object>()); 66.Returns(Array.Empty<object>());
System\ComponentModel\Design\DesignerHostTests.cs (12)
2190yield return new object[] { null, true, Array.Empty<object>() }; 2195yield return new object[] { null, false, Array.Empty<object>() }; 2200yield return new object[] { string.Empty, true, Array.Empty<object>() }; 2205yield return new object[] { string.Empty, false, Array.Empty<object>() }; 2239.Setup(f => f.FilterComponents(new ComponentCollection(Array.Empty<IComponent>()))) 3111Assert.Equal(typeof(IDesignerHost).GetMethod(nameof(IDesignerHost.Activate)), reflect.GetMethod(nameof(IDesignerHost.Activate), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, Array.Empty<Type>(), Array.Empty<ParameterModifier>())); 3128Assert.Equal(typeof(IDesignerHost).GetProperty(nameof(IDesignerHost.Container)), reflect.GetProperty(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, typeof(IContainer), Array.Empty<Type>(), Array.Empty<ParameterModifier>())); 3144Assert.Equal(surface.Host.Container, reflect.InvokeMember(nameof(IDesignerHost.Container), BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.GetProperty, null, surface.Host, Array.Empty<object>(), Array.Empty<ParameterModifier>(), null, Array.Empty<string>()));
System\ComponentModel\Design\DesignerVerbCollectionTests.cs (1)
19yield return new object[] { Array.Empty<DesignerVerb>() };
System\ComponentModel\Design\DesignSurfaceTests.cs (2)
366yield return new object[] { Array.Empty<object>() }; 1793public ViewTechnology[] SupportedTechnologies => Array.Empty<ViewTechnology>();
System\ComponentModel\Design\LoadedEventArgsTests.cs (1)
15yield return new object[] { false, Array.Empty<object>() };
System\Drawing\Design\ImageEditorTests.cs (1)
24yield return new object[] { Array.Empty<string>(), ",", null };
System\Drawing\Design\ToolboxComponentsCreatedEventArgsTests.cs (1)
15yield return new object[] { Array.Empty<IComponent>() };
System\Drawing\Design\ToolboxItemTests.cs (11)
157yield return new object[] { Array.Empty<AssemblyName>() }; 256yield return new object[] { null, Array.Empty<object>() }; 257yield return new object[] { Array.Empty<object>(), Array.Empty<object>() }; 258yield return new object[] { new object[] { null }, Array.Empty<object>() }; 1142yield return new object[] { "Filter", null, Array.Empty<ToolboxItemFilterAttribute>(), false }; 1143yield return new object[] { "Filter", Array.Empty<ToolboxItemFilterAttribute>(), Array.Empty<ToolboxItemFilterAttribute>(), true }; 1560yield return new object[] { "Filter", null, Array.Empty<ToolboxItemFilterAttribute>() }; 1561yield return new object[] { "Filter", Array.Empty<ToolboxItemFilterAttribute>(), Array.Empty<ToolboxItemFilterAttribute>() };
System\Windows\Forms\Design\Behavior\BehaviorDragDropEventArgsTests.cs (1)
15yield return new object[] { Array.Empty<object>() };
System\Windows\Forms\Design\ControlCommandSetTests.cs (1)
110Mock<PropertyDescriptor> snapPropertyDescriptorMock = new("SnapToGrid", Array.Empty<Attribute>());
System\Windows\Forms\Design\DesignerUtilsTests.cs (2)
457ICollection emptyCollection = Array.Empty<Type>(); 500ComponentCollection components = new(Array.Empty<IComponent>());
System\Windows\Forms\Design\EditorServiceContextTests.cs (1)
27_mockPropertyDescriptor = new("Items", Array.Empty<Attribute>());
System\Windows\Forms\Design\EmbeddedResourceTests.cs (2)
136Array.Sort(actual, StringComparer.Ordinal); 139Array.Sort(expected, StringComparer.Ordinal);
System\Windows\Forms\Design\SelectionUIHandlerTests.cs (1)
127object[] components = Array.Empty<object>();
System\Windows\Forms\Design\ToolStripInSituServiceTests.cs (1)
110ComponentCollection componentCollection = new(Array.Empty<IComponent>());
System.Windows.Forms.Primitives (1)
System\Windows\Forms\NonNullCollection.cs (1)
114void ICollection.CopyTo(Array array, int index) => ((IList)_list).CopyTo(array, index);
System.Windows.Forms.Primitives.Tests (258)
Interop\Oleaut32\VARIANTTests.cs (257)
1199yield return new object[] { Array.Empty<sbyte>() }; 1231AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<sbyte>(), variant); 1236yield return new object[] { Array.Empty<byte>() }; 1259AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<byte>(), variant); 1264yield return new object[] { Array.Empty<short>() }; 1287AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<short>(), variant); 1292yield return new object[] { Array.Empty<ushort>() }; 1315AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<ushort>(), variant); 1320yield return new object[] { Array.Empty<BOOL>(), Array.Empty<bool>() }; 1344AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<bool>(), variant); 1349yield return new object[] { Array.Empty<int>() }; 1372AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1377yield return new object[] { Array.Empty<uint>() }; 1400AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<uint>(), variant); 1405yield return new object[] { Array.Empty<int>() }; 1437AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1442yield return new object[] { Array.Empty<uint>() }; 1474AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<uint>(), variant); 1479yield return new object[] { Array.Empty<long>() }; 1502AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<long>(), variant); 1507yield return new object[] { Array.Empty<ulong>() }; 1530AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<ulong>(), variant); 1535yield return new object[] { Array.Empty<float>() }; 1567AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1572yield return new object[] { Array.Empty<double>() }; 1595AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<double>(), variant); 1600yield return new object[] { Array.Empty<uint>() }; 1632AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1637yield return new object[] { Array.Empty<long>(), Array.Empty<decimal>() }; 1669AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<decimal>(), variant); 1674yield return new object[] { Array.Empty<double>(), Array.Empty<DateTime>() }; 1710AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<DateTime>(), variant); 1715yield return new object[] { Array.Empty<FILETIME>(), Array.Empty<DateTime>() }; 1743AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<DateTime>(), variant); 1748yield return new object[] { Array.Empty<Guid>() }; 1780AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1823AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1865AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1907AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 1942AssertToObjectEqualExtension<InvalidOleVariantTypeException>(Array.Empty<int>(), variant); 2006Array array = (Array)value; 2025Array array = (Array)value; 2058Array array = (Array)value; 2077Array array = (Array)value; 2095Array array = (Array)value; 2112Array array = (Array)value; 2149Array array = (Array)value; 2176Array array = (Array)value; 2202Array array = (Array)value; 2227Array array = (Array)value; 2264Array array = (Array)value; 2291Array array = (Array)value; 2317Array array = (Array)value; 2342Array array = (Array)value; 2379Array array = (Array)value; 2406Array array = (Array)value; 2432Array array = (Array)value; 2457Array array = (Array)value; 2494Array array = (Array)value; 2521Array array = (Array)value; 2547Array array = (Array)value; 2572Array array = (Array)value; 2596Array array = (Array)value; 2623Array array = (Array)value; 2649Array array = (Array)value; 2674Array array = (Array)value; 2711Array array = (Array)value; 2738Array array = (Array)value; 2764Array array = (Array)value; 2789Array array = (Array)value; 2813Array array = (Array)value; 2840Array array = (Array)value; 2866Array array = (Array)value; 2891Array array = (Array)value; 2928Array array = (Array)value; 2955Array array = (Array)value; 2981Array array = (Array)value; 3006Array array = (Array)value; 3030Array array = (Array)value; 3057Array array = (Array)value; 3083Array array = (Array)value; 3108Array array = (Array)value; 3145Array array = (Array)value; 3172Array array = (Array)value; 3198Array array = (Array)value; 3223Array array = (Array)value; 3247Array array = (Array)value; 3274Array array = (Array)value; 3300Array array = (Array)value; 3325Array array = (Array)value; 3362Array array = (Array)value; 3389Array array = (Array)value; 3414Array array = (Array)value; 3439Array array = (Array)value; 3476Array array = (Array)value; 3503Array array = (Array)value; 3529Array array = (Array)value; 3554Array array = (Array)value; 3591Array array = (Array)value; 3618Array array = (Array)value; 3644Array array = (Array)value; 3669Array array = (Array)value; 3706Array array = (Array)value; 3733Array array = (Array)value; 3759Array array = (Array)value; 3784Array array = (Array)value; 3821Array array = (Array)value; 3848Array array = (Array)value; 3860yield return new object[] { Array.Empty<VARIANT_BOOL>(), Array.Empty<bool>() }; 3881Array array = (Array)value; 3907Array array = (Array)value; 3950Array array = (Array)value; 3978Array array = (Array)value; 3989yield return new object[] { Array.Empty<DECIMAL>(), Array.Empty<decimal>() }; 4014Array array = (Array)value; 4040Array array = (Array)value; 4089Array array = (Array)value; 4117Array array = (Array)value; 4143Array array = (Array)value; 4168Array array = (Array)value; 4210Array array = (Array)value; 4237Array array = (Array)value; 4263Array array = (Array)value; 4288Array array = (Array)value; 4337Array array = (Array)value; 4364Array array = (Array)value; 4393Array array = (Array)value; 4420Array array = (Array)value; 4455Array array = (Array)value; 4492Array array = (Array)value; 4525Array array = (Array)value; 4562Array array = (Array)value; 4609Array array = (Array)value; 4666Array array = (Array)value; 4707Array array = (Array)value; 4744Array array = (Array)value; 4791Array array = (Array)value; 4848Array array = (Array)value; 4890Array array = (Array)value; 4928Array array = (Array)value; 4976Array array = (Array)value; 5034Array array = (Array)value; 5096Array array = (Array)value; 5148Array array = (Array)value; 5231Array array = (Array)value; 5312SAFEARRAY* psa = CreateSafeArray(VT_I1, Array.Empty<byte>()); 5351SAFEARRAY* psa = CreateSafeArray((VARENUM)arrayVt, Array.Empty<byte>()); 5369SAFEARRAY* psa = CreateSafeArray((VARENUM)vt, Array.Empty<byte>());
System\Windows\Forms\Automation\UiaTextRangeTests.cs (1)
401Array textAttributeIdentifiers = Enum.GetValues(typeof(UIA_TEXTATTRIBUTE_ID));
System.Windows.Forms.Tests (297)
misc\CollectionHelperTests.cs (2)
50var target = Array.CreateInstance(typeof(double), [3], [2]);
System\Windows\Forms\AccessibleObjects\Button.ButtonAccessibleObjectTests.cs (1)
103Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ButtonBase.ButtonBaseAccessibleObjectTests.cs (1)
211Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\CheckBox.CheckBoxAccessibleObjectTests.cs (1)
283Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\CheckedListBoxAccessibleObjectTests.cs (1)
62Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxAccessibleObjectTests.cs (1)
243Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\Control.ControlAccessibleObjectTests.cs (1)
1403Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\DataGridView.DataGridViewEditingPanelAccessibleObjectTests.cs (1)
83Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (1)
485Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\DataGridViewComboBoxEditingControlAccessibleObjectTests.cs (1)
58Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\DataGridViewTextBoxEditingControl.DataGridViewTextBoxEditingControlAccessibleObjectTests.cs (1)
94Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\DateTimePicker.DateTimePickerAccessibleObjectTests.cs (1)
64Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\DomainUpDownAccessibleObjectTests.cs (1)
70Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\Form.FormAccessibleObjectTests.cs (1)
77Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\GroupBoxAccessibleObjectTests.cs (1)
97Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\HScrollBar.HScrollBarAccessibleObjectTests.cs (1)
85Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\LabelAccessibleObjectTests.cs (1)
100Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\LinkLabel.LinkLabelAccessibleObjectTests.cs (1)
36Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (1)
60Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (1)
1113Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\MaskedTextBox.MaskedTextBoxAccessibleObjectTests.cs (1)
51Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\MenuStrip.MenuStripAccessibleObjectTests.cs (2)
114Array roles = Enum.GetValues(typeof(AccessibleRole)); 143Array directions = Enum.GetValues<NavigateDirection>();
System\Windows\Forms\AccessibleObjects\MonthCalendar.MonthCalendarAccessibleObjectTests.cs (1)
52Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\NumericUpDownAccessibleObjectTests.cs (1)
68Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\Panel.PanelAccessibleObjectTests.cs (1)
92Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\PictureBox.PictureBoxAccessibleObjectTests.cs (1)
125Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ProgressBarAccessibleObjectTests.cs (1)
126Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\PropertyGrid.PropertyGridAccessibleObjectTests.cs (1)
83Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\RadioButton.RadioButtonAccessibleObjectTests.cs (1)
229Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ScrollBar.ScrollBarAccessibleObjectTests.cs (1)
79Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\SplitContainer.SplitContainerAccessibleObjectTests.cs (1)
50Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\Splitter.SplitterAccessibleObjectTests.cs (1)
130Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\StatusStrip.StatusStripAccessibleObjectTests.cs (2)
94Array roles = Enum.GetValues(typeof(AccessibleRole)); 123Array directions = Enum.GetValues<NavigateDirection>();
System\Windows\Forms\AccessibleObjects\TabControl.TabControlAccessibleObjectTests.cs (1)
53Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\TabPage.TabPageAccessibleObjectTests.cs (1)
56Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\TextBoxAccessibleObjectTests.cs (1)
68Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\TextBoxBaseAccessibleObjectTests.cs (1)
141Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripAccessibleObjectTests.cs (2)
92Array roles = Enum.GetValues(typeof(AccessibleRole)); 121Array directions = Enum.GetValues<NavigateDirection>();
System\Windows\Forms\AccessibleObjects\ToolStripButton.ToolStripButtonAccessibleObjectTests.cs (1)
72Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxControlAccessibleObjectTests.cs (1)
44Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripDropDown.ToolStripDropDownAccessibleObjectTests.cs (1)
51Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripDropDownButton.ToolStripDropDownButtonAccessibleObjectTests.cs (1)
47Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripGrip.ToolStripGripAccessibleObjectTests.cs (1)
46Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripItemAccessibleObjectTests.cs (1)
145Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripLabel.ToolStripLabelAccessibleObjectTests.cs (1)
53Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripMenuItem.ToolStripMenuItemAccessibleObjectTests.cs (1)
93Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripNumericUpDown.ToolStripNumericUpDownAccessibleObjectTests.cs (1)
57Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripOverflow.ToolStripOverflowAccessibleObjectTests.cs (1)
53Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripOverflowButton.ToolStripOverflowButtonAccessibleObjectTests.cs (1)
52Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripProgressBar.ToolStripProgressBarControl.ToolStripProgressBarControlAccessibleObjectTests.cs (1)
56Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripSeparator.ToolStripSeparatorAccessibleObjectTests.cs (1)
46Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripSplitButton.ToolStripSplitButtonAccessibleObjectTests.cs (1)
46Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripStatusLabel.ToolStripStatusLabelAccessibleObjectTests.cs (1)
52Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\ToolStripTextBox.ToolStripTextBoxControlAccessibleObjectTests.cs (1)
113Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\TrackBar.TrackBarAccessibleObjectTests.cs (1)
284Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\UpDownBase.UpDownButtons.UpDownButtonsAccessibleObjectTests.cs (1)
56Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\UpDownBase.UpDownEdit.UpDownEditAccessibleObjectTests.cs (1)
170Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleObjects\VScrollBar.VScrollBarAccessibleObjectTests.cs (1)
84Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AccessibleRoleControlTypeMapTests.cs (1)
14Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\AxHostTests.cs (2)
2679yield return new object[] { Array.Empty<Attribute>() }; 2876yield return new object[] { Array.Empty<Attribute>() };
System\Windows\Forms\BaseCollectionTests.cs (2)
43Assert.Throws<NullReferenceException>(() => collection.CopyTo(Array.Empty<object>(), 0)); 59Assert.Throws<NullReferenceException>(() => collection.CopyTo(Array.Empty<object>(), 0));
System\Windows\Forms\BindingSourceTests.cs (2)
126int[] emptyArray = Array.Empty<int>(); 794public void CopyTo(Array array, int arrayIndex) => ((IList)_innerList).CopyTo(array, arrayIndex);
System\Windows\Forms\ClipboardTests.cs (4)
82byte[] audioBytes = Array.Empty<byte>(); 274(Action)(() => Clipboard.SetAudio(Array.Empty<byte>())), 763Array value = Array.CreateInstance(typeof(uint), lengths: [2, 3], lowerBounds: [1, 2]);
System\Windows\Forms\ColorDialogTests.cs (1)
193yield return new object[] { Array.Empty<int>(), Enumerable.Repeat(0x00FFFFFF, 16).ToArray() };
System\Windows\Forms\ColumnHeaderConverterTests.cs (6)
53Array.Empty<Type>(), 54Array.Empty<object>() 71Array.Empty<Type>(), 72Array.Empty<object>() 77Array.Empty<Type>(), 78Array.Empty<object>()
System\Windows\Forms\Combobox.ObjectCollectionTests.cs (5)
108DataSource = Array.Empty<object>() 388DataSource = Array.Empty<object>() 456DataSource = Array.Empty<object>() 818DataSource = Array.Empty<object>() 919DataSource = Array.Empty<object>()
System\Windows\Forms\ComboBoxTests.cs (2)
622yield return new object[] { Array.Empty<int>() }; 2496Array.Sort(items);
System\Windows\Forms\ComponentModel\Com2Interop\COM2FontConverterTests.cs (2)
18Array.Empty<Attribute>(), 99: base(default, "Foo", Array.Empty<Attribute>(), default, default, default, default)
System\Windows\Forms\ControlTests.ControlCollection.cs (1)
1258collection.AddRange(Array.Empty<Control>());
System\Windows\Forms\ControlTests.Methods.cs (2)
4135Assert.Throws<InvalidOperationException>(() => control.Invoke(method, Array.Empty<object>())); 4146Assert.Throws<TargetParameterCountException>(() => control.Invoke(method, Array.Empty<object>()));
System\Windows\Forms\CursorConverterTests.cs (1)
61Assert.Throws<ArgumentException>("stream", () => converter.ConvertFrom(Array.Empty<byte>()));
System\Windows\Forms\DataGridViewAutoSizeColumnsModeEventArgsTests.cs (1)
14yield return new object[] { Array.Empty<DataGridViewAutoSizeColumnMode>() };
System\Windows\Forms\DataGridViewRowTests.cs (5)
4114Assert.Throws<ArgumentNullException>("dataGridView", () => row.CreateCells(null, Array.Empty<object>())); 4128Assert.Throws<InvalidOperationException>(() => row.CreateCells(newControl, Array.Empty<object>())); 4139Assert.Throws<InvalidOperationException>(() => row.CreateCells(control, Array.Empty<object>())); 5740Assert.Throws<InvalidOperationException>(() => row.SetValues(Array.Empty<object>())); 5752Assert.Throws<InvalidOperationException>(() => row.SetValues(Array.Empty<object>()));
System\Windows\Forms\DataObjectTests.cs (8)
723theoryData.Add(null, Array.Empty<string>()); 724theoryData.Add(new(), Array.Empty<string>()); 785{ Array.Empty<string>() }, 808{ Array.Empty<string>() }, 861{ true, Array.Empty<string>() }, 864{ false, Array.Empty<string>() }, 1043{ Array.Empty<byte>() }, 1101{ new MemoryStream(Array.Empty<byte>()) },
System\Windows\Forms\Design\ComponentEditorFormTests.cs (9)
19using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 174using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 195using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 211using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 239using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 250using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 288using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 316using SubComponentEditorForm control = new(component, Array.Empty<Type>()); 343using SubComponentEditorForm control = new(component, Array.Empty<Type>());
System\Windows\Forms\Design\PropertyTabTests.cs (1)
166yield return new object[] { mockContext.Object, new(), Array.Empty<Attribute>() };
System\Windows\Forms\Design\WindowsFormsComponentEditorTests.cs (6)
17yield return new object[] { Array.Empty<Type>(), null, null }; 21yield return new object[] { Array.Empty<Type>(), new(), mockWindow.Object }; 38yield return new object[] { Array.Empty<Type>(), null, null }; 42yield return new object[] { Array.Empty<Type>(), mockContext.Object, new() }; 59yield return new object[] { Array.Empty<Type>(), null, null, null }; 64yield return new object[] { Array.Empty<Type>(), mockContext.Object, new(), mockWindow.Object };
System\Windows\Forms\EmbeddedResourceTests.cs (2)
254Array.Sort(actual, StringComparer.Ordinal); 258Array.Sort(expected, StringComparer.Ordinal);
System\Windows\Forms\HtmlDocumentTests.cs (2)
1868Assert.Equal("NoParameter1", document.InvokeScript("divide", Array.Empty<object>())); 1888Assert.Null(document.InvokeScript("NoSuchScript", Array.Empty<object>()));
System\Windows\Forms\HtmlElementTests.cs (1)
2375Assert.Null(element.InvokeMember("NoSuchMember", Array.Empty<object>()));
System\Windows\Forms\ImageList.ImageCollectionTests.cs (2)
831collection.AddRange(Array.Empty<Image>()); 856collection.AddRange(Array.Empty<Image>());
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (1)
1902.Returns(new PropertyDescriptorCollection(Array.Empty<PropertyDescriptor>()));
System\Windows\Forms\Layout\TableLayoutSettingsTypeConverterTests.cs (1)
320.Returns(new PropertyDescriptorCollection(Array.Empty<PropertyDescriptor>()));
System\Windows\Forms\ListBindingHelperTests.cs (42)
80yield return new object[] { new IEnumerableWrapper(Array.Empty<object>()), "NoSuchProperty" }; 81yield return new object[] { new IEnumerableWrapper(Array.Empty<object>()), "Property" }; 161yield return new object[] { new IEnumerableWrapper(Array.Empty<object>()), typeof(object) }; 238yield return new object[] { null, Array.Empty<string>() }; 239yield return new object[] { 1, Array.Empty<string>() }; 240yield return new object[] { typeof(int), Array.Empty<string>() }; 252yield return new object[] { new List<ICustomTypeDescriptor>(), Array.Empty<string>() }; 256yield return new object[] { Array.Empty<DataClass>(), new string[] { "Property" } }; 258yield return new object[] { Array.Empty<object>(), Array.Empty<string>() }; 259yield return new object[] { new object[] { new DataClass() }, Array.Empty<string>() }; 262yield return new object[] { new IEnumerableWrapper(Array.Empty<object>()), Array.Empty<string>() }; 265yield return new object[] { new IEnumerableWrapper(new object[] { null }), Array.Empty<string>() }; 268yield return new object[] { new ArrayList(), Array.Empty<string>() }; 270yield return new object[] { new ArrayList { 1 }, Array.Empty<string>() }; 271yield return new object[] { new ArrayList { null }, Array.Empty<string>() }; 301properties = ListBindingHelper.GetListItemProperties(list, Array.Empty<PropertyDescriptor>())?.Cast<PropertyDescriptor>(); 305properties = ListBindingHelper.GetListItemProperties(list, null, Array.Empty<PropertyDescriptor>())?.Cast<PropertyDescriptor>(); 309properties = ListBindingHelper.GetListItemProperties(list, string.Empty, Array.Empty<PropertyDescriptor>())?.Cast<PropertyDescriptor>(); 315yield return new object[] { null, TypeDescriptor.GetProperties(typeof(DataClass)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 317yield return new object[] { new DataClass(), TypeDescriptor.GetProperties(typeof(DataClass)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 318yield return new object[] { typeof(DataClass), TypeDescriptor.GetProperties(typeof(DataClass)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 332yield return new object[] { new DataClass(), new PropertyDescriptor[] { null }, Array.Empty<string>() }; 333yield return new object[] { typeof(DataClass), new PropertyDescriptor[] { null }, Array.Empty<string>() }; 337yield return new object[] { new IEnumerableWrapper(Array.Empty<object>()), descriptors, new string[] { "Property" } }; 352yield return new object[] { new ArrayList { new MultiListDataClass { ParentListProperty = [new() { ListProperty = [new()] }] } }, inner.Take(3).ToArray(), Array.Empty<string>() }; 366yield return new object[] { new EnumerableITypedListImplementor[] { new() }, TypeDescriptor.GetProperties(typeof(EnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 367yield return new object[] { new List<EnumerableITypedListImplementor> { new() }, TypeDescriptor.GetProperties(typeof(EnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 368yield return new object[] { new ArrayList { new EnumerableITypedListImplementor() }, TypeDescriptor.GetProperties(typeof(EnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 369yield return new object[] { new IEnumerableWrapper(new object[] { new EnumerableITypedListImplementor() }), TypeDescriptor.GetProperties(typeof(EnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 374yield return new object[] { new NonEnumerableITypedListImplementor[] { new() }, TypeDescriptor.GetProperties(typeof(NonEnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 375yield return new object[] { new List<NonEnumerableITypedListImplementor> { new() }, TypeDescriptor.GetProperties(typeof(NonEnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 376yield return new object[] { new ArrayList { new NonEnumerableITypedListImplementor() }, TypeDescriptor.GetProperties(typeof(NonEnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 377yield return new object[] { new IEnumerableWrapper(new object[] { new NonEnumerableITypedListImplementor() }), TypeDescriptor.GetProperties(typeof(NonEnumerableITypedListImplementor)).Cast<PropertyDescriptor>().ToArray(), Array.Empty<string>() }; 426yield return new object[] { new ListDataClass(), "listproperty", Array.Empty<PropertyDescriptor>(), new string[] { "Property" } }; 429yield return new object[] { typeof(ListDataClass), "listproperty", Array.Empty<PropertyDescriptor>(), new string[] { "Property" } }; 473yield return new object[] { 1, Array.Empty<PropertyDescriptor>(), "Int32" }; 474yield return new object[] { typeof(int), Array.Empty<PropertyDescriptor>(), "Int32" }; 478yield return new object[] { Array.Empty<int>(), null, "Int32" }; 480yield return new object[] { Array.Empty<object>(), null, "Object" }; 488yield return new object[] { typeof(Array), null, "Array" };
System\Windows\Forms\ListBox.IntegerCollectionTests.cs (8)
478collection.AddRange(Array.Empty<int>()); 506collection.AddRange(Array.Empty<int>()); 544collection.AddRange(Array.Empty<int>()); 585collection.AddRange(Array.Empty<int>()); 619collection.AddRange(Array.Empty<int>()); 650collection.AddRange(Array.Empty<int>()); 691collection.AddRange(Array.Empty<int>()); 735collection.AddRange(Array.Empty<int>());
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (29)
53Assert.Throws<ArgumentNullException>("owner", () => new ListBox.ObjectCollection(null, Array.Empty<object>())); 61DataSource = Array.Empty<object>() 72Assert.Throws<ArgumentException>(() => new ListBox.ObjectCollection(owner, Array.Empty<object>())); 2194DataSource = Array.Empty<object>() 2233collection.AddRange(Array.Empty<object>()); 2257collection.AddRange(Array.Empty<object>()); 2284collection.AddRange(Array.Empty<object>()); 2311collection.AddRange(Array.Empty<object>()); 2352collection.AddRange(Array.Empty<object>()); 2404collection.AddRange(Array.Empty<object>()); 2459collection.AddRange(Array.Empty<object>()); 2514collection.AddRange(Array.Empty<object>()); 2553collection.AddRange(Array.Empty<object>()); 2584collection.AddRange(Array.Empty<object>()); 2619collection.AddRange(Array.Empty<object>()); 2653collection.AddRange(Array.Empty<object>()); 2690collection.AddRange(Array.Empty<object>()); 2734collection.AddRange(Array.Empty<object>()); 2782collection.AddRange(Array.Empty<object>()); 2830collection.AddRange(Array.Empty<object>()); 3667DataSource = Array.Empty<object>() 3672Assert.Throws<ArgumentException>(() => collection.AddRange(Array.Empty<object>())); 5032DataSource = Array.Empty<object>() 5984DataSource = Array.Empty<object>() 6864DataSource = Array.Empty<object>() 8999DataSource = Array.Empty<object>() 10354DataSource = Array.Empty<object>() 11306DataSource = Array.Empty<object>() 12186DataSource = Array.Empty<object>()
System\Windows\Forms\ListBoxTests.cs (4)
786yield return new object[] { Array.Empty<int>() }; 4572control.AddItemsCore(Array.Empty<object>()); 4611control.AddItemsCore(Array.Empty<object>()); 6014yield return new object[] { Array.Empty<object>() };
System\Windows\Forms\ListControlTests.cs (2)
553yield return new object[] { Array.Empty<int>() }; 1051control.DataSource = Array.Empty<int>();
System\Windows\Forms\ListViewItemTests.cs (14)
47yield return new object[] { Array.Empty<string>(), null, Color.Empty, Color.Empty, null, null, string.Empty, SystemColors.WindowText, SystemColors.Window, string.Empty }; 85yield return new object[] { Array.Empty<string>(), 0, Color.Empty, Color.Empty, null, null, SystemColors.WindowText, SystemColors.Window, string.Empty }; 123yield return new object[] { Array.Empty<string>(), null, Color.Empty, Color.Empty, null, string.Empty, SystemColors.WindowText, SystemColors.Window, string.Empty }; 161yield return new object[] { Array.Empty<string>(), 0, Color.Empty, Color.Empty, null, SystemColors.WindowText, SystemColors.Window, string.Empty }; 198yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), null, null, string.Empty, string.Empty }; 235yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), 0, null, string.Empty }; 273yield return new object[] { Array.Empty<string>(), null, null, string.Empty, string.Empty }; 311yield return new object[] { Array.Empty<string>(), 0, null, string.Empty }; 424yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), null, string.Empty, string.Empty }; 461yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), 0, string.Empty }; 499yield return new object[] { Array.Empty<string>(), null, string.Empty }; 537yield return new object[] { Array.Empty<string>(), null, string.Empty, string.Empty }; 575yield return new object[] { Array.Empty<string>(), 0, string.Empty }; 764yield return new object[] { Array.Empty<string>(), string.Empty };
System\Windows\Forms\MonthCalendar.DateBoldEventArgsTests.cs (1)
30{ Array.Empty<int>() },
System\Windows\Forms\MonthCalendarTests.cs (9)
169yield return new object[] { null, Array.Empty<DateTime>() }; 170yield return new object[] { Array.Empty<DateTime>(), Array.Empty<DateTime>() }; 497yield return new object[] { null, Array.Empty<DateTime>() }; 498yield return new object[] { Array.Empty<DateTime>(), Array.Empty<DateTime>() }; 1523yield return new object[] { null, Array.Empty<DateTime>() }; 1524yield return new object[] { Array.Empty<DateTime>(), Array.Empty<DateTime>() };
System\Windows\Forms\PropertyGridInternal\AccessibleObjects\PropertyDescriptorGridEntry.PropertyDescriptorGridEntryAccessibleObjectTests.cs (1)
174: base(ownerGrid, parent, new CustomPropertyDescriptor("Test", Array.Empty<Attribute>()), hide)
System\Windows\Forms\PropertyGridInternal\PropertiesTabTests.cs (2)
92PropertyDescriptorCollection properties = tab.GetProperties(new ClassWithDefaultProperty(), Array.Empty<Attribute>()); 176PropertyDescriptorCollection properties = tab.GetProperties(null, new ClassWithDefaultProperty(), Array.Empty<Attribute>());
System\Windows\Forms\PropertyGridTests.cs (5)
568SelectedObjects = Array.Empty<object>(), 2558yield return new object[] { null, null, Array.Empty<object>() }; 2614yield return new object[] { null, Array.Empty<object>(), null }; 2615yield return new object[] { Array.Empty<object>(), Array.Empty<object>(), null };
System\Windows\Forms\RichTextBoxTests.cs (17)
4706yield return new object[] { 0, 0, 0, Array.Empty<char>(), string.Empty, 13, FontStyle.Regular }; 6214yield return new object[] { 0, 3, new int[] { 900, 600, -900 }, Array.Empty<int>() }; 6219yield return new object[] { PFM.ALIGNMENT, 3, new int[] { 900, 600, -900 }, Array.Empty<int>() }; 6263yield return new object[] { null, Array.Empty<int>() }; 6264yield return new object[] { Array.Empty<int>(), Array.Empty<int>() }; 6269yield return new object[] { new int[] { 1, -1, 3 }, Array.Empty<int>() }; 6324yield return new object[] { null, Array.Empty<int>() }; 6325yield return new object[] { Array.Empty<int>(), Array.Empty<int>() }; 6402yield return new object[] { Array.Empty<int>() }; 8234yield return new object[] { string.Empty, Array.Empty<char>(), -1 }; 8237yield return new object[] { "abc", Array.Empty<char>(), -1 }; 8272yield return new object[] { string.Empty, Array.Empty<char>(), 0, -1 }; 8275yield return new object[] { "abc", Array.Empty<char>(), 0, -1 }; 8316yield return new object[] { string.Empty, Array.Empty<char>(), 0, end, -1 }; 8319yield return new object[] { "abc", Array.Empty<char>(), 0, end, -1 };
System\Windows\Forms\TabControl.TabPageCollectionTests.cs (1)
1140collection.AddRange(Array.Empty<TabPage>());
System\Windows\Forms\TableLayoutPanel.TableLayoutPanelAccessibleObectTests.cs (1)
50Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\TableLayoutPanelTests.cs (1)
2156.Returns(new PropertyDescriptorCollection(Array.Empty<PropertyDescriptor>()));
System\Windows\Forms\TableLayoutStyleTests.cs (4)
128yield return new object[] { new RowStyle(SizeType.AutoSize, 1), typeof(RowStyle).GetConstructor(Array.Empty<Type>()), Array.Empty<object>() }; 131yield return new object[] { new ColumnStyle(SizeType.AutoSize, 1), typeof(ColumnStyle).GetConstructor(Array.Empty<Type>()), Array.Empty<object>() };
System\Windows\Forms\ToolStrip.ToolStripAccessibleObjectWrapperForItemsOnOverflowTests.cs (1)
60Array roles = Enum.GetValues(typeof(AccessibleRole));
System\Windows\Forms\ToolStripDropDownItemTests.cs (3)
296yield return new object[] { null, null, null, Array.Empty<ToolStripItem>() }; 297yield return new object[] { string.Empty, new Bitmap(10, 10), Array.Empty<ToolStripItem>(), Array.Empty<ToolStripItem>() };
System\Windows\Forms\ToolStripItemCollectionTests.cs (4)
318ToolStripItemCollection collection = new(toolStrip2, Array.Empty<ToolStripItem>()); 348ToolStripItemCollection collection = new(toolStrip2, Array.Empty<ToolStripItem>()); 361ToolStripItemCollection collection = new(toolStrip, Array.Empty<ToolStripItem>()); 374ToolStripItemCollection collection = new(toolStrip, Array.Empty<ToolStripItem>());
System\Windows\Forms\ToolStripTests.cs (1)
172yield return new object[] { Array.Empty<ToolStripItem>() };
System\Windows\Forms\ToolStripTextBoxTests.cs (1)
251_toolStripTextBox.Lines.Should().Equal(inputLines ?? Array.Empty<string>());
System\Windows\Forms\TreeNodeTests.cs (6)
98TreeNode_Ctor_String_TreeNodeArray_Helper(null, Array.Empty<TreeNode>(), string.Empty); 99TreeNode_Ctor_String_TreeNodeArray_Helper(string.Empty, Array.Empty<TreeNode>(), string.Empty); 189TreeNode_Ctor_String_Int_Int_TreeNodeArray_Helper(null, -1, -1, Array.Empty<TreeNode>(), ""); 190TreeNode_Ctor_String_Int_Int_TreeNodeArray_Helper(null, 0, 0, Array.Empty<TreeNode>(), ""); 252Assert.Throws<ArgumentOutOfRangeException>("value", () => new TreeNode("text", imageIndex, 0, Array.Empty<TreeNode>())); 260Assert.Throws<ArgumentOutOfRangeException>("value", () => new TreeNode("text", 0, selectedImageIndex, Array.Empty<TreeNode>()));
System\Windows\Forms\TreeViewTests.cs (2)
6005yield return new object[] { Array.Empty<Image>(), null, false }; 6007yield return new object[] { Array.Empty<Image>(), new EventArgs(), false };
TextBoxBaseTests.cs (6)
1595yield return new object[] { string.Empty, Array.Empty<string>() }; 1628yield return new object[] { null, Array.Empty<string>(), string.Empty }; 1629yield return new object[] { Array.Empty<string>(), Array.Empty<string>(), string.Empty }; 1630yield return new object[] { Array.Empty<string>(), Array.Empty<string>(), string.Empty };
System.Windows.Forms.UI.IntegrationTests (1)
Infra\ScreenRecordService.cs (1)
148Array.Sort(frames, (x, y) => x.elapsed.CompareTo(y.elapsed));
System.Xaml (18)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (5)
1339Array.Copy(_entries, 0, destEntries, 0, _entries.Length); 1358public override int IndexOf(T value) => Array.IndexOf(_entries, value, 0, _count); 1365Array.Copy(_entries, index, _entries, index + 1, _count - index); 1400Array.Copy(_entries, index + 1, _entries, index, numToCopy); 1566Array.Copy(_sourceArray, start, _targetArray, _validItemCount, size);
System\Windows\Markup\ArrayExtension.cs (2)
17[MarkupExtensionReturnType(typeof(Array))] 41public ArrayExtension(Array elements)
System\Windows\Markup\ValueSerializer.cs (1)
95return Array.Empty<Type>();
System\Xaml\Parser\NodeStreamSorter.cs (3)
690Array.Copy(_sortingInfoArray, beginning, temp, 0, length1); 694Array.Copy(_sortingInfoArray, middle, _sortingInfoArray, beginning, length2); 698Array.Copy(temp, 0, _sortingInfoArray, beginning + length2, length1);
System\Xaml\Replacements\TypeListConverter.cs (1)
41public static string[] SplitTypeList(string typeList) => Array.Empty<string>();
System\Xaml\Runtime\ClrObjectRuntime.cs (1)
129Array.Copy(members, methods, members.Length);
System\Xaml\Schema\XamlMemberInvoker.cs (1)
66return UnderlyingGetter.Invoke(instance, Array.Empty<object>());
System\Xaml\Schema\XamlTypeInvoker.cs (1)
225return (IEnumerator)getEnumMethod.Invoke(instance, Array.Empty<object>());
System\Xaml\XamlObjectReader.cs (3)
1231methodParams = Array.Empty<ParameterInfo>(); 1802private static ObjectMarkupInfo ForArray(Array value, SerializerContext context) 1930if (value is Array valueAsArray)
System.Xaml.Tests (94)
System\Windows\Markup\ArrayExtensionTests.cs (4)
41yield return new object[] { Array.Empty<object>(), typeof(object) }; 43yield return new object[] { Array.Empty<int>(), typeof(int) }; 52public void Ctor_Array(Array elements, Type expectedType) 64Assert.Throws<ArgumentNullException>("elements", () => new ArrayExtension((Array)null!));
System\Xaml\Replacements\TypeListConverterTests.cs (2)
73Assert.Throws<NotSupportedException>(() => converter.ConvertTo(Array.Empty<Type>(), destinationType)); 81Assert.Throws<ArgumentNullException>("destinationType", () => converter.ConvertTo(Array.Empty<Type>(), null!));
System\Xaml\Schema\XamlTypeInvokerTests.cs (20)
157Assert.Equal(1, Assert.IsType<PublicClass>(invoker.CreateInstance(Array.Empty<object>())).Value); 172Assert.Equal(1, Assert.IsType<PrivateClass>(invoker.CreateInstance(Array.Empty<object>())).Value); 180Assert.Equal(0, invoker.CreateInstance(Array.Empty<object>())); 188Assert.Throws<NotSupportedException>(() => invoker.CreateInstance(Array.Empty<object>())); 196Assert.Throws<MissingMethodException>(() => invoker.CreateInstance(Array.Empty<object>())); 249new XamlTypeInvoker(new XamlType(typeof(List<Array>), new XamlSchemaContext())), 251typeof(ICollection<Array>).GetMethod(nameof(ICollection<Array>.Add)) 255new XamlTypeInvoker(new XamlType(typeof(List<Array>), new XamlSchemaContext())), 312new XamlType(typeof(Array), new XamlSchemaContext()), 322new XamlType(typeof(Array), new XamlSchemaContext()), 323type.GetMethod(nameof(ClassWithAllowedContentTypes.Add), new Type[] { typeof(Array) }) 329type.GetMethod(nameof(ClassWithAllowedContentTypes.Add), new Type[] { typeof(Array) }) 338new XamlType(typeof(Array), new XamlSchemaContext()), 343type.GetMethod(nameof(ClassWithAllowedContentTypes.Add), new Type[] { typeof(Array) }) 352new XamlType(typeof(Array), new XamlSchemaContext()), 366new XamlType(typeof(Array), new XamlSchemaContext()), 398public void Add(Array i) { } 408public void Add(Array i) { } 421public Array? Name { get; set; }
System\Xaml\Schema\XamlTypeNameTests.cs (13)
38yield return new object?[] { "", "", Array.Empty<XamlTypeName>() }; 49Assert.Equal(typeArguments ?? Array.Empty<XamlTypeName>(), typeName.TypeArguments); 87yield return new object?[] { new XamlTypeName("namespace", "name[value]", Array.Empty<XamlTypeName>()), null, "{namespace}name[value]" }; 197yield return new object[] { Array.Empty<XamlTypeName>(), "" }; 231Assert.Throws<ArgumentNullException>("prefixLookup", () => XamlTypeName.ToString(Array.Empty<XamlTypeName>(), null)); 236yield return new object[] { "name", "", "name", Array.Empty<XamlTypeName>() }; 237yield return new object[] { " name ", "", "name", Array.Empty<XamlTypeName>() }; 238yield return new object[] { "_name", "", "_name", Array.Empty<XamlTypeName>() }; 239yield return new object[] { "prefix:name", "prefix", "name", Array.Empty<XamlTypeName>() }; 240yield return new object[] { " prefix : name ", "prefix", "name", Array.Empty<XamlTypeName>() }; 241yield return new object[] { "_aA.1e\u0300\u0903:_bB1ee\u0300\u0903", "_aA.1e\u0300\u0903", "_bB1ee\u0300\u0903", Array.Empty<XamlTypeName>() }; 247yield return new object[] { "name[, ,]", "", "name[, ,]", Array.Empty<XamlTypeName>() }; 248yield return new object[] { "name[][]", "", "name[][]", Array.Empty<XamlTypeName>() };
System\Xaml\XamlBackgroundReaderTests.cs (1)
252nextMethod.Invoke(reader, Array.Empty<object>());
System\Xaml\XamlDirectiveTests.cs (5)
22yield return new object?[] { Array.Empty<string>(), "name", null, AllowedMemberLocations.None - 1 }; 106yield return new object?[] { directive, new XamlDirective(Array.Empty<string>(), "name", type1, null, AllowedMemberLocations.Any), false }; 150yield return new object[] { new XamlDirective(Array.Empty<string>(), "name", type, null, AllowedMemberLocations.Any), "name" }; 250var converter = new SubXamlDirective(Array.Empty<string>(), "name", type, typeConverter, AllowedMemberLocations.Any); 258var converter = new SubXamlDirective(Array.Empty<string>(), "name", type, null!, AllowedMemberLocations.Any);
System\Xaml\XamlMemberTests.cs (8)
376var member = new CustomXamlMember(typeof(DataClass).GetProperty(nameof(DataClass.Property))!, new XamlSchemaContext()) { GetXamlNamespacesResult = Array.Empty<string>() }; 418GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 593GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 625Assert.Equal(expected ?? Array.Empty<XamlMember>(), member.DependsOn); 1304GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 1438GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 1708GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 2059GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>()
System\Xaml\XamlSchemaContextTests.cs (2)
53yield return new object?[] { Array.Empty<Assembly>() }; 82yield return new object?[] { null, Array.Empty<Assembly>(), false, false };
System\Xaml\XamlTypeTests.cs (39)
26yield return new object?[] { "unknownTypeNamespace", "unknownTypeName", Array.Empty<XamlType>(), new XamlSchemaContext() }; 46Assert.Throws<ArgumentNullException>("unknownTypeNamespace", () => new XamlType(null, "unknownTypeName", Array.Empty<XamlType>(), new XamlSchemaContext())); 52Assert.Throws<ArgumentNullException>("unknownTypeName", () => new XamlType("unknownTypeNamespace", null, Array.Empty<XamlType>(), new XamlSchemaContext())); 76Assert.Throws<ArgumentNullException>("typeName", () => new SubXamlType(null!, Array.Empty<XamlType>(), new XamlSchemaContext())); 145Assert.Throws<ArgumentNullException>("schemaContext", () => new XamlType("unknownTypeNamespace", "unknownTypeName", Array.Empty<XamlType>(), null)); 148Assert.Throws<ArgumentNullException>("schemaContext", () => new SubXamlType("typeName", Array.Empty<XamlType>(), null)); 190var type = new CustomXamlType(typeof(int), new XamlSchemaContext()) { GetXamlNamespacesResult = Array.Empty<string>() }; 567GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 726yield return new object?[] { new SubXamlType("namespace", "name", null, new XamlSchemaContext()), Array.Empty<XamlMember>() }; 727yield return new object?[] { new SubXamlType("name", null, new XamlSchemaContext()), Array.Empty<XamlMember>() }; 728yield return new object?[] { new SubXamlType(typeof(EmptyClass), new XamlSchemaContext()), Array.Empty<XamlMember>() }; 729yield return new object?[] { new SubXamlType(typeof(object), new XamlSchemaContext()), Array.Empty<XamlMember>() }; 925AssertEqualXamlMembers(expectedGet ?? expectedLookup ?? Array.Empty<XamlMember>(), type.GetAllAttachableMembers()); 941return (MethodInfo)underlyingGetter.Invoke(member, Array.Empty<object>())!; 947return (MethodInfo)underlyingSetter.Invoke(member, Array.Empty<object>())!; 1153yield return new object?[] { new SubXamlType("namespace", "name", null, new XamlSchemaContext()), Array.Empty<XamlMember>() }; 1154yield return new object?[] { new SubXamlType("name", null, new XamlSchemaContext()), Array.Empty<XamlMember>() }; 1155yield return new object?[] { new SubXamlType(typeof(int), new XamlSchemaContext()), Array.Empty<XamlMember>() }; 1156yield return new object?[] { new SubXamlType(typeof(object), new XamlSchemaContext()), Array.Empty<XamlMember>() }; 1194Array.Empty<XamlMember>() 1240IEnumerable<XamlMember> expectedGetAllMembers = expectedGet ?? expectedLookup ?? Array.Empty<XamlMember>(); 1297public Array? Property { get; set; } 1370GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 1430Assert.Equal((type.IsCollection || type.IsDictionary) ? expected ?? Array.Empty<XamlType>() : null, type.AllowedContentTypes); 1965GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 2164GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 2218Assert.Equal(type.IsCollection ? expected ?? Array.Empty<XamlType>() : expected, type.ContentWrappers); 2351GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 3209public void CopyTo(Array array, int index) => throw new NotImplementedException(); 3277public void CopyTo(Array array, int index) => throw new NotImplementedException(); 3314GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 3690yield return new object?[] { new SubXamlType(typeof(ArrayExtension), new XamlSchemaContext(duplicateSupport)), 0, Array.Empty<XamlType>() }; 3748GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 3947GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 4245GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 4480GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 4653GetCustomAttributesAction = (attributeType, inherit) => Array.Empty<object>() 4904foreach (byte[]? keyToken in new object?[] { null, Array.Empty<byte>(), new byte[] { 183, 122, 92, 86, 25, 52, 224, 138 } }) 4946foreach (byte[]? keyToken in new object?[] { null, Array.Empty<byte>(), new byte[] { 183, 122, 92, 86, 25, 52, 224, 137 } })
Templates.Blazor.Tests (8)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
Templates.Blazor.WebAssembly.Auth.Tests (10)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\E2ETesting\WebDriverExtensions.cs (2)
20return Array.Empty<LogEntry>(); 29return Array.Empty<LogEntry>();
Templates.Blazor.WebAssembly.Tests (10)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\E2ETesting\WebDriverExtensions.cs (2)
20return Array.Empty<LogEntry>(); 29return Array.Empty<LogEntry>();
Templates.Mvc.Tests (10)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\E2ETesting\WebDriverExtensions.cs (2)
20return Array.Empty<LogEntry>(); 29return Array.Empty<LogEntry>();
Templates.Tests (10)
src\Shared\CertificateGeneration\CertificateManager.cs (6)
596Array.Clear(keyBytes, 0, keyBytes.Length); 597Array.Clear(pem, 0, pem.Length); 603Array.Clear(keyBytes, 0, keyBytes.Length); 604Array.Clear(pem, 0, pem.Length); 654Array.Clear(bytes, 0, bytes.Length); 682Array.Clear(pemEnvelope, 0, pemEnvelope.Length);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
171Array.Clear(export, 0, export.Length);
src\Shared\CertificateGeneration\WindowsCertificateManager.cs (1)
61Array.Clear(export, 0, export.Length);
src\Shared\E2ETesting\WebDriverExtensions.cs (2)
20return Array.Empty<LogEntry>(); 29return Array.Empty<LogEntry>();
Test.Utilities (68)
CodeMetricsTestsBase.cs (1)
83Assert.Collection(diagnostics, Array.Empty<Action<Diagnostic>>());
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (12)
19/// <seealso cref="Array.Clear(Array)"/> 24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
Text.Analyzers (73)
src\Compilers\Core\Portable\Collections\BitVector.cs (3)
23private static Word[] s_emptyArray => Array.Empty<Word>(); 100if (requiredWords > _bits.Length) Array.Resize(ref _bits, requiredWords); 385if (_bits != null) Array.Clear(_bits, 0, _bits.Length);
src\Compilers\Core\Portable\EncodedStringText.cs (3)
183bytes = new ArraySegment<byte>(Array.Empty<byte>()); 202bytes = new ArraySegment<byte>(Array.Empty<byte>()); 223: new ArraySegment<byte>(Array.Empty<byte>());
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (8)
25Array.Copy(array, start, newArray, 0, length); 34Array.Copy(array, newArray, position); 39Array.Copy(array, position, newArray, position + 1, array.Length - position); 56Array.Copy(array, newArray, position); 61Array.Copy(array, position, newArray, position + items.Length, array.Length - position); 88Array.Copy(array, newArray, position); 93Array.Copy(array, position + length, newArray, position, newArray.Length - position); 102Array.Copy(array, newArray, array.Length);
src\Compilers\Core\Portable\InternalUtilities\EnumUtilties.cs (1)
35return Array.IndexOf(GetValues<T>(), value) >= 0;
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (2)
64return Array.Empty<byte>(); 69Array.Resize(ref buffer, actualLength);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (2)
73Array.Copy(ImmutableCollectionsMarshal.AsArray(values)!, 0, _values, _index, values.Length); 112Array.Sort(_values, 0, _index, comparer);
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
1006Array.Resize(ref array, arraySize); 1026Array.Resize(ref array, i);
src\Dependencies\Collections\Internal\ICollectionCalls.cs (1)
27public static void CopyTo<TCollection>(ref TCollection collection, Array array, int index)
src\Dependencies\Collections\Internal\IDictionaryCalls.cs (1)
47public static void CopyTo<TDictionary>(ref TDictionary dictionary, Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
347void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder.cs (1)
146void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
54void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+KeyCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueBuilder.cs (1)
257readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+ValueCollection.cs (1)
47void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1.cs (1)
349void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (1)
687void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (1)
247void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (1)
356readonly void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (10)
24/// <seealso cref="Array.Clear(Array, int, int)"/> 33/// <seealso cref="Array.Copy(Array, Array, int)"/> 52public static void Copy<T>(SegmentedArray<T> sourceArray, Array destinationArray, int length) 74Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: copied, length: segment.Count); 138public static void Copy<T>(SegmentedArray<T> sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length) 169Array.Copy(segment.Array!, sourceIndex: segment.Offset, destinationArray: destinationArray, destinationIndex: destinationIndex + copied, length: segment.Count); 239index = Array.IndexOf(segment.Array!, value, segment.Offset, segment.Count);
src\Dependencies\Collections\Segmented\SegmentedArray`1.cs (2)
77_items = Array.Empty<T[]>(); 155public void CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (6)
680Array.Resize(ref segments, newSegmentCount); 685Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 689Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 875void ICollection.CopyTo(Array array, int index) 1370void ICollection.CopyTo(Array array, int index) 1578void ICollection.CopyTo(Array array, int index)
src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (3)
934Array.Resize(ref segments, newSegmentCount); 939Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<Entry>()); 943Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize);
src\Dependencies\Collections\Segmented\SegmentedList`1.cs (5)
166Array.Resize(ref segments, newSegmentCount); 171Array.Resize(ref segments[i], SegmentedArrayHelper.GetSegmentSize<T>()); 175Array.Resize(ref segments[newSegmentCount - 1], lastSegmentSize); 454void ICollection.CopyTo(Array array, int arrayIndex) 1276return Array.Empty<T>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (1)
490Array.Clear(characterToLastSeenIndex_inSource, 0, LastSeenIndexLength);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (4)
197Array.Copy(chunk, currentOffset, buffer, index, copyCount); 315Array.Clear(chunk, 0, chunk.Length); 338Array.Clear(chunks[chunkIndex], chunkOffset, chunks[chunkIndex].Length - chunkOffset); 384Array.Copy(buffer, currentIndex, chunk, currentOffset, writeCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SpecializedTasks.cs (1)
58return ValueTask.FromResult(Array.Empty<T>());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
88=> compilation.GetTypeByMetadataName(typeof(Array).FullName!);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
340var result = Array.BinarySearch([.. declarationList], declaration, comparerWithoutNameCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\SyntaxAnnotationExtensions.cs (2)
31Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); 32Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ArrayExtensions.cs (1)
16=> Array.IndexOf(array, item) >= 0;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (2)
444if (property.Name is nameof(Array.Length) or nameof(Array.LongLength))
Text.Analyzers.UnitTests (1)
IdentifiersShouldBeSpelledCorrectlyTests.cs (1)
711=> VerifyCSharpAsync(source, Array.Empty<(string Path, string Text)>(), expected);
TlsFeaturesObserve (1)
Program.cs (1)
35var success = httpSysPropFeature.TryGetTlsClientHello(Array.Empty<byte>(), out var bytesReturned);
UIAutomationClient (23)
MS\Internal\Automation\Misc.cs (12)
69internal static Array CombineArrays(IEnumerable arrays, Type t) 73foreach (Array a in arrays) 78Array combined = Array.CreateInstance(t, totalLength); 81foreach (Array a in arrays) 85Array.Copy(a, 0, combined, pos, l); 94internal static Array RemoveDuplicates(Array a, Type t) 99Array.Sort(a); 124Array a2 = Array.CreateInstance(t, newLength); 126Array.Copy(a, 0, a2, 0, newLength);
MS\Internal\Automation\Schema.cs (6)
341new AutomationPropertyInfo( convertToElementArray, SelectionPattern.SelectionProperty, typeof(AutomationElement[]), Array.Empty<AutomationElement>()), 354new AutomationPropertyInfo( null, MultipleViewPattern.SupportedViewsProperty, typeof(int []), Array.Empty<int>() ), 363new AutomationPropertyInfo( convertToElementArray, TablePattern.RowHeadersProperty, typeof(AutomationElement[]), Array.Empty<AutomationElement>()), 364new AutomationPropertyInfo( convertToElementArray, TablePattern.ColumnHeadersProperty, typeof(AutomationElement[]), Array.Empty<AutomationElement>()), 366new AutomationPropertyInfo( convertToElementArray, TableItemPattern.RowHeaderItemsProperty, typeof(AutomationElement[]), Array.Empty<AutomationElement>()), 367new AutomationPropertyInfo( convertToElementArray, TableItemPattern.ColumnHeaderItemsProperty, typeof(AutomationElement[]), Array.Empty<AutomationElement>()),
MS\Internal\Automation\UiaCoreApi.cs (3)
452return Array.Empty<UiaCacheResponse>(); // Return empty cacheresponse, not null. 871return Array.Empty<SafeTextRangeHandle>(); 887return Array.Empty<SafeTextRangeHandle>();
System\Windows\Automation\AutomationElementCollection.cs (1)
70public virtual void CopyTo( Array array, int index )
System\Windows\Automation\CacheRequest.cs (1)
409_defaultUiaCacheRequest = new UiaCoreApi.UiaCacheRequest(Automation.ControlViewCondition, TreeScope.Element, new AutomationProperty[] { AutomationElement.RuntimeIdProperty }, Array.Empty<AutomationPattern>(), AutomationElementMode.Full);
UIAutomationClientSideProviders (17)
MS\Internal\AutomationProxies\MSAANativeProvider.cs (2)
572return Array.Empty<IRawElementProviderSimple>(); 836rval = (Array.IndexOf(entry._patterns, pattern)>=0);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (3)
229return Array.Empty<double>(); 243return Array.Empty<double>(); 529return Array.Empty<IRawElementProviderSimple>();
MS\Internal\AutomationProxies\WindowsListView.cs (2)
244int location = Array.IndexOf (groupIds, groupID); 285int location = Array.IndexOf (groupIds, groupID);
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (2)
447Array.Sort(group.Items, 0, group.Count, new SortGroupItems(hwnd)); 806Array.Copy(temp, _items, temp.Length);
MS\Internal\AutomationProxies\WindowsRichEdit.cs (2)
241return Array.Empty<ITextRangeProvider>(); 251return Array.Empty<ITextRangeProvider>();
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (6)
164return Array.Empty<double>(); 375return Array.Empty<IRawElementProviderSimple>(); 396Array a1 = v1 as Array; 397Array a2 = v2 as Array;
UIAutomationTypes (10)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\HandleCollector.cs (1)
45Array.Copy(handleTypes, 0, newTypes, 0, handleTypeCount);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (1)
2369Array.Copy(bytes, 0, buffer, offset, count);
System\Windows\Automation\ControlType.cs (8)
65return ControlType.Register(id, programmaticName, stId, Array.Empty<AutomationProperty>(), Array.Empty<AutomationPattern>(), requiredPatternsSets); 72return ControlType.Register(id, programmaticName, stId, requiredProperties, Array.Empty<AutomationPattern>(), Array.Empty<AutomationPattern[]>()); 78return ControlType.Register(id, programmaticName, stId, Array.Empty<AutomationProperty>(), Array.Empty<AutomationPattern>(), Array.Empty<AutomationPattern[]>()); 234public static readonly ControlType Document = ControlType.Register(AutomationIdentifierConstants.ControlTypes.Document, "ControlType.Document", nameof(SR.LocalizedControlTypeDocument), Array.Empty<AutomationProperty>(),
vbc (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
341var buffer = Array.Empty<byte>();
VBCSCompiler (1)
src\Compilers\Shared\BuildServerConnection.cs (1)
341var buffer = Array.Empty<byte>();
VBCSCompiler.UnitTests (4)
CompilerServerApiTest.cs (1)
115var request = BuildRequest.Create(RequestLanguage.CSharpCompile, workingDirectory: temp.CreateDirectory().Path, tempDirectory: null, compilerHash: BuildProtocolConstants.GetCommitHash(), libDirectory: null, args: Array.Empty<string>());
ServerUtil.cs (2)
43Array.Empty<string>(), 50Array.Empty<string>(),
VBCSCompilerServerTests.cs (1)
393return new AnalyzerInconsistencyBuildResponse(new ReadOnlyCollection<string>(Array.Empty<string>()));
WindowsBase.Tests (8)
System\IO\Packaging\PackageDigitalSignatureManagerTests.cs (2)
225Assert.Throws<InvalidOperationException>(() => manager.Countersign(c, Array.Empty<Uri>())); 234Assert.Throws<ArgumentNullException>("certificate", () => manager.Countersign(null, Array.Empty<Uri>()));
System\Windows\Media\MatrixTests.cs (4)
4686yield return new object[] { new Matrix(2, 3, 4, 5, 6, 7), Array.Empty<Point>(), Array.Empty<Point>() }; 4779yield return new object[] { new Matrix(2, 3, 4, 5, 6, 7), Array.Empty<Vector>(), Array.Empty<Vector>() };
System\Windows\NameScopeTests.cs (1)
542var array = Array.Empty<KeyValuePair<string, object>>();
System\Windows\Threading\DispatcherTests.cs (1)
129DispatcherOperation operation = dispatcher.BeginInvoke(action, Array.Empty<object>());
WinFormsControlsTest (2)
FormOwnerTestForm.cs (1)
62Array.Clear(_array, 0, _array.Length);
MainForm.cs (1)
23Array mainFormControlsTabOrderItems = Enum.GetValues(typeof(MainFormControlsTabOrder));
xunit.assert (5)
Sdk\ArgumentFormatter.cs (1)
643 collection is Array ||
Sdk\CollectionTracker.cs (4)
137 var expectedArray = x.InnerEnumerable as Array; 138 var actualArray = y.InnerEnumerable as Array;