summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2014-07-30 10:50:11 +0200
committerJędrzej Nowacki <jedrzej.nowacki@digia.com>2014-07-31 08:50:42 +0200
commit2eea6034bc98e201694cb419f606331e4ad07624 (patch)
treeb4f64c34458dc47c6bb69973723a89c6d3d73ca1
parentf5c31262011f7fbcbff5ee91b0df22e4373dd2c1 (diff)
Micro-optimize QXmlStreamReaderPrivate.
Avoid redundant QStringRef to QString conversions. Change-Id: I4a65119e7821206e2f72387a5d02cec5ce39dbfb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r--src/corelib/xml/qxmlstream.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 69049aaccf..4b726a2295 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -1711,9 +1711,9 @@ uint QXmlStreamReaderPrivate::resolveCharRef(int symbolIndex)
uint s;
// ### add toXShort to QStringRef?
if (sym(symbolIndex).c == 'x')
- s = symString(symbolIndex, 1).toString().toUInt(&ok, 16);
+ s = symString(symbolIndex, 1).toUInt(&ok, 16);
else
- s = symString(symbolIndex).toString().toUInt(&ok, 10);
+ s = symString(symbolIndex).toUInt(&ok, 10);
ok &= (s == 0x9 || s == 0xa || s == 0xd || (s >= 0x20 && s <= 0xd7ff)
|| (s >= 0xe000 && s <= 0xfffd) || (s >= 0x10000 && s <= QChar::LastValidCodePoint));
@@ -1773,7 +1773,7 @@ void QXmlStreamReaderPrivate::startDocument()
{
QString err;
if (documentVersion != QLatin1String("1.0")) {
- if (documentVersion.toString().contains(QLatin1Char(' ')))
+ if (documentVersion.contains(QLatin1Char(' ')))
err = QXmlStream::tr("Invalid XML version string.");
else
err = QXmlStream::tr("Unsupported XML version.");