QCryptographicHash: don't allocate a Private in hash()
Just create it on the stack, we know the lifetime. Reduces memory allocations in static hash() from 2 to 1. Change-Id: Ie0e22b023331da9a6f39c80b4cd1a5c016f63a87 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
dd06439f5e
commit
713fad1c58
@ -665,9 +665,9 @@ QByteArray QCryptographicHashPrivate::finalize()
|
|||||||
*/
|
*/
|
||||||
QByteArray QCryptographicHash::hash(QByteArrayView data, Algorithm method)
|
QByteArray QCryptographicHash::hash(QByteArrayView data, Algorithm method)
|
||||||
{
|
{
|
||||||
QCryptographicHash hash(method);
|
QCryptographicHashPrivate hash(method);
|
||||||
hash.addData(data);
|
hash.addData(data);
|
||||||
return hash.result();
|
return hash.finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user