From 74bc4617dd5a38abb60aff8b252001cb2ff9c7b8 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 6 Sep 2016 17:54:23 +0200 Subject: Eradicate Q_FOREACH loops and mark the module as Q_FOREACH-free In BearerCloud::timerEvent(), bite the bullet and use a std::vector instead of a QList to avoid repeated qAsConst() applications. In BearerCloud::configurationRemoved() and configurationChanged(), instead of iterating over QMultiMap::uniqueKeys() and QMap::remove(), iterate directly over the QMultiMap and remove the desired elements. Cache a QString. In BearerCloud::updateConfigurations(), instead of using while !isEmpty() takeFirst() on a local copy of a QList, simply iterate over the QList (now made const) using C++11 ranged for. In tst_QSvgGenerator, replace a QList of statically-known size with a C array. Change-Id: Ic0dd1c67d0819fe6167f2bce248f9b910be65803 Reviewed-by: Edward Welbourne --- tests/auto/qsvggenerator/tst_qsvggenerator.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/auto/qsvggenerator') diff --git a/tests/auto/qsvggenerator/tst_qsvggenerator.cpp b/tests/auto/qsvggenerator/tst_qsvggenerator.cpp index db7e3e5..4795b55 100644 --- a/tests/auto/qsvggenerator/tst_qsvggenerator.cpp +++ b/tests/auto/qsvggenerator/tst_qsvggenerator.cpp @@ -99,10 +99,14 @@ static void compareWithoutFontInfo(const QByteArray &source, const QByteArray &r QDomDocument referenceDoc; referenceDoc.setContent(reference); - QList fontAttributes; - fontAttributes << "font-family" << "font-size" << "font-weight" << "font-style"; - - foreach (QString attribute, fontAttributes) { + const QString fontAttributes[] = { + "font-family", + "font-size", + "font-weight", + "font-style", + }; + + for (const QString &attribute : fontAttributes) { removeAttribute(sourceDoc, attribute); removeAttribute(referenceDoc, attribute); } -- cgit v1.2.1