tst_QImage: replace QList with constexpr array
"Never use a dynamically-sized container for statically-sized data." Port the loop from Q_FOREACH (which can't deal with arrays) to ranged for (which can). Task-number: QTBUG-115839 Change-Id: I40773a0397b83cce0c803967ee3fd7ae274933d3 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit 11c2a5b4778dc2c67cf21c020e8266067a99f3d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
db8a15de70
commit
dc9e677f7f
@ -1133,10 +1133,9 @@ void tst_QImage::rotate_data()
|
|||||||
QTest::addColumn<QImage::Format>("format");
|
QTest::addColumn<QImage::Format>("format");
|
||||||
QTest::addColumn<int>("degrees");
|
QTest::addColumn<int>("degrees");
|
||||||
|
|
||||||
QList<int> degrees;
|
constexpr int degrees[] = {0, 90, 180, 270};
|
||||||
degrees << 0 << 90 << 180 << 270;
|
|
||||||
|
|
||||||
foreach (int d, degrees) {
|
for (int d : degrees) {
|
||||||
const QString dB = QString::number(d);
|
const QString dB = QString::number(d);
|
||||||
for (int i = QImage::Format_Indexed8; i < QImage::NImageFormats; i++) {
|
for (int i = QImage::Format_Indexed8; i < QImage::NImageFormats; i++) {
|
||||||
QImage::Format format = static_cast<QImage::Format>(i);
|
QImage::Format format = static_cast<QImage::Format>(i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user