Eradicate Q_FOREACHs over QVarLengthArray
There is no excuse for copying several KiBs of data just to iterate over it, yet that's exactly what Q_FOREACH does. Besides, this use of Q_FOREACH is being deprecated. In my tree, it's already a hard error. Change-Id: I07240c37626f7d284781e8c4be05eef3c7a54f39 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
43c964b8ad
commit
e99b0016e8
@ -3484,9 +3484,6 @@ void tst_Collections::foreach_2()
|
||||
QCOMPARE(varl1.count(), intlist.count());
|
||||
QCOMPARE(varl2.count(), intlist.count());
|
||||
QCOMPARE(varl3.count(), intlist.count());
|
||||
foreach_test_arrays(varl1);
|
||||
foreach_test_arrays(varl2);
|
||||
foreach_test_arrays(varl3);
|
||||
|
||||
QVarLengthArray<QString> varl4;
|
||||
QVarLengthArray<QString, 3> varl5;
|
||||
@ -3499,9 +3496,6 @@ void tst_Collections::foreach_2()
|
||||
QCOMPARE(varl4.count(), strlist.count());
|
||||
QCOMPARE(varl5.count(), strlist.count());
|
||||
QCOMPARE(varl6.count(), strlist.count());
|
||||
foreach_test_arrays(varl4);
|
||||
foreach_test_arrays(varl5);
|
||||
foreach_test_arrays(varl6);
|
||||
}
|
||||
|
||||
struct IntOrString
|
||||
|
@ -827,7 +827,7 @@ void tst_QVarLengthArray::operators()
|
||||
|
||||
// +=: not provided, emulate
|
||||
//myvla += myvlatwo;
|
||||
Q_FOREACH (const QString &s, myvlatwo)
|
||||
for (const QString &s : qAsConst(myvlatwo))
|
||||
myvla.push_back(s);
|
||||
QCOMPARE(myvla, combined);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user