diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index e050ec356e4..f3c7ce10266 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -179,13 +179,13 @@ public: = default; QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QString) void swap(QString &other) noexcept { d.swap(other.d); } - inline qsizetype size() const { return d.size; } + inline qsizetype size() const noexcept { return d.size; } #if QT_DEPRECATED_SINCE(6, 4) QT_DEPRECATED_VERSION_X_6_4("Use size() or length() instead.") inline qsizetype count() const { return d.size; } #endif - inline qsizetype length() const { return d.size; } - inline bool isEmpty() const; + inline qsizetype length() const noexcept { return d.size; } + inline bool isEmpty() const noexcept { return d.size == 0; } void resize(qsizetype size); void resize(qsizetype size, QChar fillChar); @@ -1080,8 +1080,6 @@ inline const QChar QString::at(qsizetype i) const { Q_ASSERT(size_t(i) < size_t(size())); return QChar(d.data()[i]); } inline const QChar QString::operator[](qsizetype i) const { Q_ASSERT(size_t(i) < size_t(size())); return QChar(d.data()[i]); } -inline bool QString::isEmpty() const -{ return d.size == 0; } inline const QChar *QString::unicode() const { return data(); } inline const QChar *QString::data() const