104 references to CollectionsMarshal
aspire (1)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
Aspire.Dashboard (11)
Components\Controls\Chart\ChartContainer.razor.cs (1)
179DimensionFilters = ImmutableList.Create(CollectionsMarshal.AsSpan(CreateUpdatedFilters(hasInstrumentChanged)));
Components\Pages\TraceDetail.razor.cs (1)
341ref var trace = ref CollectionsMarshal.GetValueRefOrAddDefault(traceCache, traceId, out _);
Otlp\Model\OtlpApplication.cs (1)
74ref var instrumentRef = ref CollectionsMarshal.GetValueRefOrAddDefault(_instruments, instrumentKey, out _);
Otlp\Model\OtlpHelpers.cs (1)
456ref var scopeRef = ref CollectionsMarshal.GetValueRefOrAddDefault(scopes, name, out _);
Otlp\Model\OtlpInstrument.cs (1)
80ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(KnownAttributeValues, key, out _);
Otlp\Storage\TelemetryRepository.cs (5)
375ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(_applicationUnviewedErrorLogs, applicationView.ApplicationKey, out _); 720ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(attributesValues, values.Value1, out _); 726ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(attributesValues, values.Value2, out _); 754ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(attributesValues, value, out _); 1285ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(allKnownAttributes, knownAttributeValues.Key, out _);
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
Aspire.Hosting (1)
src\Shared\CircularBuffer.cs (1)
94var data = CollectionsMarshal.AsSpan(_buffer);
GenerateDocumentationAndConfigFiles (1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
Microsoft.AspNetCore.Components (2)
Reflection\MemberAssignment.cs (1)
74foreach (var other in CollectionsMarshal.AsSpan(many))
Routing\QueryParameterValueSupplier.cs (1)
25ref var values = ref CollectionsMarshal.GetValueRefOrAddDefault(_queryParameterValuesByName, decodedName, out _);
Microsoft.AspNetCore.Components.Forms (1)
EditContextDataAnnotationsExtensions.cs (1)
114foreach (var result in CollectionsMarshal.AsSpan(results))
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
159Cookies.Append(CollectionsMarshal.AsSpan(nonSuppressedValues), options);
Microsoft.AspNetCore.Http.Extensions (1)
src\Shared\PropertyAsParameterInfo.cs (1)
137return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\Shared\PropertyAsParameterInfo.cs (1)
137return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.OpenApi (1)
src\Shared\PropertyAsParameterInfo.cs (1)
137return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperRunner.cs (1)
26var tagHelpers = CollectionsMarshal.AsSpan(executionContext.TagHelperList);
Microsoft.AspNetCore.Routing (1)
Matching\HttpMethodMatcherPolicy.cs (1)
398var methods = CollectionsMarshal.AsSpan(httpMethods);
Microsoft.CodeAnalysis (1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
Microsoft.CodeAnalysis.Workspaces (1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
PresentationFramework (3)
Microsoft\Win32\FileDialog.cs (1)
741return CollectionsMarshal.AsSpan(extensions);
MS\Internal\Globalization\BamlResourceContent.cs (1)
254return CollectionsMarshal.AsSpan(tokens);
MS\Internal\Ink\LassoSelectionBehavior.cs (1)
447return CollectionsMarshal.AsSpan(pointArray);
Shared (1)
JsonSchemaExporter\JsonSchemaExporter.cs (1)
522ref string[]? pathToSchema = ref CollectionsMarshal.GetValueRefOrAddDefault(_generated, key, out bool exists);
System.Linq (28)
System\Linq\AggregateBy.cs (2)
126ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists); 158ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);
System\Linq\CountBy.cs (1)
63ref int currentCount = ref CollectionsMarshal.GetValueRefOrAddDefault(countsBy, key, out _);
System\Linq\Enumerable.cs (3)
38CollectionsMarshal.SetCount(list, count); 39return CollectionsMarshal.AsSpan(list); 60span = CollectionsMarshal.AsSpan(Unsafe.As<List<TSource>>(source));
System\Linq\OrderedEnumerable.SpeedOpt.cs (1)
376Sort(CollectionsMarshal.AsSpan(list), _descending);
System\Linq\SegmentedArrayBuilder.cs (2)
265CollectionsMarshal.SetCount(result, count); 266ToSpanInlined(CollectionsMarshal.AsSpan(result));
System\Linq\Select.SpeedOpt.cs (2)
398ReadOnlySpan<TSource> source = CollectionsMarshal.AsSpan(_source); 412ReadOnlySpan<TSource> source = CollectionsMarshal.AsSpan(_source);
System\Linq\Shuffle.SpeedOpt.cs (2)
24Random.Shared.Shuffle(CollectionsMarshal.AsSpan(list)); 279Random.Shared.Shuffle(CollectionsMarshal.AsSpan(reservoir));
System\Linq\ToCollection.cs (2)
165ReadOnlySpan<TSource> span = CollectionsMarshal.AsSpan(list); 223ReadOnlySpan<TSource> span = CollectionsMarshal.AsSpan(list);
System\Linq\Where.SpeedOpt.cs (13)
316public override int GetCount(bool onlyIfCheap) => ArrayWhereIterator<TSource>.GetCount(onlyIfCheap, CollectionsMarshal.AsSpan(_source), _predicate); 318public override TSource[] ToArray() => ArrayWhereIterator<TSource>.ToArray(CollectionsMarshal.AsSpan(_source), _predicate); 320public override List<TSource> ToList() => ArrayWhereIterator<TSource>.ToList(CollectionsMarshal.AsSpan(_source), _predicate); 326foreach (TSource item in CollectionsMarshal.AsSpan(_source)) 341ReadOnlySpan<TSource> source = CollectionsMarshal.AsSpan(_source); 363foreach (TSource item in CollectionsMarshal.AsSpan(_source)) 548public override int GetCount(bool onlyIfCheap) => ArrayWhereSelectIterator<TSource, TResult>.GetCount(onlyIfCheap, CollectionsMarshal.AsSpan(_source), _predicate, _selector); 550public override TResult[] ToArray() => ArrayWhereSelectIterator<TSource, TResult>.ToArray(CollectionsMarshal.AsSpan(_source), _predicate, _selector); 552public override List<TResult> ToList() => ArrayWhereSelectIterator<TSource, TResult>.ToList(CollectionsMarshal.AsSpan(_source), _predicate, _selector); 554public override TResult? TryGetElementAt(int index, out bool found) => ArrayWhereSelectIterator<TSource, TResult>.TryGetElementAt(CollectionsMarshal.AsSpan(_source), _predicate, _selector, index, out found); 556public override TResult? TryGetFirst(out bool found) => ArrayWhereSelectIterator<TSource, TResult>.TryGetFirst(CollectionsMarshal.AsSpan(_source), _predicate, _selector, out found); 558public override TResult? TryGetLast(out bool found) => ArrayWhereSelectIterator<TSource, TResult>.TryGetLast(CollectionsMarshal.AsSpan(_source), _predicate, _selector, out found); 560public override bool Contains(TResult value) => ArrayWhereSelectIterator<TSource, TResult>.Contains(CollectionsMarshal.AsSpan(_source), _predicate, _selector, value);
System.Linq.AsyncEnumerable (4)
System\Linq\AggregateBy.cs (2)
72ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists); 210ref TAccumulate? acc = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);
System\Linq\CountBy.cs (2)
49ref int currentCount = ref CollectionsMarshal.GetValueRefOrAddDefault(countsBy, key, out _); 100ref int currentCount = ref CollectionsMarshal.GetValueRefOrAddDefault(countsBy, key, out _);
System.Private.CoreLib (24)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (4)
164span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable); 958/// <inheritdoc cref="CollectionsMarshal.GetValueRefOrAddDefault{TKey, TValue}(Dictionary{TKey, TValue}, TKey, out bool)"/> 1063/// A helper class containing APIs exposed through <see cref="CollectionsMarshal"/> or <see cref="CollectionExtensions"/>. 1069/// <inheritdoc cref="CollectionsMarshal.GetValueRefOrAddDefault{TKey, TValue}(Dictionary{TKey, TValue}, TKey, out bool)"/>
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (10)
789ref EventMetadata eventMetadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, metaKey); 1376ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 1981ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 2135ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventCallbackArgs.EventId); 2769ref EventMetadata eventMeta = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventID); 2823ref EventMetadata eventMeta = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData, eventId); 3164ref EventMetadata newEventMetadata = ref CollectionsMarshal.GetValueRefOrAddDefault(eventData, 0, out _); 3332ref EventMetadata startEventMetadata = ref CollectionsMarshal.GetValueRefOrNullRef(eventData, startEventId); 3512ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrAddDefault(eventData, eventAttribute.EventId, out _); 4770private ref EventSource.EventMetadata Metadata => ref CollectionsMarshal.GetValueRefOrNullRef(EventSource.m_eventData!, EventId);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.cs (1)
54ref EventMetadata metadata = ref CollectionsMarshal.GetValueRefOrNullRef(m_eventData!, (int)eventID);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (1)
1300ref GCHandle rcwEntry = ref CollectionsMarshal.GetValueRefOrAddDefault(_cache, comPointer, out bool exists);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (2)
789return JoinCore(separator.AsSpan(), CollectionsMarshal.AsSpan(valuesList)); 927return JoinCore(separator, CollectionsMarshal.AsSpan(Unsafe.As<List<string?>>(values)));
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (5)
3507Span<object?> continuations = CollectionsMarshal.AsSpan(list); 4940tasks is List<Task> list ? CollectionsMarshal.AsSpan(list) : 4942CollectionsMarshal.AsSpan(new List<Task>(tasks)); 5946return WhenAll(CollectionsMarshal.AsSpan(taskList)); 6725return WhenAnyCore((ReadOnlySpan<TTask>)CollectionsMarshal.AsSpan(Unsafe.As<List<TTask>>(tasks)));
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (1)
574ReadOnlySpan<TypeName> GetGenericArguments() => CollectionsMarshal.AsSpan(_genericArguments);
System.Private.Windows.Core (1)
System\IO\BinaryReaderExtensions.cs (1)
242span = CollectionsMarshal.AsSpan(list);
System.Reflection.Metadata (1)
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
30ref var entry = ref CollectionsMarshal.GetValueRefOrAddDefault(_dictionary, dictionaryKey, out exists);
System.Runtime.InteropServices (1)
artifacts\obj\System.Runtime.InteropServices\Debug\net10.0\System.Runtime.InteropServices.Forwards.cs (1)
17[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.CollectionsMarshal))]
System.Text.Json (4)
src\libraries\System.Text.Json\Common\JsonHelpers.cs (1)
73Span<T> span = CollectionsMarshal.AsSpan(items);
System\Text\Json\Document\JsonElement.cs (2)
1372ref ValueQueue<JsonElement> values = ref CollectionsMarshal.GetValueRefOrAddDefault(properties2, prop2.Name, out bool _); 1387ref ValueQueue<JsonElement> values = ref CollectionsMarshal.GetValueRefOrAddDefault(properties2, prop.Name, out bool exists);
System\Text\Json\Schema\JsonSchemaExporter.cs (1)
443ref string[]? pathToSchema = ref CollectionsMarshal.GetValueRefOrAddDefault(_generated, key, out bool exists);
System.Text.RegularExpressions (10)
System\Text\RegularExpressions\RegexWriter.cs (1)
181ref int i = ref CollectionsMarshal.GetValueRefOrAddDefault(_stringTable, str, out bool exists);
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (1)
390ref BDD? bdd = ref CollectionsMarshal.GetValueRefOrAddDefault(_bddCache, (ordinal, one, zero), out _);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (3)
339ref BDD? result = ref CollectionsMarshal.GetValueRefOrAddDefault(_setBddCache, set, out _); 461(negate ? charSetSolver.And(CollectionsMarshal.AsSpan(conditions)) : charSetSolver.Or(CollectionsMarshal.AsSpan(conditions)));
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (1)
263ref SymbolicRegexNode<TSet>? result = ref CollectionsMarshal.GetValueRefOrAddDefault(_singletonCache, set, out _);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (4)
1314foreach (ref KeyValuePair<int, int> nfaState in CollectionsMarshal.AsSpan(state.NfaState!.NfaStateSet.Values)) 1328foreach (ref KeyValuePair<int, int> nfaState in CollectionsMarshal.AsSpan(state.NfaState!.NfaStateSet.Values)) 1373foreach (ref KeyValuePair<int, int> sourceState in CollectionsMarshal.AsSpan(sourceStates.Values)) 1427foreach (ref KeyValuePair<int, int> nfaState in CollectionsMarshal.AsSpan(state.NfaState!.NfaStateSet.Values))
Test.Utilities (1)
src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (1)
202span = CollectionsMarshal.AsSpan((List<KeyValuePair<TKey, TValue>>)enumerable);
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\ProxyHwnd.cs (1)
523return CollectionsMarshal.AsSpan(automationEvents);