diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2015-08-12 13:17:58 +0100 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2015-08-13 16:11:48 +0000 |
commit | b5572010798198de7b58ca3b905cb2691a316d1a (patch) | |
tree | b15505115ab0f68fcb6defd338c28a673af8ad65 /src/qml/jsruntime/qv4objectproto.cpp | |
parent | fbdc01f141a4ec4e6fc78ea69d86ff7aa128bf72 (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/qv4objectproto.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 41483e9ef5..1edf76e2de 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -392,7 +392,7 @@ ReturnedValue ObjectPrototype::method_toString(CallContext *ctx) } else { ScopedObject obj(scope, RuntimeHelpers::toObject(scope.engine, ctx->thisObject())); QString className = obj->className(); - return ctx->d()->engine->newString(QString::fromLatin1("[object %1]").arg(className))->asReturnedValue(); + return ctx->d()->engine->newString(QStringLiteral("[object %1]").arg(className))->asReturnedValue(); } } |