Commit dd1cc980 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Fix foreach clazy-container-anti-pattern issue

parent 5c28ba05
......@@ -677,9 +677,12 @@ void KeyboardTranslator::removeEntry(const Entry& entry)
KeyboardTranslator::Entry KeyboardTranslator::findEntry(int keyCode, Qt::KeyboardModifiers modifiers, States state) const
{
foreach(const Entry & entry, _entries.values(keyCode)) {
if (entry.matches(keyCode, modifiers, state))
return entry;
QHash<int, KeyboardTranslator::Entry>::const_iterator i = _entries.find(keyCode);
while (i != _entries.constEnd() && i.key() == keyCode) {
if (i.value().matches(keyCode, modifiers, state)) {
return i.value();
}
++i;
}
return Entry(); // No matching entry
......
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