mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Make use of std algorithms
This commit is contained in:
parent
40eb8a1f4a
commit
6d29a3af60
10 changed files with 67 additions and 61 deletions
|
@ -3460,18 +3460,18 @@ void Session::handleTorrentTrackerWarning(TorrentHandle *const torrent, const QS
|
|||
|
||||
bool Session::hasPerTorrentRatioLimit() const
|
||||
{
|
||||
for (TorrentHandle *const torrent : asConst(m_torrents))
|
||||
if (torrent->ratioLimit() >= 0) return true;
|
||||
|
||||
return false;
|
||||
return std::any_of(m_torrents.cbegin(), m_torrents.cend(), [](const TorrentHandle *torrent)
|
||||
{
|
||||
return (torrent->ratioLimit() >= 0);
|
||||
});
|
||||
}
|
||||
|
||||
bool Session::hasPerTorrentSeedingTimeLimit() const
|
||||
{
|
||||
for (TorrentHandle *const torrent : asConst(m_torrents))
|
||||
if (torrent->seedingTimeLimit() >= 0) return true;
|
||||
|
||||
return false;
|
||||
return std::any_of(m_torrents.cbegin(), m_torrents.cend(), [](const TorrentHandle *torrent)
|
||||
{
|
||||
return (torrent->seedingTimeLimit() >= 0);
|
||||
});
|
||||
}
|
||||
|
||||
void Session::initResumeFolder()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue