summaryrefslogtreecommitdiff
path: root/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-11-23 09:32:45 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2022-11-23 16:28:26 +0000
commitd0a07dcacb70eaa58b36cd9fc3b37f8c8ce8106c (patch)
treeb0c4380483b5f153c811bb72b327289d546c5179 /src/libs/qmljs/qmljsmodelmanagerinterface.cpp
parent910a8864dc43f8dede7617855282f19de62ee939 (diff)
downloadqt-creator-d0a07dcacb70eaa58b36cd9fc3b37f8c8ce8106c.tar.gz
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 <hjk@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/libs/qmljs/qmljsmodelmanagerinterface.cpp')
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp4
1 files changed, 2 insertions, 2 deletions
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<Utils::FilePath> environmentImportPaths()