Inline identifier lookup where it makes sense

Change-Id: I42ac6f4232fec2ce1535a007007542d8cc116433
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This commit is contained in:
Lars Knoll 2013-09-01 00:47:28 +02:00 committed by The Qt Project
parent 0dbc19bc80
commit 036d1bcde9
2 changed files with 9 additions and 2 deletions

View 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;

View 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])