Update Span DebuggerDisplays
authorIan Hays <ianha@microsoft.com>
Tue, 30 Jan 2018 18:54:19 +0000 (10:54 -0800)
committerIan Hays <ianha@microsoft.com>
Tue, 30 Jan 2018 18:54:19 +0000 (10:54 -0800)
src/mscorlib/shared/System/ReadOnlySpan.cs
src/mscorlib/shared/System/Span.cs

index 3531e8b..063732b 100644 (file)
@@ -125,9 +125,6 @@ namespace System
             _length = length;
         }
 
-        //Debugger Display = System.ReadOnlySpan<T>[length]
-        private string DebuggerDisplay => string.Format("System.ReadOnlySpan<{0}>[{1}]", typeof(T).Name, _length);
-
         /// <summary>
         /// Returns a reference to the 0th element of the Span. If the Span is empty, returns a reference to the location where the 0th element
         /// would have been stored. Such a reference can be used for pinning but must never be dereferenced.
@@ -280,7 +277,7 @@ namespace System
         /// <summary>
         /// Returns a <see cref="String"/> with the name of the type and the number of elements
         /// </summary>
-        public override string ToString() => string.Format("System.ReadOnlySpan<{0}>[{1}]", typeof(T).Name, Length);
+        public override string ToString() => string.Format("System.ReadOnlySpan<{0}>[{1}]", typeof(T).Name, _length);
 
         /// <summary>
         /// Defines an implicit conversion of an array to a <see cref="ReadOnlySpan{T}"/>
index 5c5cb23..d96f4b1 100644 (file)
@@ -131,9 +131,6 @@ namespace System
             _length = length;
         }
 
-        //Debugger Display = System.Span<T>[length]
-        private string DebuggerDisplay => string.Format("System.Span<{0}>[{1}]", typeof(T).Name, _length);
-
         /// <summary>
         /// Returns a reference to the 0th element of the Span. If the Span is empty, returns a reference to the location where the 0th element
         /// would have been stored. Such a reference can be used for pinning but must never be dereferenced.
@@ -355,7 +352,7 @@ namespace System
         /// <summary>
         /// Returns a <see cref="String"/> with the name of the type and the number of elements
         /// </summary>
-        public override string ToString() => string.Format("System.Span<{0}>[{1}]", typeof(T).Name, Length);
+        public override string ToString() => string.Format("System.Span<{0}>[{1}]", typeof(T).Name, _length);
 
         /// <summary>
         /// Defines an implicit conversion of an array to a <see cref="Span{T}"/>