aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4jsonobject.cpp
diff options
context:
space:
mode:
authorFrank Meerkoetter <frank.meerkoetter@basyskom.com>2016-05-06 21:02:43 +0200
committerFrank Meerkoetter <frank.meerkoetter@basyskom.com>2016-05-09 13:21:31 +0000
commit4be62189a17a2b9a3c10a2448f146a6102598312 (patch)
tree78b9242b8def76d57fec2e124ce0719f243dfda5 /src/qml/jsruntime/qv4jsonobject.cpp
parentf7463a2ae6dd8e9267f99cc88af495281405905a (diff)
Scrape off some more allocations by using the QStringBuilder
Change-Id: I25cbbcad086afb15694f69bdc52bd4ddce4b3a18 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index a211d46153..0ae7c33dea 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -590,8 +590,7 @@ bool JsonParser::parseString(QString *string)
return false;
}
if (QChar::requiresSurrogates(ch)) {
- *string += QChar(QChar::highSurrogate(ch));
- *string += QChar(QChar::lowSurrogate(ch));
+ *string += QChar(QChar::highSurrogate(ch)) + QChar(QChar::lowSurrogate(ch));
} else {
*string += QChar(ch);
}
@@ -672,8 +671,8 @@ static QString quote(const QString &str)
default:
if (c.unicode() <= 0x1f) {
product += QStringLiteral("\\u00");
- product += c.unicode() > 0xf ? QLatin1Char('1') : QLatin1Char('0');
- product += QLatin1Char("0123456789abcdef"[c.unicode() & 0xf]);
+ product += (c.unicode() > 0xf ? QLatin1Char('1') : QLatin1Char('0')) +
+ QLatin1Char("0123456789abcdef"[c.unicode() & 0xf]);
} else {
product += c;
}