diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-05-16 15:03:39 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-05-19 06:23:35 +0000 |
commit | c03eedaf8c6846dc80ab014face4d514deb9665d (patch) | |
tree | b5d20849a9b3536bab01625dabb61583c6366490 /src/qml/jsruntime/qv4internalclass_p.h | |
parent | 10b237882cfe76521b4dc65300a2a0473faca174 (diff) |
Optimize lookups in the internalClass
Inline the version taking an identifier, and use that one where
it makes sense.
Change-Id: I414c5999e61cdba219ecd1080957f3037dfebc1b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4internalclass_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4internalclass_p.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index 031f66793b..34422098d9 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -279,7 +279,14 @@ struct InternalClass : public QQmlJS::Managed { static void changeMember(Object *object, String *string, PropertyAttributes data, uint *index = 0); static void removeMember(Object *object, Identifier *id); uint find(const String *string); - uint find(const Identifier *id); + uint find(const Identifier *id) + { + uint index = propertyTable.lookup(id); + if (index < size) + return index; + + return UINT_MAX; + } Q_REQUIRED_RESULT InternalClass *sealed(); Q_REQUIRED_RESULT InternalClass *frozen(); |