fix: sonarcloud code smells (#2623)

* fix: make variable a pointer-to-const

* fix: use init-statement to reduce variable scope

* fix: implicit conversion from long to int

* fix: refactor to not nest more than 3 if|for|do|while|switch statements

* fix: make tr_session::setSocketTos() const

* fix: use array.prototype.some instead of a for loop

* refactor: use nullptr instead of NULL

* fix: oops
This commit is contained in:
Charles Kerr
2022-02-13 23:44:38 -06:00
committed by GitHub
parent 94c7208d82
commit d772824553
8 changed files with 17 additions and 32 deletions

View File

@@ -468,7 +468,7 @@ void TorrentUrlChooserDialog::onOpenURLResponse(int response, Glib::RefPtr<Sessi
}
else if (response == Gtk::RESPONSE_ACCEPT)
{
auto* const e = static_cast<Gtk::Entry*>(get_data("url-entry"));
auto const* const e = static_cast<Gtk::Entry*>(get_data("url-entry"));
auto const url = gtr_str_strip(e->get_text());
if (url.empty())