aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-05-02 23:17:51 +0200
committerRobin Burchell <robin.burchell@crimson.no>2017-05-03 16:37:55 +0000
commit566eea09a851c221c557fc5c386ba3d0613e3b05 (patch)
treea37a102c4c5a521e6548db4d775129ca073c2e27
parent0da6de65468d3b8cc1ca7ee0af10f254ae3d4dd6 (diff)
QV4BooleanObject: Avoid GC'd allocations when calling toString()
Use the global strings instead. Change-Id: Ia43045ca3f40e80d44956cf8e38511cfc4c8a8bb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/jsruntime/qv4booleanobject.cpp2
1 files changed, 1 insertions, 1 deletions
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)