summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qcryptographichash.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index a93b546c77..473d2f1fb3 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -141,7 +141,12 @@ QT_BEGIN_NAMESPACE
class QCryptographicHashPrivate
{
public:
- QCryptographicHash::Algorithm method;
+ explicit QCryptographicHashPrivate(QCryptographicHash::Algorithm method) noexcept
+ : method(method)
+ {
+ }
+
+ const QCryptographicHash::Algorithm method;
union {
Sha1State sha1Context;
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
@@ -267,9 +272,8 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount, Sha3Variant sha3Variant
Constructs an object that can be used to create a cryptographic hash from data using \a method.
*/
QCryptographicHash::QCryptographicHash(Algorithm method)
- : d(new QCryptographicHashPrivate)
+ : d(new QCryptographicHashPrivate{method})
{
- d->method = method;
reset();
}