summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2021-07-06 08:12:00 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-07-07 23:49:26 +0000
commite9fffbaf81ec81685cb6a5d75844cd700183ab9e (patch)
tree4bb6021e7d7040a1d88efd53448271915414024c /src/corelib/tools
parentbd62dc13919556c6dc564df25cbf0ddf456c05e7 (diff)
Use QCryptographicHash::hash() more widely
... instead of the "usual" rule of three: ctor, addData(), result(). Not only does it generate less code in the caller, it's now also faster. Change-Id: I67c7eeb01f527b90e80a08f60c1c7f2ec1e49dd4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qmessageauthenticationcode.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/tools/qmessageauthenticationcode.cpp b/src/corelib/tools/qmessageauthenticationcode.cpp
index 2d0145147a..9580b024c2 100644
--- a/src/corelib/tools/qmessageauthenticationcode.cpp
+++ b/src/corelib/tools/qmessageauthenticationcode.cpp
@@ -122,10 +122,7 @@ void QMessageAuthenticationCodePrivate::initMessageHash()
const int blockSize = qt_hash_block_size(method);
if (key.size() > blockSize) {
- QCryptographicHash hash(method);
- hash.addData(key);
- key = hash.result();
- hash.reset();
+ key = QCryptographicHash::hash(key, method);
}
if (key.size() < blockSize) {