From 8bdede75864638b2f57f99801d71779b39f4532e Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 7 Mar 2018 14:47:49 -0800 Subject: Delete AsReadOnly* APIs that are no longer part of the public surface (#16799) Signed-off-by: dotnet-bot --- .../shared/System/Globalization/DateTimeParse.cs | 4 ++-- .../shared/System/MemoryExtensions.cs | 28 ---------------------- 2 files changed, 2 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs b/src/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs index fd64c6d11..bf86e0cfd 100644 --- a/src/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs +++ b/src/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs @@ -5296,7 +5296,7 @@ new DS[] { DS.ERROR, DS.TX_NNN, DS.TX_NNN, DS.TX_NNN, DS.ERROR, DS.ERROR, Span 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 result = new char[Value.Length - i]; result[0] = ch; Value.Slice(i + 1).CopyTo(result.Slice(1)); - Value = result.AsReadOnlySpan(); + Value = result; } } } diff --git a/src/System.Private.CoreLib/shared/System/MemoryExtensions.cs b/src/System.Private.CoreLib/shared/System/MemoryExtensions.cs index d5a6b72eb..0f8f167e6 100644 --- a/src/System.Private.CoreLib/shared/System/MemoryExtensions.cs +++ b/src/System.Private.CoreLib/shared/System/MemoryExtensions.cs @@ -785,34 +785,6 @@ namespace System return new Span(segment.Array, segment.Offset + start, length); } - /// - /// Creates a new readonly span over the entire target array. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadOnlySpan AsReadOnlySpan(this T[] array) - { - return new ReadOnlySpan(array); - } - - /// - /// Creates a new readonly span over the entire target span. - /// - public static ReadOnlySpan AsReadOnlySpan(this Span span) => span; - - /// - /// Creates a new readonly span over the target array segment. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadOnlySpan AsReadOnlySpan(this ArraySegment arraySegment) - { - return new ReadOnlySpan(arraySegment.Array, arraySegment.Offset, arraySegment.Count); - } - - /// - /// Creates a new readonly memory over the entire target memory. - /// - public static ReadOnlyMemory AsReadOnlyMemory(this Memory memory) => memory; - /// /// Creates a new memory over the target array. /// -- cgit v1.2.3