mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Fixed clazy warnings: pass large objects by reference to const.
This commit is contained in:
8
src/blackmisc/thirdparty/simplecrypt.cpp
vendored
8
src/blackmisc/thirdparty/simplecrypt.cpp
vendored
@@ -82,7 +82,7 @@ namespace BlackMisc
|
||||
return encryptToByteArray(plaintextArray);
|
||||
}
|
||||
|
||||
QByteArray SimpleCrypt::encryptToByteArray(QByteArray plaintext)
|
||||
QByteArray SimpleCrypt::encryptToByteArray(const QByteArray &plaintext)
|
||||
{
|
||||
if (m_keyParts.isEmpty())
|
||||
{
|
||||
@@ -159,7 +159,7 @@ namespace BlackMisc
|
||||
return cypherString;
|
||||
}
|
||||
|
||||
QString SimpleCrypt::encryptToString(QByteArray plaintext)
|
||||
QString SimpleCrypt::encryptToString(const QByteArray &plaintext)
|
||||
{
|
||||
QByteArray cypher = encryptToByteArray(plaintext);
|
||||
QString cypherString = QString::fromLatin1(cypher.toBase64());
|
||||
@@ -175,7 +175,7 @@ namespace BlackMisc
|
||||
return plaintext;
|
||||
}
|
||||
|
||||
QString SimpleCrypt::decryptToString(QByteArray cypher)
|
||||
QString SimpleCrypt::decryptToString(const QByteArray &cypher)
|
||||
{
|
||||
QByteArray ba = decryptToByteArray(cypher);
|
||||
QString plaintext = QString::fromUtf8(ba, ba.size());
|
||||
@@ -191,7 +191,7 @@ namespace BlackMisc
|
||||
return ba;
|
||||
}
|
||||
|
||||
QByteArray SimpleCrypt::decryptToByteArray(QByteArray cypher)
|
||||
QByteArray SimpleCrypt::decryptToByteArray(const QByteArray &cypher)
|
||||
{
|
||||
if (m_keyParts.isEmpty())
|
||||
{
|
||||
|
||||
8
src/blackmisc/thirdparty/simplecrypt.h
vendored
8
src/blackmisc/thirdparty/simplecrypt.h
vendored
@@ -147,7 +147,7 @@ namespace BlackMisc
|
||||
a cyphertext the result. The result is a base64 encoded version of the binary array that is the
|
||||
actual result of the encryption, so it can be stored easily in a text format.
|
||||
*/
|
||||
QString encryptToString(QByteArray plaintext) ;
|
||||
QString encryptToString(const QByteArray &plaintext) ;
|
||||
|
||||
/**
|
||||
Encrypts the @arg plaintext string with the key the class was initialized with, and returns
|
||||
@@ -165,7 +165,7 @@ namespace BlackMisc
|
||||
This method returns a byte array, that is useable for storing a binary format. If you need
|
||||
a string you can store in a text file, use encryptToString() instead.
|
||||
*/
|
||||
QByteArray encryptToByteArray(QByteArray plaintext) ;
|
||||
QByteArray encryptToByteArray(const QByteArray &plaintext) ;
|
||||
|
||||
/**
|
||||
Decrypts a cyphertext string encrypted with this class with the set key back to the
|
||||
@@ -192,7 +192,7 @@ namespace BlackMisc
|
||||
If an error occured, such as non-matching keys between encryption and decryption,
|
||||
an empty string or a string containing nonsense may be returned.
|
||||
*/
|
||||
QString decryptToString(QByteArray cypher) ;
|
||||
QString decryptToString(const QByteArray &cypher) ;
|
||||
|
||||
/**
|
||||
Decrypts a cyphertext binary encrypted with this class with the set key back to the
|
||||
@@ -201,7 +201,7 @@ namespace BlackMisc
|
||||
If an error occured, such as non-matching keys between encryption and decryption,
|
||||
an empty string or a string containing nonsense may be returned.
|
||||
*/
|
||||
QByteArray decryptToByteArray(QByteArray cypher) ;
|
||||
QByteArray decryptToByteArray(const QByteArray &cypher) ;
|
||||
|
||||
/**
|
||||
Enum to describe options that have been used for the encryption. Currently only one, but
|
||||
|
||||
Reference in New Issue
Block a user