Replace some more erase/remove patterns with removeIf
Change-Id: I6c6f33450fbfd798e5ef71a8ba18f590581dc3a2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
b211148e4b
commit
c34c6af374
@ -1501,9 +1501,7 @@ void TorrentClient::addToPeerList(const QList<TorrentPeer> &peerList)
|
|||||||
};
|
};
|
||||||
// Remove inactive peers from the peer list until we're below
|
// Remove inactive peers from the peer list until we're below
|
||||||
// the max connections count.
|
// the max connections count.
|
||||||
d->peers.erase(std::remove_if(d->peers.begin(), d->peers.end(),
|
d->peers.removeIf(firstNInactivePeers);
|
||||||
firstNInactivePeers),
|
|
||||||
d->peers.end());
|
|
||||||
// If we still have too many peers, remove the oldest ones.
|
// If we still have too many peers, remove the oldest ones.
|
||||||
d->peers.erase(d->peers.begin(), d->peers.begin() + tooMany);
|
d->peers.erase(d->peers.begin(), d->peers.begin() + tooMany);
|
||||||
}
|
}
|
||||||
|
@ -1508,7 +1508,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
auto isFrom = [pro](const ProString &s) {
|
auto isFrom = [pro](const ProString &s) {
|
||||||
return s.sourceFile() == pro;
|
return s.sourceFile() == pro;
|
||||||
};
|
};
|
||||||
vit->erase(std::remove_if(vit->begin(), vit->end(), isFrom), vit->end());
|
vit->removeIf(isFrom);
|
||||||
if (vit->isEmpty()) {
|
if (vit->isEmpty()) {
|
||||||
// When an initially non-empty variable becomes entirely empty,
|
// When an initially non-empty variable becomes entirely empty,
|
||||||
// undefine it altogether.
|
// undefine it altogether.
|
||||||
|
@ -641,10 +641,7 @@ QList<QPair<int, int>> QSortFilterProxyModelPrivate::proxy_intervals_for_source_
|
|||||||
interval.first = interval.second = -1;
|
interval.first = interval.second = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proxy_intervals.erase(
|
proxy_intervals.removeIf([](QPair<int, int> interval) { return interval.first < 0; });
|
||||||
std::remove_if(proxy_intervals.begin(), proxy_intervals.end(),
|
|
||||||
[](QPair<int, int> &interval) { return interval.first < 0; }),
|
|
||||||
proxy_intervals.end());
|
|
||||||
return proxy_intervals;
|
return proxy_intervals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5204,10 +5204,8 @@ void tst_QWidget::setWindowGeometry_data()
|
|||||||
|
|
||||||
const bool skipEmptyRects = (m_platform == QStringLiteral("windows"));
|
const bool skipEmptyRects = (m_platform == QStringLiteral("windows"));
|
||||||
for (Rects l : qAsConst(rects)) {
|
for (Rects l : qAsConst(rects)) {
|
||||||
if (skipEmptyRects) {
|
if (skipEmptyRects)
|
||||||
l.erase(std::remove_if(l.begin(), l.end(), [] (const QRect &r) { return r.isEmpty(); }),
|
l.removeIf([] (const QRect &r) { return r.isEmpty(); });
|
||||||
l.end());
|
|
||||||
}
|
|
||||||
const QRect &rect = l.constFirst();
|
const QRect &rect = l.constFirst();
|
||||||
for (int windowFlag : windowFlags) {
|
for (int windowFlag : windowFlags) {
|
||||||
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
|
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user