MakefileGenerator: use erase and std::remove_if with QVector
... instead of using erase in a loop, with quadratic complexity. Change-Id: I4ac03ac0e893fc5dbb5e45131fcbfe82f1564bee Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
5034d41630
commit
f59b12c629
@ -59,6 +59,8 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
using namespace QMakeInternal;
|
using namespace QMakeInternal;
|
||||||
@ -939,12 +941,12 @@ void
|
|||||||
MakefileGenerator::filterIncludedFiles(const char *var)
|
MakefileGenerator::filterIncludedFiles(const char *var)
|
||||||
{
|
{
|
||||||
ProStringList &inputs = project->values(var);
|
ProStringList &inputs = project->values(var);
|
||||||
for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ) {
|
auto isIncluded = [this](const ProString &input) {
|
||||||
if (QMakeSourceFileInfo::included((*input).toQString()) > 0)
|
return QMakeSourceFileInfo::included(input.toQString()) > 0;
|
||||||
input = inputs.erase(input);
|
};
|
||||||
else
|
inputs.erase(std::remove_if(inputs.begin(), inputs.end(),
|
||||||
++input;
|
isIncluded),
|
||||||
}
|
inputs.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString
|
static QString
|
||||||
|
Loading…
x
Reference in New Issue
Block a user