Micro optimization for wxLANGUAGE_UNKNOWN in GetLanguageInfo()

Don't bother iterating over all the languages if we can be sure we're
not going to find anything anyhow.
This commit is contained in:
Vadim Zeitlin
2021-02-28 01:12:57 +01:00
parent d029279227
commit 3e395f9b5f

View File

@@ -952,6 +952,9 @@ const wxLanguageInfo *wxLocale::GetLanguageInfo(int lang)
if ( lang == wxLANGUAGE_DEFAULT )
lang = GetSystemLanguage();
if ( lang == wxLANGUAGE_UNKNOWN )
return NULL;
const size_t count = ms_languagesDB->GetCount();
for ( size_t i = 0; i < count; i++ )
{