Commit 4a447f4e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Properly traverse a hash with iterators

Skips construction of ::keys()
Skips look-up of matches
parent c1fd2638
......@@ -228,9 +228,9 @@ FlatpakResource * FlatpakBackend::getRuntimeForApp(FlatpakResource *resource) co
const QString runtimeId = QStringLiteral("runtime/") + runtimeInfo.at(0) + QLatin1Char('/') + runtimeInfo.at(2);
foreach (const QString &id, m_resources.keys()) {
if (id.endsWith(runtimeId)) {
runtime = m_resources.value(id);
for(auto it = m_resources.constBegin(), itEnd = m_resources.constEnd(); it!=itEnd; ++it) {
if (it.key().endsWith(runtimeId)) {
runtime = *it;
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment