From 9a137eb8e782060c2450d105389a12b324f05763 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 28 Jun 2022 14:46:06 +0200 Subject: [PATCH] Only implicitly flush on uncorking 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. --- common/rdr/OutStream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/rdr/OutStream.h b/common/rdr/OutStream.h index 61d5100b..df1d8962 100644 --- a/common/rdr/OutStream.h +++ b/common/rdr/OutStream.h @@ -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 -- 2.39.5