Merge pull request #10627 from Chocobo1/alg

Improve removeIf() to support other types
This commit is contained in:
Mike Tzou
2019-05-16 10:45:55 +08:00
committed by GitHub
7 changed files with 60 additions and 31 deletions

View File

@@ -364,9 +364,7 @@ void PeerListWidget::loadPeers(BitTorrent::TorrentHandle *const torrent, bool fo
}
}
// Delete peers that are gone
QSetIterator<QString> it(oldPeersSet);
while (it.hasNext()) {
const QString &ip = it.next();
for (const QString &ip : oldPeersSet) {
m_missingFlags.remove(ip);
m_peerAddresses.remove(ip);
QStandardItem *item = m_peerItems.take(ip);