eliminate duplicates from qmake spec and feature paths

potentially reduces the number of file::exists() calls
This commit is contained in:
Oswald Buddenhagen
2010-01-21 18:24:46 +01:00
parent 567d7ed397
commit 45cc9df8a2

View File

@@ -1196,7 +1196,9 @@ QStringList ProFileEvaluator::Private::qmakeMkspecPaths() const
foreach (const QString &it, QString::fromLocal8Bit(qmakepath).split(m_option->dirlist_sep))
ret << QDir::cleanPath(it) + concat;
ret << propertyValue(QLatin1String("QT_INSTALL_DATA")) + concat;
QString builtIn = propertyValue(QLatin1String("QT_INSTALL_DATA")) + concat;
if (!ret.contains(builtIn))
ret << builtIn;
return ret;
}
@@ -1284,6 +1286,8 @@ QStringList ProFileEvaluator::Private::qmakeFeaturePaths() const
if (!feature_roots.at(i).endsWith((ushort)'/'))
feature_roots[i].append((ushort)'/');
feature_roots.removeDuplicates();
return feature_roots;
}