forked from qt-creator/qt-creator
AutoTest: Avoid using costly containers
Replace several occurrences of QMap with QHash as we often do not care about the order and use iterators instead of fetching keys or values to iterate over them. Change-Id: I5061a7e7e60fe259ac2aa31915f338a373e278d3 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -507,7 +507,7 @@ static void handleGTest(QFutureInterface<TestParseResult> futureInterface, const
|
||||
|
||||
static void checkDocumentForTestCode(QFutureInterface<TestParseResult> futureInterface,
|
||||
CPlusPlus::Document::Ptr document,
|
||||
QMap<QString, QString> testCaseNames)
|
||||
QHash<QString, QString> testCaseNames)
|
||||
{
|
||||
const QString fileName = document->fileName();
|
||||
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
|
||||
@@ -567,7 +567,7 @@ static void checkDocumentForTestCode(QFutureInterface<TestParseResult> futureInt
|
||||
static bool parsingHasFailed;
|
||||
|
||||
static void performParse(QFutureInterface<TestParseResult> &futureInterface,
|
||||
const QStringList &list, const QMap<QString, QString> testCaseNames)
|
||||
const QStringList &list, const QHash<QString, QString> testCaseNames)
|
||||
{
|
||||
int progressValue = 0;
|
||||
futureInterface.setProgressRange(0, list.size());
|
||||
@@ -718,7 +718,7 @@ void TestCodeParser::scanForTests(const QStringList &fileList)
|
||||
|
||||
parsingHasFailed = false;
|
||||
|
||||
QMap<QString, QString> testCaseNames;
|
||||
QHash<QString, QString> testCaseNames;
|
||||
if (isFullParse) {
|
||||
// remove qml files as they will be found automatically by the referencing cpp file
|
||||
list = Utils::filtered(list, [] (const QString &fn) {
|
||||
|
||||
Reference in New Issue
Block a user