Skip to content

Commit

Permalink
Only implicitly flush on uncorking
Browse files Browse the repository at this point in the history
There is no point flushing when corking was enabled, as we might then
push out a small buffer that the corking otherwise would have preserved.
  • Loading branch information
CendioOssman committed Jun 28, 2022
1 parent af3e754 commit 9a137eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/rdr/OutStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace rdr {

// cork() requests that the stream coalesces flushes in an efficient way

virtual void cork(bool enable) { corked = enable; flush(); }
virtual void cork(bool enable) { corked = enable; if (!enable) flush(); }

// getptr() and setptr() are "dirty" methods which allow you direct access
// to the buffer. This is useful for a stream which is a wrapper around an
Expand Down

0 comments on commit 9a137eb

Please sign in to comment.