Fix Clang warning about loop variable creating a copy

Change-Id: I2a8b75294ee3bde008bcff37519da087f603ca51
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2021-08-25 14:39:54 +02:00
parent 98d65c8d42
commit 137c28d077

View File

@ -2870,7 +2870,7 @@ int QMetaEnum::keysToValue(const char *keys, bool *ok) const
auto className = [&] { return stringDataView(mobj, priv(mobj->d.data)->className); };
int value = 0;
for (const QLatin1String untrimmed : qTokenize(QLatin1String{keys}, QLatin1Char{'|'})) {
for (const QLatin1String &untrimmed : qTokenize(QLatin1String{keys}, QLatin1Char{'|'})) {
const auto parsed = parse_scope(untrimmed.trimmed());
if (parsed.scope && *parsed.scope != className())
return -1; // wrong type name in qualified name