summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimetypeparser_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-02-23 21:53:08 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-02-24 17:14:15 +0000
commit71b106ab436f75d3467a71b1b3739ce570b62522 (patch)
tree226119c718f7050dd3d19a33ec631f93bf4f5642 /src/corelib/mimetypes/qmimetypeparser_p.h
parent215bda50f959673f076fe76cf1f95a2a5f759b2c (diff)
QMimeTypeParser: use QStringRef more
Keep the return values of QXmlStream*::value() around as QStringRefs for as long as possible. Avoids conversions to QString, among other things, for: - comparison to another string - conversion to int - conversion to UTF-8 or Latin-1 byte arrays Add a pair of Q_UNLIKELY as a drive-by. Saves ~900b in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I17d440a11aeb8675979483f89e66d0a088ccc605 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimetypeparser_p.h')
-rw-r--r--src/corelib/mimetypes/qmimetypeparser_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimetypeparser_p.h b/src/corelib/mimetypes/qmimetypeparser_p.h
index cc11b70e71..a502439419 100644
--- a/src/corelib/mimetypes/qmimetypeparser_p.h
+++ b/src/corelib/mimetypes/qmimetypeparser_p.h
@@ -72,7 +72,7 @@ public:
bool parse(QIODevice *dev, const QString &fileName, QString *errorMessage);
- static bool parseNumber(const QString &n, int *target, QString *errorMessage);
+ static bool parseNumber(const QStringRef &n, int *target, QString *errorMessage);
protected:
virtual bool process(const QMimeType &t, QString *errorMessage) = 0;