Delete AsReadOnly* APIs that are no longer part of the public surface (#16799)
authorJan Kotas <jkotas@microsoft.com>
Wed, 7 Mar 2018 22:47:49 +0000 (14:47 -0800)
committerGitHub <noreply@github.com>
Wed, 7 Mar 2018 22:47:49 +0000 (14:47 -0800)
src/mscorlib/shared/System/Globalization/DateTimeParse.cs
src/mscorlib/shared/System/MemoryExtensions.cs

index fd64c6d..bf86e0c 100644 (file)
@@ -5296,7 +5296,7 @@ new DS[] { DS.ERROR, DS.TX_NNN,  DS.TX_NNN,  DS.TX_NNN,  DS.ERROR,   DS.ERROR,
                     Span<char> result = new char[i + 1];
                     result[i] = ch;
                     Value.Slice(0, i).CopyTo(result);
-                    Value = result.AsReadOnlySpan();
+                    Value = result;
                 }
             }
         }
@@ -5323,7 +5323,7 @@ new DS[] { DS.ERROR, DS.TX_NNN,  DS.TX_NNN,  DS.TX_NNN,  DS.ERROR,   DS.ERROR,
                     Span<char> result = new char[Value.Length - i];
                     result[0] = ch;
                     Value.Slice(i + 1).CopyTo(result.Slice(1));
-                    Value = result.AsReadOnlySpan();
+                    Value = result;
                 }
             }
         }
index d5a6b72..0f8f167 100644 (file)
@@ -786,34 +786,6 @@ namespace System
         }
 
         /// <summary>
-        /// Creates a new readonly span over the entire target array.
-        /// </summary>
-        [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<T> AsReadOnlySpan<T>(this T[] array)
-        {
-            return new ReadOnlySpan<T>(array);
-        }
-
-        /// <summary>
-        /// Creates a new readonly span over the entire target span.
-        /// </summary>
-        public static ReadOnlySpan<T> AsReadOnlySpan<T>(this Span<T> span) => span;
-
-        /// <summary>
-        /// Creates a new readonly span over the target array segment.
-        /// </summary>
-        [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<T> AsReadOnlySpan<T>(this ArraySegment<T> arraySegment)
-        {
-            return new ReadOnlySpan<T>(arraySegment.Array, arraySegment.Offset, arraySegment.Count);
-        }
-
-        /// <summary>
-        /// Creates a new readonly memory over the entire target memory.
-        /// </summary>
-        public static ReadOnlyMemory<T> AsReadOnlyMemory<T>(this Memory<T> memory) => memory;
-
-        /// <summary>
         /// Creates a new memory over the target array.
         /// </summary>
         public static Memory<T> AsMemory<T>(this T[] array) => new Memory<T>(array);