fix: sonarcloud warnings (#2815)

* fix: add default case to switch statement

* fix: remove redundant static specifier

* fix: use std::optional.value_or

* fix: make type of variable pointer-to-const

* refactor: move log state into a struct

* refactor: make tr_peerMgr constructor explicit

* fix: make type of variable pointer-to-const

* fix: replace insert with try_emplace

* fix: implicit conversion may lose precision

* fix: use init-statement to reduce variable scope

* chore: mark unused return value with (void)
This commit is contained in:
Charles Kerr
2022-03-25 00:24:04 -05:00
committed by GitHub
parent 0a8cfba3b3
commit b94c6796c8
8 changed files with 55 additions and 55 deletions

View File

@@ -369,7 +369,7 @@ void onBufferGotData(evbuffer* /*buf*/, evbuffer_cb_info const* info, void* vtas
return;
}
auto* const session = task->session;
auto const* const session = task->session;
auto const lock = session->unique_lock();
auto* const webseed = task->webseed;
@@ -427,8 +427,7 @@ void onPartialDataFetched(tr_web::FetchResponse const& web_response)
return;
}
auto* const tor = webseed->getTorrent();
if (tor == nullptr)
if (auto const* const tor = webseed->getTorrent(); tor == nullptr)
{
return;
}