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:
Charles Kerr
2020-11-05 16:46:21 -06:00
committed by GitHub
parent e74b3bad8b
commit 7f147c65fb
62 changed files with 355 additions and 414 deletions

View File

@@ -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);
}