From b73e06eca188aac213c8f5b03759305bbf4cb429 Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Wed, 9 Nov 2016 20:08:45 -0800 Subject: [PATCH] Remove unneeded field from BinaryWriter (#8015) The field only exists in .NET Framework for serialization compat. It isn't needed on CoreCLR. --- src/mscorlib/src/System/IO/BinaryWriter.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mscorlib/src/System/IO/BinaryWriter.cs b/src/mscorlib/src/System/IO/BinaryWriter.cs index 78b9408..ed3ae5b 100644 --- a/src/mscorlib/src/System/IO/BinaryWriter.cs +++ b/src/mscorlib/src/System/IO/BinaryWriter.cs @@ -38,6 +38,7 @@ namespace System.IO { [OptionalField] // New in .NET FX 4.5. False is the right default value. private bool _leaveOpen; +#if !FEATURE_CORECLR // This field should never have been serialized and has not been used since before v2.0. // However, this type is serializable, and we need to keep the field name around when deserializing. // Also, we'll make .NET FX 4.5 not break if it's missing. @@ -45,6 +46,7 @@ namespace System.IO { [OptionalField] private char[] _tmpOneCharBuffer; #pragma warning restore 169 +#endif // Perf optimization stuff private byte[] _largeByteBuffer; // temp space for writing chars. -- 2.7.4