diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-20 12:58:10 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-21 13:42:49 +0000 |
commit | 2422251ee5025a067b14b989153764ab36e43f10 (patch) | |
tree | 8758c5b128a38f0aa6266a156385112aa3527e03 /src/tools/qdoc/qmlcodemarker.cpp | |
parent | 08e0963e0862726feaa10c09b0e3b401c89b9224 (diff) |
qdoc: don't hold QQmlJS::AST::SourceLocation in QLists
QQmlJS::AST::SourceLocation wasn't marked as movable, and it is larger
than void*, so QList<SourceLocation> is horribly inefficient.
Fix by marking as movable primitive and holding in QVector instead.
The same fix probably is required in QtDeclarative, too.
Change-Id: I4e0d2cd32b7e03205d59cbc9900287f77045154a
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/qmlcodemarker.cpp')
-rw-r--r-- | src/tools/qdoc/qmlcodemarker.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/qdoc/qmlcodemarker.cpp b/src/tools/qdoc/qmlcodemarker.cpp index 17067bebe6..cfb5e16b44 100644 --- a/src/tools/qdoc/qmlcodemarker.cpp +++ b/src/tools/qdoc/qmlcodemarker.cpp @@ -166,7 +166,7 @@ QString QmlCodeMarker::addMarkUp(const QString &code, QQmlJS::Lexer lexer(&engine); QString newCode = code; - QList<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode); + QVector<QQmlJS::AST::SourceLocation> pragmas = extractPragmas(newCode); lexer.setCode(newCode, 1); QQmlJS::Parser parser(&engine); @@ -209,11 +209,11 @@ static void replaceWithSpace(QString &str, int idx, int n) Searches for ".pragma <value>" or ".import <stuff>" declarations in \a script. Currently supported pragmas are: library */ -QList<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script) +QVector<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script) { const QString pragma(QLatin1String("pragma")); const QString library(QLatin1String("library")); - QList<QQmlJS::AST::SourceLocation> removed; + QVector<QQmlJS::AST::SourceLocation> removed; QQmlJS::Lexer l(0); l.setCode(script, 0); |