Merge "generatePhpCharToUpperMappings: avoid fetching service in loop"
This commit is contained in:
commit
bb95e89c23
1 changed files with 2 additions and 1 deletions
|
|
@ -60,13 +60,14 @@ class GeneratePhpCharToUpperMappings extends Maintenance {
|
|||
$jsUpperChars = json_decode( $result->getStdout() );
|
||||
'@phan-var string[] $jsUpperChars';
|
||||
|
||||
$contentLanguage = MediaWikiServices::getInstance()->getContentLanguage();
|
||||
for ( $i = 0; $i <= 0x10ffff; $i++ ) {
|
||||
if ( $i >= 0xd800 && $i <= 0xdfff ) {
|
||||
// Skip surrogate pairs
|
||||
continue;
|
||||
}
|
||||
$char = \UtfNormal\Utils::codepointToUtf8( $i );
|
||||
$phpUpper = MediaWikiServices::getInstance()->getContentLanguage()->ucfirst( $char );
|
||||
$phpUpper = $contentLanguage->ucfirst( $char );
|
||||
$jsUpper = $jsUpperChars[$i];
|
||||
if ( $jsUpper !== $phpUpper ) {
|
||||
if ( $char === $phpUpper ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue