diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 7795fd7f11..5bb63bbbb2 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -1821,26 +1821,6 @@ void QByteArray::expand(qsizetype i) resize(qMax(i + 1, size())); } -/*! - \internal - Return a QByteArray that is sure to be '\\0'-terminated. - - By default, all QByteArray have an extra NUL at the end, - guaranteeing that assumption. However, if QByteArray::fromRawData - is used, then the NUL is there only if the user put it there. We - can't be sure. -*/ -QByteArray QByteArray::nulTerminated() const -{ - // is this fromRawData? - if (d.isMutable()) - return *this; // no, then we're sure we're zero terminated - - QByteArray copy(*this); - copy.detach(); - return copy; -} - /*! \fn QByteArray &QByteArray::prepend(QByteArrayView ba) diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index 5a6dc354ba..f3c167d217 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -485,7 +485,6 @@ private: void reallocData(qsizetype alloc, QArrayData::AllocationOption option); void reallocGrowData(qsizetype n); void expand(qsizetype i); - QByteArray nulTerminated() const; static QByteArray toLower_helper(const QByteArray &a); static QByteArray toLower_helper(QByteArray &a);