mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 06:01:33 -06:00
Use library provided erase_if()
`Algorithm::removeIf()` is still valuable as `QHash::removeIf()` predicate require an iterator or a `std::pair`, which both require more code to unpack the variable and therefore cumbersome to use. PR #19353.
This commit is contained in:
@@ -957,8 +957,7 @@ void SyncController::onTorrentTrackersChanged(BitTorrent::Torrent *torrent)
|
||||
|
||||
const TorrentID torrentID = torrent->id();
|
||||
Algorithm::removeIf(m_knownTrackers
|
||||
, [this, torrentID, currentTrackers]
|
||||
(const QString &knownTracker, QSet<TorrentID> &torrentIDs)
|
||||
, [this, torrentID, currentTrackers](const QString &knownTracker, QSet<TorrentID> &torrentIDs)
|
||||
{
|
||||
if (auto idIter = torrentIDs.find(torrentID)
|
||||
; (idIter != torrentIDs.end()) && !currentTrackers.contains(knownTracker))
|
||||
|
||||
Reference in New Issue
Block a user