Avoid shadowing function parameter

The function already has a parameter named `result`.
Also remove a duplicate variable since it already has a pref pointer at the start of the function.

PR #21571.
This commit is contained in:
Chocobo1 2024-10-12 15:04:47 +08:00 committed by GitHub
parent c4eeb4a14a
commit ac646f47a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -293,7 +293,6 @@ BitTorrent::LoadResumeDataResult BitTorrent::BencodeResumeDataStorage::loadTorre
if (!metadata.isEmpty()) if (!metadata.isEmpty())
{ {
const auto *pref = Preferences::instance();
const lt::bdecode_node torentInfoRoot = lt::bdecode(metadata, ec const lt::bdecode_node torentInfoRoot = lt::bdecode(metadata, ec
, nullptr, pref->getBdecodeDepthLimit(), pref->getBdecodeTokenLimit()); , nullptr, pref->getBdecodeDepthLimit(), pref->getBdecodeTokenLimit());
if (ec) if (ec)

View file

@ -456,15 +456,15 @@ void GeoIPManager::downloadFinished(const DownloadResult &result)
Utils::Fs::mkpath(targetPath); Utils::Fs::mkpath(targetPath);
const auto path = targetPath / Path(GEODB_FILENAME); const auto path = targetPath / Path(GEODB_FILENAME);
const nonstd::expected<void, QString> result = Utils::IO::saveToFile(path, data); const nonstd::expected<void, QString> saveResult = Utils::IO::saveToFile(path, data);
if (result) if (saveResult)
{ {
LogMsg(tr("Successfully updated IP geolocation database."), Log::INFO); LogMsg(tr("Successfully updated IP geolocation database."), Log::INFO);
} }
else else
{ {
LogMsg(tr("Couldn't save downloaded IP geolocation database file. Reason: %1") LogMsg(tr("Couldn't save downloaded IP geolocation database file. Reason: %1")
.arg(result.error()), Log::WARNING); .arg(saveResult.error()), Log::WARNING);
} }
} }
else else