diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-24 02:04:09 +0200 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2016-02-10 16:00:46 +0000 |
commit | cc2938b5b6aa07210b04bd48ad8a2830701a06e5 (patch) | |
tree | 5e9719c9eace2947e542f2ee34c0f23589e3e7e6 /src/tools/moc/generator.h | |
parent | 3e63a58a96bc9d7fc6004f3a8eacc062bae953f9 (diff) |
moc: replace inefficient QLists with QVectors
These types are larger than a void*, so holding them in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.
Fix by marking them movable, and holding them in a QVector instead.
Change-Id: I42f494ed87854eadc33d78db4479203ff5e0370f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/tools/moc/generator.h')
-rw-r--r-- | src/tools/moc/generator.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h index 2b5f09df5e..3833148fb3 100644 --- a/src/tools/moc/generator.h +++ b/src/tools/moc/generator.h @@ -45,10 +45,10 @@ private: bool registerableMetaType(const QByteArray &propertyType); void registerClassInfoStrings(); void generateClassInfos(); - void registerFunctionStrings(const QList<FunctionDef> &list); - void generateFunctions(const QList<FunctionDef> &list, const char *functype, int type, int ¶msIndex); - void generateFunctionRevisions(const QList<FunctionDef>& list, const char *functype); - void generateFunctionParameters(const QList<FunctionDef> &list, const char *functype); + void registerFunctionStrings(const QVector<FunctionDef> &list); + void generateFunctions(const QVector<FunctionDef> &list, const char *functype, int type, int ¶msIndex); + void generateFunctionRevisions(const QVector<FunctionDef> &list, const char *functype); + void generateFunctionParameters(const QVector<FunctionDef> &list, const char *functype); void generateTypeInfo(const QByteArray &typeName, bool allowEmptyName = false); void registerEnumStrings(); void generateEnums(int index); @@ -59,7 +59,7 @@ private: void generateSignal(FunctionDef *def, int index); void generatePluginMetaData(); QMultiMap<QByteArray, int> automaticPropertyMetaTypesHelper(); - QMap<int, QMultiMap<QByteArray, int> > methodsWithAutomaticTypesHelper(const QList<FunctionDef> &methodList); + QMap<int, QMultiMap<QByteArray, int> > methodsWithAutomaticTypesHelper(const QVector<FunctionDef> &methodList); void strreg(const QByteArray &); // registers a string int stridx(const QByteArray &); // returns a string's id |