From 8b5fb76d3426250343d838dbee4bdf3d02817ceb Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 10 Aug 2023 13:02:13 +0200 Subject: [PATCH] tst_QLocale: clean out the last use of foreach Change-Id: I0a4810dbae2137764ea1d14d515e9f06f7f2129d Reviewed-by: Thiago Macieira --- tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 99398340f6..c7017b8511 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -201,7 +201,8 @@ void tst_QLocale::initTestCase() // Get an environment free of any locale-related variables cleanEnv.clear(); - foreach (QString const& entry, QProcess::systemEnvironment()) { + const QStringList sysenv = QProcess::systemEnvironment(); + for (const QString &entry : sysenv) { if (entry.startsWith("LANG=") || entry.startsWith("LC_") || entry.startsWith("LANGUAGE=")) continue; cleanEnv << entry;