diff options
author | Frank Meerkoetter <[email protected]> | 2016-05-06 21:02:43 +0200 |
---|---|---|
committer | Frank Meerkoetter <[email protected]> | 2016-05-09 13:21:31 +0000 |
commit | 4be62189a17a2b9a3c10a2448f146a6102598312 (patch) | |
tree | 78b9242b8def76d57fec2e124ce0719f243dfda5 /src/qml/jsruntime/qv4jsonobject.cpp | |
parent | f7463a2ae6dd8e9267f99cc88af495281405905a (diff) |
Scrape off some more allocations by using the QStringBuilder
Change-Id: I25cbbcad086afb15694f69bdc52bd4ddce4b3a18
Reviewed-by: Lars Knoll <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 7 |
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; } |