Delete some dead code (#25546)
authorJan Kotas <jkotas@microsoft.com>
Wed, 3 Jul 2019 07:34:50 +0000 (00:34 -0700)
committerGitHub <noreply@github.com>
Wed, 3 Jul 2019 07:34:50 +0000 (00:34 -0700)
src/System.Private.CoreLib/shared/System/Globalization/JapaneseCalendar.Win32.cs
src/System.Private.CoreLib/shared/System/IO/StreamReader.cs
src/System.Private.CoreLib/shared/System/IO/StreamWriter.cs
src/System.Private.CoreLib/shared/System/SByte.cs

index f717adb..cf70ce2 100644 (file)
@@ -196,15 +196,5 @@ namespace System.Globalization
             return new EraInfo(0, year, month, day, year - 1, 1, 0,
                                 names[0], names[1], names[3]);
         }
-
-        // PAL Layer ends here
-
-        private static readonly string[] s_japaneseErasEnglishNames = new string[] { "M", "T", "S", "H", "R" };
-
-        private static string GetJapaneseEnglishEraName(int era)
-        {
-            Debug.Assert(era > 0);
-            return era <= s_japaneseErasEnglishNames.Length ? s_japaneseErasEnglishNames[era - 1] : " ";
-        }
     }
 }
index cbfc729..e6196f4 100644 (file)
@@ -230,7 +230,7 @@ namespace System.IO
             _disposed = true;
 
             // Dispose of our resources if this StreamReader is closable.
-            if (!LeaveOpen)
+            if (_closable)
             {
                 try
                 {
@@ -260,11 +260,6 @@ namespace System.IO
             get { return _stream; }
         }
 
-        internal bool LeaveOpen
-        {
-            get { return !_closable; }
-        }
-
         // DiscardBufferedData tells StreamReader to throw away its internal
         // buffer contents.  This is useful if the user needs to seek on the
         // underlying stream to a known location then wants the StreamReader
index 9d143ed..3cd83b0 100644 (file)
@@ -200,7 +200,7 @@ namespace System.IO
         private void CloseStreamFromDispose(bool disposing)
         {
             // Dispose of our resources if this StreamWriter is closable. 
-            if (!LeaveOpen && !_disposed)
+            if (_closable && !_disposed)
             {
                 try
                 {
@@ -312,16 +312,6 @@ namespace System.IO
             get { return _stream; }
         }
 
-        internal bool LeaveOpen
-        {
-            get { return !_closable; }
-        }
-
-        internal bool HaveWrittenPreamble
-        {
-            set { _haveWrittenPreamble = value; }
-        }
-
         public override Encoding Encoding
         {
             get { return _encoding; }
@@ -676,7 +666,7 @@ namespace System.IO
                 charPos = 0;
             }
 
-            _this.CharPos_Prop = charPos;
+            _this._charPos = charPos;
         }
 
         public override Task WriteAsync(string? value)
@@ -765,7 +755,7 @@ namespace System.IO
                 charPos = 0;
             }
 
-            _this.CharPos_Prop = charPos;
+            _this._charPos = charPos;
         }
 
         public override Task WriteAsync(char[] buffer, int index, int count)
@@ -874,7 +864,7 @@ namespace System.IO
                 charPos = 0;
             }
 
-            _this.CharPos_Prop = charPos;
+            _this._charPos = charPos;
         }
 
         public override Task WriteLineAsync()
@@ -1028,16 +1018,6 @@ namespace System.IO
             return task;
         }
 
-        private int CharPos_Prop
-        {
-            set { _charPos = value; }
-        }
-
-        private bool HaveWrittenPreamble_Prop
-        {
-            set { _haveWrittenPreamble = value; }
-        }
-
         private Task FlushAsyncInternal(bool flushStream, bool flushEncoder,
                                         char[] sCharBuffer, int sCharPos, CancellationToken cancellationToken = default)
         {
@@ -1068,7 +1048,7 @@ namespace System.IO
         {
             if (!haveWrittenPreamble)
             {
-                _this.HaveWrittenPreamble_Prop = true;
+                _this._haveWrittenPreamble = true;
                 byte[] preamble = encoding.GetPreamble();
                 if (preamble.Length > 0)
                 {
index 9b12439..ee0d8af 100644 (file)
@@ -147,12 +147,6 @@ namespace System
             return Parse(s, style, NumberFormatInfo.GetInstance(provider));
         }
 
-        private static sbyte Parse(string s, NumberStyles style, NumberFormatInfo info)
-        {
-            if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
-            return Parse((ReadOnlySpan<char>)s, style, info);
-        }
-
         private static sbyte Parse(ReadOnlySpan<char> s, NumberStyles style, NumberFormatInfo info)
         {
             Number.ParsingStatus status = Number.TryParseInt32(s, style, info, out int i);