Skip to content

Commit

Permalink
Tiny cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov committed Feb 27, 2017
1 parent af237e5 commit 5514c73
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
9 changes: 4 additions & 5 deletions qrmc/diagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ Editor* Diagram::editor() const

Type* Diagram::findType(const QString &name) const
{
if (mTypes.contains(name)) {
return mTypes[name];
}

return mEditor.findType(name);
auto res = mTypes.value(name, nullptr);
if (!res)
res = mEditor.findType(name);
return res;
}

const QMap<QString, Type *> &Diagram::types() const
Expand Down
6 changes: 1 addition & 5 deletions qrmc/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ QSet<EnumType*> Editor::getAllEnumTypes() const

Diagram* Editor::findDiagram(const QString &name) const
{
if (mDiagrams.contains(name)) {
return mDiagrams[name];
}

return nullptr;
return mDiagrams.value(name, nullptr);
}

QStringList Editor::getAllPortNames() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,5 @@ QString PluginManagerImplementation::fileName(QObject *plugin) const

QObject *PluginManagerImplementation::pluginByName(const QString &pluginName) const
{
return mFileNameAndPlugin[pluginName];
return mFileNameAndPlugin.value(pluginName, nullptr);
}

0 comments on commit 5514c73

Please sign in to comment.