mirror of
https://github.com/transmission/transmission.git
synced 2025-12-26 13:21:44 +00:00
fix: sonarcloud (#2837)
* fix: rename variable to avoid shadow warning w/UTP * fix: add default dtor for tr_strbuf * fix: implicit conversion may lose precision * fix: use init-statement to reduce variable scope * fix: implicit conversion may lose precision * fix: extract the assignment from this expression * fix: use init-statement to reduce variable scope * fix: use init-statement to reduce variable scope * fix: do not mix public and private data members * fix: add a condition to cv.wait call * fix: do not throw uncaught exceptions in destructor
This commit is contained in:
@@ -560,8 +560,7 @@ static bool UseSSL = false;
|
||||
|
||||
static std::string getEncodedMetainfo(std::string_view filename)
|
||||
{
|
||||
auto contents = std::vector<char>{};
|
||||
if (tr_loadFile(filename, contents))
|
||||
if (auto contents = std::vector<char>{}; tr_loadFile(filename, contents))
|
||||
{
|
||||
return tr_base64_encode({ std::data(contents), std::size(contents) });
|
||||
}
|
||||
@@ -2020,7 +2019,7 @@ static void printGroups(tr_variant* top)
|
||||
|
||||
if (tr_variantDictFindDict(top, TR_KEY_arguments, &args) && tr_variantDictFindList(args, TR_KEY_group, &groups))
|
||||
{
|
||||
for (int i = 0, n = tr_variantListSize(groups); i < n; ++i)
|
||||
for (size_t i = 0, n = tr_variantListSize(groups); i < n; ++i)
|
||||
{
|
||||
tr_variant* group = tr_variantListChild(groups, i);
|
||||
std::string_view name;
|
||||
|
||||
Reference in New Issue
Block a user