tst_QSslCertificate: port Q_FOREACH to ranged-for [5]

The toString() method's parameter is a const&, the loop body doesn't
change the container; and the container the parameter refers to isn't
changed during iteration.

Drive-by, remove braces from single-line if blocks.

Task-number: QTBUG-115839
Change-Id: I363e1ed37c0f75fa6a9f8eac3393a6c10d756c1b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Ahmad Samir 2023-08-11 23:25:30 +03:00
parent dccaedc626
commit 659b6d5595

View File

@ -1130,9 +1130,8 @@ QString tst_QSslCertificate::toString(const QList<QSslError>& errors)
{
QStringList errorStrings;
foreach (const QSslError& error, errors) {
for (const QSslError &error : errors)
errorStrings.append(QLatin1Char('"') + error.errorString() + QLatin1Char('"'));
}
return QLatin1String("[ ") + errorStrings.join(QLatin1String(", ")) + QLatin1String(" ]");
}