diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-08-10 13:28:29 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-08-11 19:58:01 +0200 |
commit | 1530731694a247b91fe63c9916c51361fdb9ad67 (patch) | |
tree | bacedeaec41f67dc88158e2b0806a4432153dd35 /tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | |
parent | 8b5fb76d3426250343d838dbee4bdf3d02817ceb (diff) |
tst_QTextBoundaryFinder: clean out the last two foreach uses
Change-Id: I71be0cb59b45fcce438c4a4749ec8b6f9e4f1694
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp')
-rw-r--r-- | tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp index d196d4e13b..fc34d53c8c 100644 --- a/tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp +++ b/tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp @@ -101,7 +101,8 @@ static void generateDataFromFile(const QString &fname) QString testString; QList<int> expectedBreakPositions; - foreach (const QString &part, test.simplified().split(QLatin1Char(' '), Qt::SkipEmptyParts)) { + const QStringList parts = test.simplified().split(QLatin1Char(' '), Qt::SkipEmptyParts); + for (const QString &part : parts) { if (part.size() == 1) { if (part.at(0).unicode() == 0xf7) expectedBreakPositions.append(testString.size()); @@ -125,7 +126,7 @@ static void generateDataFromFile(const QString &fname) if (!comments.isEmpty()) { const QStringList lst = comments.simplified().split(QLatin1Char(' '), Qt::SkipEmptyParts); comments.clear(); - foreach (const QString &part, lst) { + for (const QString &part : lst) { if (part.size() == 1) { if (part.at(0).unicode() == 0xf7) comments += QLatin1Char('+'); |