Reduce number of unneeded copies

This patch aims at reducing the number of copies for obejcts that could
be referenced rather than copied, because they're not modified during
the computation.
This commit is contained in:
Gianluca Recchia 2018-10-28 12:49:32 +01:00
parent a67a574b89
commit da9afd3f6f
No known key found for this signature in database
GPG key ID: 3C2B4128D9A1F218
40 changed files with 90 additions and 90 deletions

View file

@ -71,7 +71,7 @@ int Clip::execute(const QStringList& arguments)
return clipEntry(db, args.at(1), args.value(2));
}
int Clip::clipEntry(Database* database, QString entryPath, QString timeout)
int Clip::clipEntry(Database* database, const QString& entryPath, const QString& timeout)
{
TextStream err(Utils::STDERR);

View file

@ -26,7 +26,7 @@ public:
Clip();
~Clip();
int execute(const QStringList& arguments);
int clipEntry(Database* database, QString entryPath, QString timeout);
int clipEntry(Database* database, const QString& entryPath, const QString& timeout);
};
#endif // KEEPASSXC_CLIP_H

View file

@ -71,7 +71,7 @@ void populateCommands()
}
}
Command* Command::getCommand(QString commandName)
Command* Command::getCommand(const QString& commandName)
{
populateCommands();
if (commands.contains(commandName)) {

View file

@ -35,7 +35,7 @@ public:
QString getDescriptionLine();
static QList<Command*> getCommands();
static Command* getCommand(QString commandName);
static Command* getCommand(const QString& commandName);
};
#endif // KEEPASSXC_COMMAND_H