diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2022-08-17 13:34:40 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2022-08-20 21:22:53 +0200 |
| commit | 52c5f286950a56a8714a0be9b8ecb088f07d7eb8 (patch) | |
| tree | fbbe69c6dd10a71e20b94175b23000a65590ad48 /src/corelib/io/qdebug.cpp | |
| parent | 817e47fbcde21ab54d353efd647685159cb437a9 (diff) | |
QBuffer: optimize setData(ptr, n)
The old code always created a new QByteArray, always allocating
memory.
The new call assigns the data to the existing QByteArray, enabling
potential re-use of the internal QByteArray's buffer. Since QByteArray
is missing the STL-style assign() function, abuse replace() for this
task.
Change-Id: I357f11bad0a976d4d0fb2faeb93f8b2262fa5a65
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
0 files changed, 0 insertions, 0 deletions
