a bit more cleanup

pull/7576/head
Jan Tattermusch 5 years ago
parent ba61d76e52
commit 94e64f2c0b
  1. 19
      csharp/src/Google.Protobuf/CodedOutputStream.cs
  2. 4
      csharp/src/Google.Protobuf/WriterInternalState.cs

@ -548,20 +548,6 @@ namespace Google.Protobuf
#endregion #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> /// <summary>
/// Indicates that a CodedOutputStream wrapping a flat byte array /// Indicates that a CodedOutputStream wrapping a flat byte array
/// ran out of space. /// ran out of space.
@ -605,11 +591,6 @@ namespace Google.Protobuf
{ {
var span = new Span<byte>(buffer); var span = new Span<byte>(buffer);
WriteBufferHelper.Flush(ref span, ref state); WriteBufferHelper.Flush(ref span, ref state);
/*if (output != null)
{
RefreshBuffer();
}*/
} }
/// <summary> /// <summary>

@ -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 // 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 // be included in CodedOutputStream's internal state
internal int limit; // TODO: it's readonly in CodedOutputStream internal int limit; // the size of the current buffer
internal int position; internal int position; // position in the current buffer
internal WriteBufferHelper writeBufferHelper; internal WriteBufferHelper writeBufferHelper;

Loading…
Cancel
Save