mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
fix: sonarcloud warnings (#2804)
* fix: break will never be executed * refactor: compile the name fallback string * fix: replace redundant type with auto * fix: use init-statement to reduce variable scope * fix: implicit conversion loses precision * fix: use in-class initializer * fix: make variable a pointer-to-const * fix: local variable name shadows class variable * fix: implicit conversion may lose precision
This commit is contained in:
@@ -2067,8 +2067,11 @@ static char const* sessionStats(
|
||||
auto cumulativeStats = tr_session_stats{};
|
||||
|
||||
auto const& torrents = session->torrents();
|
||||
int const total = std::size(torrents);
|
||||
int const running = std::count_if(std::begin(torrents), std::end(torrents), [](auto const* tor) { return tor->isRunning; });
|
||||
auto const total = std::size(torrents);
|
||||
auto const running = std::count_if(
|
||||
std::begin(torrents),
|
||||
std::end(torrents),
|
||||
[](auto const* tor) { return tor->isRunning; });
|
||||
|
||||
tr_sessionGetStats(session, ¤tStats);
|
||||
tr_sessionGetCumulativeStats(session, &cumulativeStats);
|
||||
|
||||
Reference in New Issue
Block a user