qmake: eradicate Q_FOREACH loops [rvalues]

... by replacing them with C++11 range-for loops.

This is the simplest of the patch series: Q_FOREACH took a
copy, so we do, too. Except we don't, since we're just
catching the return value that comes out of the function
(RVO). We can't feed the rvalues into range-for, because
they are non-const and would thus detach.

Change-Id: I5834620bf82f3442da7b2838363d351a0fb960a0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
(cherry picked from qtbase/8d7e913248aa1cad23447668d98911bba01faf4b)
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Marc Mutz
2016-01-26 14:38:54 +01:00
committed by Oswald Buddenhagen
parent ccdcbc55ca
commit 1a4f0f1dad
3 changed files with 34 additions and 17 deletions

View File

@@ -313,7 +313,8 @@ bool QMakeGlobals::initProperties()
QT_PCLOSE(proc);
}
#endif
foreach (QByteArray line, data.split('\n')) {
const auto lines = data.split('\n');
for (QByteArray line : lines) {
int off = line.indexOf(':');
if (off < 0) // huh?
continue;