From ed604ce1019b037e27f06aa867e8bf203e1d433f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 19 Mar 2023 15:33:41 +0100 Subject: [PATCH] QMessageAuthenticationCode: remove Private::method ...it's the same as messageHash.method, so we don't need to store it twice. Pick-to: 6.5 Change-Id: I926dbfa177c25e9bc3ebed9149da5ce8bad8cf2f Reviewed-by: Thiago Macieira --- src/corelib/tools/qcryptographichash.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index abfef79cec3..1fecf2ee6af 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -1303,14 +1303,13 @@ class QMessageAuthenticationCodePrivate { public: QMessageAuthenticationCodePrivate(QCryptographicHash::Algorithm m) - : messageHash(m), method(m) + : messageHash(m) { } HashBlock key; HashResult result; QCryptographicHashPrivate messageHash; - const QCryptographicHash::Algorithm method; void setKey(QByteArrayView k) noexcept; void initMessageHash() noexcept; @@ -1333,7 +1332,7 @@ public: */ void QMessageAuthenticationCodePrivate::setKey(QByteArrayView newKey) noexcept { - const int blockSize = qt_hash_block_size(method); + const int blockSize = qt_hash_block_size(messageHash.method); if (newKey.size() > blockSize) { messageHash.addData(newKey);