Improve usage of std::move and const references parameters
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`. Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move. Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
This commit is contained in:
1 parent
33f62b0f9f
commit
95dec13203
140 files changed
+318
-277
No files matched your search
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "DolphinQt/Config/CheatWarningWidget.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPixmap>
|
||||
@@ -16,9 +18,8 @@
|
||||
#include "DolphinQt/QtUtils/QtUtils.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
CheatWarningWidget::CheatWarningWidget(const std::string& game_id, bool restart_required,
|
||||
QWidget* parent)
|
||||
: QWidget(parent), m_game_id(game_id), m_restart_required(restart_required)
|
||||
CheatWarningWidget::CheatWarningWidget(std::string game_id, bool restart_required, QWidget* parent)
|
||||
: QWidget(parent), m_game_id(std::move(game_id)), m_restart_required(restart_required)
|
||||
{
|
||||
CreateWidgets();
|
||||
ConnectWidgets();
|
||||
|
||||
@@ -14,7 +14,7 @@ class CheatWarningWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CheatWarningWidget(const std::string& game_id, bool restart_required, QWidget* parent);
|
||||
explicit CheatWarningWidget(std::string game_id, bool restart_required, QWidget* parent);
|
||||
|
||||
signals:
|
||||
void OpenCheatEnableSettings();
|
||||
|
||||
@@ -91,7 +91,7 @@ void ConfigStringChoice::OnConfigChanged()
|
||||
Load();
|
||||
}
|
||||
|
||||
ConfigComplexChoice::ConfigComplexChoice(const InfoVariant setting1, const InfoVariant setting2,
|
||||
ConfigComplexChoice::ConfigComplexChoice(const InfoVariant& setting1, const InfoVariant& setting2,
|
||||
Config::Layer* layer)
|
||||
: m_layer(layer), m_setting1(setting1), m_setting2(setting2)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ class ConfigComplexChoice final : public ToolTipComboBox
|
||||
using OptionVariant = std::variant<Config::DefaultState, u32, int, bool>;
|
||||
|
||||
public:
|
||||
ConfigComplexChoice(const InfoVariant setting1, const InfoVariant setting2,
|
||||
ConfigComplexChoice(const InfoVariant& setting1, const InfoVariant& setting2,
|
||||
Config::Layer* layer = nullptr);
|
||||
|
||||
void Add(const QString& name, const OptionVariant option1, const OptionVariant option2);
|
||||
|
||||
@@ -101,7 +101,8 @@ void VerifyWidget::CreateWidgets()
|
||||
m_verify_button = new QPushButton(tr("Verify Integrity"), this);
|
||||
}
|
||||
|
||||
std::pair<QCheckBox*, QLineEdit*> VerifyWidget::AddHashLine(QFormLayout* layout, QString text)
|
||||
std::pair<QCheckBox*, QLineEdit*> VerifyWidget::AddHashLine(QFormLayout* layout,
|
||||
const QString& text)
|
||||
{
|
||||
QLineEdit* line_edit = new QLineEdit(this);
|
||||
line_edit->setReadOnly(true);
|
||||
@@ -225,7 +226,7 @@ void VerifyWidget::Verify()
|
||||
m_redump_line_edit->setText(QString::fromStdString(result->redump.message));
|
||||
}
|
||||
|
||||
void VerifyWidget::SetProblemCellText(int row, int column, QString text)
|
||||
void VerifyWidget::SetProblemCellText(int row, int column, const QString& text)
|
||||
{
|
||||
QLabel* label = new QLabel(text);
|
||||
label->setTextInteractionFlags(Qt::TextSelectableByMouse);
|
||||
|
||||
@@ -32,13 +32,13 @@ public:
|
||||
private:
|
||||
void OnEmulationStateChanged(Core::State state);
|
||||
void CreateWidgets();
|
||||
std::pair<QCheckBox*, QLineEdit*> AddHashLine(QFormLayout* layout, QString text);
|
||||
std::pair<QCheckBox*, QLineEdit*> AddHashLine(QFormLayout* layout, const QString& text);
|
||||
void ConnectWidgets();
|
||||
|
||||
bool CanVerifyRedump() const;
|
||||
void UpdateRedumpEnabled();
|
||||
void Verify();
|
||||
void SetProblemCellText(int row, int column, QString text);
|
||||
void SetProblemCellText(int row, int column, const QString& text);
|
||||
|
||||
std::shared_ptr<DiscIO::Volume> m_volume;
|
||||
QTableWidget* m_problems;
|
||||
|
||||
Reference in new issue
Block a user