Skip to content

Commit 0b1cab3

Browse files
authored
Merge pull request MessagePack-CSharp#1107 from AArnott/netcorefilters
Simplify #if netcoreapp filters
2 parents 84564bf + 06c98de commit 0b1cab3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ private BigIntegerFormatter()
476476

477477
public void Serialize(ref MessagePackWriter writer, System.Numerics.BigInteger value, MessagePackSerializerOptions options)
478478
{
479-
#if NETCOREAPP2_1
479+
#if NETCOREAPP
480480
if (!writer.OldSpec)
481481
{
482482
// try to get bin8 buffer.
@@ -504,7 +504,7 @@ public void Serialize(ref MessagePackWriter writer, System.Numerics.BigInteger v
504504
public System.Numerics.BigInteger Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
505505
{
506506
ReadOnlySequence<byte> bytes = reader.ReadBytes().Value;
507-
#if NETCOREAPP2_1
507+
#if NETCOREAPP
508508
if (bytes.IsSingleSegment)
509509
{
510510
return new System.Numerics.BigInteger(bytes.First.Span);

src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ private string ReadStringSlow(int byteLength)
11091109
int bytesRead = Math.Min(remainingByteLength, this.reader.UnreadSpan.Length);
11101110
remainingByteLength -= bytesRead;
11111111
bool flush = remainingByteLength == 0;
1112-
#if NETCOREAPP2_1
1112+
#if NETCOREAPP
11131113
initializedChars += decoder.GetChars(this.reader.UnreadSpan.Slice(0, bytesRead), charArray.AsSpan(initializedChars), flush);
11141114
#else
11151115
unsafe

src/MessagePack.UnityClient/Assets/Scripts/MessagePack/StringEncoding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal static class StringEncoding
1313
{
1414
internal static readonly Encoding UTF8 = new UTF8Encoding(false);
1515

16-
#if !NETCOREAPP2_1 // Define the extension method only where an instance method does not already exist.
16+
#if !NETCOREAPP // Define the extension method only where an instance method does not already exist.
1717
internal static unsafe string GetString(this Encoding encoding, ReadOnlySpan<byte> bytes)
1818
{
1919
if (bytes.Length == 0)

0 commit comments

Comments
 (0)