MessageCache: Remove redundant Language::ucfirst() optimisation
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Nov 2015 00:40:54 +0000 (00:40 +0000)
committerKrinkle <krinklemail@gmail.com>
Tue, 10 Nov 2015 00:41:45 +0000 (00:41 +0000)
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

includes/cache/MessageCache.php

index 2818d2f..a9af9c4 100644 (file)
@@ -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 );