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/stat.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace QMakeInternal;
|
||||
@ -939,12 +941,12 @@ void
|
||||
MakefileGenerator::filterIncludedFiles(const char *var)
|
||||
{
|
||||
ProStringList &inputs = project->values(var);
|
||||
for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ) {
|
||||
if (QMakeSourceFileInfo::included((*input).toQString()) > 0)
|
||||
input = inputs.erase(input);
|
||||
else
|
||||
++input;
|
||||
}
|
||||
auto isIncluded = [this](const ProString &input) {
|
||||
return QMakeSourceFileInfo::included(input.toQString()) > 0;
|
||||
};
|
||||
inputs.erase(std::remove_if(inputs.begin(), inputs.end(),
|
||||
isIncluded),
|
||||
inputs.end());
|
||||
}
|
||||
|
||||
static QString
|
||||
|
Loading…
x
Reference in New Issue
Block a user