From 3e395f9b5f003d4077c00d095fc712f2934a1423 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 28 Feb 2021 01:12:57 +0100 Subject: [PATCH] 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. --- src/common/intl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index d9f4718c3e..88ee2e0bfe 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -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++ ) {