410 references to AsSpan
aspire (3)
Certificates\CertificateGeneration\MacOSCertificateManager.cs (1)
347RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Commands\DescribeCommand.cs (1)
459Endpoints.AsSpan().SequenceEqual(other.Endpoints);
Utils\ReparsePoint.cs (1)
438var span = buffer.AsSpan();
Aspire.Dashboard (2)
Components\Controls\Chart\MetricInstrumentDataCache.cs (1)
97=> left.AsSpan().SequenceEqual(right);
Otlp\Model\OtlpHelpers.cs (1)
321parentAttributes.AsSpan().CopyTo(copiedAttributes);
Aspire.Dashboard.Tests (2)
Integration\Playwright\NativeAotDashboardTests.cs (1)
35dashboardBytes.AsSpan().IndexOf("Aspire.Dashboard.Resources.Columns.resources"u8) >= 0,
Integration\Playwright\TerminalTests.cs (1)
256return !before.AsSpan().SequenceEqual(after);
Aspire.Hosting (1)
Dcp\DcpLogParser.cs (1)
150var result = TryParseDcpLog(bytes.AsSpan(), out message, out logLevel, out _, out timestamp);
Aspire.Hosting.Tests (13)
Dcp\DcpLogParserTests.cs (13)
21var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category); 36var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category, out var timestamp); 51var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out _, out _, out _, out var timestamp); 65var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category); 82var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category); 99var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category); 116var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category); 133var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out _); 149var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out _); 165var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out _, out _, out _); 179var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out _, out _, out _); 238var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category); 260var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
cdac-build-tool (2)
ObjectFileScraper.cs (2)
460state.ReadBytes(endMagic.AsSpan()); 644state.ReadBytes(namesPool.AsSpan());
crossgen2 (1)
Program.cs (1)
966if (blob.AsSpan().SequenceEqual(s_ecmaKey))
dotnet-aot (1)
parent\dotnet\Commands\Test\MTP\IPC\ProtocolMessageSerializer.cs (1)
19int payloadLength = BitConverter.ToInt32(frame.AsSpan());
dotnet-dev-certs (1)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
335RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
GenerateDocumentationAndConfigFiles (4)
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
ILCompiler.Compiler (6)
Compiler\ReachabilityInstrumentationFilter.cs (1)
47if (reader.Read(MemoryMarshal.Cast<bool, byte>(tokenStates.AsSpan())) != numTokens)
Compiler\ReachabilityInstrumentationProvider.cs (1)
114BinaryPrimitives.WriteInt32LittleEndian(newBytes.AsSpan()[2..6], MetadataTokens.GetToken(MetadataTokens.FieldDefinitionHandle(0)));
parent\parent\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmEmitter.cs (1)
24FunctionBody.EncodeRelocations(relocs.AsSpan());
parent\parent\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (1)
222foreach (CorInfoWasmType paramType in types.AsSpan().Slice(1))
parent\parent\Common\Compiler\ObjectWriter\SectionData.cs (1)
32_padding.AsSpan().Fill(paddingByte);
parent\parent\Common\Compiler\ObjectWriter\WasmInstructions.cs (1)
65int pos = DwarfHelper.WriteULEB128(_locals.AsSpan(), localChunks);
ILCompiler.ReadyToRun (7)
Compiler\DependencyAnalysis\ReadyToRun\CopiedMethodILDeduplicator.cs (1)
84return a.Data.AsSpan().SequenceEqual(b.Data);
Compiler\DependencyAnalysis\ReadyToRun\RuntimeFunctionsTableNode.cs (1)
114DwarfHelper.ReadULEB128(blobData.AsSpan(), out int offset); // skip frame size
parent\parent\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmEmitter.cs (1)
24FunctionBody.EncodeRelocations(relocs.AsSpan());
parent\parent\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (1)
222foreach (CorInfoWasmType paramType in types.AsSpan().Slice(1))
parent\parent\Common\Compiler\ObjectWriter\SectionData.cs (1)
32_padding.AsSpan().Fill(paddingByte);
parent\parent\Common\Compiler\ObjectWriter\WasmInstructions.cs (1)
65int pos = DwarfHelper.WriteULEB128(_locals.AsSpan(), localChunks);
parent\parent\Common\Compiler\ObjectWriter\WebCilObjectWriter.cs (1)
526BinaryPrimitives.WriteUInt32LittleEndian(lengthBuffer.AsSpan().Slice(4), (uint)MethodCount);
ILLink.RoslynAnalyzer (1)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (1)
229new char[bytes.Length * 2].AsSpan() :
Infrastructure.Tests (1)
WorkflowScripts\AnalyzeCiFailureWorkflowTests.cs (1)
3165var endRecordOffset = archiveBytes.AsSpan().LastIndexOf("PK\u0005\u0006"u8);
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\CacheViewTextWriter.cs (1)
159foreach (ref readonly var frame in capture.GetCapturedFrames().AsSpan())
Microsoft.AspNetCore.Components.Server (2)
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (1)
728this.Write(src.AsSpan());
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyRingBasedDataProtector.cs (1)
390var targetSpan = targetArr.AsSpan();
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
335RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Microsoft.AspNetCore.Http.Extensions (1)
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
136return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Identity (1)
PasskeyHandler.cs (1)
752if (!CryptographicOperations.FixedTimeEquals(authenticatorData.RpIdHash.Span, originalRpIdHash.AsSpan()))
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
136return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.OpenApi (1)
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
136return flattenedParameters is not null ? CollectionsMarshal.AsSpan(flattenedParameters) : parameters.AsSpan();
Microsoft.AspNetCore.Razor.Utilities.Shared (3)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\EnumerableExtensions.cs (1)
580if (!sortHelper.ComputeKeys(newArray.AsSpan(), keySelector, keys.Span))
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ImmutableArrayExtensions_Unsafe.cs (1)
180var items = innerArray.AsSpan();
Utilities\Checksum.cs (1)
39=> From(bytes.AsSpan());
Microsoft.AspNetCore.Routing (1)
EndpointRoutingMiddleware.cs (1)
95return blockToken.AsSpan().SequenceEqual(ownToken);
Microsoft.AspNetCore.Server.IIS (1)
Core\IO\AsyncWriteOperationBase.cs (1)
77_handles.AsSpan().Clear();
Microsoft.AspNetCore.Server.Kestrel.Core (2)
Internal\Http\HttpParser.cs (1)
395var errorBytes = errorSlice.IsSingleSegment ? errorSlice.FirstSpan : errorSlice.ToArray().AsSpan();
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
335RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Microsoft.AspNetCore.SignalR.Core (1)
Internal\Utf8HashLookup.cs (1)
67if (_slots[i].caseSensitiveHashCode == caseSensitiveHashCode && encodedValue.SequenceEqual(_slots[i].encodedValue.AsSpan()))
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Protocol\MessagePackHubProtocolWorker.cs (1)
372var span = array.AsSpan();
Microsoft.Build (1)
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (1)
289skipProjects.AsSpan().Fill(true);
Microsoft.Build.Framework (2)
Utilities\AssemblyNameExtension.cs (2)
788return aPKT.AsSpan().SequenceEqual(bPKT.AsSpan());
Microsoft.Build.Tasks.Core (3)
AssemblyDependency\ReferenceTable.cs (2)
2343if (!rpkt.AsSpan().SequenceEqual(dpkt.AsSpan()))
MSBuild.cs (1)
248skipProjects.AsSpan().Fill(true);
Microsoft.CodeAnalysis (8)
Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
CommandLine\CommandLineParser.cs (1)
640lineBuffer.CopyTo(temp.AsSpan());
Compilation\DeterministicKeyBuilder.cs (1)
442WriteByteArrayValue(writer, "publicKey", peReader.GetBlobBytes(assemblyDef.PublicKey).AsSpan());
InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
Syntax\SyntaxTriviaListBuilder.cs (3)
84=> Add(items.AsSpan()); 92=> Add(items.AsSpan(), offset, length); 101items.Slice(offset, length).CopyTo(_nodes.AsSpan().Slice(_count, length));
Microsoft.CodeAnalysis.Analyzers (4)
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.CodeStyle (4)
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.Razor.Compiler (2)
Language\CodeGeneration\CodeWriter.cs (1)
534chunks = (page?.Value ?? []).AsSpan();
Language\Intermediate\IntermediateNodeWalker.Stack.cs (1)
32: _stack.AsSpan()[_stackPointer..];
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.Workspaces (8)
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Workspace\Solution\Checksum_Factory.cs (3)
47=> Create(ImmutableCollectionsMarshal.AsArray(values).AsSpan()); 159var hashes = ImmutableCollectionsMarshal.AsArray(checksums).AsSpan(); 165=> Create(ImmutableCollectionsMarshal.AsArray(bytes).AsSpan());
Workspace\Solution\Checksum.cs (1)
43=> From(checksum.AsSpan());
Microsoft.Diagnostics.DataContractReader.Contracts (4)
Contracts\DacStreams_1.cs (1)
86ReadOnlySpan<byte> miniMdBuffer = bytes.AsSpan();
Contracts\Debugger\Debugger_1.cs (1)
335ctx.GetBytes().AsSpan().CopyTo(context);
Contracts\RuntimeTypeSystem_1.cs (2)
434target.ReadBuffer(storedSigMethodDesc.Sig, Signature.AsSpan()); 1839_target.ReadBuffer(asyncData.Signature.SignaturePointer, sig.AsSpan());
Microsoft.Diagnostics.DataContractReader.Legacy (8)
Dbi\DacDbiImpl.cs (6)
513blob.AsSpan().CopyTo(new Span<byte>(pBuffer, blobLength)); 1006contextBuffer.AsSpan().CopyTo(new Span<byte>((void*)pOriginalContext, (int)cbSizeContext)); 1818seedContext.AsSpan().CopyTo(new Span<byte>(pInternalContextBuffer, seedContext.Length)); 1914context.AsSpan().CopyTo(new Span<byte>(pContext, context.Length)); 2225context.AsSpan().CopyTo(new Span<byte>((byte*)ctxPtr, context.Length)); 2629context.AsSpan().CopyTo(new Span<byte>(pContextBuffer, context.Length));
SOSDacImpl.cs (1)
771buckets.AsSpan().CopyTo(dest);
StressTestApi\CdacStressApi.cs (1)
105blob.AsSpan().CopyTo(new Span<byte>(dest, (int)req.BlobBufferLen));
Microsoft.DotNet.Build.Tasks.FileCatalog (2)
CatalogBuilder.cs (2)
252x.AsSpan().SequenceCompareTo(y.AsSpan());
Microsoft.DotNet.Build.Tasks.Installers (7)
src\ArReader.cs (2)
26if (!magic.AsSpan().SequenceEqual("!<arch>\n"u8)) 67if (!footer.AsSpan().SequenceEqual("`\n"u8))
src\CpioReader.cs (1)
28if (!magic.AsSpan().SequenceEqual("070701"u8))
src\RpmHeader.cs (4)
135IndexEntry indexEntry = ReadIndexEntry(store.AsSpan().Slice(entry.Offset)); 210contents.SetValue(BinaryPrimitives.ReadInt16BigEndian(store.AsSpan().Slice(offset.AlignUp(2), 2)), i); 215contents.SetValue(BinaryPrimitives.ReadInt32BigEndian(store.AsSpan().Slice(offset.AlignUp(4), 4)), i); 220contents.SetValue(BinaryPrimitives.ReadInt64BigEndian(store.AsSpan().Slice(offset.AlignUp(8), 8)), i);
Microsoft.DotNet.Cli.Telemetry (1)
Implementation\FileSystemTelemetryBlobStorage.cs (1)
33=> _provider.Value.TryCreateBlob(data.AsSpan(), out _);
Microsoft.DotNet.TemplateLocator (2)
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (2)
55span = buffer.AsSpan().Slice(0, readCount); 103span = newBuffer.AsSpan().Slice(0, remaining + readCount);
Microsoft.Extensions.AI.Abstractions (1)
Contents\DataContent.cs (1)
288bool wrote = array.AsSpan().TryWrite($"data:{MediaType};base64,", out int prefixLength);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIResponsesChatClient.cs (1)
1497outputItem.Patch.Set("$.output"u8, JsonSerializer.SerializeToUtf8Bytes(elements, OpenAIJsonContext.Default.ListFunctionToolCallOutputElement).AsSpan());
Microsoft.Extensions.Caching.Hybrid.Tests (3)
TagSetTests.cs (3)
53arr.AsSpan().Clear(); // to check defensive copy 84arr.AsSpan().Clear(); // to check defensive copy 121arr.AsSpan().Clear(); // to check defensive copy
Microsoft.Extensions.Compliance.Abstractions (3)
Redaction\Redactor.cs (3)
150return Redact(((char[])(object)value).AsSpan()); 201return Redact(((char[])(object)value).AsSpan(), destination); 265ros = ((char[])(object)value).AsSpan();
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Redaction\NullRedactorTest.cs (1)
44Assert.Throws<ArgumentException>(() => r.Redact("ABCD".AsSpan(), new char[1].AsSpan()));
Microsoft.Extensions.DependencyInjection.Abstractions (3)
ActivatorUtilities.cs (3)
975return invoker.Invoke(arguments.AsSpan()); 1137return invoker.Invoke(constructorArguments.AsSpan()); 1150return invoker.Invoke(arguments.AsSpan());
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
ByteArrayEqualityComparer.cs (1)
18return x.AsSpan().SequenceEqual(y);
Microsoft.Extensions.FileProviders.Physical (1)
PollingWildCardChangeToken.cs (1)
145else if (!_previousHash.AsSpan().SequenceEqual(currentHash))
Microsoft.Extensions.Hosting.Systemd (1)
SystemdHelpers.cs (1)
67return comm.AsSpan().SequenceEqual("systemd\n"u8);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (6)
Resolver\DnsDataWriterTests.cs (3)
34Assert.Equal(expected, buffer.AsSpan().Slice(0, writer.Position).ToArray()); 82Assert.Equal(expected, buffer.AsSpan().Slice(0, writer.Position).ToArray()); 138Assert.Equal(expected, buffer.AsSpan().Slice(0, writer.Position).ToArray());
Resolver\DnsPrimitivesTests.cs (3)
28Assert.Equal(expected, buffer.AsSpan().Slice(0, written).ToArray()); 78Assert.Equal(buffer1.AsSpan().Slice(0, written1).ToArray(), buffer2.AsSpan().Slice(0, written2).ToArray());
Microsoft.Extensions.Telemetry (2)
Logging\JustInTimeRedactor.cs (2)
120inputAsSpan = c.AsSpan(); 159result = t.AsSpan().Slice(0, redactedLen).ToString();
Microsoft.ML.Core (9)
Utilities\ArrayUtils.cs (1)
40return FindIndexSorted(input.AsSpan(), min, lim, value);
Utilities\Stream.cs (7)
485ReadBinaryDataIntoSpan(reader, values.AsSpan()); 527ReadBinaryDataIntoSpan(reader, values.AsSpan()); 550ReadBinaryDataIntoSpan(reader, values.AsSpan()); 573ReadBinaryDataIntoSpan(reader, values.AsSpan()); 596ReadBinaryDataIntoSpan(reader, values.AsSpan()); 621ReadBinaryDataIntoSpan(reader, values.AsSpan()); 644ReadBinaryDataIntoSpan(reader, values.AsSpan());
Utilities\Utils.cs (1)
265return FindIndexSorted(input.AsSpan(), min, lim, value);
Microsoft.ML.DataView (1)
parent\Microsoft.ML.Core\Utilities\ArrayUtils.cs (1)
40return FindIndexSorted(input.AsSpan(), min, lim, value);
Microsoft.ML.FastTree (16)
Utils\ToByteArrayExtensions.cs (16)
293MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 304buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 326MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 337buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 359MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 375buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 397MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 408buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 430MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 441buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 463MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 474buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 496MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 507buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan())); 529MemoryMarshal.AsBytes(a.AsSpan()).CopyTo(buffer.AsSpan(position)); 540buffer.AsSpan(position, byteLength).CopyTo(MemoryMarshal.AsBytes(a.AsSpan()));
Microsoft.ML.ImageAnalytics (1)
ImageLoader.cs (1)
338var readBufferSpan = readBuffer.AsSpan();
Microsoft.ML.StandardTrainers (3)
LdSvm\LdSvmModelParameters.cs (3)
194ctx.Writer.WriteSinglesNoCount(_biasW.AsSpan()); 196ctx.Writer.WriteSinglesNoCount(_biasTheta.AsSpan()); 198ctx.Writer.WriteSinglesNoCount(_biasThetaPrime.AsSpan());
Microsoft.ML.Tokenizers (27)
Model\CodeGenTokenizer.cs (1)
1298bytesIndex += Helpers.GetUtf8Bytes(removePrefixSpace ? specialToken.AsSpan().Slice(1) : specialToken.AsSpan(), bytes.AsSpan().Slice(bytesIndex));
Model\EnglishRobertaTokenizer.cs (3)
393List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 699List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping); 744List<EncodedToken> result = EncodeToTokens(token.AsSpan().Slice(0, newTokenIndex), indexMapping);
Model\SentencePieceTokenizer.cs (1)
747precompiledCharsMap is not null ? precompiledCharsMap.AsSpan() : default,
Model\SentencePieceUnigramModel.cs (15)
425normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 442normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).CopyTo(utf16NormalizedString.AsSpan(utf16NormalizedString.Length - normalizedStringCountFromEnd)); 456Span<char> utf16NormalizedString = normalizedString.AsSpan().Slice(normalizedStringIndex); 461utf16NormalizedString = normalizedString.AsSpan().Slice(normalizedStringIndex); 470Span<char> normalizedUtf16Span = normalizedString.AsSpan().Slice(normalizedStringIndex); 474normalizedUtf16Span = normalizedString.AsSpan().Slice(normalizedStringIndex); 531normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 559normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 570Span<byte> byteSpan = MemoryMarshal.AsBytes(buffer.AsSpan()); 986normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1008normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1366normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1388normalizedText = normalizedString.AsSpan().Slice(0, normalizedStringIndex).ToString(); 1632normalizedText = normalizedString is not null ? normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null; 1650normalizedText = normalizedString is not null ? normalizedString.AsSpan().Slice(normalizedString.Length - normalizedStringCountFromEnd).ToString() : null;
Model\TiktokenTokenizer.cs (1)
842utf8Bytes.CopyTo(tmp.AsSpan());
Normalizer\SentencePieceNormalizer.cs (2)
490_spaceSymbol.AsSpan().CopyTo(normalized.Slice(normalizedIndex)); 552_spaceSymbol.AsSpan().CopyTo(normalized.Slice(normalizedIndex));
PreTokenizer\RegexPreTokenizer.cs (3)
118if (!TryGetMatch(specialTokensRegex, text.AsSpan(), beginning, textLength - beginning, out specialMatch)) 123while (TryGetMatch(regex, text.AsSpan(), beginning, specialMatch.Offset - beginning, out match)) 134while (TryGetMatch(regex, text.AsSpan(), beginning, textLength - beginning, out match))
Utils\Helpers.cs (1)
25arrayPoolArray.CopyTo(tmp.AsSpan());
Microsoft.ML.Tokenizers.Tests (36)
BpeTests.cs (5)
341status = bpe.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens, out idsConsumed, out charactersWritten); 351status = bpe.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens, out idsConsumed, out charactersWritten); 355Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString()); 849Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out int idsConsumed, out int charsWritten)); 852Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: false, out idsConsumed, out charsWritten));
CodeGenTests.cs (3)
314status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten); 324status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten); 328Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
EnglishRobertaTests.cs (3)
319status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 327status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten); 331Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
LlamaTests.cs (18)
310status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 320status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten); 324Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString()); 848Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 850Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 853Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten)); 856Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().ToString()); 862Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 864Assert.True(textWithSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 867Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 870Assert.Equal(textWithSpecialTokens, destinationBuffer.AsSpan().ToString()); 887Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten)); 889Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten))); 892Assert.Equal(OperationStatus.Done, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten)); 895Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().Slice(0, charactersWritten).ToString()); 901Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten)); 903var sp = destinationBuffer.AsSpan().Slice(0, charactersWritten); 911Assert.Equal(OperationStatus.Done, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out idsConsumed, out charactersWritten));
parent\parent\src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (1)
25arrayPoolArray.CopyTo(tmp.AsSpan());
TiktokenTests.cs (3)
182status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten); 192status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten); 196Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
UnigramTests.cs (3)
545Assert.Equal(decodedString, buffer.AsSpan().Slice(0, charsWritten).ToString()); 549status = tokenizer.Decode(ids, buffer.AsSpan().Slice(0, i), considerSpecialTokens: false, out idsConsumed, out charsWritten); 551Assert.Equal(decodedString.AsSpan().Slice(0, charsWritten).ToString(), buffer.AsSpan().Slice(0, charsWritten).ToString());
Microsoft.ML.TorchSharp (2)
AutoFormerV2\Anchors.cs (1)
62var imageShape = torch.tensor(image.shape.AsSpan().Slice(2).ToArray());
Roberta\Models\RobertaModel.cs (1)
112var questionSize = srcTokenArray.AsSpan().IndexOf(EosIndex) - 1;
Microsoft.NET.Build.Tasks (2)
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.SystemTextJson.cs (2)
55span = buffer.AsSpan().Slice(0, readCount); 103span = newBuffer.AsSpan().Slice(0, remaining + readCount);
Microsoft.NET.HostModel (1)
MachO\BinaryFormat\Blobs\CodeDirectoryBlob.cs (1)
35int nullTerminatorIndex = data.AsSpan().Slice(identifierDataOffset).IndexOf((byte)0x00);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
parent\parent\StaticWebAssetsSdk\Tasks\Utils\FileHasher.cs (1)
42var dividend = BigInteger.Abs(new BigInteger(hash.AsSpan()[..9].ToArray()));
Microsoft.NET.Sdk.StaticWebAssets.Tasks (2)
ScopedCss\ComputeCssScope.cs (1)
67var dividend = BigInteger.Abs(new BigInteger([.. hash.AsSpan()[..9]]));
Utils\FileHasher.cs (1)
42var dividend = BigInteger.Abs(new BigInteger(hash.AsSpan()[..9].ToArray()));
Microsoft.NET.Sdk.WorkloadManifestReader (2)
WorkloadManifestReader.SystemTextJson.cs (2)
55span = buffer.AsSpan().Slice(0, readCount); 103span = newBuffer.AsSpan().Slice(0, remaining + readCount);
Microsoft.Private.Windows.Core (2)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
174if (isSerializedObject = bytes.AsSpan().StartsWith(s_serializedObjectID))
System\TypeExtensions.cs (1)
180|| ComparePublicKeys(assemblyName.GetPublicKeyToken().AsSpan(), assemblyNameInfo.PublicKeyOrToken.AsSpan()));
Microsoft.TestPlatform.AdapterUtilities (5)
src\vstest\src\Microsoft.TestPlatform.Hashing.Source\XxHashShared.cs (4)
265source.AsSpan().Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 309source.AsSpan().Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 326source.AsSpan().Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 338source.AsSpan().Slice(sourceIndex).CopyTo(remaining);
TestIdProvider.cs (1)
111var hashSlice = GetHash().AsSpan().Slice(0, 16);
Microsoft.VisualStudio.TestPlatform.ObjectModel (4)
src\vstest\src\Microsoft.TestPlatform.Hashing.Source\XxHashShared.cs (4)
265source.AsSpan().Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 309source.AsSpan().Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 326source.AsSpan().Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 338source.AsSpan().Slice(sourceIndex).CopyTo(remaining);
NuGet.ProjectModel (1)
src\nuget-client\build\Shared\Utf8JsonStreamReader.cs (1)
67bool hasUtf8Bom = Utf8Bom.AsSpan().SequenceEqual(_buffer.AsSpan(start: 0, length: 3));
RepoTasks (1)
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
335RandomNumberGenerator.Fill(passwordBytes.AsSpan()[0..35]);
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (2)
47&& _bits.AsSpan().SequenceEqual(other._bits.AsSpan());
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
114=> Add(chars.AsSpan());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
System.Data.Common (2)
System\Data\DataKey.cs (1)
173return column1.AsSpan().SequenceEqual(column2);
System\Data\RelatedView.cs (1)
66bool allow = childValues.AsSpan().SequenceEqual(parentValues);
System.Data.Odbc (3)
System\Data\Odbc\OdbcHandle.cs (3)
191sqlState = new string(buffer.AsSpan(0, buffer.AsSpan().IndexOf('\0'))); 211sqlState = new string(buffer.AsSpan(0, buffer.AsSpan().IndexOf('\0'))); 217messageBuilder.Append(new string(message.AsSpan(0, message.AsSpan().IndexOf('\0'))));
System.Diagnostics.DiagnosticSource (12)
System\Diagnostics\Metrics\Counter.cs (1)
69public void Add(T delta, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(delta, tags.AsSpan());
System\Diagnostics\Metrics\CounterAggregator.cs (1)
62foreach (ref PaddedDouble paddedDelta in _deltas.AsSpan())
System\Diagnostics\Metrics\Gauge.cs (1)
67public void Record(T value, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(value, tags.AsSpan());
System\Diagnostics\Metrics\Histogram.cs (1)
71public void Record(T value, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(value, tags.AsSpan());
System\Diagnostics\Metrics\Instrument.common.cs (1)
87protected void RecordMeasurement(T measurement) => RecordMeasurement(measurement, Instrument.EmptyTags.AsSpan());
System\Diagnostics\Metrics\Measurement.cs (2)
82tags.CopyTo(_tags.AsSpan()); 95public ReadOnlySpan<KeyValuePair<string, object?>> Tags => _tags.AsSpan();
System\Diagnostics\Metrics\ObjectSequence.netcore.cs (1)
47return _values.AsSpan();
System\Diagnostics\Metrics\StringSequence.cs (3)
88_values.AsSpan(); 91_values.AsSpan().SequenceEqual(other._values.AsSpan());
System\Diagnostics\Metrics\UpDownCounter.cs (1)
68public void Add(T delta, params KeyValuePair<string, object?>[] tags) => RecordMeasurement(delta, tags.AsSpan());
System.DirectoryServices.Protocols (9)
System\DirectoryServices\Protocols\common\DirectoryControl.cs (9)
127_directoryControlValue = value.AsSpan().ToArray(); 140return _directoryControlValue.AsSpan().ToArray(); 628return _dirsyncCookie.AsSpan().ToArray(); 694return _dirsyncCookie.AsSpan().ToArray(); 743return _pageCookie.AsSpan().ToArray(); 788return _pageCookie.AsSpan().ToArray(); 1022return _target.AsSpan().ToArray(); 1036return _context.AsSpan().ToArray(); 1115return _context.AsSpan().ToArray();
System.Formats.Cbor (3)
System\Formats\Cbor\Writer\CborWriter.Map.cs (1)
161Span<byte> source = _buffer.AsSpan();
System\Formats\Cbor\Writer\CborWriter.String.cs (2)
29WriteByteString(value.AsSpan()); 210Span<byte> buffer = _buffer.AsSpan();
System.Formats.Nrbf (6)
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (5)
131Span<T> valuesToRead = result.AsSpan(); 164Span<short> span = MemoryMarshal.Cast<T, short>(result.AsSpan()); 176Span<int> span = MemoryMarshal.Cast<T, int>(result.AsSpan()); 188Span<long> span = MemoryMarshal.Cast<T, long>(result.AsSpan()); 204Span<byte> resultAsBytes = MemoryMarshal.AsBytes<T>(result.AsSpan());
System\Formats\Nrbf\RectangularArrayRecord.cs (1)
39public override ReadOnlySpan<int> Lengths => _lengths.AsSpan();
System.IO.Compression (1)
System\IO\Compression\ZipArchive.cs (1)
666Span<byte> fileBuffer = arrayPoolArray.AsSpan();
System.Net.Http.WinHttpHandler (1)
System\Net\Http\WinHttpRequestCallback.cs (1)
361rawCertData.AsSpan().SequenceEqual(serverCertificate.RawDataMemory.Span))
System.Net.HttpListener (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
17DumpBuffer(thisOrContextObject, buffer.AsSpan(), memberName);
System.Net.NetworkInformation (2)
System\Net\NetworkInformation\PhysicalAddress.cs (2)
64_address.AsSpan().SequenceEqual(other._address); 68return Convert.ToHexString(_address.AsSpan());
System.Net.Security (8)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
681oldBuffer.AsSpan().CopyTo(buffer);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
17DumpBuffer(thisOrContextObject, buffer.AsSpan(), memberName);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (2)
388!mechListMIC.AsSpan().SequenceEqual(blob.AsSpan()))
System\Net\Security\SslApplicationProtocol.cs (1)
38protocol.AsSpan().ToArray() :
System\Net\Security\SslSessionsCache.cs (1)
96thumbPrint.AsSpan().SequenceEqual(otherThumbPrint);
System\Net\Security\SslStream.Protocol.cs (1)
1584oldPayload.AsSpan<byte>().CopyTo(Payload);
System\Net\Security\SslStreamCertificateContext.Linux.cs (1)
352issuerHandles.AsSpan().Clear();
System.Net.Sockets (3)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
17DumpBuffer(thisOrContextObject, buffer.AsSpan(), memberName);
System\Net\Sockets\Socket.cs (2)
1302SendFile(fileName, preBuffer.AsSpan(), postBuffer.AsSpan(), flags);
System.Private.CoreLib (16)
src\runtime\src\libraries\System.Private.CoreLib\src\System\ApplicationId.cs (1)
77_publicKeyToken.AsSpan().SequenceEqual(other._publicKeyToken);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (1)
1933!_tables._countPerLock.AsSpan().ContainsAnyExcept(0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (2)
529return (!monthNames.AsSpan().SequenceEqual(genitiveMonthNames) || !abbrevMonthNames.AsSpan().SequenceEqual(genitiveAbbrevMonthNames))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (1)
413result.AsSpan().Replace((byte)' ', (byte)'+');
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
621GetItems(choices, items.AsSpan());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfilerEventSource.cs (1)
78AsyncEvents(buffer.AsSpan());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\ISimdVector_2.cs (2)
184static virtual void CopyTo(TSelf vector, T[] destination) => TSelf.CopyTo(vector, destination.AsSpan()); 235static virtual TSelf Create(T[] values) => TSelf.Create(values.AsSpan());
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (1)
46_hashEntries.AsSpan().Fill(values[0]);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
87existingBucket.AsSpan().CopyTo(newBucket);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (1)
1143JoinCore(separator, values.ToArray().AsSpan());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (2)
409KeyValuePair<IAsyncLocal, object?>[] newValues = _keyValues.AsSpan().ToArray(); 523KeyValuePair<IAsyncLocal, object?>[] updatedValues = _keyValues.AsSpan().ToArray();
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (1)
507arrayPoolArray.CopyTo(tmp.AsSpan());
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (1)
842return currentRules.AsSpan().SequenceEqual(otherRules);
System.Private.Windows.Core (2)
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
174if (isSerializedObject = bytes.AsSpan().StartsWith(s_serializedObjectID))
System\TypeExtensions.cs (1)
180|| ComparePublicKeys(assemblyName.GetPublicKeyToken().AsSpan(), assemblyNameInfo.PublicKeyOrToken.AsSpan()));
System.Private.Xml (1)
System\Xml\Schema\DataTypeImplementation.cs (1)
876value1.AsSpan().SequenceEqual(value2) ? 0 : -1;
System.Reflection.Metadata (5)
System\Reflection\Metadata\BlobBuilder.cs (2)
780WriteBytes(buffer.AsSpan()); 977WriteUTF16(value.AsSpan());
System\Reflection\Metadata\BlobContentId.cs (1)
81return FromHash(hashCode.AsSpan());
System\Reflection\Metadata\BlobWriter.cs (2)
221WriteBytes(buffer.AsSpan()); 380WriteUTF16(value.AsSpan());
System.Resources.Extensions (1)
System\Resources\Extensions\TypeNameComparer.cs (1)
117return pkt1.AsSpan().SequenceEqual(pkt2);
System.Runtime.Numerics (6)
System\Number.BigInteger.cs (1)
313if (bits.AsSpan().ContainsAnyExcept(0u))
System\Numerics\BigInteger.cs (5)
432value.Slice(0, wholeLimbCount * nint.Size).CopyTo(MemoryMarshal.AsBytes(val.AsSpan())); 474int len = val.AsSpan().LastIndexOfAnyExcept(0u) + 1; 1684hash.AddBytes(MemoryMarshal.AsBytes(_bits.AsSpan())); 1756return _sign == other._sign && _bits.AsSpan().SequenceEqual(other._bits); 4018int firstNonZero = value._bits.AsSpan().IndexOfAnyExcept((nuint)0);
System.Security.AccessControl (2)
System\Security\AccessControl\ACE.cs (1)
444return array1.AsSpan().SequenceEqual(array2);
System\Security\AccessControl\ACL.cs (1)
1185return aceOpaque.AsSpan().SequenceEqual(newAceOpaque);
System.Security.Cryptography (24)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (3)
171SignData(new ReadOnlySpan<byte>(data), destination.AsSpan(), new ReadOnlySpan<byte>(context)); 374SignPreHash(new ReadOnlySpan<byte>(hash), destination.AsSpan(), hashAlgorithmOid, new ReadOnlySpan<byte>(context)); 538SignMu(externalMu, destination.AsSpan());
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (2)
465lastBlock.AsSpan().CopyTo(destination.AsSpan(written)); 999Span<byte> tmpEndSpan = tmpEnd.AsSpan();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (2)
186SignData(new ReadOnlySpan<byte>(data), destination.AsSpan(), new ReadOnlySpan<byte>(context)); 379SignPreHash(new ReadOnlySpan<byte>(hash), destination.AsSpan(), hashAlgorithmOid, new ReadOnlySpan<byte>(context));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (1)
1076array.AsSpan().CopyTo(next);
System\Security\Cryptography\CapiHelper.Windows.cs (1)
101string providerNameString = new string(providerName.AsSpan(0, providerName.AsSpan().IndexOf('\0')));
System\Security\Cryptography\CngProperty.cs (1)
87return _value.AsSpan().SequenceEqual(other._value);
System\Security\Cryptography\ECCng.ImportExport.cs (2)
162Debug.Assert(ecparams.Q.X.AsSpan().SequenceEqual(localParameters.Q.X)); 163Debug.Assert(ecparams.Q.Y.AsSpan().SequenceEqual(localParameters.Q.Y));
System\Security\Cryptography\HashStatic.cs (1)
35int written = HashData(source, buffer.AsSpan());
System\Security\Cryptography\Helpers.cs (1)
158return a1.AsSpan().SequenceEqual(a2);
System\Security\Cryptography\HMACStatic.cs (1)
53int written = HashData(key, source, buffer.AsSpan());
System\Security\Cryptography\HpkeECDiffieHellmanKemAdapter.cs (1)
218parameters.D.AsSpan().CopyTo(destination);
System\Security\Cryptography\HpkeImplementation.Managed.cs (2)
378_baseNonce.AsSpan().CopyTo(nonce); 458_baseNonce.AsSpan().CopyTo(nonce);
System\Security\Cryptography\Rfc2898DeriveBytes.cs (1)
151value.AsSpan().CopyTo(_salt);
System\Security\Cryptography\RSABCrypt.cs (2)
126int written = Encrypt(new ReadOnlySpan<byte>(data), ret.AsSpan(), padding); 153ret.AsSpan(),
System\Security\Cryptography\UniversalCryptoDecryptor.cs (1)
98_heldoverCipher.AsSpan().CopyTo(ciphertext);
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
209Import(rawData.AsSpan()); 232Import(rawData.AsSpan(), password.AsSpan(), keyStorageFlags);
System.Security.Cryptography.Cose (6)
System\Security\Cryptography\Cose\CoseHeaderValue.cs (2)
53return FromEncodedValue(encodedValue.AsSpan()); 118return FromBytes(value.AsSpan());
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (2)
647=> AddSignatureForEmbedded(signer, associatedData.AsSpan()); 698AddSignatureForDetached(detachedContent.AsSpan(), signer, associatedData);
System\Security\Cryptography\Cose\CoseSign1Message.cs (2)
56return SignCore(detachedContent.AsSpan(), null, signer, associatedData, isDetached: true); 81return SignCore(embeddedContent.AsSpan(), null, signer, associatedData, isDetached: false);
System.Security.Cryptography.Pkcs (8)
Internal\Cryptography\PkcsHelpers.cs (2)
281ba1.AsSpan().SequenceEqual(ba2.AsSpan());
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (2)
465lastBlock.AsSpan().CopyTo(destination.AsSpan(written)); 999Span<byte> tmpEndSpan = tmpEnd.AsSpan();
System\Security\Cryptography\Pkcs\CmsSigner.cs (1)
496cert.SubjectName.RawData.AsSpan().SequenceEqual(cert.IssuerName.RawData))
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (1)
159_encodedBytes.AsSpan().CopyTo(destination);
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (1)
221_encodedBytes.AsSpan().CopyTo(destination);
System\Security\Cryptography\Pkcs\SubjectIdentifier.cs (1)
73DummySignerEncodedValue.AsSpan().SequenceEqual(issuerNameSpan))
System.Security.Cryptography.Xml (2)
System\Security\Cryptography\Xml\SymmetricKeyWrap.cs (2)
240if (!rgbA.AsSpan().SequenceEqual(s_rgbAES_KW_IV.AsSpan()))
System.Text.Json (5)
parent\Common\JsonHelpers.cs (1)
176if (childMap.AsSpan().IndexOf(true) == -1)
System\Text\Json\Document\JsonDocument.MetadataDb.cs (1)
377Span<int> newDbInts = MemoryMarshal.Cast<byte, int>(newDatabase.AsSpan());
System\Text\Json\Document\JsonDocument.Parse.cs (1)
91utf8Json.CopyTo(utf8Bytes.AsSpan());
System\Text\Json\JsonHelpers.cs (1)
255(left is not null && right is not null && left.AsSpan().SequenceEqual(right));
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
363(resolver?.CustomTypeDiscriminatorPropertyNameUtf8?.AsSpan().SequenceEqual(propertyName) == true);
System.Text.Json.SourceGeneration (1)
parent\Common\JsonHelpers.cs (1)
176if (childMap.AsSpan().IndexOf(true) == -1)
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\Regex.cs (1)
452result = capslist.AsSpan().ToArray();
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
832literal.Chars is not null ? slice.IndexOfAny(literal.Chars.AsSpan()) :
System.Text.RegularExpressions.Generator (1)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (1)
229new char[bytes.Length * 2].AsSpan() :
System.Windows.Extensions (1)
System\Media\SoundPlayer.cs (1)
622!data.AsSpan().StartsWith("RIFF"u8) ||
System.Windows.Forms (3)
System\Windows\Forms\Components\ImageList\ImageListStreamer.cs (1)
97ReadOnlySpan<byte> buffer = stream.GetBuffer().AsSpan()[..(int)stream.Length];
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiSelectRootGridEntry.PropertyMerger.cs (2)
63properties = GetCommonProperties(restObjects.AsSpan(), presort: true, tab, parentEntry); 69List<PropertyDescriptor[]>? firstProperties = GetCommonProperties(firstObject.AsSpan(), presort: false, tab, parentEntry);
System.Windows.Forms.Design (3)
System\ComponentModel\Design\BinaryEditor.cs (1)
62Encoding.Unicode.GetBytes(stringValue.AsSpan(), buffer.AsSpan());
System\ComponentModel\Design\ByteViewer.cs (2)
425Encoding.Unicode.GetChars(dataBuf.AsSpan(), text); 593currentFile.Write(_dataBuf.AsSpan());