diff options
author | Ahson Khan <ahkha@microsoft.com> | 2018-04-13 08:40:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-13 08:40:43 +0300 |
commit | 5c01da951f57ad69d64a5d7c7357d4f033cb5fea (patch) | |
tree | 2ac5c4a1bf1bd4903f2a53ddfa958cf638c6d43e /src/System.Security.Cryptography.Encoding | |
parent | 4e98099cbd6c2786444f68ebcc88bfb2be05ce62 (diff) |
Collapse leftover AsSpan().Slice(...) into AsSpan(...) (#29078)
Diffstat (limited to 'src/System.Security.Cryptography.Encoding')
7 files changed, 10 insertions, 10 deletions
diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBMPString.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBMPString.cs index 3eb40a428b..642f54943f 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBMPString.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBMPString.cs @@ -542,7 +542,7 @@ namespace System.Security.Cryptography.Tests.Asn1 Assert.Equal(1000, bytesWritten); Assert.Equal( - input.AsSpan().Slice(4).ByteArrayToHex(), + input.AsSpan(4).ByteArrayToHex(), output.ByteArrayToHex()); } diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBitString.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBitString.cs index 4230b1d1bd..077e3c639f 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBitString.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadBitString.cs @@ -247,7 +247,7 @@ namespace System.Security.Cryptography.Tests.Asn1 Assert.True(didRead, "reader.TryCopyBitStringBytes"); Assert.Equal(expectedUnusedBitCount, unusedBitCount); - Assert.Equal(expectedHex, output.AsSpan().Slice(0, bytesWritten).ByteArrayToHex()); + Assert.Equal(expectedHex, output.AsSpan(0, bytesWritten).ByteArrayToHex()); } private static void TryCopyBitStringBytes_Throws( @@ -453,7 +453,7 @@ namespace System.Security.Cryptography.Tests.Asn1 Assert.Equal(999, bytesWritten); Assert.Equal( - input.AsSpan().Slice(5).ByteArrayToHex(), + input.AsSpan(5).ByteArrayToHex(), output.ByteArrayToHex()); } diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadIA5String.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadIA5String.cs index 5d3d285a42..4dcb6f0aaa 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadIA5String.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadIA5String.cs @@ -506,7 +506,7 @@ namespace System.Security.Cryptography.Tests.Asn1 Assert.Equal(1000, bytesWritten); Assert.Equal( - input.AsSpan().Slice(4).ByteArrayToHex(), + input.AsSpan(4).ByteArrayToHex(), output.ByteArrayToHex()); } diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadOctetString.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadOctetString.cs index f9ff4d4f7d..909f62a668 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadOctetString.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadOctetString.cs @@ -204,7 +204,7 @@ namespace System.Security.Cryptography.Tests.Asn1 out int bytesWritten); Assert.True(didRead, "reader.TryCopyOctetStringBytes"); - Assert.Equal(expectedHex, output.AsSpan().Slice(0, bytesWritten).ByteArrayToHex()); + Assert.Equal(expectedHex, output.AsSpan(0, bytesWritten).ByteArrayToHex()); } private static void TryCopyOctetStringBytes_Throws( @@ -359,7 +359,7 @@ namespace System.Security.Cryptography.Tests.Asn1 Assert.Equal(1000, bytesWritten); Assert.Equal( - input.AsSpan().Slice(4).ByteArrayToHex(), + input.AsSpan(4).ByteArrayToHex(), output.ByteArrayToHex()); } diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadUTF8String.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadUTF8String.cs index f441405c5b..d3bb9dfe27 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadUTF8String.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Reader/ReadUTF8String.cs @@ -522,7 +522,7 @@ namespace System.Security.Cryptography.Tests.Asn1 Assert.Equal(1000, bytesWritten); Assert.Equal( - input.AsSpan().Slice(4).ByteArrayToHex(), + input.AsSpan(4).ByteArrayToHex(), output.ByteArrayToHex()); } diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/ComprehensiveWriteTest.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/ComprehensiveWriteTest.cs index cb524dfd1d..183c5b75ac 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/ComprehensiveWriteTest.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/ComprehensiveWriteTest.cs @@ -266,7 +266,7 @@ namespace System.Security.Cryptography.Tests.Asn1 "C058767D1FF060A609D7E3D4317079AF0CD0A8A49251AB129157F9894A036487" + "090807060504030201").HexToByteArray(); - writer.WriteBitString(containsSignature.AsSpan().Slice(9, 256)); + writer.WriteBitString(containsSignature.AsSpan(9, 256)); // certificate writer.PopSequence(); diff --git a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs index 6d1f4d9cf4..b9ac66f75b 100644 --- a/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs +++ b/src/System.Security.Cryptography.Encoding/tests/Asn1/Writer/WriteCharacterString.cs @@ -372,8 +372,8 @@ namespace System.Security.Cryptography.Tests.Asn1 byte[] encoded = writer.Encode(); - Assert.Equal(tagHex, encoded.AsSpan().Slice(0, tagHex.Length / 2).ByteArrayToHex()); - Assert.Equal("0000", encoded.AsSpan().Slice(encoded.Length - 2).ByteArrayToHex()); + Assert.Equal(tagHex, encoded.AsSpan(0, tagHex.Length / 2).ByteArrayToHex()); + Assert.Equal("0000", encoded.AsSpan(encoded.Length - 2).ByteArrayToHex()); Assert.Equal(encodedSize, encoded.Length); } |