qdoc: Don't use QStringLiteral in string comparisons

Using QStringLiteral to compare strings performs poorly
compared to QLatin1String.

These cases were previously fixed by commit 1a5c0b26, but
some were reintroduced with new commits to QDoc.

Change-Id: I272376052e876d88817606deb0a6dda92867dcbf
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Topi Reinio 2015-08-05 09:40:46 +02:00 committed by Kai Koehne
parent 5c1b9bbdf1
commit 5677176d76

View File

@ -691,9 +691,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
else if ((idx = atom->string().indexOf(QStringLiteral("bymodule"))) != -1) {
QString moduleName = atom->string().mid(idx + 8).trimmed();
Node::Genus genus = Node::CPP;
if (atom->string().startsWith(QStringLiteral("qml")))
if (atom->string().startsWith(QLatin1String("qml")))
genus = Node::QML;
else if (atom->string().startsWith(QStringLiteral("js")))
else if (atom->string().startsWith(QLatin1String("js")))
genus = Node::JS;
QDocDatabase* qdb = QDocDatabase::qdocDB();
const CollectionNode* cn = qdb->getCollectionNode(moduleName, genus);
@ -1667,7 +1667,7 @@ void HtmlGenerator::generateDocumentNode(DocumentNode* dn, CodeMarker* marker)
Generate the TOC for the new doc format.
Don't generate a TOC for the home page.
*/
if ((dn->name() != QStringLiteral("index.html")))
if ((dn->name() != QLatin1String("index.html")))
generateTableOfContents(dn,marker,0);
generateKeywordAnchors(dn);
@ -4557,11 +4557,11 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString
if (s.length() < 2
|| s.at(0).isDigit()
|| s.at(0) == '-'
|| s == QStringLiteral("qt")
|| s == QStringLiteral("the")
|| s == QStringLiteral("and")
|| s.startsWith(QStringLiteral("example"))
|| s.startsWith(QStringLiteral("chapter")))
|| s == QLatin1String("qt")
|| s == QLatin1String("the")
|| s == QLatin1String("and")
|| s.startsWith(QLatin1String("example"))
|| s.startsWith(QLatin1String("chapter")))
tag_it = tags.erase(tag_it);
else if (s != *tag_it) {
modified << s;