From 4503207caf9349fb48ffecbd1a06506c5e36cb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 9 Sep 2022 09:57:49 +0200 Subject: [PATCH] Http2: Drop an unnecessary copy of incoming data We don't need the QBA later, so just pass it directly to the QByteDataBuffer and avoid the ref-counter increase/decrease. Change-Id: I253a29981bdfffb1a205baaaa0788d4283253e19 Reviewed-by: Konrad Kujawa Reviewed-by: Edward Welbourne --- src/network/access/qhttp2protocolhandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index 562b883242f..f41cde067ab 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -1242,8 +1242,7 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const Frame &frame, replyPrivate->totalProgress += length; - const QByteArray wrapped(data, length); - replyPrivate->responseData.append(wrapped); + replyPrivate->responseData.append(QByteArray(data, length)); if (replyPrivate->shouldEmitSignals()) { if (connectionType == Qt::DirectConnection) {