forked from qt-creator/qt-creator
Even more algorithm usage in ProjectExplorer
Add Utils::transform and anyOf that take a member function pointer. Remove bestElementOr it's unused. Use declval<T> in transform's return type, because msvc does evaluate T() and for types that don't have simple constructor this fails. Add std::remove_reference since decltype returns a reference for lvalues. Change-Id: I22248b226748eeb27af0d300182d574438d7f756 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -156,17 +156,14 @@ Utils::AbstractMacroExpander *BuildConfiguration::macroExpander()
|
||||
|
||||
QList<Core::Id> BuildConfiguration::knownStepLists() const
|
||||
{
|
||||
return Utils::transform(m_stepLists, [](BuildStepList *list) {
|
||||
return list->id();
|
||||
});
|
||||
return Utils::transform(m_stepLists, &BuildStepList::id);
|
||||
}
|
||||
|
||||
BuildStepList *BuildConfiguration::stepList(Core::Id id) const
|
||||
{
|
||||
foreach (BuildStepList *list, m_stepLists)
|
||||
if (id == list->id())
|
||||
return list;
|
||||
return 0;
|
||||
return Utils::findOrDefault(m_stepLists, [id](BuildStepList *list) {
|
||||
return id == list->id();
|
||||
});
|
||||
}
|
||||
|
||||
QVariantMap BuildConfiguration::toMap() const
|
||||
|
||||
Reference in New Issue
Block a user