瀏覽代碼

a bit more cleanup

Jan Tattermusch 5 年之前
父節點
當前提交
94e64f2c0b
共有 2 個文件被更改,包括 2 次插入21 次删除
  1. 0 19
      csharp/src/Google.Protobuf/CodedOutputStream.cs
  2. 2 2
      csharp/src/Google.Protobuf/WriterInternalState.cs

+ 0 - 19
csharp/src/Google.Protobuf/CodedOutputStream.cs

@@ -548,20 +548,6 @@ namespace Google.Protobuf
 
         #endregion
 
-        //private void RefreshBuffer()
-        //{
-        //    if (output == null)
-        //    {
-        //        // We're writing to a single buffer.
-        //        throw new OutOfSpaceException();
-        //    }
-
-        //    // Since we have an output stream, this is our buffer
-        //    // and buffer offset == 0
-        //    output.Write(buffer, 0, position);
-        //    position = 0;
-        //}
-
         /// <summary>
         /// Indicates that a CodedOutputStream wrapping a flat byte array
         /// ran out of space.
@@ -605,11 +591,6 @@ namespace Google.Protobuf
         {
             var span = new Span<byte>(buffer);
             WriteBufferHelper.Flush(ref span, ref state);
-            
-            /*if (output != null)
-            {
-                RefreshBuffer();
-            }*/
         }
 
         /// <summary>

+ 2 - 2
csharp/src/Google.Protobuf/WriterInternalState.cs

@@ -50,8 +50,8 @@ namespace Google.Protobuf
         // NOTE: the Span representing the current buffer is kept separate so that this doesn't have to be a ref struct and so it can
         // be included in CodedOutputStream's internal state
 
-        internal int limit;  // TODO: it's readonly in CodedOutputStream
-        internal int position;
+        internal int limit;  // the size of the current buffer
+        internal int position;  // position in the current buffer
 
         internal WriteBufferHelper writeBufferHelper;