qdoc: replace some inefficient QLists with QVector

The types are either too large or too small for QList, which
only has acceptable performance with movable types of size
= sizeof(void*).

Change-Id: I5a2354e9400baad44095f1eac18d76ef915f6545
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2015-07-19 21:48:38 +02:00
parent 14dde164dc
commit b1b3083dec
4 changed files with 6 additions and 6 deletions

View File

@ -308,7 +308,7 @@ public:
Doc::Sections granularity_;
Doc::Sections section_; // ###
QList<Atom*> tableOfContents_;
QList<int> tableOfContentsLevels_;
QVector<int> tableOfContentsLevels_;
QList<Atom*> keywords_;
QList<Atom*> targets_;
QStringMultiMap metaMap_;
@ -3087,7 +3087,7 @@ const QList<Atom *> &Doc::tableOfContents() const
return priv->extra->tableOfContents_;
}
const QList<int> &Doc::tableOfContentsLevels() const
const QVector<int> &Doc::tableOfContentsLevels() const
{
priv->constructExtra();
return priv->extra->tableOfContentsLevels_;

View File

@ -168,7 +168,7 @@ public:
bool hasKeywords() const;
bool hasTargets() const;
const QList<Atom *> &tableOfContents() const;
const QList<int> &tableOfContentsLevels() const;
const QVector<int> &tableOfContentsLevels() const;
const QList<Atom *> &keywords() const;
const QList<Atom *> &targets() const;
const QStringMultiMap &metaTagMap() const;

View File

@ -74,8 +74,8 @@ class QDocIndexFiles
QDocDatabase* qdb_;
Generator* gen_;
QString project_;
QList<QPair<ClassNode*,QString> > basesList_;
QList<QPair<FunctionNode*,QString> > relatedList_;
QVector<QPair<ClassNode*,QString> > basesList_;
QVector<QPair<FunctionNode*,QString> > relatedList_;
};
QT_END_NAMESPACE

View File

@ -157,7 +157,7 @@ private:
QString sourceText(QQmlJS::AST::SourceLocation &location);
QQmlJS::Engine *engine;
QList<ExtraType> extraTypes;
QVector<ExtraType> extraTypes;
QVector<QQmlJS::AST::SourceLocation> extraLocations;
QString source;
QString output;