mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
refactor: fix more sonarcloud warnings (#1508)
* refactor: const correctness * refactor: use getpwuid_r instead of getpwuid * chore: simplify dict walking loop logic * refactor: remove dead store assignment in announcer * refactor: use std::make_shared
This commit is contained in:
@@ -185,13 +185,12 @@ void TorrentModel::updateTorrents(tr_variant* torrents, bool is_complete_list)
|
||||
keys.push_back(tr_quark_new(str, len));
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (first_child != nullptr)
|
||||
{
|
||||
// In 'object' format, every entry is an object with the same set of properties
|
||||
size_t i = 0;
|
||||
tr_quark key;
|
||||
tr_variant* value;
|
||||
while (first_child && tr_variantDictChild(first_child, i++, &key, &value))
|
||||
for (size_t i = 0; tr_variantDictChild(first_child, i, &key, &value); ++i)
|
||||
{
|
||||
keys.push_back(key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user