Fix QByteArray::(last)IndexOf inlining conditions

The original patch didn't make it into 6.7, so the conditions should
be changed to 6.8

Amends 5ea4e27661e1805a6ed01c7a61643f9a50c15d62.

Found in API Review.

Change-Id: Ib8b77e3370685057b09b5eea2d982d3a6b77a1a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b3ebfc64d4c6fefde970c18c89e59cef9abc56c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ivan Solovev 2024-06-05 15:50:20 +02:00 committed by Qt Cherry-pick Bot
parent 462088b115
commit 1d72f3f935
2 changed files with 4 additions and 4 deletions

View File

@ -635,7 +635,7 @@ QBitArray QBitArray::operator~() const
return QBitArray(*this).inverted_inplace(); return QBitArray(*this).inverted_inplace();
} }
#include "qbytearray.h" // also includes inlined API #include "qbytearray.h"
QByteArray QByteArray::left(qsizetype len) const QByteArray QByteArray::left(qsizetype len) const
{ {

View File

@ -136,12 +136,12 @@ public:
[[nodiscard]] char back() const { return at(size() - 1); } [[nodiscard]] char back() const { return at(size() - 1); }
[[nodiscard]] inline char &back(); [[nodiscard]] inline char &back();
QT_CORE_INLINE_SINCE(6, 7) QT_CORE_INLINE_SINCE(6, 8)
qsizetype indexOf(char c, qsizetype from = 0) const; qsizetype indexOf(char c, qsizetype from = 0) const;
qsizetype indexOf(QByteArrayView bv, qsizetype from = 0) const qsizetype indexOf(QByteArrayView bv, qsizetype from = 0) const
{ return QtPrivate::findByteArray(qToByteArrayViewIgnoringNull(*this), from, bv); } { return QtPrivate::findByteArray(qToByteArrayViewIgnoringNull(*this), from, bv); }
QT_CORE_INLINE_SINCE(6, 7) QT_CORE_INLINE_SINCE(6, 8)
qsizetype lastIndexOf(char c, qsizetype from = -1) const; qsizetype lastIndexOf(char c, qsizetype from = -1) const;
qsizetype lastIndexOf(QByteArrayView bv) const qsizetype lastIndexOf(QByteArrayView bv) const
{ return lastIndexOf(bv, size()); } { return lastIndexOf(bv, size()); }
@ -706,7 +706,7 @@ bool QByteArray::isNull() const noexcept
return d->isNull(); return d->isNull();
} }
#endif #endif
#if QT_CORE_INLINE_IMPL_SINCE(6, 7) #if QT_CORE_INLINE_IMPL_SINCE(6, 8)
qsizetype QByteArray::indexOf(char ch, qsizetype from) const qsizetype QByteArray::indexOf(char ch, qsizetype from) const
{ {
return qToByteArrayViewIgnoringNull(*this).indexOf(ch, from); return qToByteArrayViewIgnoringNull(*this).indexOf(ch, from);