diff options
Diffstat (limited to 'src/corelib/text/qbytearray.cpp')
| -rw-r--r-- | src/corelib/text/qbytearray.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 7f8349131d8..42921e99d76 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -2044,9 +2044,14 @@ QByteArray &QByteArray::prepend(const QByteArray &ba) QByteArray &QByteArray::append(const QByteArray &ba) { - if (size() == 0 && ba.size() > d->freeSpaceAtEnd() && ba.d.isMutable()) - return (*this = ba); - return append(QByteArrayView(ba)); + if (!ba.isNull()) { + if (isNull()) { + operator=(ba); + } else if (ba.size()) { + append(QByteArrayView(ba)); + } + } + return *this; } /*! |
