summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/main.cpp
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2013-04-04 16:04:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-21 18:39:13 +0200
commit8969f57b6abef31d2e27500742dffa5498e38a46 (patch)
treeb4301de4637111cfb1d9826fd638c35f693f890b /src/tools/qdoc/main.cpp
parentcab86ec3edda4c64b816b3a3f84aebd103093c67 (diff)
Improve qdoc performance.
Valgrind blamed CppCodeMarker::addMarkUp as slow, the patch improves situation by ~12% Use of QStringLiterals instead of const char* reduce amount of allocations on startup. Change-Id: I8737e02785506bba7e23868ab3952eab09d543d2 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/main.cpp')
-rw-r--r--src/tools/qdoc/main.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 26aa0a7dc2..dd72be7f6e 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -78,16 +78,16 @@ QT_BEGIN_NAMESPACE
And those are all the default values for configuration variables.
*/
static const struct {
- const char *key;
- const char *value;
+ const QString key;
+ const QString value;
} defaults[] = {
- { CONFIG_CODEINDENT, "4" },
- { CONFIG_FALSEHOODS, "0" },
- { CONFIG_FILEEXTENSIONS, "*.cpp *.h *.qdoc *.qml"},
- { CONFIG_LANGUAGE, "Cpp" },
- { CONFIG_OUTPUTFORMATS, "HTML" },
- { CONFIG_TABSIZE, "8" },
- { 0, 0 }
+ { CONFIG_CODEINDENT, QLatin1String("4") },
+ { CONFIG_FALSEHOODS, QLatin1String("0") },
+ { CONFIG_FILEEXTENSIONS, QLatin1String("*.cpp *.h *.qdoc *.qml") },
+ { CONFIG_LANGUAGE, QLatin1String("Cpp") },
+ { CONFIG_OUTPUTFORMATS, QLatin1String("HTML") },
+ { CONFIG_TABSIZE, QLatin1String("8") },
+ { QString(), QString() }
};
bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2)
@@ -269,7 +269,7 @@ static void processQdocconfFile(const QString &fileName)
*/
Config config(QCoreApplication::translate("QDoc", "qdoc"));
int i = 0;
- while (defaults[i].key) {
+ while (!defaults[i].key.isEmpty()) {
config.setStringList(defaults[i].key, QStringList() << defaults[i].value);
++i;
}