QMessageAuthenticationCode: make reset() noexcept

This is the last method that can and should be noexcept:

- the ctor allocates the Private, so can't be
- static hash() allocates QByteArray::data(), so also cannot be
- ditto result()

All other functions are already noexcept.

Fixes: QTBUG-111688
Change-Id: I237c3d1292452da5ca92712531c3527c1fb2f59b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Marc Mutz 2023-03-02 22:44:00 +01:00
parent c19f9716fb
commit a6bf36d409
2 changed files with 2 additions and 2 deletions

View File

@ -1307,7 +1307,7 @@ QMessageAuthenticationCode::~QMessageAuthenticationCode()
/*!
Resets message data. Calling this method doesn't affect the key.
*/
void QMessageAuthenticationCode::reset()
void QMessageAuthenticationCode::reset() noexcept
{
d->result.clear();
d->messageHash.reset();

View File

@ -31,7 +31,7 @@ public:
void swap(QMessageAuthenticationCode &other) noexcept
{ qt_ptr_swap(d, other.d); }
void reset();
void reset() noexcept;
#if QT_CORE_REMOVED_SINCE(6, 6)
void setKey(const QByteArray &key);