From 7c7046be6e0cff6081ecf63b4bbdeefc4a710a13 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Wed, 4 Sep 2024 01:14:40 +0100 Subject: [PATCH] Fix infinite loop when searching for missing torrents by id (#7097) --- gtk/Session.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk/Session.cc b/gtk/Session.cc index 5327a21c9..e6c8a976e 100644 --- a/gtk/Session.cc +++ b/gtk/Session.cc @@ -622,7 +622,14 @@ std::pair, 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 {};