From 8bbb8af3594803184bb1344d37705bb20d15abf0 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 20 Nov 2008 22:47:26 +0100 Subject: [PATCH] Look up a type as alias with all template arguments attached. When a type is registered as alias, it has the complete type information, including any template arguments. Hence, we check whether a type is a known alias right at the beginning. --- kdbg/typetable.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/kdbg/typetable.cpp b/kdbg/typetable.cpp index d612261..5643b31 100644 --- a/kdbg/typetable.cpp +++ b/kdbg/typetable.cpp @@ -251,16 +251,19 @@ void ProgramTypeTable::loadTypeTable(TypeTable* table) TypeInfo* ProgramTypeTable::lookup(QString type) { + /* + * Registered aliases contain the complete template parameter list. + * Check for an alias first so that this case is out of the way. + */ + if (TypeInfo* result = m_aliasDict[type]) + return result; + // compress any template types to '<*>' int templ = type.find('<'); if (templ > 0) { - type = type.left(templ) + "<*>"; - } - TypeInfo* result = m_types[type]; - if (result == 0) { - result = m_aliasDict[type]; + return m_types[type.left(templ) + "<*>"]; } - return result; + return m_types[type]; } void ProgramTypeTable::registerAlias(const QString& name, TypeInfo* type) -- 2.11.4.GIT