From 80e8062f676ca214765983ecefbaef9bc1c2446f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Jan 2002 00:34:41 +0000 Subject: [PATCH] lookup the classes in the hash table if it had been already set up git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/object.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/common/object.cpp b/src/common/object.cpp index 120d0afac5..86b84c8a43 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -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 -- 2.45.2