diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-11-16 16:29:29 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-05-17 20:37:42 +0200 |
commit | 88c72d972a2b33acf6382107d4aa5ddb4af0d6ec (patch) | |
tree | 4e5fe58929f7bfbd72fef4eaefb3b36dfefedf77 | |
parent | fae7a47bb3f89ded2d59dc2ad6960e35f252733b (diff) |
Don't access QArrayData::sharedNull() from QByteArray anymore
Change-Id: I1292f8d2d62fa96ae4c6aa91c7c95c1f3a18570f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 32642b83e3..4d86205488 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -1209,13 +1209,11 @@ QByteArray &QByteArray::operator=(const QByteArray & other) noexcept QByteArray &QByteArray::operator=(const char *str) { if (!str || !*str) { - QPair<Data *, char *> pair; if (!str) { - pair = qMakePair(Data::sharedNull(), Data::sharedNullData()); + d.clear(); } else { - pair = Data::allocate(0); + d = QByteArrayData(Data::allocate(0), 0); } - d = QByteArrayData(pair.first, pair.second, 0); } else { const int len = int(strlen(str)); const uint fullLen = uint(len) + 1; |