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:
@@ -37,6 +37,7 @@
|
||||
#include "target.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
@@ -121,11 +122,9 @@ bool BuildStepList::isEmpty() const
|
||||
|
||||
bool BuildStepList::contains(Core::Id id) const
|
||||
{
|
||||
foreach (BuildStep *bs, steps()) {
|
||||
if (bs->id() == id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return Utils::anyOf(steps(), [id](BuildStep *bs){
|
||||
return bs->id() == id;
|
||||
});
|
||||
}
|
||||
|
||||
void BuildStepList::cloneSteps(BuildStepList *source)
|
||||
|
||||
Reference in New Issue
Block a user