path: root/qmake
diff options
authorMarc Mutz <>2016-01-28 16:48:36 +0100
committerMarc Mutz <>2016-02-02 10:20:00 +0000
commitfdfd63053ae6b10af06553be3c1b15de274bebf7 (patch)
treee8fe0248ff2b926b0b351a012342fe4168911c2d /qmake
parent1d3503b8f3b49b0f684e1caa504deb0d05f2c60a (diff)
QtBase: avoid uses of Java-style iterators [QHash, QMap]
Java-style iterators are slower than STL-style ones, so they should not be used in library code. Replaced them with C++11 range-for, STL iterators or, in one case, qDeleteAll(). In one case, avoid a double hash lookup by using erase(it) instead of remove(it.key()), which we can now do without detaching, due to the new erase() taking const_iterator. Change-Id: I96174657fed70f76120b2c9d8190b4e70d5d8179 Reviewed-by: Lars Knoll <>
Diffstat (limited to 'qmake')
1 files changed, 1 insertions, 3 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index d473f3df9f..6219252161 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -685,9 +685,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
t << _slnGlobalBeg;
- QHashIterator<VcsolutionDepend *, QStringList> extraIt(extraSubdirs);
- while (extraIt.hasNext()) {
+ for (auto extraIt = extraSubdirs.cbegin(), end = extraSubdirs.cend(); extraIt != end; ++extraIt) {
for (const QString &depend : extraIt.value()) {
if (!projGuids[depend].isEmpty()) {
extraIt.key()->dependencies << projGuids[depend];