simplify some formatted_raw_ostream code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78836
91177308-0d34-0410-b5e6-
96231b3b80d8
// own buffering, and it doesn't need or want TheStream to do another
// layer of buffering underneath. Resize the buffer to what TheStream
// had been using, and tell TheStream not to do its own buffering.
- TheStream->flush();
- if (size_t BufferSize = TheStream->GetNumBytesInBuffer())
+ if (size_t BufferSize = TheStream->GetBufferSize())
SetBufferSize(BufferSize);
TheStream->SetUnbuffered();
Unbuffered = false;
}
+ size_t GetBufferSize() const {
+ return OutBufEnd - OutBufStart;
+ }
+
/// SetUnbuffered - Set the streams buffering status. When
/// unbuffered the stream will flush after every write. This routine
/// will also flush the buffer immediately when the stream is being