From 1d72f3f9353c9cb699ce6195dc0def8e591d38fc Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Wed, 5 Jun 2024 15:50:20 +0200 Subject: [PATCH] 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 Reviewed-by: Marc Mutz (cherry picked from commit b3ebfc64d4c6fefde970c18c89e59cef9abc56c8) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/compat/removed_api.cpp | 2 +- src/corelib/text/qbytearray.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 40ef9875b00..b8f208e82ec 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -635,7 +635,7 @@ QBitArray QBitArray::operator~() const return QBitArray(*this).inverted_inplace(); } -#include "qbytearray.h" // also includes inlined API +#include "qbytearray.h" QByteArray QByteArray::left(qsizetype len) const { diff --git a/src/corelib/text/qbytearray.h b/src/corelib/text/qbytearray.h index 3c8a3bba454..5902b015167 100644 --- a/src/corelib/text/qbytearray.h +++ b/src/corelib/text/qbytearray.h @@ -136,12 +136,12 @@ public: [[nodiscard]] char back() const { return at(size() - 1); } [[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(QByteArrayView bv, qsizetype from = 0) const { 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(QByteArrayView bv) const { return lastIndexOf(bv, size()); } @@ -706,7 +706,7 @@ bool QByteArray::isNull() const noexcept return d->isNull(); } #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 { return qToByteArrayViewIgnoringNull(*this).indexOf(ch, from);