csharptest 14 жил өмнө
parent
commit
c86b504409

+ 3 - 1
src/ProtocolBuffers.Serialization/JsonFormatWriter.cs

@@ -246,8 +246,10 @@ namespace Google.ProtocolBuffers.Serialization
         {
             if (disposing)
             {
-                while(_counter.Count > 1)
+                while (_counter.Count > 1)
+                {
                     WriteMessageEnd();
+                }
             }
 
             base.Dispose(disposing);

+ 5 - 1
src/ProtocolBuffers.Serialization/XmlFormatWriter.cs

@@ -78,8 +78,10 @@ namespace Google.ProtocolBuffers.Serialization
         {
             if (disposing)
             {
-                while(_messageOpenCount > 0)
+                while (_messageOpenCount > 0)
+                {
                     WriteMessageEnd();
+                }
 
                 _output.Close();
             }
@@ -163,7 +165,9 @@ namespace Google.ProtocolBuffers.Serialization
         public override void WriteMessageEnd()
         {
             if (_messageOpenCount <= 0)
+            {
                 throw new InvalidOperationException();
+            }
 
             _output.WriteEndElement();
             _output.Flush();

+ 2 - 0
src/ProtocolBuffers/CodedOutputStream.cs

@@ -131,7 +131,9 @@ namespace Google.ProtocolBuffers
             if (output != null)
             {
                 if (position > 0)
+                {
                     Flush();
+                }
                 output.Dispose();
             }
         }