mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
fix: minor warnings (#5409)
* chore: fix readability-qualified-auto warnings * chore: fix clang-analyzer-core.uninitialized.Branch warning * fix: collision of key 'ERROR' in transmission-qt * chore: silence -Wshadow warning * chore: silence warning C4100: 'iter': unreferenced formal parameter * chore: fix warning C4127: conditional expression is constant warning
This commit is contained in:
@@ -645,7 +645,7 @@ void Session::Impl::on_torrent_metadata_changed(tr_torrent* raw_torrent)
|
||||
[this, core = get_core_ptr(), torrent_id = tr_torrentId(raw_torrent)]()
|
||||
{
|
||||
/* update the torrent's collated name */
|
||||
if (auto const [torrent, position] = find_torrent_by_id(torrent_id); torrent != nullptr)
|
||||
if (auto const& [torrent, position] = find_torrent_by_id(torrent_id); torrent)
|
||||
{
|
||||
torrent->update();
|
||||
}
|
||||
@@ -912,7 +912,7 @@ void Session::Impl::torrents_added()
|
||||
|
||||
void Session::torrent_changed(tr_torrent_id_t id)
|
||||
{
|
||||
if (auto const [torrent, position] = impl_->find_torrent_by_id(id); torrent != nullptr)
|
||||
if (auto const& [torrent, position] = impl_->find_torrent_by_id(id); torrent)
|
||||
{
|
||||
torrent->update();
|
||||
}
|
||||
@@ -920,7 +920,7 @@ void Session::torrent_changed(tr_torrent_id_t id)
|
||||
|
||||
void Session::remove_torrent(tr_torrent_id_t id, bool delete_files)
|
||||
{
|
||||
if (auto const [torrent, position] = impl_->find_torrent_by_id(id); torrent != nullptr)
|
||||
if (auto const& [torrent, position] = impl_->find_torrent_by_id(id); torrent)
|
||||
{
|
||||
/* remove from the gui */
|
||||
impl_->get_raw_model()->remove(position);
|
||||
|
||||
Reference in New Issue
Block a user