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
@@ -34,7 +34,7 @@ AchievementsWindow::AchievementsWindow(QWidget* parent) : QDialog(parent)
|
||||
m_event_hook = AchievementManager::GetInstance().update_event.Register(
|
||||
[this](AchievementManager::UpdatedItems updated_items) {
|
||||
QueueOnObject(this, [this, updated_items = std::move(updated_items)] {
|
||||
AchievementsWindow::UpdateData(std::move(updated_items));
|
||||
AchievementsWindow::UpdateData(updated_items);
|
||||
});
|
||||
});
|
||||
UpdateData(AchievementManager::UpdatedItems{.all = true});
|
||||
@@ -80,7 +80,7 @@ void AchievementsWindow::ConnectWidgets()
|
||||
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
}
|
||||
|
||||
void AchievementsWindow::UpdateData(AchievementManager::UpdatedItems updated_items)
|
||||
void AchievementsWindow::UpdateData(const AchievementManager::UpdatedItems& updated_items)
|
||||
{
|
||||
m_settings_widget->UpdateData(updated_items.failed_login_code);
|
||||
if (updated_items.all)
|
||||
|
||||
Reference in new issue
Block a user