Use AsSpan/AsMemory (start, length) (#45310)
authorxtqqczze <45661989+xtqqczze@users.noreply.github.com>
Mon, 30 Nov 2020 11:26:17 +0000 (11:26 +0000)
committerGitHub <noreply@github.com>
Mon, 30 Nov 2020 11:26:17 +0000 (06:26 -0500)
commit1edc35f8517bbb2fae8c0152de14bd105f9bac06
tree89bc3b96e79b9aa1a0921f0823c89b021b6682df
parentc8a97ff77957202323b64b8513f363366010343f
Use AsSpan/AsMemory (start, length)  (#45310)

* Use AsSpan(start, length)

Replace `AsSpan().Slice(start, length)` with `AsSpan(start, length)`

* Use AsMemory(start, length)

Replace `AsMemory().Slice(start, length)` with `AsMemory(start, length)`

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
18 files changed:
src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs
src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs
src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/AnsiParserTests.cs
src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/Console/TestConsole.cs
src/libraries/System.Memory.Data/tests/BinaryDataTests.cs
src/libraries/System.Memory/tests/BuffersExtensions/BuffersExtensionsTests.cs
src/libraries/System.Memory/tests/Span/AsSpan.cs
src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.Unix.cs
src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs
src/libraries/System.Net.Security/tests/StressTests/SslStress/StressOperations.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs
src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketDuplicationTests.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.cs
src/libraries/System.Private.CoreLib/src/System/Globalization/GlobalizationMode.cs
src/libraries/System.Runtime/tests/System/IndexTests.cs
src/libraries/System.Runtime/tests/System/RangeTests.cs
src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/SimpleRead.cs
src/tests/JIT/Intrinsics/BinaryPrimitivesReverseEndianness.cs