diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-05-02 23:17:51 +0200 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-05-03 16:37:55 +0000 |
commit | 566eea09a851c221c557fc5c386ba3d0613e3b05 (patch) | |
tree | a37a102c4c5a521e6548db4d775129ca073c2e27 /src/qml/jsruntime/qv4booleanobject.cpp | |
parent | 0da6de65468d3b8cc1ca7ee0af10f254ae3d4dd6 (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>
Diffstat (limited to 'src/qml/jsruntime/qv4booleanobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4booleanobject.cpp | 2 |
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) |