mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-29 17:48:46 -04:00
Reduce unnecessary copies using move semantics
This commit is contained in:
parent
896a66e6d8
commit
379c41d20c
10 changed files with 24 additions and 13 deletions
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <QBuffer>
|
||||
#include <QFile>
|
||||
#include <utility>
|
||||
|
||||
#define UUID_LENGTH 16
|
||||
|
||||
|
@ -43,9 +44,9 @@ KdbxXmlReader::KdbxXmlReader(quint32 version)
|
|||
* @param version KDBX version
|
||||
* @param binaryPool binary pool
|
||||
*/
|
||||
KdbxXmlReader::KdbxXmlReader(quint32 version, const QHash<QString, QByteArray>& binaryPool)
|
||||
KdbxXmlReader::KdbxXmlReader(quint32 version, QHash<QString, QByteArray> binaryPool)
|
||||
: m_kdbxVersion(version)
|
||||
, m_binaryPool(binaryPool)
|
||||
, m_binaryPool(std::move(binaryPool))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class KdbxXmlReader
|
|||
|
||||
public:
|
||||
explicit KdbxXmlReader(quint32 version);
|
||||
explicit KdbxXmlReader(quint32 version, const QHash<QString, QByteArray>& binaryPool);
|
||||
explicit KdbxXmlReader(quint32 version, QHash<QString, QByteArray> binaryPool);
|
||||
virtual ~KdbxXmlReader() = default;
|
||||
|
||||
virtual Database* readDatabase(const QString& filename);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "format/KeePass1.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <utility>
|
||||
|
||||
/**
|
||||
* Read database from file and detect correct file format.
|
||||
|
@ -37,7 +38,7 @@ Database* KeePass2Reader::readDatabase(const QString& filename, QSharedPointer<c
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
QScopedPointer<Database> db(readDatabase(&file, key));
|
||||
QScopedPointer<Database> db(readDatabase(&file, std::move(key)));
|
||||
|
||||
if (file.error() != QFile::NoError) {
|
||||
raiseError(file.errorString());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue