Get rid of QByteArray::nulTerminated()

It is private and was not called by anything inline, even in 5.15, so
can safely be removed without causing binary incompatibilities, now
that it is no longer used even out-of-line.

Task-number: QTBUG-74286
Change-Id: Iaec3877079746bd9ba7d1a39efbfb2711e7c00a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Edward Welbourne 2021-08-09 19:00:56 +02:00
parent 0cee66048d
commit e0206fe9d4
2 changed files with 1 additions and 22 deletions

View File

@ -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)

View File

@ -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);