diff options
| author | Marc Mutz <[email protected]> | 2023-08-08 10:54:07 +0200 |
|---|---|---|
| committer | Ahmad Samir <[email protected]> | 2023-08-14 23:11:54 +0300 |
| commit | f2f8820073488c89fb71e3eb2d2e87bb582c3995 (patch) | |
| tree | 13e8a7bc5bb755fac84f8e8dc9801a670edea5d0 /tests/baseline/shared/paintcommands.cpp | |
| parent | 47375a213f0751b5649ee7c4ae47fae020f9c77f (diff) | |
tests: port assorted trivial uses of Q_FOREACH to ranged for loops
All of these fall into the trivial category: loops over (readily made)
const local containers. As such, they cannot possibly depend on the
safety copy that Q_FOREACH performs, so are safe to port as-is to
ranged for loops.
There may be more where these came from, but these were the ones that
stood out as immediately obvious when scanning the 100s of uses in
qtbase, so I preferred to directly fix them over white-listing their
files with QT_NO_FOREACH (which still may be necessary for some files,
as this patch may not port all uses in that file).
Pick-to: 6.6 6.5
Task-nubmber: QTBUG-115839
Change-Id: I7b7893bec8254f902660dac24167113aca855029
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: MÃ¥rten Nordheim <[email protected]>
Reviewed-by: Ivan Solovev <[email protected]>
Diffstat (limited to 'tests/baseline/shared/paintcommands.cpp')
| -rw-r--r-- | tests/baseline/shared/paintcommands.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/baseline/shared/paintcommands.cpp b/tests/baseline/shared/paintcommands.cpp index 1af6de1e089..2aef532b28c 100644 --- a/tests/baseline/shared/paintcommands.cpp +++ b/tests/baseline/shared/paintcommands.cpp @@ -745,8 +745,8 @@ void PaintCommands::runCommand(const QString &scriptLine) return; } QString firstWord = scriptLine.section(separators, 0, 0); - QList<int> indices = s_commandHash.values(firstWord); - foreach(int idx, indices) { + const QList<int> indices = s_commandHash.values(firstWord); + for (int idx : indices) { PaintCommandInfos command = s_commandInfoTable.at(idx); Q_ASSERT(command.regExp.isValid()); QRegularExpressionMatch match = command.regExp.match(scriptLine); |
