Reduce unnecessary copies using move semantics

This commit is contained in:
Gianluca Recchia committed 2018-10-31 15:16:04 +01:00
1 parent 896a66e6d8
commit 379c41d20c
10 files changed
+24 -13

No files matched your search

+4 -2
View File
@@ -17,6 +17,8 @@
#include "HmacBlockStream.h"
#include <utility>
#include "core/Endian.h"
#include "crypto/CryptoHash.h"
@@ -25,7 +27,7 @@ const QSysInfo::Endian HmacBlockStream::ByteOrder = QSysInfo::LittleEndian;
HmacBlockStream::HmacBlockStream(QIODevice* baseDevice, QByteArray key)
: LayeredStream(baseDevice)
, m_blockSize(1024 * 1024)
, m_key(key)
, m_key(std::move(key))
{
init();
}
@@ -33,7 +35,7 @@ HmacBlockStream::HmacBlockStream(QIODevice* baseDevice, QByteArray key)
HmacBlockStream::HmacBlockStream(QIODevice* baseDevice, QByteArray key, qint32 blockSize)
: LayeredStream(baseDevice)
, m_blockSize(blockSize)
, m_key(key)
, m_key(std::move(key))
{
init();
}