Fix infinite loop when searching for missing torrents by id (#7097)

This commit is contained in:
Mike Gelfand 2024-09-04 01:14:40 +01:00 committed by GitHub
parent 7e60fb87ab
commit 7c7046be6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -622,7 +622,14 @@ std::pair<Glib::RefPtr<Torrent>, guint> Session::Impl::find_torrent_by_id(tr_tor
return { torrent, position };
}
(current_torrent_id < torrent_id ? begin_position : end_position) = position;
if (current_torrent_id < torrent_id)
{
begin_position = position + 1;
}
else
{
end_position = position;
}
}
return {};