Use reference whenever possible

This commit is contained in:
Chocobo1
2023-05-05 02:50:19 +08:00
parent 5b43782f58
commit 8c9b6e2f2d
12 changed files with 13 additions and 13 deletions

View File

@@ -171,7 +171,7 @@ void CustomDiskIOThread::async_set_file_priority(lt::storage_index_t storage, lt
, std::function<void (const lt::storage_error &, lt::aux::vector<lt::download_priority_t, lt::file_index_t>)> handler)
{
m_nativeDiskIO->async_set_file_priority(storage, priorities
, [=, handler = std::move(handler)](const lt::storage_error &error, lt::aux::vector<lt::download_priority_t, lt::file_index_t> priorities)
, [=, handler = std::move(handler)](const lt::storage_error &error, const lt::aux::vector<lt::download_priority_t, lt::file_index_t> &priorities)
{
m_storageData[storage].filePriorities = priorities;
handler(error, priorities);

View File

@@ -4986,7 +4986,7 @@ void SessionImpl::upgradeCategories()
const auto legacyCategories = SettingValue<QVariantMap>(u"BitTorrent/Session/Categories"_qs).get();
for (auto it = legacyCategories.cbegin(); it != legacyCategories.cend(); ++it)
{
const QString categoryName = it.key();
const QString &categoryName = it.key();
CategoryOptions categoryOptions;
categoryOptions.savePath = Path(it.value().toString());
m_categories[categoryName] = categoryOptions;

View File

@@ -1632,7 +1632,7 @@ void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathLi
{
const auto nativeIndex = nativeIndexes.at(i);
const Path actualFilePath = fileNames.at(i);
const Path &actualFilePath = fileNames.at(i);
p.renamed_files[nativeIndex] = actualFilePath.toString().toStdString();
const Path filePath = actualFilePath.removedExtension(QB_EXT);