From a6bf36d409f5a5ba7cae7438142c37d786042429 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 2 Mar 2023 22:44:00 +0100 Subject: [PATCH] QMessageAuthenticationCode: make reset() noexcept MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Thiago Macieira Reviewed-by: MÃ¥rten Nordheim --- src/corelib/tools/qcryptographichash.cpp | 2 +- src/corelib/tools/qmessageauthenticationcode.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 8f616e966d..ccf34312de 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -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(); diff --git a/src/corelib/tools/qmessageauthenticationcode.h b/src/corelib/tools/qmessageauthenticationcode.h index 9e7f9dfbdb..4e88138763 100644 --- a/src/corelib/tools/qmessageauthenticationcode.h +++ b/src/corelib/tools/qmessageauthenticationcode.h @@ -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);