diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/MemoryDebugView.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/MemoryDebugView.cs | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/System.Private.CoreLib/shared/System/MemoryDebugView.cs b/src/System.Private.CoreLib/shared/System/MemoryDebugView.cs index b1ed88199..6ab6e5065 100644 --- a/src/System.Private.CoreLib/shared/System/MemoryDebugView.cs +++ b/src/System.Private.CoreLib/shared/System/MemoryDebugView.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.Diagnostics; -using System.Runtime.InteropServices; namespace System { @@ -22,31 +21,6 @@ namespace System } [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public T[] Items - { - // This is a work around since we cannot use _memory.ToArray() due to - // https://devdiv.visualstudio.com/DevDiv/_workitems?id=286592 - get - { - if (MemoryMarshal.TryGetArray(_memory, out ArraySegment<T> segment)) - { - T[] array = new T[_memory.Length]; - Array.Copy(segment.Array, segment.Offset, array, 0, array.Length); - return array; - } - - if (typeof(T) == typeof(char) && - MemoryMarshal.TryGetString((ReadOnlyMemory<char>)(object)_memory, out string text, out int start, out int length)) - { - return (T[])(object)text.Substring(start, length).ToCharArray(); - } - -#if FEATURE_PORTABLE_SPAN - return SpanHelpers.PerTypeValues<T>.EmptyArray; -#else - return Array.Empty<T>(); -#endif // FEATURE_PORTABLE_SPAN - } - } + public T[] Items => _memory.ToArray(); } } |