From d0a07dcacb70eaa58b36cd9fc3b37f8c8ce8106c Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 23 Nov 2022 09:32:45 +0100 Subject: QmlJS: std::set instead of QList This reduces the CPU time of Export::visibleInVContext() from 50% to 15% on Windows, when switching files. Change-Id: Iff82924c47d1b696c9d3d7ca40f49d9d02bcb3e6 Reviewed-by: hjk Reviewed-by: Thomas Hartmann --- src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.cpp') diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 70eebf6faf..6d3fda5af3 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -63,8 +63,8 @@ static const char *qtQuickUISuffix = "ui.qml"; static void maybeAddPath(ViewerContext &context, const Utils::FilePath &path) { - if (!path.isEmpty() && !context.paths.contains(path)) - context.paths.append(path); + if (!path.isEmpty() && !context.paths.count(path) > 0) + context.paths.insert(path); } static QList environmentImportPaths() -- cgit v1.2.1