Skip to content

Commit

Permalink
Merge pull request #92 from vktr/ninja-fix-queue-positions
Browse files Browse the repository at this point in the history
Fix infinite loop when sorting on queue position
  • Loading branch information
vktr committed Dec 22, 2022
2 parents 32a3ddc + 605ef89 commit 1b33ea2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/methods/torrentslist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void TorrentsList::Invoke(const TorrentsListReq& req, WriteCb<TorrentsListRes> c
{"queue_position", false},
[](auto const& lhs, auto const& rhs)
{
if (lhs.queue_position < 0) return false;
if (rhs.queue_position < 0) return true;
return lhs.queue_position >= rhs.queue_position;
}
Expand All @@ -44,6 +45,7 @@ void TorrentsList::Invoke(const TorrentsListReq& req, WriteCb<TorrentsListRes> c
{"queue_position", true},
[](auto const& lhs, auto const& rhs)
{
if (lhs.queue_position < 0) return false;
if (rhs.queue_position < 0) return true;
return lhs.queue_position < rhs.queue_position;
}
Expand Down

0 comments on commit 1b33ea2

Please sign in to comment.