aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4errorobject.cpp
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2015-08-12 13:17:58 +0100
committerSérgio Martins <sergio.martins@kdab.com>2015-08-13 16:11:48 +0000
commitb5572010798198de7b58ca3b905cb2691a316d1a (patch)
treeb15505115ab0f68fcb6defd338c28a673af8ad65 /src/qml/jsruntime/qv4errorobject.cpp
parentfbdc01f141a4ec4e6fc78ea69d86ff7aa128bf72 (diff)
qml: Avoid heap allocations due to QString::fromLatin1()
By using QStringLiteral when the argument is a literal. Change-Id: Ib25042d10f3d9d0aca81af74cde0107aba4f9432 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4errorobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4errorobject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp
index 3c0a05483c..a6c2a25b91 100644
--- a/src/qml/jsruntime/qv4errorobject.cpp
+++ b/src/qml/jsruntime/qv4errorobject.cpp
@@ -361,11 +361,11 @@ ReturnedValue ErrorPrototype::method_toString(CallContext *ctx)
ScopedValue name(scope, o->get(ctx->d()->engine->id_name()));
QString qname;
if (name->isUndefined())
- qname = QString::fromLatin1("Error");
+ qname = QStringLiteral("Error");
else
qname = name->toQString();
- ScopedString s(scope, ctx->d()->engine->newString(QString::fromLatin1("message")));
+ ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("message")));
ScopedValue message(scope, o->get(s));
QString qmessage;
if (!message->isUndefined())