From 1530731694a247b91fe63c9916c51361fdb9ad67 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 10 Aug 2023 13:28:29 +0200 Subject: [PATCH] tst_QTextBoundaryFinder: clean out the last two foreach uses Change-Id: I71be0cb59b45fcce438c4a4749ec8b6f9e4f1694 Reviewed-by: Thiago Macieira --- .../text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp | 5 +++-- 1 file 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 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('+');