From: Timo Tijhof Date: Tue, 10 Nov 2015 00:40:54 +0000 (+0000) Subject: MessageCache: Remove redundant Language::ucfirst() optimisation X-Git-Tag: 1.31.0-rc.0~9043^2 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=2d3ea7996f231e07f9fe01daf7d54f3e60181e7c;p=lhc%2Fweb%2Fwiklou.git MessageCache: Remove redundant Language::ucfirst() optimisation Language::ucfirst() already has this optimisation. The expensive method is Language::uc(), which is only called when needed. The ord() < 128 is one of the conditionals in Language::ucfirst(). Change-Id: Idd648b7b84eba1f92dda904438122fe38d3cf22b --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 2818d2f122..a9af9c4ada 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -749,11 +749,7 @@ class MessageCache { Hooks::run( 'MessageCache::get', array( &$lckey ) ); - if ( ord( $lckey ) < 128 ) { - $uckey = ucfirst( $lckey ); - } else { - $uckey = $wgContLang->ucfirst( $lckey ); - } + $uckey = $wgContLang->ucfirst( $lckey ); // Loop through each language in the fallback list until we find something useful $lang = wfGetLangObj( $langcode );