From 5b78d7fdcf9b758f117eaa65dc5eeddd0d4557e0 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 7 May 2021 18:16:17 +0300 Subject: QLocalSocket/Win: avoid double buffering on write As QWindowsPipeWriter now maintains a chunk queue, there is no need to use the internal QIODevice buffer and wait for the previous operation to complete. Change-Id: Id4d54edfe920aeb4a534980cb0cc85a56c067a70 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qiodevice.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/corelib/io/qiodevice.cpp') diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index f3354cad65..3e3ee6e406 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1763,9 +1763,7 @@ qint64 QIODevice::write(const QByteArray &data) */ void QIODevicePrivate::write(const char *data, qint64 size) { - if (currentWriteChunk != nullptr - && currentWriteChunk->constData() == data - && currentWriteChunk->size() == size) { + if (isWriteChunkCached(data, size)) { // We are called from write(const QByteArray &) overload. // So, we can make a shallow copy of chunk. writeBuffer.append(*currentWriteChunk); -- cgit v1.2.3