Commit bd11711a authored by Christoph Cullmann's avatar Christoph Cullmann 🍨
Browse files

avoid double lookup

parent b30e095f
Pipeline #236761 canceled with stage
in 4 minutes and 35 seconds
......@@ -301,17 +301,8 @@ void KatePluginManager::disablePluginGUI(KatePluginInfo *item)
KTextEditor::Plugin *KatePluginManager::plugin(const QString &name)
{
/**
* name known?
*/
if (!m_name2Plugin.contains(name)) {
return nullptr;
}
/**
* real plugin instance, if any ;)
*/
return m_name2Plugin.value(name)->plugin;
const auto it = m_name2Plugin.find(name);
return (it == m_name2Plugin.end()) ? nullptr : it.value()->plugin;
}
bool KatePluginManager::pluginAvailable(const QString &name)
......
Supports Markdown
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