mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-23 16:51:22 -04:00
Improve performance of a few for-loops
Some for-loops needlessly copied the collection they were looping over.
This commit is contained in:
parent
e2ee82169c
commit
4876beabed
5 changed files with 11 additions and 11 deletions
|
@ -101,7 +101,7 @@ const QString OpenSSHKey::fingerprint(QCryptographicHash::Algorithm algo) const
|
|||
|
||||
stream.writeString(m_type);
|
||||
|
||||
for (QByteArray ba : m_publicData) {
|
||||
for (const QByteArray& ba : m_publicData) {
|
||||
stream.writeString(ba);
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ const QString OpenSSHKey::publicKey() const
|
|||
|
||||
stream.writeString(m_type);
|
||||
|
||||
for (QByteArray ba : m_publicData) {
|
||||
for (const QByteArray& ba : m_publicData) {
|
||||
stream.writeString(ba);
|
||||
}
|
||||
|
||||
|
@ -544,7 +544,7 @@ bool OpenSSHKey::writePublic(BinaryStream& stream)
|
|||
return false;
|
||||
}
|
||||
|
||||
for (QByteArray t : m_publicData) {
|
||||
for (const QByteArray& t : m_publicData) {
|
||||
if (!stream.writeString(t)) {
|
||||
m_error = tr("Unexpected EOF when writing public key");
|
||||
return false;
|
||||
|
@ -566,7 +566,7 @@ bool OpenSSHKey::writePrivate(BinaryStream& stream)
|
|||
return false;
|
||||
}
|
||||
|
||||
for (QByteArray t : m_privateData) {
|
||||
for (const QByteArray& t : m_privateData) {
|
||||
if (!stream.writeString(t)) {
|
||||
m_error = tr("Unexpected EOF when writing private key");
|
||||
return false;
|
||||
|
|
|
@ -38,7 +38,7 @@ SSHAgent::SSHAgent(QObject* parent)
|
|||
|
||||
SSHAgent::~SSHAgent()
|
||||
{
|
||||
for (QSet<OpenSSHKey> keys : m_keys.values()) {
|
||||
for (const QSet<OpenSSHKey>& keys : m_keys.values()) {
|
||||
for (OpenSSHKey key : keys) {
|
||||
removeIdentity(key);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue