diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-12 16:44:03 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-16 18:33:44 +0200 |
commit | d2c6ac8d5eaa1d4b53b647f01c53d821bbba4665 (patch) | |
tree | 0b006fe452155eb3806995dc5094ffb36a242d80 /src/qml/qml/qqmldirdata.cpp | |
parent | 53bb052704eed8672bbb37fcc6741d33c82177bd (diff) |
Clean up import resolution handling
Instead of storing raw pointers into the compiled data and creating
synthetic CompiledData::Import objects for implicit imports, this patch
introduces a dedicated PendingImport data structure that removes the
need of using raw pointers, reduces the amount of string index to string
resolution and incorporates the priority field thus eliminating the need
for a hash table.
Change-Id: Ia59aad17687bc0935aafd36236bda85d5f4f82a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmldirdata.cpp')
-rw-r--r-- | src/qml/qml/qqmldirdata.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/qml/qqmldirdata.cpp b/src/qml/qml/qqmldirdata.cpp index ec398fa896..7652cec322 100644 --- a/src/qml/qml/qqmldirdata.cpp +++ b/src/qml/qml/qqmldirdata.cpp @@ -51,16 +51,15 @@ const QString &QQmlQmldirData::content() const return m_content; } -const QV4::CompiledData::Import *QQmlQmldirData::import(QQmlTypeLoader::Blob *blob) const +QQmlTypeLoader::Blob::PendingImportPtr QQmlQmldirData::import(QQmlTypeLoader::Blob *blob) const { - QHash<QQmlTypeLoader::Blob *, const QV4::CompiledData::Import *>::const_iterator it = - m_imports.find(blob); + auto it = m_imports.find(blob); if (it == m_imports.end()) return nullptr; return *it; } -void QQmlQmldirData::setImport(QQmlTypeLoader::Blob *blob, const QV4::CompiledData::Import *import) +void QQmlQmldirData::setImport(QQmlTypeLoader::Blob *blob, QQmlTypeLoader::Blob::PendingImportPtr import) { m_imports[blob] = import; } |