]> git.saurik.com Git - wxWidgets.git/commitdiff
lookup the classes in the hash table if it had been already set up
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 16 Jan 2002 00:34:41 +0000 (00:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 16 Jan 2002 00:34:41 +0000 (00:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/object.cpp

index 120d0afac5ef0ce6f974c193df60197119ad4717..86b84c8a4370cf79d26e2f740fc90192a834068a 100644 (file)
@@ -135,11 +135,20 @@ void wxObject::operator delete[] (void *buf)
 
 wxClassInfo *wxClassInfo::FindClass(const wxChar *className)
 {
-    for(wxClassInfo *info = sm_first; info ; info = info->m_next)
-        if( wxStrcmp(info->GetClassName(), className) == 0 )
-            return info;
+    if ( sm_classTable )
+    {
+        return (wxClassInfo *)wxClassInfo::sm_classTable->Get(className);
+    }
+    else
+    {
+        for ( wxClassInfo *info = sm_first; info ; info = info->m_next )
+        {
+            if ( wxStrcmp(info->GetClassName(), className) == 0 )
+                return info;
+        }
 
-    return 0;
+        return NULL;
+    }
 }
 
     // Set pointers to base class(es) to speed up IsKindOf