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:
Martino Fontana committed 2026-04-17 12:39:46 +02:00
1 parent 33f62b0f9f
commit 95dec13203
140 files changed
+318 -277

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ signals:
void GameCountUpdated(int total_games, int visible_games) const;
void OnStartWithRiivolution(const UICommon::GameFile& game);
void NetPlayHost(const UICommon::GameFile& game);
void SelectionChanged(std::shared_ptr<const UICommon::GameFile> game_file);
void SelectionChanged(const std::shared_ptr<const UICommon::GameFile>& game_file);
void OpenGeneralSettings();
void OpenGraphicsSettings();
#ifdef USE_RETRO_ACHIEVEMENTS
@@ -54,7 +54,7 @@ GameTracker::GameTracker(QObject* parent) : QFileSystemWatcher(parent)
connect(&Settings::Instance(), &Settings::MetadataRefreshRequested, this,
[this] { m_load_thread.EmplaceItem(Command{CommandType::UpdateMetadata, {}}); });
m_load_thread.Reset("GameList Tracker", [this](Command command) {
m_load_thread.Reset("GameList Tracker", [this](const Command& command) {
switch (command.type)
{
case CommandType::LoadCache:
@@ -356,7 +356,7 @@ void GameTracker::LoadGame(const QString& path)
bool cache_changed = false;
auto game = m_cache.AddOrGet(converted_path, &cache_changed);
if (game)
emit GameLoaded(std::move(game));
emit GameLoaded(game);
if (cache_changed && !m_refresh_in_progress)
m_cache.Save();
}