TimeZoneInfo.StringSerializer can be a struct (#8784)
authorJustin Van Patten <jvp@justinvp.com>
Tue, 3 Jan 2017 21:51:26 +0000 (13:51 -0800)
committerJan Kotas <jkotas@microsoft.com>
Tue, 3 Jan 2017 21:51:26 +0000 (13:51 -0800)
src/mscorlib/src/System/TimeZoneInfo.StringSerializer.cs

index 0e495bc..8012d1f 100644 (file)
@@ -12,10 +12,9 @@ namespace System
     public sealed partial class TimeZoneInfo
     {
         /// <summary>
-        /// This class is used to serialize and deserialize TimeZoneInfo
-        /// objects based on the custom string serialization format.
+        /// Used to serialize and deserialize TimeZoneInfo objects based on the custom string serialization format.
         /// </summary>
-        private sealed class StringSerializer
+        private struct StringSerializer
         {
             private enum State
             {
@@ -124,6 +123,7 @@ namespace System
             private StringSerializer(string str)
             {
                 _serializedText = str;
+                _currentTokenStartIndex = 0;
                 _state = State.StartOfToken;
             }