summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-12-03 12:21:46 +0100
committerLars Knoll <lars.knoll@qt.io>2020-07-06 21:30:33 +0200
commitfbce2e58e6f29dc8dde5618597d53e1b1007b503 (patch)
tree836e966a69b532e140bc3d83ad846999adb75e47 /src/corelib/text
parentc01804bd1edf00006a76edb1bf33ba9f72a69296 (diff)
Get rid of QArrayData::sharedNull()
Remove the last places where those got used and avoid allocations when we resize to 0. Change-Id: Ib553f4e7ce7cc24c31da15a55a86d18bdf1cc5c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qbytearray.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index 350fa3be25..e0f720bc86 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -1732,7 +1732,7 @@ QByteArray QByteArray::nulTerminated() const
QByteArray &QByteArray::prepend(const QByteArray &ba)
{
- if (size() == 0 && d->isStatic() && ba.d.isMutable()) {
+ if (size() == 0 && ba.d.isMutable()) {
*this = ba;
} else if (ba.size() != 0) {
QByteArray tmp = *this;
@@ -1825,7 +1825,7 @@ QByteArray &QByteArray::prepend(char ch)
QByteArray &QByteArray::append(const QByteArray &ba)
{
- if (size() == 0 && d->isStatic() && ba.d.isMutable()) {
+ if (size() == 0 && ba.d.isMutable()) {
*this = ba;
} else if (ba.size() != 0) {
if (d->needsDetach() || size() + ba.size() > capacity())