From 566eea09a851c221c557fc5c386ba3d0613e3b05 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 2 May 2017 23:17:51 +0200 Subject: QV4BooleanObject: Avoid GC'd allocations when calling toString() Use the global strings instead. Change-Id: Ia43045ca3f40e80d44956cf8e38511cfc4c8a8bb Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4booleanobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/jsruntime/qv4booleanobject.cpp b/src/qml/jsruntime/qv4booleanobject.cpp index 601066110f..c8e9ebb2dd 100644 --- a/src/qml/jsruntime/qv4booleanobject.cpp +++ b/src/qml/jsruntime/qv4booleanobject.cpp @@ -85,7 +85,7 @@ void BooleanPrototype::method_toString(const BuiltinFunction *, Scope &scope, Ca result = thisObject->value(); } - scope.result = scope.engine->newString(QLatin1String(result ? "true" : "false")); + scope.result = result ? scope.engine->id_true() : scope.engine->id_false(); } void BooleanPrototype::method_valueOf(const BuiltinFunction *, Scope &scope, CallData *callData) -- cgit v1.2.3