Inline identifier lookup where it makes sense
authorLars Knoll <lars.knoll@digia.com>
Sat, 31 Aug 2013 22:47:28 +0000 (00:47 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 2 Sep 2013 15:27:36 +0000 (17:27 +0200)
Change-Id: I42ac6f4232fec2ce1535a007007542d8cc116433
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/jsruntime/qv4identifiertable.cpp
src/qml/jsruntime/qv4identifiertable_p.h

index 07c19e4..618696a 100644 (file)
@@ -135,7 +135,7 @@ String *IdentifierTable::insertString(const QString &s)
 }
 
 
-Identifier *IdentifierTable::identifier(String *str)
+Identifier *IdentifierTable::identifierImpl(String *str)
 {
     if (str->identifier)
         return str->identifier;
index 0f9a592..6450a87 100644 (file)
@@ -68,10 +68,17 @@ public:
 
     String *insertString(const QString &s);
 
-    Identifier *identifier(String *str);
+    Identifier *identifier(String *str) {
+        if (str->identifier)
+            return str->identifier;
+        return identifierImpl(str);
+    }
+
     Identifier *identifier(const QString &s);
     Identifier *identifier(const char *s, int len);
 
+    Identifier *identifierImpl(String *str);
+
     void mark() {
         for (int i = 0; i < alloc; ++i)
             if (entries[i])