Use corelib-shared ValueStringBuilder
authorStephen Toub <stoub@microsoft.com>
Mon, 29 Jan 2018 17:01:12 +0000 (12:01 -0500)
committerStephen Toub <stoub@microsoft.com>
Mon, 29 Jan 2018 20:37:10 +0000 (15:37 -0500)
Use the shared version, delete the copy.

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
src/mscorlib/shared/System/Text/ValueStringBuilder.cs

index 0a91eb0..84e5fa8 100644 (file)
@@ -21,7 +21,22 @@ namespace System.Text
             _pos = 0;
         }
 
-        public int Length => _pos;
+        public int Length
+        {
+            get => _pos;
+            set
+            {
+                int delta = value - _pos;
+                if (delta > 0)
+                {
+                    Append('\0', delta);
+                }
+                else
+                {
+                    _pos = value;
+                }
+            }
+        }
 
         public override string ToString()
         {