aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4stringobject_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-04-30 23:50:50 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-17 09:03:46 +0000
commit81d8e36c1732854a0c6b0312c0bf42804d30192e (patch)
tree0ab2458bdeaa03e81bd29107547e7cc714fd233c /src/qml/jsruntime/qv4stringobject_p.h
parenta4aa358acf763469bf46244c7f5a3a358c038a81 (diff)
Get rid of the tmpProperty in StringObject
This was a bad hack. The new code is cleaner, and should also perform faster in a couple of cases (avoiding the creation of a temporary String that is then only thrown away). Change-Id: Ia6f978e037506484adbc01a61606307d4645b343 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsruntime/qv4stringobject_p.h')
-rw-r--r--src/qml/jsruntime/qv4stringobject_p.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4stringobject_p.h b/src/qml/jsruntime/qv4stringobject_p.h
index b0f2dd3e97..8b05cfd3dc 100644
--- a/src/qml/jsruntime/qv4stringobject_p.h
+++ b/src/qml/jsruntime/qv4stringobject_p.h
@@ -48,9 +48,8 @@ struct StringObject : Object {
StringObject(ExecutionEngine *engine, const Value &value);
Value value;
- Property *getIndex(uint index) const;
- // ### get rid of tmpProperty
- mutable Property tmpProperty;
+ Heap::String *getIndex(uint index) const;
+ uint length() const;
};
struct StringCtor : FunctionObject {
@@ -63,9 +62,12 @@ struct StringObject: Object {
V4_OBJECT2(StringObject, Object)
Q_MANAGED_TYPE(StringObject)
- Property *getIndex(uint index) const {
+ Heap::String *getIndex(uint index) const {
return d()->getIndex(index);
}
+ uint length() const {
+ return d()->length();
+ }
static bool deleteIndexedProperty(Managed *m, uint index);